cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 UART on b-l072z-lrwan1

MMath.10
Associate II

Hi,

I use the b-l072z-lrwan1 to make lora advertisment and it's work.

I use the project AT_slave or END_Node.

But i want to use the second uart USART1 and nothing work in the environment.

If i just change the file B-L072Z-LRWAN1\Applications\LoRa\End_Node\Core\inc\mlm32l0xx_hw_conf

The program launch but nothing appear on the UART.

I make a project with 2 UART with STM32CubeMX and both work great (it's not a hardware problem)

Someone could help me?

18 REPLIES 18

Ok, will let them manage this then.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you I remember this table but I did not make the link.

Read in RM0377 rev8. p246.

I will re-read this part again to find a solution to my problem...

EDIT : a good tutorial for this problem :

https://visualgdb.com/tutorials/arm/stm32/uart/hal/

If you could continue help me that could be great.

 Because the reactivity is really better here.

EDIT :

I have USART2 working and USART1 sending only the first message. (DMA locked somewhere?)

i just comment these ligns that i'va put when i init my USART 2 :

 /* NVIC for USART, to catch the TX complete */

 //HAL_NVIC_SetPriority(USART2_IRQn, 1, 1);

 //HAL_NVIC_EnableIRQ(USART2_IRQn);

MMath.10
Associate II

@Community member​ 

Do you have an idea where a can found a project with lora installed and 2 USART 115200?

When i change the baudrate in AT_slave project, the RX part stop working...

My application with the Murata module uses multiple USART, I have no specific need to port the AT_Slave application. Getting a working port built and tested would take some time/effort. You might need to refactor the code to deal with high baud rates, and timeouts associated with the LoRa stack.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I already tried to start from a fresh project.

The USART work well but incorporate the lora stack is not so easy....

My prototype will be ready next week, so i have to go forward and i use the program AT_slave with 9600baud...

I have no specific need of the AT_slave application too. But i need a project with a functionnal UART in full duplex mode and lora stack...

@Community member​ 

Lora work here. Start to a fresh program that's look good.

I have my 2 UART in TX RX mode.

But the lora.c of the example is really different from the lora.c from the lora stack and i have some trouble.

The problem is when i send an downlink frame, it take 8 uplink to be send.

In the example every uplink allow a downlink.

MMath.10
Associate II

Hi @Community member​ ,

I'm not really happy with my CubeMX project because Lora does not work very well ...

So get back with EndNode project.

Lora is OK

I have TX and RX on UART2 at 115200 !!

But when i tried to initialize USART1

// if(HAL_UART_Init(&huart1) != HAL_OK)

// {

//  /* Initialization Error */

//  Error_Handler();

// }

My USART_2 gState still locked in HAL_UART_STATE_BUSY_TX mode.

I don't understand where the default is.

I only change this comment lign and USART2 stop working.

The DMA not release the gState in READY mode...

Do you have an idea?

the solution is found :

HAL_UART_MspInit and HAL_UART_MspDeInit shall be separated depending on wich huart called.

void HAL_UART_MspInit(UART_HandleTypeDef *huart)

{

 static DMA_HandleTypeDef hdma_tx;

 if(huart->Instance==USART1)

 {

 __USART1_CLK_ENABLE();

 __GPIOA_CLK_ENABLE();

 vcomh1_IoInit();

 //HAL_NVIC_SetPriority(USART1_IRQn, USARTx_DMA_Priority, 1);

 //HAL_NVIC_EnableIRQ(USART1_IRQn);

 }

 else

 {

void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)

{

 if(huart->Instance==USART1)

 {

  vcomh1_IoDeInit( );

  __USART1_FORCE_RESET();

  __USART1_RELEASE_RESET();

 }

Regards