STM32F051 HAL DAC build problems
Posted: Tue Sep 06, 2016 2:14 pm
Hello
i'm trying to use chibios and the HAL with a STM32F051 chip, with the latest version from GIT.
i'm encountering several build errors in the DAC HAL driver - "os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c":
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c: In function 'dac_lld_stop':
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:291:36: error: 'DAC_CR_EN2' undeclared (first use in this function)
if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:291:36: note: each undeclared identifier is reported only once for each function it appears in
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c: In function 'dac_lld_put_channel':
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:349:24: error: 'DAC_TypeDef' has no member named 'DHR12R2'
dacp->params->dac->DHR12R2 = (uint32_t)sample;
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:364:24: error: 'DAC_TypeDef' has no member named 'DHR12L2'
dacp->params->dac->DHR12L2 = (uint32_t)sample;
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:379:24: error: 'DAC_TypeDef' has no member named 'DHR8R2'
dacp->params->dac->DHR8R2 = (uint32_t)sample;
^
make: *** [build/obj/hal_dac_lld.o] Error 1
these errors are generated because the HAL code has several problems:
line 291: void dac_lld_stop(DACDriver *dacp) DAC_CR_EN2 is used when STM32_DAC_USE_DAC1_CH1 is defined, DAC_CR_EN1 is used for STM32_DAC_USE_DAC1_CH2
line 349 and all other errors: void dac_lld_put_channel: register DHR12R2 is always used, no check is made if the register is present on the platform
i've attached my configuration files as an archive ( why are ".h" / ".c" files not allowed ? )
best regards,
alex
i'm trying to use chibios and the HAL with a STM32F051 chip, with the latest version from GIT.
i'm encountering several build errors in the DAC HAL driver - "os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c":
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c: In function 'dac_lld_stop':
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:291:36: error: 'DAC_CR_EN2' undeclared (first use in this function)
if ((dacp->params->dac->CR & DAC_CR_EN2) == 0U) {
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:291:36: note: each undeclared identifier is reported only once for each function it appears in
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c: In function 'dac_lld_put_channel':
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:349:24: error: 'DAC_TypeDef' has no member named 'DHR12R2'
dacp->params->dac->DHR12R2 = (uint32_t)sample;
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:364:24: error: 'DAC_TypeDef' has no member named 'DHR12L2'
dacp->params->dac->DHR12L2 = (uint32_t)sample;
^
./os/hal/ports/STM32/LLD/DACv1/hal_dac_lld.c:379:24: error: 'DAC_TypeDef' has no member named 'DHR8R2'
dacp->params->dac->DHR8R2 = (uint32_t)sample;
^
make: *** [build/obj/hal_dac_lld.o] Error 1
these errors are generated because the HAL code has several problems:
line 291: void dac_lld_stop(DACDriver *dacp) DAC_CR_EN2 is used when STM32_DAC_USE_DAC1_CH1 is defined, DAC_CR_EN1 is used for STM32_DAC_USE_DAC1_CH2
line 349 and all other errors: void dac_lld_put_channel: register DHR12R2 is always used, no check is made if the register is present on the platform
i've attached my configuration files as an archive ( why are ".h" / ".c" files not allowed ? )
best regards,
alex