Skip to content

RP2040 DEBUG=1 builds don't work #5091

@dhalbert

Description

@dhalbert

Version: fails with 7.0.0 main at this time and earlier

RP2040 board builds built with DEBUG=1 don't work: they crash. The crash can be seen with gdb:

(gdb) mon reset
Resetting target
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
isr_hardfault () at sdk/src/rp2_common/pico_standard_link/crt0.S:99
99	decl_isr_bkpt isr_hardfault
(gdb) bt
#0  isr_hardfault () at sdk/src/rp2_common/pico_standard_link/crt0.S:99
#1  <signal handler called>
#2  0x1001d160 in port_init () at supervisor/port.c:97
#3  0x1001cfc2 in main () at ../../main.c:773
(gdb) 

If I set a breakpoint at main(), it does get past main(), and then soon hits the decl_isr_bkpt isr_hardfault.

MicroPython built as CMAKE_ARGS = -DMICROPY_BOARD=$(BOARD) -DCMAKE_BUILD_TYPE=Debug does not have this problem.

(I originally thought this was some kind of problem with the Segger J-Link and gdb, but that's because I never tried this with a non-debug build. In fact gdb works fine with a non-debug build, but it's not so useful.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions