Skip to main content
Visitor II
September 5, 2019
Question

FreeRTOS does not run on STM32MP1 (M4 core)

  • September 5, 2019
  • 11 replies
  • 7757 views

Board: STM32MP157A-DK1

Situation: I have the release 2.6-openstlinux-4.19-thud-mp1-19-02-20 on the A7 core running. I created a simple FreeRTOS LED app with the latest CubeMX for the M4 core. The FreeRTOS interface ist CMSIS V2. The SYS Timebase Source is TIM7. The DefaultTask toggles LED7.

Problem: In production mode the function osKernelStart returns the osErrorISR state. I figured out that the IPSR holds the value 71 dec.

For test case i included the following code on top of the main.

int main(void)
{
 /* USER CODE BEGIN 1 */
 volatile uint32_t result;
 __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
 __ASM volatile ("nop"::);
 /* USER CODE END 1 */
.
.
.
}

result already has the value 71 when M4 firmware starts. I expect the value 0 because there is no ISR at that time.

If the MP1 is in engineering mode, the scheduler starts normal and result is 0.

Can somebody explain that behavior? Is it possible that the A7 core sets the value in the IPSR?

Thx for your help.

    This topic has been closed for replies.

    11 replies

    ST Employee
    January 20, 2020

    Example to increase the stack size of the tasks :

    +++ b/Firmware/Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_FreeRTOS_echo/Src/main.c

    @@ -166,7 +166,7 @@

      {

       .name = "idle",

       .priority = (osPriority_t) osPriorityNormal,

    -  .stack_size = 128

    +  .stack_size = 512

      };

      idleTaskHandle = osThreadNew(IdleTask, NULL, &idleTask_attributes);

    @@ -174,7 +174,7 @@

      {

       .name = "T0",

       .priority = (osPriority_t) osPriorityHigh,

    -  .stack_size = 128

    +  .stack_size = 512

      };

      t0_TaskHandle = osThreadNew(t0Task, NULL, &t0_attr);

      /* USER CODE END RTOS_THREADS */