Hi, I read a lot across the web but i couldn't solve my problem using my bootloader and my RTX application on at91sam7x256. So i try to simplify my projects and these was the results: simple bootloader which just a jump to a none RTX app works Fine but when i use bootloader witha an simple RTX application it get freeze in os_sys_init() function;
The simple bootloader
#define APPL_START_ADDR 0x00109D00 int main(){ void (*init_app)(void) = (void(*)(void))APPL_START_ADDR; //================================== // AT91F_WDTRestart(WatchdogCtrl); //Disable the Interrupts AT91C_BASE_AIC->AIC_IDCR = 0xFFFFFFFF; //Undo the Remap (Set iFlash to Boot Memory) AT91F_MC_Remap(); //Do a Reset that the Exception Vectors in the Application // are correctly written into RAM and the Remap is done correct pRSTC->RSTC_RCR = 0xA5000000 | AT91C_RSTC_EXTRST; /* Wait for hardware reset */ while (!(pRSTC->RSTC_RSR & AT91C_RSTC_NRSTL)); init_app(); }
Simple RTX App
#include <AT91SAM7X256.H> #include "rtl.h" __task void init (void); __task void task1 (void); OS_TID task1ID; int main(){ int i = 0; os_sys_init(init);//Application hang, inside this function while(1){ i++; } } __task void init (void){ task1ID = os_tsk_create(task1,1); os_tsk_delete_self(); } __task void task1 (void){ int i = 0; while (1){//infinite loop i++; } }
Bootloader Target Configuration: _________Start__|___Size_____ IROM1: 0x100000 | 0x9D00 IRAM1: 0x200058 | 0xFFA8 RTX App Target Configuration: _________Start__|___Size_____ IROM1: 0x109D00 | 0x36300 IRAM1: 0x200040 | 0xFFC0
Any idea? It is really frustrating not getting the expected behavior. Please Help!