IAP bootloader not working with FREERTOS application
I have build a IAP bootloader at 0x8000000 and test with a simple blink app at 0x8040000 which works fine but if I add FreeRTOS for the same blink app at 0x8040000 its not working. It jump to the blink application but it doesn't pass the SystemClock_Config() function while under debugging. Did I miss anything to configure?
/* Blink app */
int main(void)
{
/* USER CODE BEGIN 1 */
SCB->VTOR = 0x8040000;
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
while(1){
HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0 | GPIO_PIN_1,GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0 | GPIO_PIN_1,GPIO_PIN_RESET);
HAL_Delay(500);
}
/* USER CODE END 2 */
/* USER CODE BEGIN RTOS_MUTEX */
/* add mutexes, ... */
/* USER CODE END RTOS_MUTEX */
/* USER CODE BEGIN RTOS_SEMAPHORES */
/* add semaphores, ... */
/* USER CODE END RTOS_SEMAPHORES */
/* USER CODE BEGIN RTOS_TIMERS */
/* start timers, add new ones, ... */
/* USER CODE END RTOS_TIMERS */
/* USER CODE BEGIN RTOS_QUEUES */
/* add queues, ... */
/* USER CODE END RTOS_QUEUES */
/* Create the thread(s) */
/* definition and creation of defaultTask */
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
/* USER CODE END RTOS_THREADS */
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}/* IAP Bootloader */
#define APP_ADDRESS 0x8040000
if (((*(__IO uint32_t*)APP_ADDRESS) & 0x2FFE0000 ) == 0x20000000) {
HAL_RCC_DeInit();
HAL_DeInit();
JumpAddress = *(__IO uint32_t*) (APP_ADDRESS + 4);
Jump = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) APP_ADDRESS);
Jump();
}