In order to become familiar with RIOT-OS and because I need anyway some long range communication of data collected from a UART, I am trying to merge tests/driver_sx127x, tests/periph_uart and tests/periph_timer_periodic with the following objective:
- collect from UART an array of bytes to be transmitted (typically about 400)
- once the transmission has stopped (as detected with the timer) send the array with the Lora interface
- repeat UART data collection (these are GPS sentences so the communication repeats for a short burst of data every second). A rough calculation says the SX1272 with 500 kHz bandwidth and a spreading factor of 7 should provide the necessary bandwidth.
Each test application works fine by itself, but every combination fails:
- sx127x with uart: activating the UART reception with a separate thread as
void *_rs_thread(void *arg)
{
(void)arg;
while (1)
{stdio_read ((char*)&c[compteurin], 1);
compteurin++;
if (compteurin==BUFSIZE) {compteurin=0;printf("*");}
}
}
leads to
gnrc_netdev: possibly lost interrupt.
and even attempting to reset the SX1272 will not allow for sending another byte. This sentence has been properly transmitted though and was received by another Lora transceiver so it is really when the driver returns from transmitting that the ISR state is corrupted. Since UART reception and Lora transmission never occur at the same time I wanted to put the UART reception thread to sleep or take it out of the scheduler queue but I cannot figure out how to do that from the main loop.
- sx127x with timer just hangs when attempting to send a packet through the Lora interface … I see quite a few timers initialized in drivers/sx127x so possibly some conflict with my
timer_init(TIMER_CYCL, timer_hz, timercb, NULL);
timer_set_periodic(TIMER_CYCL, 1, steps, TIM_FLAG_RESET_ON_MATCH);
but here too I am unsure how to proceed.
Any help welcome, thanks, Jean-Michel