Conversation
fea1575 to
5447cb8
Compare
f7ec1ca to
1de1790
Compare
|
@tomas-c, this seems to be working pretty well for me in my limited testing. Would you like to test it out? |
580cc37 to
b9eb44d
Compare
335ac38 to
31a51cd
Compare
|
@jwhui Ahh nice, had been thinking of doing the switch to Rail 2 and the UART driver too. Will test. |
There was a problem hiding this comment.
Thanks for updating to RAIL 2.0 👍 . Please remove duplicated RADIO_CONFIG_XTAL_FREQUENCY and other parameters from openthread-core-efr32-config.h if we put auto-generated header file here.
examples/platforms/efr32/uart.c
Outdated
There was a problem hiding this comment.
Is this line really needed? Other platforms send nothing on otPlatUartEnable.
There was a problem hiding this comment.
This was left over from my own testing. Removed!
examples/platforms/efr32/uart.c
Outdated
There was a problem hiding this comment.
Why not use non blocking UARTDRV_Transmit? As I see OT is not designed to be blocked in process drivers call. I think sending big buffer may introduce RF packet drops etc. I notice some issue with EFR32 in case intensive data exchange and sending logs via uart. It looks like the root cause was delay in processTransmit but I didn't investigate it so much.
There was a problem hiding this comment.
I'll switch this to non-blocking soon.
There was a problem hiding this comment.
Updated to use non-blocking UARTDRV_Transmit.
examples/platforms/efr32/radio.c
Outdated
There was a problem hiding this comment.
Shall OT_RADIO_CAPS_TRANSMIT_RETRIES be added as well?
There was a problem hiding this comment.
Does RAIL implement automatic retransmissions on no ack?
There was a problem hiding this comment.
I didn't find any info about retransmissions. So, most probably doesn't implement.
9c87993 to
782bb8a
Compare
|
Tested CLI app (used the latest update with async UART). All basic tests mentioned in the porting guide pass. Will soon check with wpantund and a bigger network of devices. |
|
This pull request seems to fix issue #2372. Not sure if this was an issue with old RAIL implementation (couldn't test due to #2372) but I have noticed the network is much less stable than with SiLabs Thread v2.3.1.0 stack. Had four devices continuously sending messages to each other. With SiLabs stack I didn't have single missed message over 12 hour period. With OpenThread I had hundreds of missed messages over the same period with the same setup (same CCA threshold, same transmit power, same channel). |
|
@tomas-c, thanks for testing and providing feedback! I found a bug in handling RAIL's received packet FIFO. In particular, packets that were in process of being received could be discarded by the example driver. I have updated the example driver to avoid this. When you get a chance, try out the latest and let me know if you see improvement. |
2faceca to
9ecaacb
Compare
|
@jwhui Good catch! Been running for three hours already and no lost messages so far. |
|
@tomas-c, great to hear! |
examples/platforms/efr32/uart.c
Outdated
There was a problem hiding this comment.
Spinel docs say flow control must be used. I had framing errors at higher baud rates if it's not enabled.
Tested and works if:
- Change
uartdrvFlowControlNonetouartdrvFlowControlHwUart - Change
0,0at the end of this struct toRETARGET_CTS_LOCATION, RETARGET_RTS_LOCATION
There was a problem hiding this comment.
@tomas-c, thanks! I updated this PR with your proposed changes.
examples/platforms/efr32/uart.c
Outdated
There was a problem hiding this comment.
Given UARTDRV_Transmit is asynchronous and aBuf can be reclaimed after otPlatUartSend returns, we should copy aBuf contents, not just its pointer.
There was a problem hiding this comment.
Ah, just saw that layer above makes sure the buffer is not touched until this is done. Disregard.
This update also makes the following changes: - Initialize chip using `halInitChipSpecific()` provided by RAIL HAL. - Use `RAIL_HoldRxPacket()` to move rx processing out of interrupt context - Eliminate critical sections from `otPlatRadio*` APIs. - Use UART driver provided by Gecko SDK.
|
I got the system to run for 36h without any issues, with
It's difficult to tell at this point which of these were necessary (will not have time to investigate for a while) but might be that the latest changes from this PR and default settings are enough to get a stable network with EFR32. |
|
@tomas-c, thanks for the feedback again! Do you think this PR is good for merge? If we find more issues, we can address them in subsequent PRs. |
|
This seems to work better than the current Rail 1.x based version and I can't think of any improvements besides maybe increasing UART RX DMA buffer size to something bigger than 1 byte but it's tricky and should probably come as a separate PR. I'd say let's merge this! |
|
@tomas-c I'm new to openThread, but have built this version for my efr32 dev boards and was wondering how you were testing the stability? You mentioned test sending messages between nodes, was this UDP messages? Do you have a test app that is not included in this repository to do this? I wanted to test sending messages between my dev boards over the thread network, but wasn't sure how to go about this easily. Thanks. |
|
@erbp If you just want to test whether sending messages works - you can probably just follow the platform readme file and use the ping command. You can also follow the CLI app example or a more involved CLI app + NCP example. I myself use a bunch of Linux devices running wpantund with NCPs connected to them. I have an existing setup with SiLabs Thread stack so just switched it out with OpenThread to test. Can't really share it but on Linux with wpantund you can write a simple Python script to send UDP packets or even use CoAP. As for how to send UDP messages directly from the devices without wpantund - someone else might be more equiped to point you in the right direction. |
|
@tomas-c, thanks for your help on this PR! |
This update also makes the following changes:
halInitChipSpecific()provided by RAIL HAL.RAIL_HoldRxPacket()to move rx processing out of interrupt contextotPlatRadio*APIs.Resolves #2372
Resolves #2379
//cc @tomas-c @plasticchris @xiaom-GitHub