You can also manually add a custom memory section directly in the launch.json file.
Complete the following steps to manually add a custom memory section tab:
- Click the Configure debugging button (the cog wheel) that is to the right of Debug in the extension's Actions View.
This opens thelaunch.jsonin your current workspace. -
Extend the configuration by adding a
memorySectionsarray to it.
The following example shows how to add a 1-KB custom section that starts at the address0xCAFE0000:Extend launch.json with a custom memory section[ { "symbol": "symbol", }, { "name": "Custom_section", "start": "0xCAFE0000", "size": 1024 }, ]- The
startproperty defines the start address of the section. - The
sizeproperty defines the number of bytes from the start address that the property should span. - Either integers or hex strings can be used for
start, and only integers are valid forsize.
A validation check is run against these values and a warning message appears if they are invalid.
The
launch.jsonfile should now include amemorySectionsarray and look like the following:Full configuration{ "configurations": [ { "type": "nrf-connect", "request": "launch", "config": "${activeConfig}", "name": "Launch nRF Connect application", "memorySections": [ { "name": "Custom_section", "start": "0xCAFE0000", "size": 1024 } ] } ] } - The
-
Save the file.
- Click Debug from the Actions View.
- Once the Debug toolbar appears in the editor, click on the Pause button.
- Open the nRF Debug panel from the Panel View (Ctrl-J).
You can now see the custom region tab in the Memory Explorer.