Using Segger 5.70a.
I have a couple of issues regarding the heap size not being correctly propagated from the UI to the .emProject file.
These are the 2 subtleties
Display All
From a first load of Segger Embedded Studio, I go through the following steps:
If I remove the arm_linker_heap_size="8192" line from my .emProject file, Segger then builds using the default heap size of 1024 bytes. From that point forwards, things work normally. Manually setting the heap size from the project options menu all starts working as expected. Therefore, you did not encounter the issue. When specifying a different heap size from the Segger menu, the line “arm_linker_heap_size="32768"” is added to the .emProject file when the project file is saved, right at the very bottom of the project file:
Display All
When a non-default heap size is specified within Segger, it is placing the directive in a different location within the .emProject file.
To summarise, there are 2 points:
Ola
I have a couple of issues regarding the heap size not being correctly propagated from the UI to the .emProject file.
These are the 2 subtleties
- The location of the heap size directive within the .emProject file; and
- A refresh issue when the emProject file is viewed in the Segger Editor window.
XML Source Code
- <!DOCTYPE CrossStudio_Project_File>
- <solution Name="keyboard_usb" target="8" version="2">
- <project Name="keyboard_usb">
- <configuration
- Name="Common"
- arm_architecture="v7EM"
- arm_core_type="Cortex-M4"
- arm_endian="Little"
- arm_fp_abi="Hard"
- arm_fpu_type="FPv4-SP-D16"
- arm_linker_heap_size="8192"
- arm_linker_process_stack_size="0"
- arm_linker_stack_size="8192"
- arm_linker_treat_warnings_as_errors="Yes"
- arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
- arm_target_device_name="nRF52840_xxAA"
- .
- .
- .
From a first load of Segger Embedded Studio, I go through the following steps:
- Start SES (which automatically opens the last project).
- View the .emProject file within Segger, where I can see “arm_linker_heap_size="8192"” under the Common configuration in the first part of the.
- With the top tree node selected in the Project Explorer, Click the menu Project -> Options.
- In the drop-down box of build configurations, select “Common” (I have Debug and Release build configurations).
- In the Code tree node, select “Runtime Memory Area”.
- Heap Size shows as 1024 bytes (the first clue we have a problem, as it shows as 1024 bytes for all Debug, Release or Common configurations selected in the drop-down list, despite .emProject file Common configuration setting this to 8192 bytes).
- Set Heap Size to a different value, e.g. 32768. Value now shows as “modified”. Note the right-click menu changes to allow it to be re-set to “Use Inherited Value”, so Segger knows it’s overriding the inherited value.
- Click OK.
- From the File menu, save the project file. Click “Yes” to re-load the project when prompted.
- Visual check of .emProject file shows no changes (arm_linker_heap_size="8192"). Checked both within Segger and with external editor.
- Build project – Inspecting .ld file shows heap still at old 8,192 value.
- Re-Build project - Inspecting .ld file shows heap still at old 8,192 value.
If I remove the arm_linker_heap_size="8192" line from my .emProject file, Segger then builds using the default heap size of 1024 bytes. From that point forwards, things work normally. Manually setting the heap size from the project options menu all starts working as expected. Therefore, you did not encounter the issue. When specifying a different heap size from the Segger menu, the line “arm_linker_heap_size="32768"” is added to the .emProject file when the project file is saved, right at the very bottom of the project file:
XML Source Code
- .
- .
- .
- <configuration Name="Release" c_preprocessor_definitions="NDEBUG" />
- <configuration Name="Debug" c_preprocessor_definitions="DEBUG;DEBUG_NRF" />
- <configuration
- Name="Common"
- arm_linker_heap_size="32768"
- macros="NRF_SDK_ROOT=C:\\SVN\\Tricklestar\\Keyboard\\sdk\\nRF5_SDK_17.1.0_ddde560;ACC_SDK_ROOT=C:\\SVN\\Tricklestar\\Keyboard\\acconeer_xm122" />
- </solution>
To summarise, there are 2 points:
- Segger Embedded Studio does not seem to be correctly handling the “arm_linker_heap_size="8192" field in the project file. It may be related to the specific location of that line within the .emProject file. It seems that Segger will detect, and use, the value specified in the earlier part of the .emProject file, however the value set here does not interact with the Segger IDE user controls for setting that propery. It seems placing this value early in the .emProject file is overriding any settings the user may attempt to specify in the Segger IDE and there is no user feedback that this override is in place. Segger seems to be aware of the override, as manually setting a new value through the IDE shows the user visually that the new value is accepted, but the new value is not written to the .emProject file when the file is saved, and the new value is not used when the project is compiled. This is the crux of my heap size issue.
- Segger Embedded Studio has a refresh/reload issue relating to the .emProject file. When the file is changed, Segger detects it and re-loads the project file. However, if the .emProject file is open in the Segger Editor, it does not refresh the view of the file, showing the old content.
Ola
The post was edited 1 time, last by ola1olsson ().