-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVD not updating registers #210
Comments
Could you post a little bit more from the Debug Console window? Also from the Adapter Output window to see messages if any from pyocd. |
Sure, I'll do it when I get to laptop |
Some details: GPIOA->ODR =0x000ffff; Works correctly in code but register is still: Also after any operation of refreshing svd preview in debug console I receive: This is my repository: {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"request": "launch",
"servertype": "pyocd",
"cwd": "${workspaceRoot}",
"executable": "exec/main.elf",
"name": "Debug (pyOCD)",
"device": "STM32F103RB",
"targetId": "",
"boardId": "",
"showDevDebugOutput": true,
"svdFile": "svd/STM32F103.svd",
"preLaunchTask": "build",
}
]
} Is there any other setup I need to complete to allow svd preview to update? Thank in advace for any help! Witek |
Since I don't have your HW, I can't debug with your project but I can see what tools you are using. What I need is the full output of the Debug Console... before the following. I want to know what requests were made to gdb, which ones succeeded and which failed. What I see below is just the response to one failed request. GDB -> App: {"token":267,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Unable to read memory."]]}} And, the output from pyocd. You can also use the memory window to see what is at 0x40010800. If memory reads are not working in that region of the address space then, SVD can't work. I see a couple of registers there that night be the issue. I still need to see what requests were made to GDB |
Okay, I see the problem. The memory read is trying to read 28 bytes but 8 of those bytes are write-only. You enter the following in the "Debug Console"
The above should succeed. If the above fail, then we have a different problem. Change 16 to 20 or 24 and it will probably fail. Please confirm. It is a bug in Cortex-Debug and I can fix it after your confirmation. |
Oh darn/puzzled. Can we even read 4 or 8 bytes? If not, nothing will work. At this point, I am suspecting problem may be pyocd? Is it possible for you to try with OpenOCD -- just as an experiment. My theory was that up to 16 bytes from that address, everything should be fine. Are other peripheral addresses working or is it across the board failure? Normally even if you have a |
Switching to openOCD works like charm :) |
Whew!!. You may want to file an issue with either pyocd or STM simply mentioning why memory reads fail and/or how they can expect SVD to even work. Use gdb as an example instead of this extension. I know it is a bit of work It will help a whole lot of people. Chances are you will have the exact same issues with Eclipse-based IDEs |
OK I will post issue on pyocd while I can easily link this issue. |
Although the issue is now closed I would like to add some feedback as I recently run into the same problem with STM32L5 and I think that the potential solution description may save some other people time. Firstly I would like to confirm that Cortex-Debug plugin is working properly. Secondly the problem with SVD or more generally with peripherals memory sector access is caused by the way pyOCD is handling CMSIS packs, or to be more precise - by the information provided in pack descriptor. <!-- ************************* Device 'STM32L552CCTx' ***************************** -->
<device Dname="STM32L552CCTx">
<debug svd="CMSIS/SVD/STM32L552.svd"/>
<compile header="Drivers/CMSIS/Device/ST/STM32L5xx/Include/stm32l5xx.h" define="STM32L552xx"/>
<book name="Documentation/DB3609_STM32L552.pdf" title="STM32L552xx Data Sheet"/>
<memory name="Flash-non-secure" access="rx" id="IROM1" start="0x08000000" size="0x00040000" default="1" startup="1" />
<memory name="Flash-secure" access="rx" id="IROM2" start="0x0C000000" size="0x00040000" default="0" startup="1" />
<memory name="SRAM-non-secure" access="rwx" id="IRAM1" start="0x20000000" size="0x00040000" default="1" init="0" />
<memory name="SRAM-secure" access="rwx" id="IRAM2" start="0x30000000" size="0x00040000" default="0" init="0" />
<feature type="QFP" n="48"/>
</device> Flash and RAM sectors are properly defined but that's it. All remaining address space is not part of memory map and therefore illegal to access by a GDB client. After I had modified the pack descriptor and added additional memory section for peripheral address space the SVD/peripheral register view functionality was fully restored. <memory name="Peripheral" access="rw" id="PERPH" start="0x40000000" size="0x10000000" default="0" init="0" /> The same issue type ("unable to read memory") will happen in case of other address sectors like FSMC external memory or some vendor registers unless they are not defined in the memory map. For the record my environment:
|
Thank you for the investigation, resolution, and explanation. |
Another workaround when using pyOCD is to use a user script |
Hello,
I've started using cortex debug addin.
It works ok, until I want to use svd file.
It looks like it not updating registers, after refresh it shows:
GDB -> App: {"token":267,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","Unable to read memory."]]}}
Here is my code repo:
https://github.com/mes1234/nucleo_bare_metal
The text was updated successfully, but these errors were encountered: