mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Fix missing Binary Info for boot_stage2 (#1844)
* fix boot stage2 not showing up in binary info; sync rp2040 and rp230 bs2 CMakeLists.txt
This commit is contained in:
parent
62df126ad5
commit
cd71c8953e
3 changed files with 7 additions and 6 deletions
|
|
@ -30,7 +30,7 @@ pico_register_common_scope_var(PICO_DEFAULT_BOOT_STAGE2_FILE)
|
|||
# needed by function below
|
||||
set(PICO_BOOT_STAGE2_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "")
|
||||
|
||||
add_library(boot_stage2_headers INTERFACE)
|
||||
pico_add_library(boot_stage2_headers)
|
||||
target_include_directories(boot_stage2_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
|
||||
# by convention the first source file name without extension is used for the binary info name
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ function(pico_define_boot_stage2 NAME SOURCES)
|
|||
)
|
||||
|
||||
# todo bit of an abstraction failure - revisit for Clang support anyway
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if (PICO_C_COMPILER_IS_CLANG)
|
||||
target_link_options(${NAME} PRIVATE "-nostdlib")
|
||||
else ()
|
||||
elseif (PICO_C_COMPILER_IS_GNU)
|
||||
target_link_options(${NAME} PRIVATE "--specs=nosys.specs")
|
||||
target_link_options(${NAME} PRIVATE "-nostartfiles")
|
||||
endif ()
|
||||
|
|
@ -63,12 +63,13 @@ function(pico_define_boot_stage2 NAME SOURCES)
|
|||
find_package (Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
add_custom_target(${NAME}_bin DEPENDS ${ORIGINAL_BIN})
|
||||
add_custom_command(OUTPUT ${ORIGINAL_BIN} DEPENDS ${NAME} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${NAME}> ${ORIGINAL_BIN})
|
||||
add_custom_command(OUTPUT ${ORIGINAL_BIN} DEPENDS ${NAME} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${NAME}> ${ORIGINAL_BIN}
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(${NAME}_padded_checksummed_asm DEPENDS ${PADDED_CHECKSUMMED_ASM})
|
||||
add_custom_command(OUTPUT ${PADDED_CHECKSUMMED_ASM} DEPENDS ${ORIGINAL_BIN}
|
||||
COMMAND ${Python3_EXECUTABLE} ${PICO_BOOT_STAGE2_DIR}/pad_checksum -s 0xffffffff -a $<IF:${PICO_RISCV},riscv,arm> ${ORIGINAL_BIN} ${PADDED_CHECKSUMMED_ASM}
|
||||
)
|
||||
VERBATIM)
|
||||
|
||||
add_library(${NAME}_library INTERFACE)
|
||||
add_dependencies(${NAME}_library ${NAME}_padded_checksummed_asm)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#if !PICO_NO_BINARY_INFO && !PICO_NO_PROGRAM_INFO
|
||||
#include "pico/binary_info.h"
|
||||
|
||||
#if LIB_PICO_BOOT_STAGE2_HEADERS && !PICO_NO_FLASH
|
||||
#if LIB_BOOT_STAGE2_HEADERS && !PICO_NO_FLASH
|
||||
#include "boot_stage2/config.h"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue