cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446VET7 LoRa E220-400T30S UART Communication

testbenchmark
Associate III

Hello,

I am trying write a LoRa library to STM32F446VET7 in my application.

In the LoRa E220-400T30S documentation, it tells me to set the UART settings for configuration mode to 9600 and 8N1 and to give 1 to M0 - M1 pins.

testbenchmark_0-1722677845691.png

After doing that I am trying an exampe in below of the document

testbenchmark_1-1722678016431.png

I am sending "C10004" and I have an interrupt for receive function for RX. But I got nothing in buffer...

testbenchmark_2-1722678063835.png

testbenchmark_3-1722678118028.png

testbenchmark_4-1722678157021.png

I'm using UART for the first time, so I can't even guess what I'm doing wrong. I would be very grateful if you can help me.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Send a three bytes not as an ASCII string

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

5 REPLIES 5
warningyukihyo
Associate III

Is the UART RX interrupt actually triggered? You will be able to check with debugger breakpoint or onboard LED.

If interrupt is not triggered, check the NVIC configuration, likes HAL_NVIC_EnableIRQ().

 

Make sure interrupt handler can call the HAL driver's callback. HAL_UART_RxCpltCallback function is executed by the UART interrupt handler:

 

void USART1_IRQHandler(void)
{
    HAL_UART_IRQHandler(&huart);
}

 

(examples are about USART1. You need to find an interrupt handler suitable for your hardware.)

 

If the connection between hardware cannot be guaranteed, the loopback test will be helpful for diagnosis. Tie the TX pin and the RX pin and send any data. check the RX interrupt occurs and the RX data is the same as the TX data.

Send a three bytes not as an ASCII string

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

I did it after posting this nothing changed still not working :(

Send

testbenchmark_0-1722683636923.png

Receive

testbenchmark_1-1722683664616.png

 

 

Hi again,

testbenchmark_0-1722684674559.png

adding a delay after M0 and M1 set to 1 is worked for me...

testbenchmark_1-1722684696114.png

Thanks for answering. Now I got a question again 

 

This is the format of set and read a register.

testbenchmark_2-1722684849005.png

 

in set register E.g.2 : 

C0 is the write command

00 is the start address

04 is the length 

that means it gonna read 4 byte data  started from 0x00.

0x00 = 12

0x01 = 34 

0x02 = 00

0x03 = 61

but in the register map 0x02 should be

0110 0000  =  60 or

0110 0001 = 61 or

0110 0010 = 62.

instead of 0x02 = 61, there is a 0x03 = 61?

testbenchmark_4-1722685282508.png

 

I read the register. There is nothing wrong. 

Document document incorrect.