-
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
cc2538_rf: implement Radio HAL #14791
Conversation
0b74149
to
7bd8ba3
Compare
I wanted to test
but I would only get
is this expected? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is only the lowest layer.
Well I can confirm that the old netdev part still works with examples/gnrc_networking
.
With the test I was wondering 'why is this implemented in the test?'
Is the plan to move this to the submac layer eventually?
Looking good btw!
RFCORE_SFR_MTM0 |= TIMER_PERIOD_LSB; | ||
RFCORE_SFR_MTM1 |= TIMER_PERIOD_MSB; | ||
|
||
RFCORE_SFR_MTMSEL &= ~CC2538_SFR_MTMSEL_MASK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you already clear that in line 146?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but because I had to set the 3 LSBs of RFCORE_SFR_MTMSEL to 001 (hence 146 and 148). For the next operation, I have to set those bits to 000 (so I have to clear it again).
If I do it the other way around the timer will start with the wrong configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I mark is as resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better add a comment.
If something turned out to need clarification during review, better add the explanation to the code so we don't lose that information. And future readers of the code who might have the same question shouldn't have to dig through old PRs in search of answers ;)
Yes, exactly! Most of the stuff here are handled by the SubMAC :) |
I think I addressed all comments |
I also added the Kconfig symbols for the CSMA-CA params. |
@benpicco done! :) |
Please squash! (& rebase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some regression tests and the old netdev
code path is still working.
So let's move on with this!
1f1fec0
to
107c607
Compare
107c607
to
0fa291d
Compare
rebased and squashed! |
Murdock is not happy |
6b64fd0
to
bb64ceb
Compare
Fixed. I also adapted to the changes from #14938 and removed references to other radios in the Makefile (only the cc2538_rf is supported so far, when the other radios are there we can update the Makefile) |
bb64ceb
to
387deec
Compare
thanks for the review! |
Contribution description
This PR adds an
ieee802154_hal
implementation for the CC2538 radios. It's based on the work of #14655. It also includes the definition of anieee802154_radio_hal
module to be able to switch betweennetdev
andieee802154_hal
implementations (they are mutually exclusive).The test application was adapted from #14655 for testing this radio. When more radios are there, the test application will be expanded.
Testing procedure
Run
tests/ieee802154_hal
test. Ideally this should be tested between 2 CC2538 radios. If that's not possible, it should be enough to use an AT86RF2XX or NRF52840 with #14655.config_phy
command:An out of range value for TX power should give an error
txtsnd
command.It's possible to get the long address with the
print_addr
command.cca
command:config_cca
command:Note the ED is in dBm. The ED threshold doesn't affect the Carrier Sense mode (CCA mode 2).
tx_mode
command:rx_mode
command:Use a sniffer to check if the receiver sends ACK. As expected, a radio with Promiscuous Mode will receive all kind of packets with correct FCS.
caps
command to get the available caps for a given device:test_states
command to test state transitions and measure transition time. The important thing here is the TX-RX turnaround time (it should be equal or less than 12 symbols, 192 us, in order to comply with LIFS frames like the ACK):Note this radio takes ~193 us to switch between RX-TX if the radio is not programmed to automatically go from TX to RX. However, since the symbol time is 16 us, this is not a problem for detecting the IEEE 802.15.4 preamble.
#14787 proves this :)
Issues/PRs references
#13943 and friends