Skip to content
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

[WIP] cpu/cc26x2_cc13x2: add sub-1-ghz netdev driver #13295

Closed
wants to merge 13 commits into from

Conversation

jeandudey
Copy link
Contributor

@jeandudey jeandudey commented Feb 5, 2020

Contribution description

Note: this code is untested and I highly don't recommend running the code yet.


Status

What works:

  • Sending a packet.
  • Receiving a packet.
  • Auto initialization.
  • Data whitening (not sure, not verified).

What doesn't work (not done):

  • CRC calculation of packets: I've disabled it as it gave me some errors, needs to configured correctly, (in the sending/receive functions).
  • CCA, can be trivially implemented but the driver codebase is quite a lot complex and I first want to get initial thoughts on this before continuing to work.

What isn't supported by hardware:

  • Auto ACK
  • Address-based filtering (can be done, but removes compatibility with IEEE 802.15.4g standard).
  • FEC (needs a CPE patch, I couldn't find where).
  • Mode Switching (same as FEC).

Standard compliance

This driver implements the MR-FSK PHY of the IEEE 802.15.4g standard, on the 915 MHz band using Filtered 2-FSK (2-GFSK). It still needs to be verified with another device to check that it works.

About channel pages I haven't been able to find what page is that PHY on that Band, I'm not sure about it. I defaulted to page 0.


Some of the code is based on the @kaspar030 code for the cc26x0, and on the OpenThread implementation for the CC1352 (IMHO a lot of the OpenThread code has been rewritten, but I kept the Copyright notice).

Testing procedure

Don't do that, but if you want to get your hands on the code here it is:

BOARD=cc1312-launchpad make

On a GNRC example.

Issues/PRs references

#13205
#13215

Useful links

cc @amovitz , @benpicco , @kaspar030

@benpicco benpicco added Area: drivers Area: Device drivers Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Feb 5, 2020
@benpicco
Copy link
Contributor

benpicco commented Feb 5, 2020

Would it make sense to include the driverlib as a pkg? This was done for Microchips cryptoauthlib (#13014), which is a similarly heavy library.

@jeandudey
Copy link
Contributor Author

Would it make sense to include the driverlib as a pkg? This was done for Microchips cryptoauthlib (#13014), which is a similarly heavy library.

I'll take a look at it, I don't want to pollute the RIOT repo with all that code

@benpicco
Copy link
Contributor

benpicco commented Feb 5, 2020

It's has a prop in the name because it uses the propietary mode of the RF Core (the only available on the CC1312, and the Sub-GHz option for CC1352)

I'm a bit confused because the product page lists IEEE 802.15.4g support as a feature, so I'd assume it could talk to other IEEE 802.15.4g radios like the at86rf215.

@jeandudey
Copy link
Contributor Author

It's has a prop in the name because it uses the propietary mode of the RF Core (the only available on the CC1312, and the Sub-GHz option for CC1352)

I'm a bit confused because the product page lists IEEE 802.15.4g support as a feature, so I'd assume it could talk to other IEEE 802.15.4g radios like the at86rf215.

They call it proprietary mode for unknown reasons (doesn't comply with IEEE standards, but in some way it's compatible, i don't know if compatible with other radios, but in the documentation the radio parameters can be changed to be compatible with CC110x), The IEEE mode support I've seen from the CC1352 and CC26x2 are for the 2.4 GHz band, however the CC1312 is Sub-GHz only.

In conclusion after digging up a little bit:

  • Sub-GHz -> Propietary mode
  • 2.4 GHz -> IEEE mode

@benpicco benpicco added the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Feb 5, 2020
@jeandudey jeandudey force-pushed the 2020_02_04-cc13xx-driver branch 2 times, most recently from 3983ee1 to a279588 Compare February 5, 2020 18:23
@jeandudey
Copy link
Contributor Author

I've added the cc26xx_cc13xx_driverlib package and rebased the changes.

@benpicco
Copy link
Contributor

benpicco commented Feb 5, 2020

I'd put the board config in a separate commit.
Also no need to first add the files to cpu/cc26xx_cc13xx only to move them to cpu/cc26x2_cc13x2 in the next commit 😉

Haven't looked at the code yet, so I'm just nitpicking commits 😉

@jeandudey jeandudey force-pushed the 2020_02_04-cc13xx-driver branch from a279588 to 990199a Compare February 5, 2020 18:47
@jeandudey
Copy link
Contributor Author

Re-rebased. I'm investigating if it can be compatible with other modules. TI docs are confusing on that matter.

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2020
@jeandudey jeandudey force-pushed the 2020_02_04-cc13xx-driver branch 6 times, most recently from 6872e82 to 9bb9a89 Compare February 13, 2020 16:48
@jeandudey
Copy link
Contributor Author

So far I have been investigating and it seems that the CC13x2 devices are compatible with the MR-FSK PHY of the IEEE 802.15.4g standard, although it isn't quite easy and doesn't support all of the IEEE 802.15.4g features (Mode Switching, FEC, etc.), and it requires some patches on the RF Core (I haven't found what patches exactly, documentation is scarce). So far I have been working to get this done, I'm doing some refactorings to clean-up the code and testing here and there.

Signed-off-by: Jean Pierre Dudey <me@jeandudey.tech>
@jeandudey jeandudey force-pushed the 2020_02_04-cc13xx-driver branch from 897f9c9 to 74121c3 Compare April 5, 2021 09:33
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Mar 2, 2022
@stale stale bot closed this Apr 17, 2022
@benpicco
Copy link
Contributor

Uh what was the last state of this one?
I have two boards and can do some tests.

@benpicco benpicco reopened this Apr 17, 2022
@stale stale bot removed State: stale State: The issue / PR has no activity for >185 days labels Apr 17, 2022
@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: sys Area: System Area: tests Area: tests and testing framework Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Apr 17, 2022
@jeandudey
Copy link
Contributor Author

It's quite outdated a bit due to the recent HAL changes, have to wait for some boards to come in to continue development

@kYc0o
Copy link
Contributor

kYc0o commented Sep 8, 2022

I'm very interested on this driver so I took the liberty of rebasing it into current master. @jeandudey should I push it into this branch? I'm doing some tests with various hardware I have at hand, so I'll be giving some feedback during this week.

@jeandudey
Copy link
Contributor Author

Yeah for sure, I just bought some hardware couple months ago, haven't had the time to keep working on it yet but would like to get this in re built

@kYc0o
Copy link
Contributor

kYc0o commented Sep 16, 2022

So now I succeeded to rebase it and adapt it to current master. HAL adaptations were done and basic examples/tests are running. There's just a little problem with ACK and retransmissions which may be due to a wrong set symbol time, which I'll investigate soon.

@jeandudey should I just force push and restart the review process?

@kYc0o
Copy link
Contributor

kYc0o commented Sep 16, 2022

Oh and thanks a lot @jia200x for the help on the HAL adaptation!

@benpicco
Copy link
Contributor

Might be easier if you just make a new PR of your own.

@kYc0o
Copy link
Contributor

kYc0o commented Oct 13, 2022

I've opened a new PR with the updated code at #18737 @benpicco @jeandudey @jia200x

@jeandudey
Copy link
Contributor Author

Thanks! Will close this one in favor of yours

@jeandudey jeandudey closed this Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants