Hi,
Very thanks Kerry.
I have ask the SemTech community the same question.
Unable to use LoRa SX1261 Module SPI
I retrieved the project proposed by STM enterprise. Lora Ping Pong - STM
I tested on the nucleo card provides.
Pay attention to the rider.
I received the code and I imported it into my project (ping-pong). It still did not work.
2.
Try with Nucleo and check the Ping Pong.
Use one Nucleo for the Ping, and one FRDM K66 for the Pong.
3.
Some error code:
The port is not managed by the spi but by an external gpio.
A jumper will not be enough, it will be coded by writing low then high of this output with each spi command.
//NSS = 0;
GPIO_PortClear(
BOARD_INITPINS_LORA_NSS_GPIO, 1u << BOARD_INITPINS_LORA_NSS_PIN);
// blah blah blah
// DSPI_RTOS_Transfer(blah blah blah, blah blah blah);
//NSS = 1;
GPIO_PortSet(
BOARD_INITPINS_LORA_NSS_GPIO, 1u << BOARD_INITPINS_LORA_NSS_PIN);
Via FRDM K66 on the start, there is no timeout (I use FreeRTOS). Force
if( SX126xGetOperatingMode() == MODE_TX )
State = TX_TIMEOUT;
State = RX_TIMEOUT;
After, the Lora has an effective timeout and this code will become useless.
Enable the DIO interrupt and intercept the interrupt.
Code with Irq_Fired must be rewritten.
The imported code ignores the interrupt mode and the normal mode.
Be careful, you have to turn the "blah"_irqProcess function into a task.
For this you will need two semaphores.
g_spi_semaHandle = xSemaphoreCreateBinary();
g_spi_semaHandle2 = xSemaphoreCreateBinary();
xTaskCreate("blah"_irqProcess, "blah", configMINIMAL_STACK_SIZE, NULL, TASK_PRIORITY_VERY_LOW, NULL);
Be careful when importing the code to not include a code error.
After that, and with envy, he ends up walking.
Have a great day,
Daniel