Hi,
I'm trying to use WiflyInterface together with RTOS, and I've run in to some problems.
It works fine as long as it is the only thread running (along with the main thread, which does nothing but wait for mail from other threads, so when they are not activated it essentially does nothing).
Once I start another thread, the WiflyInterface thread will almost immediately deadlock.
I searched around a bit, and found this:
https://mbed.org/users/leihen/notebook/using-wifly-interface-with-rtos-to-implement-a-htt/
It suggests replacing the tx interrupt with this, instead of using getc:
while (wifi.readable()) {
char c = LPC_UART3->RBR;
buf_wifly.queue(c);
}
This does not seem to help, and when I look inside the WiflyInterface classes, I see that it is using RawSerial, which I thought was supposed to be a thread safe version of Serial, thus making it ok to call getc in an interrupt handler.
For reference, the two other threads on the system are as follows:
- Communicating with serial bluetooth tranceiver on serial port (p27,p28) by polling, no interrupts
- Communicating with an SPI device
It doesn't seem to matter what the other threads do or if I enable only one or two of them. The two threads work together just fine when I do not enable the network thread.
Hi,
I'm trying to use WiflyInterface together with RTOS, and I've run in to some problems.
It works fine as long as it is the only thread running (along with the main thread, which does nothing but wait for mail from other threads, so when they are not activated it essentially does nothing).
Once I start another thread, the WiflyInterface thread will almost immediately deadlock.
I searched around a bit, and found this: https://mbed.org/users/leihen/notebook/using-wifly-interface-with-rtos-to-implement-a-htt/
It suggests replacing the tx interrupt with this, instead of using getc:
while (wifi.readable()) { char c = LPC_UART3->RBR; buf_wifly.queue(c); }
This does not seem to help, and when I look inside the WiflyInterface classes, I see that it is using RawSerial, which I thought was supposed to be a thread safe version of Serial, thus making it ok to call getc in an interrupt handler.
For reference, the two other threads on the system are as follows:
It doesn't seem to matter what the other threads do or if I enable only one or two of them. The two threads work together just fine when I do not enable the network thread.