2018-04-26 01:57 AM
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_slaveSolved! Go to Solution.
2018-04-26 08:36 AM
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)2018-04-26 08:36 AM
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)2018-04-27 02:41 AM
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