mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
give user more control over embedded_start_block.S contents (#2470)
This commit is contained in:
parent
66540fe88e
commit
8066bee734
1 changed files with 18 additions and 8 deletions
|
|
@ -5,6 +5,21 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PICO_CRT0_INCLUDE_PICOBIN_VECTOR_TABLE_ITEM
|
||||
// If no_flash bin, then include a vector table item
|
||||
#if PICO_NO_FLASH && !PICO_RP2040
|
||||
#define PICO_CRT0_INCLUDE_PICOBIN_VECTOR_TABLE_ITEM 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PICO_CRT0_INCLUDE_PICOBIN_ENTRY_POINT_ITEM
|
||||
// On RISC-V the default entry point from bootrom is the start of the binary, but
|
||||
// we have our vtable at the start, so we must include an entry point
|
||||
#ifdef __riscv
|
||||
#define PICO_CRT0_INCLUDE_PICOBIN_ENTRY_POINT_ITEM 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef PICO_CRT0_INCLUDE_PICOBIN_BLOCK
|
||||
#define PICO_CRT0_INCLUDE_PICOBIN_BLOCK PICO_CRT0_INCLUDE_PICOBIN_IMAGE_TYPE_ITEM
|
||||
#endif
|
||||
|
|
@ -73,9 +88,7 @@ embedded_block:
|
|||
.hword PICO_CRT0_VERSION_MAJOR
|
||||
#endif
|
||||
|
||||
#ifdef __riscv
|
||||
// On RISC-V the default entry point from bootrom is the start of the binary, but
|
||||
// we have our vtable at the start, so we must include an entry point
|
||||
#if PICO_CRT0_INCLUDE_PICOBIN_ENTRY_POINT_ITEM
|
||||
.byte PICOBIN_BLOCK_ITEM_1BS_ENTRY_POINT
|
||||
.byte 0x3 // word size to next item
|
||||
.byte 0 // pad
|
||||
|
|
@ -84,15 +97,12 @@ embedded_block:
|
|||
.word SRAM_END // stack pointer
|
||||
#endif
|
||||
|
||||
#if !PICO_RP2040
|
||||
#if PICO_NO_FLASH
|
||||
// If no_flash bin, then include a vector table item
|
||||
#if PICO_CRT0_INCLUDE_PICOBIN_VECTOR_TABLE_ITEM
|
||||
.byte PICOBIN_BLOCK_ITEM_1BS_VECTOR_TABLE
|
||||
.byte 0x2
|
||||
.hword 0
|
||||
.word __vectors
|
||||
#endif
|
||||
#endif
|
||||
|
||||
.byte PICOBIN_BLOCK_ITEM_2BS_LAST
|
||||
.hword (embedded_block_end - embedded_block - 16 ) / 4 // total size of all
|
||||
|
|
@ -106,4 +116,4 @@ embedded_block:
|
|||
#endif
|
||||
.word PICOBIN_BLOCK_MARKER_END
|
||||
embedded_block_end:
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue