-
Notifications
You must be signed in to change notification settings - Fork 513
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
[rtl872x] fix openocd FreeRTOS thread view #2723
Conversation
🎉🎉🎉
Probably due to dual-core architecture. I previously found the OpenOCD is trying to access some dirty address.
For single core, the flash usually starts at 0x00000000, it's fine for debugger to access this address. For RTL872x, it is dual-core, we debug KM4 via AP2 while debug KM0 via AP1. The memory address 0x00000000 belongs to KM0's ROM, which means the debugger trys to access KM0's data from KM4 side, this might cause a BUS Fault and then OpenOCD stops to parse thread context. |
👍 that all makes sense and explains what im seeing.
I think this is the problem addressed in this PR. You can try applying this change to NRF concurrent_hal.cpp and see if it goes away. In fact, I think we should apply this change to the NRF HAL regardless. I will test it tomorrow |
Approve this PR becasue the recommended usage for It appears that OpenOCD aims to add one for compatibility.
see: |
Again, thanks for the effort to figure out this annoyed issue! This can greatly help to improve debugging efficiency. |
Problem
Openocd experiences an error when attempting to retrieve the Freertos symbols needed to debug on RTL872X platforms.
The error is related to the
uxTopUsedPriority
definition. This definition is used by openocd to determine how many lists of threads exist. Openocd will search for threads beyond the number of existing thread lists, return an error when trying to parse a random memory location and abandon using FreeRTOS symbols at all.I dont know why the NRF platforms do not have this issue, since they should also be "off by 1" with the number of tasks/priorities.
Solution
Decrement
uxTopUsedPriority
to not search beyond the list of valid threadsSteps to Test
Flash device os from this branch, attach debugger, run
info threads
command. All FreeRTOS threads should be enumerated.Example App
any
References
Openocd section 20.6
Completeness