Skip to content

Conversation

@philmoz
Copy link
Collaborator

@philmoz philmoz commented Aug 12, 2025

Testing language translations is slow and tedious requiring rebuilding the simulator libraries multiple times.
This PR enables the simulator to load all language translations and fonts at startup allowing the UI language to be switched at will, while running the simulator.

Primary goals:

  • Minimise the code changes required to the current code base.
  • Normal firmware builds should be functionally equivalent with little to no change in the radio operation, performance, firmware size or RAM usage.

The UI language is changed in the simulator using the existing 'Voice Language' setting.

In addition this can be compiled and run on some current radios:

  • B&W radios with 1MB of FLASH. Tested on GX12 and BumbleBee.
  • Color radios with 8MB of FLASH and at least 8MB of RAM. Tested on ST16, TX15 and T15Pro.

When used on compatible B&W radios the flash size is increased by ~300K, leaving ~200K free. RAM usage is increased by a few hundred bytes.
On compatible color radios the flash size increases by ~1.9MB. RAM usage increases with ~2.3MB free at startup (down from ~3.9MB).

To build for a radio add -DALL_LANGUAGES=YES to the cmake configuration.

TODO:

  • Generate the sim_string_list.h file in the build process (dependent on string_list.h). Currently created using 'm4' preprocessor and the simstr.m4 file.

@philmoz philmoz added this to the 3.0 milestone Aug 12, 2025
@philmoz philmoz added enhancement ✨ New feature or request simulator labels Aug 12, 2025
@philmoz
Copy link
Collaborator Author

philmoz commented Aug 12, 2025

Also works in the standalone simulator.

@raphaelcoeffic
Copy link
Member

Applying the patches from #6561 seems to help regain some SDRAM already:

  • without the patch:
❯ arm-none-eabi-nm -n -S build/firmware.elf | grep _heap_
c03aab54 B _heap_start
c0800000 A _heap_end

That's ~4.3MB heap.

❯ arm-none-eabi-nm -n -S build/firmware.elf | grep _heap_
c0269cc4 B _heap_start
c0800000 A _heap_end

Around ~5.6MB heap, so ~1.3MB regained.

@philmoz philmoz force-pushed the philmoz/string-cleaning branch 2 times, most recently from 0bdf2f0 to f943513 Compare September 13, 2025 20:48
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch from 92c656d to 9702dbf Compare September 13, 2025 20:55
@philmoz philmoz force-pushed the philmoz/string-cleaning branch from f943513 to b41e5b7 Compare September 19, 2025 06:22
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch from f9be519 to 83b6746 Compare September 19, 2025 09:31
@philmoz philmoz force-pushed the philmoz/string-cleaning branch from 4127669 to 6a1d150 Compare September 20, 2025 05:20
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch from 83b6746 to 51b4ded Compare September 20, 2025 08:58
@philmoz philmoz force-pushed the philmoz/string-cleaning branch 2 times, most recently from 3e268e4 to 3561913 Compare October 4, 2025 05:39
Base automatically changed from philmoz/string-cleaning to main October 5, 2025 03:04
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch 2 times, most recently from f039037 to ce2e8a4 Compare October 6, 2025 22:03
@philmoz
Copy link
Collaborator Author

philmoz commented Oct 6, 2025

Warning for testing on H7 based radios from RadioMaster or Jumper - if your radio has firmware built prior to PR #6629 (commit 6235f01) then bootloader UF2 flashing will not work with this PR. The firmware image is 3.1MB; but the older bootloader only accepts UF2 images up to 2MB.

You can either update the radio to a newer version with the flash size fix first, or use the DFU flashing in Companion to install this PR.

@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch 3 times, most recently from 2f83588 to 37e95ae Compare October 14, 2025 20:36
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch 3 times, most recently from 0526fd7 to c650ca1 Compare October 19, 2025 06:35
@philmoz philmoz force-pushed the philmoz/runtime-lang-select branch from c650ca1 to 64d3dba Compare October 20, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request simulator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants