Hi All,
I’m having difficulties converting a working FreeRTOS project from a 6kb RAM 8bit Atmega4809 microcontroller to a 8kb RAM STM32g030* Cortex-M0+
I used the CubeMX tool inside STM32CubeIDE to setup the project.
Inside CubeMX you can configure FreeRTOS settings through CMSIS v1 or v2 interface.
I started with v1 and quickly noticed the 8kb RAM was not enough.
I saved some RAM by switching GPIO / interrupt settings to LL drivers instead of HAL.
I got to a point that I had 3 out of 6 tasks running but had to refactor a lot of code to use the CMSIS functions. But more and more discovered that CMSIS was missing functionality I needed.
I discovered that those were inside CMSIS v2 so tried that one.
But this is definitely not build for M0+ . RAM usage went sky high.
I tried to mix CMSIS v1 with normal FreeRTOS calls for the missing functionality, but I think this doesn’t work good for Queue and Task notifications.
So now new attempt was just implement FreeRTOS native as it was done on the 8 bit controller.
I’m using ARM CORTEX M0 port and tried to copy FreeRTOSConfig.h content from the CMSIS v1 experiment before removing it.
I got warning that I had duplicate functions (xPortSysTickHandler() and PendSV_Handler()) in stm32g0xx_it.h and port.h, I think it was CubeMX leftovers from switching CMSIS on and off. But I made those either __weak or deleted them from stm32g0xx_it.h
The issue is that Task do run sometimes only once or in other situation simply ignoring vTaskDelay()
static void tsk_alarm(void *pvParameters)
{
uint32_t ulNotifiedValue;
//xSemaphoreGive(AlarmMelodyBusySemaphore);
while (1) {
alarm_short();
vTaskDelay(5000);
}
}
For example Task above let my buzzer sound continuously. So it is ignoring vTaskDelay or alarm_short() is stuck
I think by turning of FreeRTOS/CMSIS and try implementing the Native way, somehow my SysTick / Timers are not configured the right way?
In CubeMX TIM1
is greyed out and not selectable.
Once touched the CubeMX options, there is no way back?