diff --git a/components/ulp/cmake/CMakeLists.txt b/components/ulp/cmake/CMakeLists.txt index 625ff97154..d1f4fecc21 100644 --- a/components/ulp/cmake/CMakeLists.txt +++ b/components/ulp/cmake/CMakeLists.txt @@ -149,3 +149,4 @@ add_custom_target(build WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(${ULP_APP_NAME} -T${CMAKE_CURRENT_BINARY_DIR}/${ULP_LD_SCRIPT} ${EXTRA_LINKER_ARGS}) +set_target_properties(${ULP_APP_NAME} PROPERTIES LINK_DEPENDS ${ULP_LD_SCRIPT}) diff --git a/components/ulp/ld/esp32s2.ulp.riscv.ld b/components/ulp/ld/esp32s2.ulp.riscv.ld index 983481df29..2134f8dd17 100644 --- a/components/ulp/ld/esp32s2.ulp.riscv.ld +++ b/components/ulp/ld/esp32s2.ulp.riscv.ld @@ -12,10 +12,17 @@ SECTIONS . = ORIGIN(ram); .text : { + *start.S.obj(.text.vectors) /* Default reset vector must link to offset 0x0 */ *(.text) *(.text*) } >ram + .rodata ALIGN(4): + { + *(.rodata) + *(.rodata*) + } > ram + .data ALIGN(4): { *(.data) diff --git a/components/ulp/ulp_riscv/start.S b/components/ulp/ulp_riscv/start.S index 1da9b755b0..949fd7fb48 100644 --- a/components/ulp/ulp_riscv/start.S +++ b/components/ulp/ulp_riscv/start.S @@ -1,4 +1,4 @@ - .section .text + .section .text.vectors .global irq_vector .global reset_vector @@ -11,6 +11,8 @@ reset_vector: irq_vector: ret + .section .text + __start: /* setup the stack pointer */ la sp, __stack_top