STM32F051 HAL DAC build problems Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
ealex
Posts: 2
Joined: Tue Sep 06, 2016 1:46 pm

STM32F051 HAL DAC build problems

Post by ealex »

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
Attachments
firmware.rar
(7.42 KiB) Downloaded 395 times
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32F051 HAL DAC build problems

Post by Giovanni »

Hi,

Moving in the bug reports section for further analysis.

Giovanni
ealex
Posts: 2
Joined: Tue Sep 06, 2016 1:46 pm

Re: STM32F051 HAL DAC build problems

Post by ealex »

for reference:

git log:
commit 7e20b9958aa68f3c52d3a45ebe92f252a0447e51
Author: Giovanni Di Sirio <[email protected]>
Date: Sun Aug 28 09:59:35 2016 +0000

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9753 35acf78f-673a-0410-8e92-d51de3d6d3f4

and

#define CH_KERNEL_VERSION "4.0.0"
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: STM32F051 HAL DAC build problems

Post by RoccoMarco »

Hi,
fixed in repository ad Bug 776.
Post Reply