cancel
Showing results for 
Search instead for 
Did you mean: 

Zephyr: how DAC on STM32H723ZG ?

Lysandros
Associate II

Dear all,
does anyone have experience with setting analog output signals via Zephyr RTOS? I managed to get the D/A conversion on the Nucleo H723ZG to run via STM32CubeIDE, but I’m running intro trouble when using Zephyr. Apparently a "DAC" driver is required, however the documentation is not very clear.

Thanks 

4 REPLIES 4
AScha.3
Chief

Hi,

>running intro trouble when using Zephyr

Why ? Using RTOS or not - you just write to the DAC , no "driver" needed.

When using Cube/HAL , to setup the chip configuration, just use the HAL functions or write direct to DAC .

If you feel a post has answered your question, please click "Accept as Solution".
Sarra.S
ST Employee

Hello @Lysandros

You can use STM32H743 as a reference as the Nucleo H723ZG is not yet supported in Zephyr.

You'll need to create a new board definition under zephyr/boards/arm/, in which you add the board config (board.dts, board_defconfig, Kconfig.board , andCMakeLists.txt) 

There is already a sample of DAC with STM32H743.overlay here

This is not a simple task, but it is worth it if you're willing to invest some time learning the whole Zephyr architecture

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @Sarra.S ,

thanks for your reply and this hyperlink.

I have a few follow-up questions:

  • I am surprised that "Nucleo H723ZG is not yet supported in Zephyr", because other applications and some samples actually run on this very board with Zephyr. On the other hand, I get: #error "Unsupported board: see README and check /zephyr,user node" when I try to run the dac sample with the H723ZG...
  • the directory zephyr/boards/arm/ contains folders for the V2M, MPS2 and MPS3 boards. However the directory zephyr/boards/st/ actually contains many Nucleo boards including the H743ZI and H723ZG, listing the files you mention (except the CMakeLists.txt). What is the difference between the directories zephyr/boards/arm/ and zephyr/boards/st/ then?
  •  I'm getting the error "No SOURCES given to Zephyr library: drivers__dac". Could it be, that I have to target this driver library somewhere?
  • Can you recommend training courses on Zephyr, in particular for ST boads?

Best regards

Lysandros

Hello Lysandros, 

Sorry for the confusion! the STM32H723 is supported: Zephyr supported boards 

  • zephyr/boards/arm/: This directory contains board configuration files for ARM architecture-based boards such as V2M, MPS2, and MPS3, which are ARM Versatile Express boards.

  • zephyr/boards/st/: This directory is specifically for ST boards. The naming convention here is more vendor-specific, focusing on ST's product lines like the Nucleo series, which includes models such as H743ZI and H723ZG.

"No SOURCES given to Zephyr library: drivers__dac": this could happen if the CMakeLists.txt file for the DAC driver is missing the necessary source files

Regarding trainings, this is all I can think about: 

GitHub - zephyrproject-rtos/hal_stm32

https://docs.zephyrproject.org/latest/ 

https://discord.com/invite/Ck7jw53nU2 

You can check PR issues here: https://github.com/zephyrproject-rtos/zephyr/labels/platform%3A%20STM32 

Use STM32Cube in your application: https://github.com/zephyrproject-rtos/hal_stm32#use-stm32cube-in-your-application

 

Hope that helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.