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

mrf24j40: does not link for examples/default #8752

Closed
miri64 opened this issue Mar 7, 2018 · 11 comments
Closed

mrf24j40: does not link for examples/default #8752

miri64 opened this issue Mar 7, 2018 · 11 comments
Assignees
Labels
Area: drivers Area: Device drivers Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@miri64
Copy link
Member

miri64 commented Mar 7, 2018

Description

When using this driver with a board that does not provide an on-board network device (e.g. stm32f4discovery or nucleo-f302) with examples/default, the application will fail to link due to the GNRC module missing. I think this is some dependency issue.

Steps to reproduce the issue

Build the default example with a board in question and mrf24j40:

BOARD=stm32f4discovery USEMODULE=mrf24j40 make -C examples/default/

Expected results

Linking step should succeed.

Actual results

Linking fails:

make: Entering directory '/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default'
Building application "default" for "stm32f4discovery" with MCU "stm32f4".

"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/boards/stm32f4discovery
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/core
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/stm32f4
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/cortexm_common
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/cortexm_common/periph
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/stm32_common
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/stm32_common/periph
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/cpu/stm32f4/periph
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/drivers
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/drivers/mrf24j40
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/drivers/netdev_ieee802154
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/drivers/periph_common
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/drivers/saul
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/auto_init
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/auto_init/saul
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/div
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/fmt
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/isrpipe
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/luid
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/net/link_layer/ieee802154
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/newlib_syscalls_default
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/phydat
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/pm_layered
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/ps
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/saul_reg
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/shell
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/shell/commands
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/tsrb
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/uart_stdio
"make" -C /home/mlenders/Repositories/RIOT-OS/RIOT/sys/xtimer
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default/bin/stm32f4discovery/application_default.a(main.o): In function `main':
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default/main.c:42: undefined reference to `gnrc_netreg_register'
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default/main.c:48: undefined reference to `gnrc_pktdump_pid'
collect2: error: ld returned 1 exit status
/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default/../../Makefile.include:328: recipe for target 'link' failed
make: *** [link] Error 1
make: Leaving directory '/home/mlenders/Repositories/RIOT-OS/RIOT/examples/default'

Versions

Operating system: Ubuntu 17.10
Build environment:

Installed toolchain versions
----------------------------
          native gcc: gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
          msp430-gcc: msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
             avr-gcc: missing/error
   arm-none-eabi-gcc: arm-none-eabi-gcc (15:5.4.1+svn241155-1) 5.4.1 20160919
    mips-mti-elf-gcc: missing/error
dist/tools/ci/print_toolchain_versions.sh: 92: dist/tools/ci/print_toolchain_versions.sh: clang: not found
arm-none-eabi-newlib: "2.4.0"
 mips-mti-elf-newlib: missing/error
            avr-libc: missing/error (missing/error)
            cppcheck: missing
          coccinelle: missing
                 git: git version 2.14.1
@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers GNRC labels Mar 7, 2018
@bergzand
Copy link
Member

bergzand commented Mar 7, 2018

@miri64 I can also reproduce this issue with:
BOARD=stm32f4discovery USEMODULE=at86rf233 make -C examples/default/
and with
BOARD=stm32f4discovery USEMODULE=cc2440 make -C examples/default/
so this is not limited to the mrf24j40, but a valid issue nonetheless

@aabadie
Copy link
Contributor

aabadie commented Apr 15, 2018

Briefly looked at the 'default' Makefile and gnrc related modules are only loaded if the board is listed in the BOARD_PROVIDES_NETIF variable.
So I would say that this is not a bug but a feature.
Could you try the same build command but with your board added to this list ? Maybe using BOARD_PROVIDES_NETIF=stm32f4discovery BOARD=stm32f4discovery USEMODULE= cc2420 make would work ?

@aabadie
Copy link
Contributor

aabadie commented Apr 15, 2018

Maybe using BOARD_PROVIDES_NETIF=stm32f4discovery BOARD=stm32f4discovery USEMODULE= cc2420 make would work ?

It doesn't since BOARD_PROVIDES_NETIF is set using := in the Makefile. So one has to modify the Makefile to make it compile, or use ?= instead of :=

I tested cc2420, mrf24j40 with stm32f4discovery and they all build when stm32f4discovery is added to the list of boards in BOARD_PROVIDES_NETIF

@miri64
Copy link
Member Author

miri64 commented Apr 15, 2018

So I would say that this is not a bug but a feature.

I think there is still a dependency issue if you get a linking error due to this. Even if the board is not in BOARD_PROVIDES_NETIF, the worst thing that should happen is that it isn't controllable, since GNRC is missing. So this is a bug.

But yes, besides that, we might either make the list configurable or, maybe much more convenient have it like PROVIDES_FEATURE with the periph interfaces, that every network device driver just provides the feature.

@aabadie
Copy link
Contributor

aabadie commented Apr 15, 2018

AFAIU, the default application mainly relies on the hardware provided by the boards. So if a device is not provided by default by a board (and also configured for this particular board), it's not guaranteed to work. Here, you are trying to build an external radio plugged on a board that doesn't provide/configure it.
Your PROVIDES_FEATURE proposition sounds interesting though. But this won't solve the fact that a driver loaded at build time from command line will work. Is it worth doing this ?

@kYc0o
Copy link
Contributor

kYc0o commented Jul 20, 2018

Jut to confirm that this still is an issue and quite annoying btw... @miri64 any ideas so far? What it has been discussed here is still valid?

@miri64
Copy link
Member Author

miri64 commented Jul 20, 2018

New ideas (apart from the one proposed in the discussion), no. I still think however that this is a configuration bug / flaw of the application and/or our dependency system.

@miri64 miri64 added Area: network Area: Networking and removed GNRC labels Sep 30, 2018
@stale
Copy link

stale bot commented Aug 10, 2019

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 Aug 10, 2019
@stale stale bot closed this as completed Sep 10, 2019
@aabadie aabadie reopened this Sep 21, 2019
@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Sep 21, 2019
@aabadie
Copy link
Contributor

aabadie commented Oct 16, 2019

I think this PR issue can be fixed by #11676.

@fjmolinas
Copy link
Contributor

This no longer fails for me:

BUILD_IN_DOCKER=1 BOARD=stm32f4discovery USEMODULE=mrf24j40 make -C examples/default/
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/home/francisco/workspace/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=stm32f4discovery'  -w '/data/riotbuild/riotbase/examples/default/' 'riot/riotbuild:latest' make      
Building application "default" for "stm32f4discovery" with MCU "stm32".

"make" -C /data/riotbuild/riotbase/boards/stm32f4discovery
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/stm32
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common
"make" -C /data/riotbuild/riotbase/cpu/cortexm_common/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/periph
"make" -C /data/riotbuild/riotbase/cpu/stm32/stmclk
"make" -C /data/riotbuild/riotbase/cpu/stm32/vectors
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/drivers/saul
"make" -C /data/riotbuild/riotbase/drivers/saul/init_devs
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
"make" -C /data/riotbuild/riotbase/sys/fmt
"make" -C /data/riotbuild/riotbase/sys/isrpipe
"make" -C /data/riotbuild/riotbase/sys/malloc_thread_safe
"make" -C /data/riotbuild/riotbase/sys/newlib_syscalls_default
"make" -C /data/riotbuild/riotbase/sys/phydat
"make" -C /data/riotbuild/riotbase/sys/pm_layered
"make" -C /data/riotbuild/riotbase/sys/ps
"make" -C /data/riotbuild/riotbase/sys/saul_reg
"make" -C /data/riotbuild/riotbase/sys/shell
"make" -C /data/riotbuild/riotbase/sys/shell/commands
"make" -C /data/riotbuild/riotbase/sys/stdio_uart
"make" -C /data/riotbuild/riotbase/sys/tsrb
   text	   data	    bss	    dec	    hex	filename
  20880	    132	   2484	  23496	   5bc8	/data/riotbuild/riotbase/examples/default/bin/stm32f4discovery/default.elf

@miri64 can you confirm and this can be closed?

@miri64
Copy link
Member Author

miri64 commented May 6, 2021

@miri64 can you confirm and this can be closed?

Confirmed

@miri64 miri64 closed this as completed May 6, 2021
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: network Area: Networking Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

6 participants