cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO -WL55 PingPong example

HHaru.1
Associate

Good day! I have 2 NUCLEO -WL55 boards. I want to use them to interrupt the charging of the device through LoRa communication. I want to use the PingPong example with a physics layer. But when I try to connect the ADC using CubeMX, the project falls apart. I'm trying to build a project from scratch, putting together a project, connect a radio.h library, but OnTxDone, OnRxDone, OnTxTimeout, OnRxTimeout events in the subghz_phy_app.c file are not generated. Please tell me my mistake and how to connect the events

2 REPLIES 2

Find concise ADC use/configuration examples in the HAL trees, and merge those.

If CubeMX can't magic viable code you'll need to DIY.

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

But my question is that when I write a project myself, I include the radio.h library, but the OnTxDone, OnRxDone, OnTxTimeout, OnRxTimeout events in the subghz_phy_app.c file are not generated.

void SubghzApp_Init(void)

{

 /* USER CODE BEGIN SubghzApp_Init_1 */

 /* USER CODE END SubghzApp_Init_1 */

 /* Radio initialization */

UTIL_TIMER_Create(&timerLed, 0xFFFFFFFFU, UTIL_TIMER_ONESHOT, OnledEvent, NULL);

 UTIL_TIMER_SetPeriod(&timerLed, LED_PERIOD_MS);

 UTIL_TIMER_Start(&timerLed);

 RadioEvents.TxDone = OnTxDone;

 RadioEvents.RxDone = OnRxDone;

 RadioEvents.TxTimeout = OnTxTimeout;

 RadioEvents.RxTimeout = OnRxTimeout;

 RadioEvents.RxError = OnRxError;

 Radio.Init(&RadioEvents);

 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, TX_TIMEOUT_VALUE);

  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);

  Radio.SetMaxPayloadLength(MODEM_LORA, BUFFER_SIZE);

  Radio.SetChannel(RF_FREQUENCY);

  uint8_t str=Radio.Read(0x42);

  while (str == 0x00)

    {

   HAL_UART_Transmit(&huart1,"NoRADIO\n", 8,5);;

    }

  HAL_UART_Transmit(&huart1,"INIT RADIO\n", 11,5);

  Radio.Rx(RX_TIMEOUT_VALUE);

  UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_PingPong_Process), UTIL_SEQ_RFU, PingPong_Process);

 /* USER CODE BEGIN SubghzApp_Init_2 */

 /* USER CODE END SubghzApp_Init_2 */

}

 I can't find more information about connecting the radio library and don't know what to do.