6 years, 6 months ago.

Nucleo-L073RZ+SX1272:Porting ping pong example project (I-Cube-LRWAN) to FreeRTOS OpenStm32 projec

Hallo together, I have a problem to build a project that combines FreeRTOS with the Ping Pong example-project from the I-CUBE-LRWAN expansion pack. The goal of my current work is a thread-based ping-pong project running on two nodes and exchanging messages. Therefore, I have created a new SW4STM32-toolchain project in CubeMx for the Nucleo-L073RZ board that includes FreeRTOS. After that, I have opened the project in the OpenStm32-IDE and have added the LoRa-middleware and the SX1272MB2DAS drivers from the I-CUBE-LRWAN expansion pack to the project. At this state, the project could not be compiled and there were a lot of errors. After adding the required files from the ping pong project and adjusting the includes and compiler settings, the project could be compiled. At this state, threading works well (the scheduler could switch between two test threads). Then I have created a LoRa-ping-pong thread with the ping pong code of the I-CUBE-LRWAN expansion pack. The project is still able to be compiled, but there is a problem with unexpected interrupts, because the control flow ends in the infinity loop of the default handler. After debugging, I have found out that the following code snippet, executing before initializing the threads, cause the problems. I hope that someone could help me to get the project running./media/uploads/msonne3s/main.c/media/uploads/msonne3s/main.c

static RadioEvents_t RadioEvents; RadioEvents.TxDone = OnTxDone; RadioEvents.RxDone = OnRxDone; RadioEvents.TxTimeout = OnTxTimeout; RadioEvents.RxTimeout = OnRxTimeout; RadioEvents.RxError = OnRxError; Radio.Init( &RadioEvents ); Radio.SetChannel( RF_FREQUENCY );

  1. if defined( USE_MODEM_LORA ) Radio.SetTxConfig( MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, LORA_CODINGRATE, LORA_PREAMBLE_LENGTH, LORA_FIX_LENGTH_PAYLOAD_ON, true, 0, 0, LORA_IQ_INVERSION_ON, 3000000 ); Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH, LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, 0, true, 0, 0, LORA_IQ_INVERSION_ON, true );
  1. elif defined( USE_MODEM_FSK ) Radio.SetTxConfig( MODEM_FSK, TX_OUTPUT_POWER, FSK_FDEV, 0, FSK_DATARATE, 0, FSK_PREAMBLE_LENGTH, FSK_FIX_LENGTH_PAYLOAD_ON, true, 0, 0, 0, 3000000 ); Radio.SetRxConfig( MODEM_FSK, FSK_BANDWIDTH, FSK_DATARATE, 0, FSK_AFC_BANDWIDTH, FSK_PREAMBLE_LENGTH, 0, FSK_FIX_LENGTH_PAYLOAD_ON, 0, true, 0, 0,false, true );
  1. else
  2. error "Please define a frequency band in the compiler options."
  3. endif

Radio.Rx( RX_TIMEOUT_VALUE );

Be the first to answer this question.