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

ieee802154/at86rf2xx: port to Radio HAL #19015

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
tests/ieee802154_submac: add support for AT86RF2XX radios
  • Loading branch information
jia200x committed Apr 13, 2023
commit 3a9ab03a99edc3d41001f0271e40cf293e1f9d68
7 changes: 7 additions & 0 deletions tests/ieee802154_submac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ include ../Makefile.tests_common
BOARD_WHITELIST += adafruit-clue \
adafruit-itsybitsy-nrf52 \
arduino-nano-33-ble \
atmega256rfr2-xpro \
avr-rss2 \
cc2538dk \
derfmega128 \
derfmega256 \
feather-nrf52840 \
microduino-corerf \
native \
nrf52840dk \
nrf52840dongle \
Expand All @@ -22,7 +27,9 @@ BOARD_WHITELIST += adafruit-clue \
remote-pa \
remote-reva \
remote-revb \
samr21-xpro \
pba-d-01-kw2x \
zigduino \
#

USEMODULE += od
Expand Down
3 changes: 3 additions & 0 deletions tests/ieee802154_submac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ static ieee802154_dev_t *_reg_callback(ieee802154_dev_type_t type, void *opaque)
case IEEE802154_DEV_TYPE_MRF24J40:
printf("mrf24j40");
break;
case IEEE802154_DEV_TYPE_AT86RF2XX:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to run the test with CONTINUE_ON_EXPECTED_ERRORS=1 USEMODULE+=at86rf233 BOARD=nucleo-f767zi.

I get linking errors:

/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/netdev_ieee802154_submac/netdev_ieee802154_submac.o: in function `ieee802154_submac_bh_request':
/home/fabian/forks/RIOT/drivers/netdev_ieee802154_submac/netdev_ieee802154_submac.c:133: multiple definition of `ieee802154_submac_bh_request'; /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/application_tests_ieee802154_submac/main.o:/home/fabian/forks/RIOT/tests/ieee802154_submac/main.c:174: first defined here
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/netdev_ieee802154_submac/netdev_ieee802154_submac.o: in function `ieee802154_submac_ack_timer_set':
/home/fabian/forks/RIOT/drivers/netdev_ieee802154_submac/netdev_ieee802154_submac.c:144: multiple definition of `ieee802154_submac_ack_timer_set'; /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/application_tests_ieee802154_submac/main.o:/home/fabian/forks/RIOT/tests/ieee802154_submac/main.c:134: first defined here
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/netdev_ieee802154_submac/netdev_ieee802154_submac.o: in function `ieee802154_submac_ack_timer_cancel':
/home/fabian/forks/RIOT/drivers/netdev_ieee802154_submac/netdev_ieee802154_submac.c:153: multiple definition of `ieee802154_submac_ack_timer_cancel'; /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/application_tests_ieee802154_submac/main.o:/home/fabian/forks/RIOT/tests/ieee802154_submac/main.c:138: first defined here
collect2: error: ld returned 1 exit status
make: *** [/home/fabian/forks/RIOT/tests/ieee802154_submac/../../Makefile.include:740: /home/fabian/forks/RIOT/tests/ieee802154_submac/bin/nucleo-f767zi/tests_ieee802154_submac.elf] Fehler 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that board pulls an netdev_eth, which selects netdev. As a result, the build system pulls netdev_ieee802154_submac, which shouldn't be there...

The proper fix for this is #19052. I will try to come up with a workaround

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard to fix as it is now :/. How should we proceed? Should we try to get #19052?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any opinions? @benpicco @fabian18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a blocker for this PR?
It only happens when manually adding the module to the test, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, just because we cannot provide netdev and the radio HAL at the same time for IEEE 802.15.4 devices

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the border router going to work then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm wait, it's definitely possible to run the nrf52840 with a border router... I think it hast to do with the way this driver is modeled.
It's still not possible to run the HAL and netdev_ieee802154 variants at the same time, but it shouldn't affect the BR. I will give it a look.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, the reason is because the submac callbacks are just C functions that should be defined somewhere. This would only happen with this test application (as netdev_ieee802154_submac already implements these callbacks and therefore there won't be duplicated symbols).

So yes, this only occurs in tests/ieee802154_submac

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is a real solution but at least it links fine with DISABLE_MODULE += netdev_ieee802154_submac in tests/ieee802154_submac/Makefile

printf("at86rf2xx");
break;
}

puts(".");
Expand Down