2024-10-18 05:42 PM - edited 2024-10-19 03:54 PM
Hi,
I'm developing a custom bootloader.
My freertos appl. is running well on debug mode in stm32cubeide while my freertos appl is on 0x08008000.
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - 8
/*FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K*/
FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 512K - 0x8000
}
And, I load my custom bootloader on 0x08000000, and I try to jump to 0x080080000 but my freertos appl is not running.
My bootloader is using Systick, but my freertos is using TIM4.
My jump code of bootloader is as:
void
appl_jump (void)
{
DBG ("Jump to appl\n");
pFunction Jump_To_Application;
uint32_t JumpAddress;
RAM_BOOT_FLAG = 0x424f4f54; // 'BOOT'
/* Disable all interrupts */
__disable_irq();
/* Set the clock to the default state */
HAL_RCC_DeInit();
HAL_DeInit();
/* Disable Systick timer */
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* Clear Interrupt Enable Register & Interrupt Pending Register */
for (uint8_t i = 0; i < sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0]); i ++)
{
NVIC->ICER[i] = 0xFFFFFFFF;
NVIC->ICPR[i] = 0xFFFFFFFF;
}
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (APPL_START_ADDR + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPL_START_ADDR);
/* Jump to application */
Jump_To_Application();
}
I call this at front of main() of freertos appl.
SCB->VTOR = APPL_START_ADDR;
Help me anyone.
BR
Paul
2024-10-20 06:09 PM
Hi,
My freertos is stuck at osKernelStart
----
osStatus_t osKernelStart (void) {
osStatus_t stat;
if (IS_IRQ()) {
stat = osErrorISR;
DBG ("osErrorISR\n");
}
else {
if (KernelState == osKernelReady) {
KernelState = osKernelRunning;
vTaskStartScheduler();
stat = osOK;
} else {
stat = osError;
}
}
return (stat);
}
IS_IRQ() is true, so cannot start scheduler.
Let me know how can I fix it.
BR
Paul
2024-10-20 06:43 PM - edited 2024-10-20 07:19 PM
Hi,
I solved this problem by
call __enable_irq after SystemClock_Config();
But, at line 123 DBG function(formatted uart out function) should be needed.
DBG function use pvPortMalloc inside. passing "" null.
If ommit this call, not not work.
Anyone know how?
RB
Paul