cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with LL_USART_Setbaudrate and ATOMIC access

JamesHolland
Associate II

I'm porting some code over from an STM32F407 processor to an STM32F072 processor. The code uses the low-level driver to change the baudrate. It all works on the 407 but with the 072 I get the following error:

In file included from ../Core/Src/main.c:24:

../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usart.h: In function 'LL_USART_EnableInStopMode':

../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usart.h:619:3: warning: implicit declaration of function 'ATOMIC_SET_BIT' [-Wimplicit-function-declaration]

619 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_UESM);

There are several similar errors, the compiler does not seem to be able find the header for the ATOMIC macros. How do I include those without changing any of the files in the HAL? The HAL version that I have is STM32Cube_FW_F0_V1.11.5.

 

 

 

3 REPLIES 3
Souhaib MAZHOUD
ST Employee

Hello @JamesHolland 

Could you please attach your IOC in order to investigate the issue?

KR, Souhaib

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.

ile attached, thank you.

I've compared the F4 project with the F0 project:

             In the F4 project the ATOMIC macros are included in stm32f4xx.h

            In the F0 project the ATOMIC macros do not exist in stm32f0xx.h

 

It seems that the HAL code for the UART is calling macros that don't exist.