Skip to content

Commit 7cdb8ec

Browse files
authored
Add PICO_CRT0_NO_RESET_SECTION (#2453)
1 parent 0779dfe commit 7cdb8ec

File tree

1 file changed

+8
-1
lines changed
  • src/rp2_common/pico_crt0

1 file changed

+8
-1
lines changed

src/rp2_common/pico_crt0/crt0.S

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
pico_default_asm_setup
2525

26+
// PICO_CONFIG: PICO_CRT0_NO_RESET_SECTION, Omit .reset section contents containing the startup code. This must be set if you want to replace the startup code while still keeping the rest of pico_crt0 as the reset section define here is not garbage collected, type=bool, default=0, advanced=true, group=pico_crt0
27+
#ifndef PICO_CRT0_NO_RESET_SECTION
28+
#define PICO_CRT0_NO_RESET_SECTION 0
29+
#endif
30+
2631
#ifdef PICO_NO_STORED_VECTOR_TABLE
2732
#warning PICO_NO_STORED_VECTOR_TABLE is no longer used. PICO_MINIMAL_STORED_VECTOR_TABLE is not identical but usually serves the same purpose
2833
#endif
@@ -328,6 +333,7 @@ binary_info_header:
328333

329334
// ----------------------------------------------------------------------------
330335

336+
#if !PICO_CRT0_NO_RESET_SECTION
331337
.section .reset, "ax"
332338

333339
// On flash builds, the vector table comes first in the image (conventional).
@@ -492,7 +498,7 @@ data_cpy:
492498
// Note the data copy table is still included for NO_FLASH builds, even though
493499
// we skip the copy, because it is listed in binary info
494500

495-
.align 2
501+
.p2align 2
496502
data_cpy_table:
497503
#if PICO_RP2350 && PICO_EMBED_XIP_SETUP && !PICO_NO_FLASH
498504
.word __boot2_start__
@@ -529,6 +535,7 @@ data_cpy_table:
529535
runtime_init:
530536
bx lr
531537

538+
#endif // PICO_CRT0_NO_RESET_SECTION
532539
// ----------------------------------------------------------------------------
533540
// Stack/heap dummies to set size
534541

0 commit comments

Comments
 (0)