RT1160 with VSCode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1160 with VSCode

438 Views
larsmagne
Contributor II

Hello,

We have a MIMXRT1160-EVK board and want to test it with VSCode, gcc and gdb.

To give it a try we download the latest SDK with the GCC-version of the led_blinky project and the latest gcc tolchain. In VSCode we install plugins for Cmake/Ninja, C/C++ and Cortex-Debug(GDB). 

Compiling linking and downloading seems to work fine, but GDB will not run the program.

Here is what we did:
To make VSCode compile the project we add the following line into CmakeLists.txt:
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

Then we got:
[build] Memory region         Used Size  Region Size  %age Used
[build]     m_interrupts:          1 KB         1 KB    100.00%
[build]           m_text:       25036 B       255 KB      9.59%
[build]           m_data:        2280 B       256 KB      0.87%
[build]          m_data2:          0 GB        64 KB      0.00%
[build] Build finished with exit code 0

We use jlink and the jlink script file from the example code.
In VSCode launch.json we add the following section:
    "configurations": [
        {
            "name": "NC4 Core",
            "type": "cortex-debug",
            "device": "MIMXRT1166XXX6_M7",          
            "request": "launch",
            "interface": "swd",
            "servertype": "jlink",
            "runToEntryPoint": "main",
            "jlinkscript":"${workspaceRoot}/cm7/evkmimxrt1160_connect_cm4_cm7side.jlinkscript",
            "cwd": "${workspaceRoot}/cm7/armgcc/Debug",
            "executable": "iled_blinky_cm7.elf",
        },
 
But GDB fail to jump to main.
Hopefully anyone can help us with the trick to succeed with this setup:)
0 Kudos
1 Reply

421 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @larsmagne ,

We haven't demos or experience on VScode. I also haven't RT1160 on hand. To fast repeat the phenomenon I import RT1064 demo project into MCUXpresso and compile it. Then I create VScode project in the direction. I try to use VScode to debug.

This is settings.json

{
    "python.pythonPath": "C:\\Users\\nxf32199\\AppData\\Local\\Continuum\\anaconda3\\pythonw.exe",
    "cmake.configureOnOpen": true,
    "cortex-debug.armToolchainPath": "C:\\Program Files (x86)\\GNU Arm Embedded Toolchain\\10 2021.07\\bin",
     "makefile.makefilePath": "C:\\Users\\nxf32199\\mcuxpresso\\02\\SDKPackages\\SDK_2_11_1_EVK-MIMXRT1064\\boards\\evkmimxrt1064\\demo_apps\\hello_world\\armgcc",
    "makefile.makePath": "cmake"
}
 
This is launch.json
   "version": "0.2.0",
    "configurations": [
       
        {
            "cwd": "${workspaceRoot}/Debug",
            "executable": "./evkmimxrt1064_iled_blinky.axf",
            "name": "Debug with JLink",
            "request": "launch",
            "interface": "swd",
            "type": "cortex-debug",
            "device": "RT1064",
            "runToEntryPoint": "main",
            "showDevDebugOutput": "none",
            "jlinkscript":"${workspaceRoot}/evkmimxrt1064_sdram_init.jlinkscript",
            "servertype": "jlink"
        }
    ]
To my surprise it can debug and stop at main().
I installed these extension
jingpan_0-1666875715687.png

 

Regards,

Jing

  
0 Kudos