Read memory error during debugging in VS-Code debugging with MCU-LinkServer-Debug

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Read memory error during debugging in VS-Code debugging with MCU-LinkServer-Debug

719 次查看
jslota13245
Contributor II

Dear Everyone, 

I'm using MCUXpresso for VScode and i managed to debug my project for IMXRT1176 EVKB with all panes (peripheral, variables ... ) working. I think it uses MCU-LinkServer under the hood so i wanted to use it as well to create more lightweight setup.

I tried to follow this tutorial:

https://mcuoneclipse.com/2023/11/27/mcu-link-with-cortex-debug-and-linkserver/

I got my SVD file from here:

https://github.com/nxp-mcuxpresso/mcux-soc-svd/blob/main/MIMXRT1176/MIMXRT1176_cm7.xml

Tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "start LinkServer",
            "command": "LinkServer gdbserver --keep-alive MIMXRT1176:MIMXRT1170-EVKB -c all",
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "group": {
                "kind": "build",
                "isDefault": false
            }
        }
    ]
}
Launch.json:
{
  "configurations": [
    {
      "name": "Cortex Debug Launch cm7",
      "type": "cortex-debug",
      "request": "launch",
      "servertype": "external",
      "gdbTarget": "localhost:3333",
      "cwd": "${workspaceFolder}",
      "executable": "cm7/flexspi_nor_debug/imxrt1176_CM7.elf",
      "runToEntryPoint": "main",
      "preLaunchCommands": [
        "monitor reset halt",
        "monitor semihosting enable"
      ],
      "postLaunchCommands": [
        "load"
      ],
      "rtos": "FreeRTOS",
      "svdFile": "${workspaceFolder}/MIMXRT1176_cm7.xml"
    }
  ]
}


After i setup the gdb server via start linkserver task, i can connect to the device, i can perform steps and place breakpoints. But the peripheral pane is not working, every time i perform a step i get error in VSCode and error message in GDB:

Temporary breakpoint 2, main () at D:\projects\main_master.c:316 316 BOARD_ConfigMPU();
Failed to update peripheral MUA: Error: peripheral-viewer: readMemory failed @ 0x40c48000 for 40 bytes: CodeExpectedError: Read memory error: Unable to read memory. (from data-read-memory-bytes "0x40c48000" 40), session=d1a62b07-9097-479a-9d0e-11bf8bef6200
Internal error: Failed to update peripheral MUA after memory reads

Failed to update peripheral LPI2C6: Error: peripheral-viewer: readMemory failed @ 0x40c38000 for 116 bytes: CodeExpectedError: Read memory error: Unable to read memory. (from data-read-memory-bytes "0x40c38000" 116), session=d1a62b07-9097-479a-9d0e-11bf8bef6200

Failed to update peripheral LPI2C6: Error: peripheral-viewer: readMemory failed @ 0x40c38110 for 28 bytes: CodeExpectedError: Read memory error: Unable to read memory. (from data-read-memory-bytes "0x40c38110" 28), session=d1a62b07-9097-479a-9d0e-11bf8bef6200

Failed to update peripheral LPI2C6: Error: peripheral-viewer: readMemory failed @ 0x40c38140 for 52 bytes: CodeExpectedError: Read memory error: Unable to read memory. (from data-read-memory-bytes "0x40c38140" 52), session=d1a62b07-9097-479a-9d0e-11bf8bef6200
Internal error: Failed to update peripheral LPI2C6 after memory reads

And in VS-Code there is a pop-up:
Read memory error: Unable to read memory. (from data-read-memory-bytes "0x40c38110" 28)

Does anyone know what can i do to fix it? Or what is the root of the issue?
I'm not in need 100% for cortex-debug i used it as my default, if there is other debugger that works i can switch to it. If there is no solution i will just stick with nxp for vscode extension.


1 回复

648 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @jslota13245,

Does this error also happen when debugging an imported "hello_world_cm7" example code from the SDK, or any SDK example for that matter? Or is it exclusive to your current project?

0 项奖励
回复