cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS does not run on STM32MP1 (M4 core)

nrg6
Associate II

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.

11 REPLIES 11

Integration of OpenAMP in FreeRtos is available now in the new example in CubeFW1.1.1 called "OpenAmpFreeRtos_echo" example works fine with the new delivery of CubeIde1.2.0 + update of 1.2.1 for debugging. 

With -O0 option only increase the Task stack size.

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 */