Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAC is not described in soc of STM32L4xx series #25123

Closed
wzedmund opened this issue May 8, 2020 · 1 comment
Closed

DAC is not described in soc of STM32L4xx series #25123

wzedmund opened this issue May 8, 2020 · 1 comment
Assignees
Labels
platform: STM32 ST Micro STM32

Comments

@wzedmund
Copy link

wzedmund commented May 8, 2020

Hi,
When I try to get dac work on stm32l4xx, I found buiding error like this:

/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:33:18: error: 'LL_DAC_CHANNEL_1' undeclared here (not in a function); did you mean 'LL_ADC_CHANNEL_1'?
33 | #define CHAN(n) LL_DAC_CHANNEL_##n
| ^~~~~~~~~~~~~~~
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:35:2: note: in expansion of macro 'CHAN'
35 | CHAN(1),
| ^~~~
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c: In function 'dac_stm32_write_value':
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:66:3: warning: implicit declaration of function 'LL_DAC_ConvertData8RightAligned' [-Wimplicit-function-declaration]
66 | LL_DAC_ConvertData8RightAligned(cfg->base,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:69:3: warning: implicit declaration of function 'LL_DAC_ConvertData12RightAligned' [-Wimplicit-function-declaration]
69 | LL_DAC_ConvertData12RightAligned(cfg->base,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c: In function 'dac_stm32_channel_setup':
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:98:2: warning: implicit declaration of function 'LL_DAC_SetOutputBuffer' [-Wimplicit-function-declaration]
98 | LL_DAC_SetOutputBuffer(cfg->base,
| ^~~~~~~~~~~~~~~~~~~~~~
/home/zhe/scriptiot/evm_publish_final/components/zephyr-rtos/zephyr/drivers/dac/dac_stm32.c:100:3: error: 'LL_DAC_OUTPUT_BUFFER_ENABLE' undeclared (first use in this function); did you mean 'DAC_OUTPUTBUFFER_ENABLE'?
100 | LL_DAC_OUTPUT_BUFFER_ENABLE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| DAC_OUTPUTBUFFER_ENABLE

It seems that some header files of stm32l4xx are not included. I tried to add some codes in soc.h file that it works for my project building. Here is the code:

#ifdef CONFIG_DAC_STM32
#include <stm32l4xx_ll_dac.h>
#endif

Hopefully it may help.

@erwango
Copy link
Member

erwango commented May 11, 2020

@wzedmund it is true that DAC support is not yet enabled on STM32L4 series.
For now DAC is only available on STM32L0 series, but if your willing to help, you can push a PR to add its support. To do this, on top of files headers inclusion, we would need to add dts node description and enable a support on a board, so it can be build and potentially tested.
#25112 is an example of a similar work on STM32L4

@erwango erwango closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32
Projects
None yet
Development

No branches or pull requests

2 participants