Skip to content
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

"Memory protection is enabled. Reset target to disable it..". (debugging works, memory protection disabled) (OCD-433) #190

Closed
ad7718 opened this issue Nov 5, 2021 · 5 comments

Comments

@ad7718
Copy link

ad7718 commented Nov 5, 2021

Environment

  • Development Kit: Ai-thinker esp32-c3
  • Module or chip used: esp32-c3-32s
  • Debug Adapter: builtin esp32 jtag
  • OpenOCD version: v0.10.0-esp32-20210902-33-g65b7bf50
  • Operating System: debian 11 (MX linux 21)
  • Using an IDE?: VS Code + platformio
  • OpenOCD command line: openocd -f board/esp32c3-builtin.cfg
  • JTAG Clock: 5000 kHz
  • ESP-IDF version: v4.3

Problem Description

Steps to reproduce the behavior:

  1. Disable memory protection in menuconfig
  2. Start debugging
  3. Open debug terminal
  4. See warning: "Memory protection is enabled. Reset target to disable it..."

Debug Logs

openocd_log.txt

Expected behavior

No warning

@github-actions github-actions bot changed the title "Memory protection is enabled. Reset target to disable it..". (debugging works, memory protection disabled) "Memory protection is enabled. Reset target to disable it..". (debugging works, memory protection disabled) (OCD-433) Nov 5, 2021
@ad7718
Copy link
Author

ad7718 commented Nov 5, 2021

Also there is "Warn : No symbols for FreeRTOS!" warning, and seems it's also doesn't affect debugging. I don't know if it's IDF or openocd-esp32 issue.

@gerekon
Copy link
Collaborator

gerekon commented Nov 5, 2021

@ad7718
That warning was added intentionally to notify the user that the target will be reset by OpenOCD to disable memory protection. It does not affect functionality.
Is that warning is the only problem you see?

@ad7718
Copy link
Author

ad7718 commented Nov 5, 2021

@gerekon
Yes, I think it must not say that memory protection is enabled if it's disabled, or we need a different message that only reminds about memory protection.

@gerekon
Copy link
Collaborator

gerekon commented Nov 5, 2021

Ok. Got it. It looks like some memprot bits remain set https://github.com/espressif/openocd-esp32/blob/master/tcl/target/esp32c3.cfg#L121. I think we need to limit checked bits for ESP32-C3 to ones in SENSITIVE_CORE_0_xxx_PMS_MONITOR_1_REG

Thanks, for the findings!

@ad7718
Copy link
Author

ad7718 commented Nov 5, 2021

Thank you, glad it helped. Maybe it's offtop, but what do you think about the FreeRTOS warning? Is it openocd or IDF related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants