Skip to main content
Graduate
August 4, 2024
Question

STM32F4 LoRa E220-400T30S Communication

  • August 4, 2024
  • 2 replies
  • 3102 views

I got 2 STM32F446VET7 MCU board and I am trying to communicate each other with LoRa E220-400T30S.

I cannot found any usefull libraries so I am trying to write one.

I can communicate with modules from UART and setting configuration parameters.

Both E22 module has same configuration(address,channel, baudrate, etc.)

in the documents of datasheet it says : "in fixed mode..."

testbenchmark_0-1722767477601.png

data[0] is 0x00 which is ADDR High

data[1] is 0x01 which is ADDR Low

data[2] is 0x32 which is Channel (410.125MHz + data[2]*1MHz = 460.125MHz)

so I am sending uint8_t data[5] = {0x00, 0x01, 0x32, 0x03, 0x03}; through to the E220 in tranciever board.

I try with 2 functions.

HAL_UART_Transmit(&huart1, data, sizeof(data), HAL_MAX_DELAY);

HAL_UART_Transmit_DMA(&huart1, data, sizeof(data));

on the other side I am trying to read with 3 ways:

HAL_UART_Receive(&huart1, data, sizeof(data), HAL_MAX_DELAY);

HAL_UART_Receive_IT(&huart1, data, sizeof(data));

HAL_UART_Receive_DMA(&huart1, data, sizeof(data));

 

But I cannot read any data. What should I do?

    This topic has been closed for replies.

    2 replies

    ST Employee
    August 4, 2024

    Hi @testbenchmark 

    My shared projects with 2 Nucleo-L432KC boards that communicate in Lora point to point, which you can learn from.
    https://github.com/rreicher/STM32-Lora-EBYTE-E22-900T22D

    My EBYTE modules are E22-900T22D in 868MHz and UART. It is based on a SEMETCH SX1278 module, yours is an LLCC68 module. But the UART protocols are perfectly identical.

    Have a look at the drivers e220_900t22d.h and e220_900t22d.c
    Apart from the operating modes defined by M0 and M1, and the AUX pin, which appears to be identical, you should simply change the addresses relating to register reads/writes. You'll need to refer to the respective User Manuals.

    From personal experience with these modules, I'd say you should also measure the AUX timing precisely. Do this with an oscilloscope and adjust the following constants:
    #define E220_MODE_TIMEOUT_MS 40U // Timeout for E220 Mode switching
    #define E220_TX_TIMEOUT_MS 2U // Timeout for E220 packet send

    Best regard.

    Romain

     

    Graduate
    August 5, 2024

    I wrote myself a library for the E220-400T30S but I could only do the configurations.
    I adapted the library you gave me according to myself, but again I could not go beyond making configurations.
    I cannot send and receive data in any way

    ! I DONT HAVE AUX CONNECTION ON MY BOARD. AUX IS FLOAT"

    Here is my test station. I got 2 boards with STM32F446VET7 and LoRa E220-400T30S & 2 410-480MHz antenna.

    WhatsApp Image 2024-08-05 at 17.17.00_18b7c319.jpg

    I tried fixed and tranmission modes seperatly but nothing changed. Still no data transcieve.

    Here is my Transciever and receiever configuration for fixed mode:

    testbenchmark_1-1722867765351.png

    testbenchmark_6-1722868115363.png

     

    testbenchmark_2-1722867911254.png

     

    and first three byte of data is ADDH(0x00) - ADDL(0x03) - CHANNEL(0x04) of receiever.

    uint8_t E220_tx_Buffer[8] = {0x00, 0x03, 0x04, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};

     

    and the transmit & receive functions that I used in while loop : 

    Transmit :

    testbenchmark_3-1722867972885.png

    Receive :

    testbenchmark_5-1722868034404.png

     

     

     

     

    ST Employee
    August 5, 2024

    Hi @testbenchmark 

    Is it an hardware issue? You must investigate, normally these modules can transmit already out of the box without any configuration.
    - Are your STM32 uart's working? Are they well configured? Can you send ascii characters to a serial terminal?
    - Have you crossed the signals between the STM32 and the modules UART_RX to the E220_Tx and UART_Tx to the E220_Rx?
    - Have you checked and visualized the Rx and Tx signals from one end to the other of your modules (with a logic analyzer or an oscilloscope)?
    - Have you you visualized the AUX pins, do you see the waveform responses that you find in the user manual of the module (even if you do not use AUX)?
    - Are your modules and STM32 correctly (sufficiently) powered, can you check your cards and your schematic?

    Good luck

    Romain

    Graduate
    August 6, 2024

    Hello Romain thanks for answering.

     

    My UART are working. I can configure my device with that.

    Yes I crossed RX-TX signals.

    This is the transciever logic analyzer image:

    RED is module RX pin which microcontroller TX.

    Orange is AUX pin and it always LOW.

    testbenchmark_0-1722957194062.png

    This is the receiver logic analyzer image:

    White is module TX pin which microcontroller RX always high.

    Brown is AUX pin and it always LOW

    testbenchmark_1-1722957402249.png