cancel
Showing results for 
Search instead for 
Did you mean: 

VS Extension v2.0.0: Errors in reading peripheral registers from VSCode, but CubeIDE works fine

brian_schmalz
Associate II

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:

brian_schmalz_0-1719502350786.png

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

2 REPLIES 2
brian_schmalz
Associate II

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. 

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.