Re: How to use STM32 HAL drives


Massimiliano Cialdi
 

and what about peripherals that zephyr doesn't manage, like FSMC?

I am writing a demo graphic application running on STM32F412G-Discovery. For this purpose I use the pre-compiled STemWin532_CM4_OS_GCC. a library, and I am trying to integrate some sources from the ST demo application.
I'm not sure that the STemWin532_CM4_OS_GCC. a library doesn't make calls to the functions of the HAL library, but certainly ST application sources make these calls.

best regards
Max

On 14/09/2017 15:53, Erwan Gouriou wrote:
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@... <mailto: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@...
<mailto:Zephyr-devel@...>
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
<https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel>

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