You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@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
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.
The text was updated successfully, but these errors were encountered: