I have tested a few things but still can't get any further
"enable_interrupts()" as first instruction in main() triggers the SIGTRAP signal. The debugger stops at decl_isr_bkpt isr_hardfault. "restore_interrupts(0)" works fine.
In the enc_bootloader, stdio_deinit_all(); is called before rom_chain_image. When I do this, it results in an exit(1) somewhere deep in the deinit call. I followed it up to critical_section_deinit and then gave up.
disable_interrupts(); leads directly to a SIGTRAP signal and the debugger stops at decl_isr_bkpt isr_hardfault
rom_chain_image(workarea8, sizeof(workarea8), XIP_BASE, flash_size); leads directly to a SIGTRAP signal and the debugger stops at unhandled_user_irq_num_in_r0: bkpt #0, regardless of whether I have previously called save_and_disable_interrupts(); or not
asm volatile (...); has the same problem as rom_chain_image
Here is my test code
"enable_interrupts()" as first instruction in main() triggers the SIGTRAP signal. The debugger stops at decl_isr_bkpt isr_hardfault. "restore_interrupts(0)" works fine.
In the enc_bootloader, stdio_deinit_all(); is called before rom_chain_image. When I do this, it results in an exit(1) somewhere deep in the deinit call. I followed it up to critical_section_deinit and then gave up.
disable_interrupts(); leads directly to a SIGTRAP signal and the debugger stops at decl_isr_bkpt isr_hardfault
rom_chain_image(workarea8, sizeof(workarea8), XIP_BASE, flash_size); leads directly to a SIGTRAP signal and the debugger stops at unhandled_user_irq_num_in_r0: bkpt #0, regardless of whether I have previously called save_and_disable_interrupts(); or not
asm volatile (...); has the same problem as rom_chain_image
Here is my test code
Code:
static __attribute__((aligned(4))) uint8_t workarea8[4 * 1024];auto workarea = reinterpret_cast<uint32_t*>(workarea8);constexpr int flash_size = 0x200000;int main(void){//enable_interrupts();restore_interrupts(0);stdio_init_all();sleep_ms(100);printf("Bootloader\r\n");//stdio_deinit_all();//disable_interrupts();save_and_disable_interrupts();//uint32_t APP_OFFSET = 0x20000;uint32_t APP_OFFSET = 0;rom_chain_image(workarea8, sizeof(workarea8), XIP_BASE + APP_OFFSET, flash_size);//asm volatile (//"mov r0, %[start]\n"//"ldr r1, =%[vtable]\n"//"str r0, [r1]\n"//"ldmia r0, {r0, r1}\n"//"msr msp, r0\n"//"bx r1\n"//://: [start] "r" (XIP_BASE+APP_OFFSET), [vtable] "X" (PPB_BASE + M33_VTOR_OFFSET)//://);stdio_init_all();printf("Hier dürfen wir nicht landen\r\n");while (1){tight_loop_contents();}}Statistics: Posted by derGerd — Tue Jul 29, 2025 9:21 am