-
Notifications
You must be signed in to change notification settings - Fork 134
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
setting gdb breakpoints at init causes PSRAM memory overwrite (IDFGH-8913) (OCD-670) #264
Comments
size
exceeds 24540size
exceeds 24540 (IDFGH-8913)
size
exceeds 24540 (IDFGH-8913)
@zfields Do you observe this issue when you aren't connecting OpenOCD? I think OpenOCD on ESP32-S3 doesn't support PSRAM yet, so PSRAM data may be corrupted when OpenOCD is setting/removing a breakpoint. |
If that's true, that would certainly explain it. How would I connect without OpenOCD to check? |
I think you can try to still run OpenOCD but disable the software breakpoints in flash, then force GDB to use only hardware breakpoints. As a result, OpenOCD will not write to flash and this should prevent PSRAM corruption. In step 7:
When running GDB, add
and use |
Thanks @igrr for following up with me so quickly! When dumping memory even with these fixes and even with 1 breakpoint, the first byte looks bad when you first dump it. However, it seems to "clear up" if you dump it twice. Any ideas? Also, is there any time frame for when using OpenOCD on the ESP32-S3 will support PSRAM? |
@zfields Have transferred this issue to OpenOCD project so that it is tracked properly. Regarding the successful read on 2nd attempt, there has been a similar issue we had fixed recently; however it looks like you are already using the latest release which includes the fix. Could you please confirm the version of OpenOCD you are running? Regarding PSRAM support for ESP32-S3, it will likely be done in Q1 2023. |
Thanks @igrr!
I'm using OpenOCD v0.11.0-esp32-20221026.
Thanks, that's great news!
No, I have not. Is there a way to "transfer" it using the GitHub UI, or do you mean reopen it there? |
Sorry for not phrasing this clearly. I meant that I have already transferred this issue to the OpenOCD project. You don't need to do anything. |
Hi @zfields Can I ask you to test with the attached version? openocd-esp32-macos-0.11.0-esp32-20221026-86-g283b87d64.tar.gz |
I'm working on something at this very moment, but I will test it ASAP and get back to you. Thanks! |
@zfields We provided the solution in the latest release. Can you please confirm your issue has been fixed? |
I'm sorry, but it does NOT appear to be fixed. My Test
Repro Instructions
when it hits the first breakpoint in |
@zfields IDF is not updated to use the latest release. In your example you still use |
I'm happy to test, but this is the message I responded to:
Can you please provide detailed instructions on what exactly you would like for me to test? |
I suppose that was about the latest OpenOCD release.
It would be great of you checked your scenario described in the first message of this topic. But with the latest OpenOCD release. So your modified command should look like
|
Okay, so everything else will be the same, and you want me to additionally update/replace I'll will test this 👆, and get back to you. |
I downloaded the latest
The problem happens when I say "c" to continue after setting the breakpoint. On the gdb side it gives the warning that I can't insert the breakpoint, and on the openocd side it says "Warn" "address not writable". GDB Output: OpenOCD Output:
|
@zfields please make sure the |
Eureka! That worked! 👍 Do you know which official IDF release is planned to contain the latest release of Thanks, |
Afaik, it will be in the IDF v5.1 release around June. Thanks for providing reproducible code and support to get this done. |
Answers checklist.
IDF version.
v5.0
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S3-WROOM-1 (N8R2)
Power Supply used.
USB
What is the expected behavior?
I expect to be able to allocate PSRAM in chunks bigger than 24540 bytes.
What is the actual behavior?
It starts to overwrite memory when 24541 and larger bytes are allocated.
Steps to reproduce.
main.c
openocd -f board/esp32s3-builtin.cfg -c "esp32s3.cpu1 configure -rtos FreeRTOS"
xtensa-esp32s3-elf-gdb -tui -ex 'set pagination off' -ex 'target extended-remote :3333' -ex 'mon reset halt' -ex 'maintenance flush register-cache' -ex 'thb app_main' -ex 'monitor [target current] configure -event gdb-detach { shutdown }' -ex 'c' ./build/main.elf
Debug Logs.
No response
More Information.
The text was updated successfully, but these errors were encountered: