We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I wrote a simple bootloader program (doesn't do anything but jump to the application code in flash once a timer expires) and I am having trouble getting rtx to work in the application code. It gets to a point in os_sys_init()'s assembly code where it will stick. If my application without rtx,it do work ok.
I am using the stm32f429zi m4 chip.
This is bootloader code.
static void JumpToApp(void) { if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFD0000) == 0x20000000) { /* Jump to user application */ m_JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); JumpToApplication = (FunVoidType) m_JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) ApplicationAddress); __set_PRIMASK(1); JumpToApplication(); } Uart1SendSyc("JumpToApp Failed!\r\n"); }
This is appliction code.
int main(void) { NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x10000); LED_Init(); while(1) { STM_EVAL_LEDToggle(LED4); } }
this is .s file. ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size
What can i do for Vector ? I am sorry for my english level.. I hope you can understand.
I find my mistake. if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFD0000) == 0x20000000)
The code has mistake.
STM32F429ZI's stack start 0x20000000H size 30000H. So I change code below:
static void JumpToApp(void) { UINT32 addr = (*(__IO uint32_t*)ApplicationAddress); addr = addr & 0x1FFFFFFF; if (addr < 0x30000)//check stack addr { /* Jump to user application */ m_JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); JumpToApplication = (FunVoidType) m_JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) ApplicationAddress); __set_PRIMASK(1); JumpToApplication(); } Uart1SendSyc("JumpToApp Failed!\r\n"); }
That is ok.