Re: How to use STM32 HAL drives


Erwan Gouriou
 

Hi,

This is the correct understanding, you need to modify Makefile/Kbuild to access HAL drivers.
Then, if you need to use some driver in an application, you'd theoretically use zephyr HW API and drivers (based on HAL or directly accessing HW).
Then,CONFIG flags actually control the compilation but through activation of Zephyr drivers.
For instance for GPIO:
CONFIG_GPIO=y
CONFIG_GPIO_STM32=y
CONFIG_GPIO_STM32_PORTA=y

Of course, you can directly access stm32cube HAL in your application if you want to, but this is not the usual use foreseen by Zephyr architecture.

Erwan

On 14 September 2017 at 15:30, massimiliano cialdi <massimiliano.cialdi@...> wrote:
In an application I need to use STM32 HAL driver, for example GPIO, FSMC and others.

I wonder how can I have the appropriate files compiled. There are some CONFIG_* to set?

I read zephyr/ext/hal/st/stm32cube/README

If I understand well it seems that I have to modify Makefile or Kbuild in zephyr/ext/hal/st/stm32cube/ but it seems very strange and counterintuitive to have to modify a zephyr file for the needs of a specific application. I would have expected to be able to "control" the compilation using appropriate CONFIG_*.


best regards

Max
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

Join devel@lists.zephyrproject.org to automatically receive all group messages.