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

[BUG] esp32s3 gdb debug problem with CONFIG_ESPRESSIF_SIMPLE_BOOT #14660

Closed
1 task done
chirping78 opened this issue Nov 6, 2024 · 4 comments
Closed
1 task done

[BUG] esp32s3 gdb debug problem with CONFIG_ESPRESSIF_SIMPLE_BOOT #14660

chirping78 opened this issue Nov 6, 2024 · 4 comments
Labels
Arch: xtensa Issues related to the Xtensa architecture Area: Debugging Debugging issues OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working

Comments

@chirping78
Copy link
Contributor

Description / Steps to reproduce the issue

Take esp32s3-devkit:sotest as an example, with legacy boot format, the board can be debugged. The steps are:

  1. add CONFIG_ESP32S3_APP_FORMAT_LEGACY=y to boards/xtensa/esp32s3/esp32s3-devkit/configs/sotest/defconfig
  2. build (needs esp-bins of bootloader and partition table)
./tools/configure.sh -E esp32s3-devkit:sotest
make -j8 flash ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BINDIR=/path/to/esp-bins/
  1. launch openocd openocd -f board/esp32s3-builtin.cfg
  2. gdb debug (it's working as expected)
xtensa-esp32s3-elf-gdb nuttx
 target remote :3333
 monitor reset halt
 b nx_start
 c

With CONFIG_ESPRESSIF_SIMPLE_BOOT, gdb debug is not working. The steps are:

  1. delete CONFIG_ESP32S3_APP_FORMAT_LEGACY=y from boards/xtensa/esp32s3/esp32s3-devkit/configs/sotest/defconfig
  2. build
./tools/configure.sh -E esp32s3-devkit:sotest
make -j8 flash ESPTOOL_PORT=/dev/ttyUSB0
  1. launch openocd openocd -f board/esp32s3-builtin.cfg
  2. gdb debug
xtensa-esp32s3-elf-gdb nuttx
 target remote :3333
 monitor reset halt
 b nx_start
 c

After c, the program can't continue, gdb shows:

(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x42030cec

Command aborted.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu 20.04

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: Debugging]

Verification

  • I have verified before submitting the report.
@chirping78 chirping78 added the Type: Bug Something isn't working label Nov 6, 2024
@github-actions github-actions bot added Arch: xtensa Issues related to the Xtensa architecture Area: Debugging Debugging issues OS: Linux Issues related to Linux (building system, etc) labels Nov 6, 2024
@xiaoxiang781216
Copy link
Contributor

@tmedicci could you look at this problem? We want to optimize xtensa arch with esp32s3.

@eren-terzioglu
Copy link
Contributor

Hi @chirping78,

Due to simpleboot implementation, please force hardware breakpoints with adding -c 'set ESP_FLASH_SIZE 0' parameter to openocd command. In your example openocd command should be openocd -c 'set ESP_FLASH_SIZE 0' -f board/esp32s3-builtin.cfg

@chirping78
Copy link
Contributor Author

Hi @eren-terzioglu, tried to add -c 'set ESP_FLASH_SIZE 0', and it works.
But the hardware breakpoints have size limit, currently it seems only support 2 hw breakpoints.

So if use normal b breakpoint, I have to delete oldest ones.
Or use tb to set temporary breakpoint.

Is this inconvenience is expected?

@eren-terzioglu
Copy link
Contributor

Hi @eren-terzioglu, tried to add -c 'set ESP_FLASH_SIZE 0', and it works. But the hardware breakpoints have size limit, currently it seems only support 2 hw breakpoints.

So if use normal b breakpoint, I have to delete oldest ones. Or use tb to set temporary breakpoint.

Is this inconvenience is expected?

It was about (if I remember correctly) place where bootloader resides, so it should be expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: xtensa Issues related to the Xtensa architecture Area: Debugging Debugging issues OS: Linux Issues related to Linux (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants