NXPS32K358: FreeRTOS Tasks Not Running After Bootloader Jumps to Application

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NXPS32K358: FreeRTOS Tasks Not Running After Bootloader Jumps to Application

63 Views
Indhumathi
Contributor I

We have created a sample application project and are using it as the bootloader. The actual application project is identical, with the only difference being the flash start address.

The bootloader successfully jumps to the application, and the application starts executing. However, within the application, the xTaskCreate() function does not executed.

Is there any additional configuration required when jumping from a bootloader to a FreeRTOS-based application? For example, are there any startup, interrupt, vector table, stack pointer, or scheduler-related configurations that must be performed before the application can create and execute FreeRTOS tasks?

I referred the Unified bootloader Demo ticket from community. I didn't get the solution. Issue is only when we include FreeRTOS, without RTOS the application is working fine.

 Its working for S32K344 not for NXPS32K358.


Please let me know if any additional information is required.

0 Kudos
Reply
3 Replies

5 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Indhumathi,

To narrow down the root cause, could you please verify whether the following interrupt handlers are actually being executed?

SVC handler (vPortSVCHandler) — responsible for starting the first FreeRTOS task

PendSV handler (vPortPendSVHandler) — responsible for context switching between tasks

SysTick handler (vPortSysTickHandler / xPortSysTickHandler) — responsible for the FreeRTOS tick

 

The simplest way to check is to place a breakpoint or a GPIO toggle at the entry of each handler in the application.

 

Thank you,

Regards,

Daniel

0 Kudos
Reply

24 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Indhumathi,

This "xTaskCreate() does not execute" is ambiguous and could mean different things.

Can you check the following?

1. Execution never reaches xTaskCreate()
The application starts, but something hangs or faults before the call.

2. xTaskCreate() is called but returns an error
The function is called and returns an error, for example errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY.

3. Tasks are created, but the scheduler never runs them
xTaskCreate() succeeds (returns pdPASS) and the tasks are created, but vTaskStartScheduler() is never called, fails, or SysTick/PendSV are not operating correctly after the bootloader jump. As a result, the tasks remain in the Ready state and never get CPU time.

Also, is vApplicationMallocFailedHook() called?

Which heap implementation are you using?

What is the state of CM7_2? Is it running, held in reset, or started by the bootloader?

 

Thank you,

BR, Daniel

0 Kudos
Reply

53 Views
Indhumathi
Contributor I

Bootloader-to-Application Jump Code Used in Our Project:

void Boot_JumpToApp(uint32 i_AppAddr)
{
uint32_t appStack;
uint32_t func;
uint8 i;
 
DisableAllInterrupts();
 
S32_SysTick->CSRr = 0;
S32_SysTick->RVR = 0;
S32_SysTick->CVR = 0;
 
    for(i = 0; i < 10; i++)
    {
    S32_NVIC->ICER[i] = 0xFFFFFFFFU;
    S32_NVIC->ICPR[i] = 0xFFFFFFFFU;
    }
    appStack = *(volatile uint32_t *)0x00442000;
__set_MSP(appStack);
S32_SCB->VTOR = 0x00442000;
func = *(uint32_t volatile *)(((uint32_t)0x00442004));
(* (void (*) (void)) func)();
}

 

 

0 Kudos
Reply