Failing to read peripheral registers

I am trying to debug my stm32cube project with VSCode and PlatformIO. I am having problems displaying the peripheral registers. When I stop the code with a breakpoint or step the code I see a message similar to the one below, depending upon which peripheral I am trying to examine:

Internal error: Failed to update peripheral GPIOA after memory reads

My board under test is Nucleo-L452.

Having the same issue, though I would guess a different configuration.

platformio ststm32 or nxplpc platform
bare metal, no framework

using pyocd debug via debug_tool = custom as there is no openocd support for my target, and built-in pyocd via debug_tool = cmsis-dap does not have a way to add packs - there is neither a config option for this that I can see, nor does it set the working path to the project directory, so cannot add packs via config file.

Program and debug work correctly. Only peripheral access via peripheral pane doesn’t work.

  • Have tried adding peripheral memory maps via pyocd_user.py, so there should be nothing restricting access to peripherals.
  • Have tried editing device pack to add peripheral memory space.
  • Have tried set mem inaccessible-by-default off

Can manually read and write peripheral memory addresses in the debug console, but cannot read nor edit them in the peripheral pane. Get the same error as original poster. For example, trying to read ADC from the peripheral pane:

Internal error: Failed to update peripheral ADC after memory reads

Can you open an issue about it in the right platform (platform-ststm32 or platform-nxplpc) with the exact project files and errro message / screenshot?

The issue does not seem to be dependent on the platform, as it affects both in testing. Would presume it affects others. Likewise as ststm32 is opencd-only, and the original poster is likely using this, the OCD may not matter either.

But it still occurs in the context of using a particular platform, so I think Issues · platformio/platform-ststm32 · GitHub should be fine. The other platforms may just be suffering from similiar bugs.