mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-06-19 22:57:57 +08:00
Prevent optimization in reset handler for QEMU MPS2 (#484)
This commit is contained in:
@ -41,7 +41,10 @@ void __attribute__((weak)) EthernetISR (void);
|
||||
|
||||
extern uint32_t _estack, _sidata, _sdata, _edata, _sbss, _ebss;
|
||||
|
||||
__attribute__((naked)) void Reset_Handler(void)
|
||||
/* Prevent optimization so gcc does not replace code with memcpy */
|
||||
__attribute__((optimize("O0")))
|
||||
__attribute__((naked))
|
||||
void Reset_Handler(void)
|
||||
{
|
||||
// set stack pointer
|
||||
__asm volatile ("ldr r0, =_estack");
|
||||
|
@ -41,8 +41,11 @@ void __attribute__((weak)) EthernetISR (void);
|
||||
|
||||
extern uint32_t _estack, _sidata, _sdata, _edata, _sbss, _ebss;
|
||||
|
||||
__attribute__((naked)) void Reset_Handler(void)
|
||||
{
|
||||
/* Prevent optimization so gcc does not replace code with memcpy */
|
||||
__attribute__((optimize("O0")))
|
||||
__attribute__((naked))
|
||||
void Reset_Handler(void)
|
||||
{
|
||||
// set stack pointer
|
||||
__asm volatile ("ldr r0, =_estack");
|
||||
__asm volatile ("mov sp, r0");
|
||||
|
Reference in New Issue
Block a user