2024-06-27 08:37 AM
I'm in the middle of debugging a GPDMA issue on an STM32H5 processor. I had a memory view window open (where the DMA was writing to) in VSCode, debugging my application, and I tried to write a new value to a byte of RAM from within that memory window. The first byte write appeared to work. But the second byte gave an error which I had never seen before - something about a failure to read memory.
From that point on, I am no longer able to read any RAM memory in a memory window, and I am no longer able to view the contents of any peripheral registers. Every time I try to debug I get a number of errors that look like this:
It appears that the debugger is not able to read any peripheral registers or RAM.
Steps I took to try and resolve the problem:
- Shut everything off (power to target, PC, USB hub, STLinkV3, etc.) and turn it back on
- Deleted my CMake build directory to force rebuild of everything
- Used STM32CubeProgrammer to do a full erase of the MCU
- Put a breakpoint at entry to main(), before any DMA registers are set up
None of the above steps changed the behavior of the problem. VSCode could still not read registers or RAM.
I also tried debugging the same project from within CubeIDE, and it has no problem reading peripheral registers or reading any RAM.
So I feel like something is 'stuck' in a VSCode configuration file somewhere that is causing this problem. I don't there is actually anything wrong with the MCU itself.
What other debugging steps can I take to try and find/fix the issue? Maybe just wholesale delete the .vscode directory?
*Brian
2024-06-27 08:47 AM
So this is sort of a nuclear option (I think) but I was able to fix the above problem by re-importing the CMake project from within the STM32 VS Code Extension. So some file (that got re-built with the import) had some setting that was preventing the reading of registers/RAM.
2024-06-27 09:40 AM
The strangeness gets stranger: I can solve the above problem when I re-import the CMake project using the STM32 VS Code Extension. Debugs fine, displays peripheral registers and memory fine. But then if I close VS Code, and restart it, then start debugging again - all of my memory read failure errors are back. So my 'reimport the project' solution isn't a solution after all.
I'm going to head back to CubeIDE to debug this for now. Let me know if you have any good ideas for me to try on the VS Code side of things.
2024-08-20 08:05 AM
Any idea about this problem ST? I'm still stuck on my GPDMA debugging, and VSCode Extension is still not happy trying to read peripheral registers while debugging:
Failed to update peripheral GPDMA1: Error: peripheral-viewer: readMemory failed @ 0x4002044c for 4 bytes: CodeExpectedError: Busy, session=ebf62a39-b75e-42e1-bf4f-877a9d6d74ab
Internal error: Failed to update peripheral GPDMA1 after memory reads
2024-08-20 11:56 AM
Memory view really seems to have issues. The detail page says: "https://marketplace.visualstudio.com/items?itemName=mcu-debug.memory-view is available as a preview.". cortex-debug relies on it. So we have a mix of extensions and I doubt that ST can/will do something here.
Although I like VS Code much more, when things are getting serious, STMCubeIDE is still the better choice.
hth
KnarfB