-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: Add support for KW41Z builtin transceiver #7107
Conversation
Is there someone with the hardware that can review and test this ? @kYc0o ? |
Rebased |
rebased |
48e30e7
to
006ed56
Compare
I have observed random hard faults with this driver, I think the stack usage is to blame. I will investigate further |
517112c
to
91e106e
Compare
4fb285c
to
1944a58
Compare
Rebased on latest master @jia200x |
basic testing on phynode-kw41z is going ok so far. I tried basic commands (channels, etc) and works as expected. I will do more stress testing :) |
the radio has ben running for 18 days and haven't seen any crash. The issue described before might not be present anymore |
I have seen a hard to trace problem where the netif thread hangs in the wait_idle function, waiting for an IRQ which never comes. It seems to be related to state switching because I sometimes see IRQ triggers right when switching sequences. It is difficult to debug and I have not yet found the cause. |
Hi, there is a bug in this implementation, the order of the bytes to set the short address in kw41zrf_set_addr_short(...) in kw41zrf_getset.c should be something like this:
Nice work btw ! @gebart |
@@ -615,12 +615,13 @@ int kw41zrf_netdev_get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
break;
case NETOPT_ADDRESS:
- if (len != sizeof(uint16_t)) {
+ if (len < sizeof(uint16_t)) {
res = -EOVERFLOW;
break;
}
*((uint16_t *)value) = kw41zrf_get_addr_short(dev);
- res = len;
+ res = sizeof(uint16_t);
break;
case NETOPT_ADDRESS_LONG: ifconfig uses the same |
I've seen these indefinite IRQ waits too. I noticed at least that they aren't all happening from any one specific transceiver state. At one point I was unintentionally getting close to having a repeatable test to reproduce it, but in normal use I only see it very rarely. I will look for a solution next time it starts happening more. However, I don't think it's bad enough to block the PR. I am finding this reliable enough that I've stopped using a watchdog timer in desperation to find more crashes. The discussion here is getting almost too long to read thoroughly, so I have to apologize for asking: is anything blocking this PR from proceeding now that it was decoupled from #7897? |
@benemorius from what I know through other channels @gebart is no longer active on this PR. |
Yes if that's the case I'm very glad to do that. I'll open a new PR. Should I duplicate it as-is first or is this a good time to squash it? Thanks very much @gebart for all your hard work. |
@benemorius yes #7897 is in the same state so feel free to take over that PR too to shepherd it towards merging. I'd say:go ahead, squash and open 2 new PRs! |
Sorry for the delay. I haven't dropped this. I did fix the IRQ wait bug and a few others and I've been testing it for a while and I'll clean up the result and open a new PR "very soon". In the mean time there is a usable version of this (currently with less bugfixes) in benemorius/RIOT/openlabs |
This is the radio found in NXP Kinetis KW41Z, KW21Z. Only 802.15.4 mode
is implemented (KW41Z also supports BLE on the same transceiver).
The driver uses vendor supplied initialization code for the low level
XCVR hardware, these files were imported from
Kinetis Connectivitymcuxpresso.nxp.com (KSDK 2.2.0, framework_5.3.5)Software version 1.0.2 (framework_5.3.2)
The reason for using the vendor code is that setting up the XCVR module requires a lot of precalculated values which I don't have time to recreate. The vendor code works and was imported with minimal modifications to support easy updates if a new version comes out.
Tested with two FRDM-KW41Z boards running gnrc_networking example
Depends on:
#6994#6995#6916#6978#7362#7897