nxp-mcuxpresso / vscode-for-mcux

Support for NXP Visual Studio Code for MCUXpresso Extension project.
13 stars 0 forks source link

Using .jlinkscript file with debugger #36

Closed DrEdHepler closed 3 months ago

DrEdHepler commented 3 months ago

I'm attempting to convert a project from MCUXpresso to VS Code for MCUXpresso.

The import of the project went well... I had to manually change a few things, but was able to get the project to compile and attempt to debug.

But I'm using JLink and MCUXpresso provides a way (RightClick on project -> Debug As -> Debug Configurations) to specify a .jlinkscript file (under the JLink Debugger tab -> Additional options) that is applied before the target code is applied to the target memory.

This is required when the target code resides in ITCM/DTCM, since the MCU (iMXRT1062) register that maps on-chip memory must be written prior to the target code being loaded.

I don't see a way to do this while in vscode-for-mcux.

I did find a script on the Segger Wiki for VS code that appears to provide a json keyword to name a .jlinkscript, but haven't been able to get it to work with vscode-for-mcux.

Is there a built-in way (in vscode-for-mcux) to do this?

Thanks!

cristitep-nxp commented 3 months ago

Hi @DrEdHepler,

In Projects View -> Settings -> mcuxpresso-tools.json, add your script as: "debug": { [...] "segger": { [...] "scriptfile": "c:/example/my_script.jlinkscript" }

See picture for example: image

Regards, Cristian

DrEdHepler commented 3 months ago

Many thanks!!!