Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
F421: work around bug in old bootloader
the released F421 bootloader does this: 0x08000b3a: ldr r0, [r4, am32-firmware#24] 0x08000b3c: str r0, [r4, am32-firmware#28] 0x08000b3e: ldr r0, [r5, #0] 0x08000b40: msr MSP, r0 0x08000b44: ldr r0, [r4, am32-firmware#28] 0x08000b46: ldmia.w sp!, {r4, r5, r7, lr} 0x08000b4a: bx r0 that writes to the application stack area before jumping. If the application stack is set to the end of ram then the ldmia instruction hard faults as it writes past the end of memory this avoids the issue by only giving the app 15k instead of 16k of ram. This is not needed when we fix the bootloader to use the right jump method, which is this: // setup sp, msp and jump asm volatile( "mov sp, %0 \n" "msr msp, %0 \n" "bx %1 \n" : : "r"(stack_top), "r"(JumpAddress) :);
- Loading branch information