pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Inconsistent use of PICO_RP2040 macro in embedded_start_block.inc.S

Open eightycc opened this issue 8 months ago • 4 comments

In src/rp2_common/pico_crt0/embedded_start_block_inc.S the macro PICO_RP2040 is tested with #ifdef. Elsewhere in the SDK, PICO_RP2040 is expected to have a value of 0 for RP2350 and 1 for RP2040. #ifdef usage results in an incorrect ARM.attributes section generated when compiling crt0.S with PICO_RP2040=0 and PICO_RP2350=1 resulting in an un-bootable UF2.

eightycc avatar Mar 18 '25 14:03 eightycc

merged into develop

kilograham avatar Mar 18 '25 15:03 kilograham

@kilograham On a similar note, by doing some git grep I see that most places in the SDK use #if PICO_RP2350 but https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/hardware_rcp/include/hardware/rcp.h#L19 uses #if defined(PICO_RP2350) - does that also need fixing up?

lurch avatar Mar 18 '25 15:03 lurch

@kilograham On a similar note, by doing some git grep I see that most places in the SDK use #if PICO_RP2350 but https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/hardware_rcp/include/hardware/rcp.h#L19 uses #if defined(PICO_RP2350) - does that also need fixing up?

Actually that one should just be #if HAS_REDUNDANCY_COPROCESSOR as we now have feature flags like that (which also takes care of the RISC-V ness.

Probably worth looking at any remaining PICO_RP2350 OR PIO_RP2040 tests

kilograham avatar Mar 18 '25 18:03 kilograham

re-opening for me to go and have a quick look at other places

kilograham avatar Mar 18 '25 19:03 kilograham

none others found

kilograham avatar Jul 21 '25 21:07 kilograham