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


Problem with finding HAL_StatusTypeDef

I’m trying to add some functionality to the project created by CubeMX.
After toggling LED on my Nucleo board and polling a button (with using examples from the FW examples package) I wanted to use EXTI for the button, but could not get the interrupt. After two day of fighting with no lack decided, that for my project I don’t need it yet and tried to use UART.
For the UART I also used examples from the package. And also decided to start from polling UART.
Uncommented

  1. define HAL_UART_MODULE_ENABLED
  2. define HAL_UART_MODULE_ENABLED


in the file stm32l1xx_hal_conf.h and copied initialization procedure from according example project.
it seems ok, but during compilation the compiler shows me errors in stm32l1xx_hal.h eek
And the errors are
unknown type name ‘HAL_StatusTypeDef’
What?!!!
It shows it for the definitions of the functions:

HAL_StatusTypeDef HAL_Init(void);
HAL_StatusTypeDef HAL_DeInit(void);
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);

HAL_StatusTypeDef defined in stm32l1xx_hal_def.h

Even though this is a bad practice, I tried to include this file into stm32l1xx_hal.h Obviously, it did not help. Seems like I missed something because of my small experience with ARM programming with using HAL. Probably something very simple, but I can’t figure out :-(

Please, help.

stm32l1xx_hal.h includes stm32l1xx_hal_conf.h, where I took out comment from stm32l1xx_hal_usart.h
stm32l1xx_hal_usart.h includes stm32l1xx_hal_def.h, where type HAL_StatusTypeDef defined.

Why ‘HAL_StatusTypeDef’ in stm32l1xx_hal.h is unknown type name? eek


Found a solution. Moved definition of HAL_StatusTypeDef from stm32l1xx_hal_def.h to stm32l1xx_hal_conf.h and my project have compiled.

Basicaly it means that I moved this definition a couple of levels higher in defines.
Are there any limitations in number of definitions levels? rolleyes sad

And somehow it is related to using USART/UART. I got that error only after I added UART initialization. SPI also uses this type, and there was no problem with its initialization.


I had this issue too, and found the correct way to solve it.

Instead of including a specific HAL part (#include “stm32f7xx_hal_gpio.h” in my case), you only have to include the full HAL header (#include “stm32f7xx_hal.h”).

This solved all my errors.


I am trying to generate external flash loader for stm32f446re but while compiling I am getting this error in qspi library provided by ST

/home/shaileshbakshi/Desktop/extldr/extloader/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_qspi.h:127:3: error: unknown type name ‘DMA_HandleTypeDef’
DMA_HandleTypeDef *hdma; /* QSPI Rx/Tx DMA Handle parameters */

please, help me.
Thanks in advance


 

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