-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[POC] ieee802154_hal: tester PR for #14371 #14655
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
Conversation
7a7eb95
to
13ed540
Compare
@PeterKietzmann @maribu @benpicco if you all agree, I would like to move the CC2538 commits out of #14371 and move them here. That way #14371 only focus on the API. I can keep rebasing this one. |
13ed540
to
5aebfa9
Compare
done! |
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.
First test observation:
nrf52840 -> remote-reva : txtsnd <remote-reva addy> 10
- nrf52840 hangs, remote-reva crashes
- reset both nodes and send a packet the other way around before
- nrf52840 will receive the packet
- now repeat nrf52840->remote-reva
- nrf52840 will indicate that it receive a packet and hang. It is still receive-ready though.
case IEEE802154_RADIO_CONFIRM_CCA: | ||
mutex_unlock(&lock); | ||
break; | ||
case IEEE802154_RADIO_INDICATION_RX_DONE: |
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.
Add IEEE802154_RADIO_INDICATION_RX_START
and IEEE802154_RADIO_CONFIRM_ACK_TIMEOUT
here
tests/ieee802154_hal/main.c
Outdated
ieee802154_radio_write(_dev, pkt); | ||
|
||
/* If the radio supports frame retransmissions (thus, CSMA-CA), send with | ||
* CSMA-CA. Otherwise, send without any kind of collision avoidance */ |
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.
Add a note that this would be the task of a MAC layer (SubMAC) to justify that it is out of scope for the radio HAL
|
||
/* Set PHY configuration */ | ||
ieee802154_phy_conf_t conf = {.channel=21, .page=0, .pow=1000}; | ||
ieee802154_radio_config_phy(_dev, &conf); |
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.
#define
parameters in header of file
tests/ieee802154_hal/main.c
Outdated
ieee802154_radio_set_hw_addr_filter(_dev, (uint8_t*) &short_addr, (uint8_t*) &ext_addr, 0x23); | ||
|
||
/* Set PHY configuration */ | ||
ieee802154_phy_conf_t conf = {.channel=21, .page=0, .pow=1000}; |
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.
1000dBm?
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.
.iol_next = NULL, | ||
}; | ||
|
||
flags = IEEE802154_FCF_TYPE_DATA | 0x20; |
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.
Use IEEE802154_FCF_ACK_REQ
?
tests/ieee802154_hal/main.c
Outdated
return send(addr, res, len); | ||
} | ||
|
||
int config_phy(int argc, char **argv) |
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.
A bit confusing the shell function is names similar to the HAL function
ifneq (,$(filter nrf52840dk,$(BOARD))) | ||
DRIVER := nrf802154 | ||
endif | ||
ifneq (,$(filter cc2538dk,$(BOARD))) |
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.
Would be fine to check for the CC2538 MCU here. However, you were talking about the remote-rev% board somewhere, not cc2538dk.
I think we should specify a test procedure according to which we test all combinations of devices |
ieee802154_dev_t *dev = &nrf802154_hal_dev; | ||
|
||
ack[0] = 5; | ||
ack[1] = 0x02; |
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.
ack[1] = 0x02; | |
ack[1] = IEEE802154_FCF_TYPE_ACK; |
(void)chan; | ||
ieee802154_dev_t *dev = &nrf802154_hal_dev; | ||
|
||
ack[0] = 5; |
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.
Do we have defines for that?
ack[0] = 5; | |
ack[0] = 5; /* frame length */ |
ack[0] = 5; | ||
ack[1] = 0x02; | ||
ack[2] = 0; |
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.
We might just initialize that part once and never touch it, should always stay constant.
ack[0] = 5; | ||
ack[1] = 0x02; | ||
ack[2] = 0; | ||
ack[3] = rxbuf[3]; |
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.
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, this includes frame length. I will add a macro for the magic number
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.
sizeof(ack)
would be enough. There are already maces for the rest.
daf4111
to
7eeeed9
Compare
updated to latest changes of #14371 |
I had to re-implement the I also needed to enable Fast RX-TX transition (this means I had to manually calculate IFS times and reject a transmit request if it doesn't meet the IFS criteria) |
57be8fb
to
3569a98
Compare
d9956b4
to
b1aa378
Compare
So how do we proceed? |
I would say so. The CC2420 is in an ok-ish state (I just need to fix some labels and minor stuff). The nrf52840 is also not so far from being in a mergeable state. The at86rf2xx might need some love. |
70c1fc5
to
cabdb5e
Compare
Rebased. I will leave this PR open as a reference and open implementations for the radios. |
cabdb5e
to
c213fd5
Compare
c213fd5
to
433a05a
Compare
since we already have a couple of radios merged with the new Radio HAL API, I think we can close this one. |
Contribution description
This PR is rebased on top of #14371 and add all radios implemented so far for testing the Radio HAL API.
This means:
Testing procedure
ieee802154_radio_ops_t
implementationtests/ieee802154_hal
test (for any of this radios).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:Example session between a
cc2538dk
andnrf52840
:NRF52840:
CC2538DK
Issues/PRs references
#14371
#13943