This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory violation calling ATSAM3X8

Hi,
project VScode PIO, ATSAM3X8, Framework Arduino.
simple bootloader on Flash, loader code in RAM call code, execute.
load code call direct ( my entry_main_ram) 0x20000000 area ok.

see: run ok , file flash.ld and sram.ld compiling separately (flash)

code in bootloader main flash{  

typedef void(*entry_function_t)( void);

loader code in ram...ok
entry_function_t entry_exe = entry_exe = (entry_function_t) entry_main_ram; for call

        entry_exe();  call ram code

}

//-------------program in RAM running ok

void entry_main_ram(){    it in area RAM running ok
uint32_t led =0;
 while(1){
     digitalWrite( L1, led );
      led ^=1;
   }
}
//----------------------
problems violation cause reset processor, program in RAM execute code

void entry_main_ram(){ bool bl = true; while(1){ digitalWrite( L1, bl = !bl ); not effects, in flash ok set_invert_led(); simple call reset processor } } //---------------------see list call reset processor Serial.begin(9600); //reset processor pmc_enable_periph_clk(ID_CAN0); //reset processor can_init(CAN0, 84000000, 500); //reset processor

in short, all calls outside the function cause an error or have no effect on variables.

thanks,
Carlos.