Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


freeRTOS project don't compile

Hi I just create a new project using HAL and freeRTOS

https://www.dropbox.com/s/rdytll6k8bkg9x9/Captura%20de%20pantalla%202015-05-24%2020.36.43.png?dl=0Question

but I can´t compile the project, in fact nucleo-f411re-hal-lib don’t compile anymore. This action adds freeRTOS folder and source to the lib and it don’t compile. I know that I have to add a freeRTOS_Config.h to my project, so I do it, but I don’t know how to tell hal-lib where do they have to look for config.h file....

France

Hi,

Currently you should add the FreeRTOS_Config.h file in the nucleo-f411_hal_lib project, not in th eapplication project, as it is needed by th eFreeRTOS surce code to compile.

In the next version, due end of this week, this will be streamlined and selecting FreeRTOS in the firmware configuration will automatically add a default FreeRTOS_Config.h file at the proper place.

Support for other components and third party libraries will be included in following releases so you should regularly do an update of your installation by Help >> Check for update so that you get the latest evolutions.

Bernard

Ok, I just do it. I make a new CubeMX freeRTOS project, it has a good freeRTOS_Config.h (it has been done on another workspace), so I copy freeRTOS_Config.h and paste on \nucleo-f411re_hal_lib\Middlewares\Third_Party\FreeRTOS\Source\include.
Then I made changes sugested here:
http://www.forosdeelectronica.com/f24/tutorial-freertos-103057/Question
to the nucleo-f411re_hal_lib project.
Clean the project and try to build once again. I obtain this:

18:20:24 **** Build of configuration Debug for project nucleo-f411re_hal_lib ****
make all
‘Building file: ../Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.c’
‘Invoking: MCU GCC Compiler’
D:\UDB_Nucleo\STMSW-WS\nucleo-f411re_hal_lib\Debug
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSTM32F4 -DSTM32 -DNUCLEO_F411RE -DSTM32F411RETx -DUSE_HAL_DRIVER -DSTM32F411xE -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/core” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/device” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc/Legacy” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Utilities/STM32F4xx-Nucleo” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/core” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/device” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc/Legacy” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Utilities/STM32F4xx-Nucleo” -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.d” -MT”Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.d” -o “Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.o” “../Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.c”
‘Finished building: ../Utilities/STM32F4xx-Nucleo/stm32f4xx_nucleo.c’
’ ’
‘Building file: ../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c’
‘Invoking: MCU GCC Compiler’
D:\UDB_Nucleo\STMSW-WS\nucleo-f411re_hal_lib\Debug
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSTM32F4 -DSTM32 -DNUCLEO_F411RE -DSTM32F411RETx -DUSE_HAL_DRIVER -DSTM32F411xE -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/core” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/device” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc/Legacy” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Utilities/STM32F4xx-Nucleo” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/core” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/CMSIS/device” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc/Legacy” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/HAL_Driver/Inc” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/IAR/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM0” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F” -I”D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Utilities/STM32F4xx-Nucleo” -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.d” -MT”Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.d” -o “Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.o” “../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c”
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c: In function ‘vPortYield’:
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:231:4: error: ‘portNVIC_INT_CTRL’ undeclared (first use in this function)
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;

../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:231:4: note: each undeclared identifier is reported only once for each function it appears in
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:231:25: error: ‘portNVIC_PENDSVSET’ undeclared (first use in this function)
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;

../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:235:2: warning: implicit declaration of function ‘__DSB’ -Wimplicit-function-declaration
__DSB();

../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:236:2: warning: implicit declaration of function ‘__ISB’ -Wimplicit-function-declaration
__ISB();

In file included from D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h:94:0,
from ../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:71:
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c: In function ‘vPortEnterCritical’:
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:254:23: error: ‘portNVIC_INT_CTRL’ undeclared (first use in this function)
configASSERT( ( ( *(portNVIC_INT_CTRL) ) & portVECTACTIVE_MASK ) == 0 );

D:/UDB_Nucleo/STMSW-WS/nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOSConfig.h:153:32: note: in definition of macro ‘configASSERT’
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}

../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c: In function ‘SysTick_Handler’:
../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:279:6: error: ‘portNVIC_INT_CTRL’ undeclared (first use in this function)
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;

../Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c:279:27: error: ‘portNVIC_PENDSVSET’ undeclared (first use in this function)
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;

make: *** Middlewares/Third_Party/FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.o Error 1

18:20:38 Build Finished (took 13s.203ms)

so, what am I doing wrong right now?

BTW how do I do to put “code” on the post?


Ok, I know where the error is.
I have to use port.c from GCC/ARM_CM4F, but the compiler use port.c from tasking/ARM_CM4F.
I remove all include path related to other ports. So I have just one port included path, but the project insist to take port from tasking directory....

ideas?


I’m seeing to portable.h and after a lot of “ifdef” (on grey color, becouse there are not defined) I have:

/* Catch all to ensure portmacro.h is included in the build. Newer demos
have the path as part of the project options, rather than as relative from
the project location. If portENTER_CRITICAL() has not been defined then
portmacro.h has not yet been included - as every portmacro.h provides a
portENTER_CRITICAL() definition. Check the demo application for your demo
to find the path to the correct portmacro.h file. */

  1. ifndef portENTER_CRITICAL

#include “portmacro.h”

  1. endif


If I press F3 on portmacro.h it opens portmacro.h from the correct folder Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F, but there is an build error on port.c from tasking\ARM_CM4F...

Oooooh!!!! looking at the freeRTOS generated by CubeMX I see that there is just one portable folder... so I have to delete the other portables folders, right?

yessssss that is!!!! now I can build the project!!!!


when I #include freeRTOS.h and task.h and put a vTaskStartScheduler();

I obtain this new errors:
Description Resource Path Location Type
make: *** freeRTOS_01.elf Error 1 freeRTOS_01 C/C++ Problem
undefined reference to `pvPortMalloc’ tasks.c /nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source line 2922 C/C++ Problem
undefined reference to `pvPortMalloc’ tasks.c /nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source line 2929 C/C++ Problem
undefined reference to `vPortFree’ tasks.c /nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source line 2934 C/C++ Problem
undefined reference to `vPortFree’ tasks.c /nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source line 3102 C/C++ Problem
undefined reference to `vPortFree’ tasks.c /nucleo-f411re_hal_lib/Middlewares/Third_Party/FreeRTOS/Source line 3103 C/C++ Problem

ideas?


Ok, solved! It was a MemMang missing folder.
Why the project gereator don’t add this folder?

Regards!


For ARMCM3 I use the heap_3.c works very well.

 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs