cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to switch from LPUART to USART1 in AT_Slave ?

Nicolas Hell
Associate II
Posted on April 26, 2018 at 10:57

Hi everybody,

I work on a B-L072Z-LRWAN1 and particularly on the AT_Slave project from I_CUBE_LRWAN. I know that this project uses LPUART via ST-LINK to send AT commands through a terminal to the Murata LoRa module, the pin related are PA2 and PA3 for Tx and Rx.

What I would like to do is to switch from LPUART to USART1 (I need to do that for another project). I tried to change the code in order to replace LL_LPUART by LL_USART then I tested it and tried to send AT on USART1 through a terminal plugged to PA9 and PA10 pins (Tx and Rx for USART1) but it didn't work, the code changed is joined.

So my question is, is there a way to do what I try to do ? To switch from LPUART to USART1 to send AT commands ?

Thank you

#lpuart #stm32l0 #usart #i-cube-lrwan #b-l072z-lrwan1 #at_slave
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on April 26, 2018 at 17:36

I hadn't looked at the LRWAN V1.1.4 VCOM.C, seems more complex and convoluted than the earlier builds.

DMA settings look entirely wrong for USART1 (LPUART1_TX = DMA1_CH7_REQ5, USART1_TX = DMA1_CH2/4_REQ3)

These should be GPIOAEN, but that's not your bug

#define UARTX_RX_GPIO_CLK_ENABLE() LL_IOP_GRP1_EnableClock(RCC_IOPENR_GPIOBEN)

#define UARTX_TX_GPIO_CLK_ENABLE() LL_IOP_GRP1_EnableClock(RCC_IOPENR_GPIOBEN)
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2
Posted on April 26, 2018 at 17:36

I hadn't looked at the LRWAN V1.1.4 VCOM.C, seems more complex and convoluted than the earlier builds.

DMA settings look entirely wrong for USART1 (LPUART1_TX = DMA1_CH7_REQ5, USART1_TX = DMA1_CH2/4_REQ3)

These should be GPIOAEN, but that's not your bug

#define UARTX_RX_GPIO_CLK_ENABLE() LL_IOP_GRP1_EnableClock(RCC_IOPENR_GPIOBEN)

#define UARTX_TX_GPIO_CLK_ENABLE() LL_IOP_GRP1_EnableClock(RCC_IOPENR_GPIOBEN)
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 27, 2018 at 09:41

Hi Clive One,

Thank you for your answer, indeed there was a big issue with DMA configuration, I also figured it out, DMA was initialized with CHANNEL7 and REQ5, I used CHANNEL4 and REQ3.

There was also a problem with GPIO but I solved it in a different way, in AT_Slave, HAL is used for GPIO initialization so I replaced that by LL and it works perfectly now