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

mk64f12: test failing with undefined reference to 'z_impl_sys_rand_get' #82344

Open
manuargue opened this issue Nov 29, 2024 · 4 comments · May be fixed by #82363
Open

mk64f12: test failing with undefined reference to 'z_impl_sys_rand_get' #82344

manuargue opened this issue Nov 29, 2024 · 4 comments · May be fixed by #82363
Assignees
Labels
area: Bluetooth Host bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug

Comments

@manuargue
Copy link
Member

manuargue commented Nov 29, 2024

Describe the bug
Tests failing with undefined reference to z_impl_sys_rand_get for boards hexiwear/mk64f12 and frdm_k64f/mk64f12. It looks like these boards lack of RNG driver and the test scenarios are not enabling any test RNG.

To Reproduce

west build -p -b hexiwear/mk64f12 tests/subsys/mgmt/mcumgr/os_mgmt_info -T mgmt.mcumgr.os.info.bt
west build -p -b frdm_k64f/mk64f12 samples/bluetooth/peripheral_ht -T sample.bluetooth.peripheral_ht.frdm_kw41z_shield
west build -p -b frdm_k64f/mk64f12 samples/bluetooth/peripheral_hr -T sample.bluetooth.peripheral_hr.frdm_kw41z_shield

Expected behavior
All tests above can build

Impact
Blocking CI of #82195 with unrelated failure

Logs and console output
https://github.com/zephyrproject-rtos/zephyr/pull/82195/checks?check_run_id=33638058374
Example

FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /__w/zephyr/zephyr/twister-out/frdm_k64f_mk64f12/samples/bluetooth/peripheral_hr/sample.bluetooth.peripheral_hr.frdm_kw41z_shield/zephyr/zephyr_pre0.map 
: && ccache /opt/toolchains/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/__w/zephyr/zephyr/twister-out/frdm_k64f_mk64f12/samples/bluetooth/peripheral_hr/sample.bluetooth.peripheral_hr.frdm_kw41z_shield/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/net_buf/liblib__net_buf.a  zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a  zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a  zephyr/subsys/bluetooth/crypto/libsubsys__bluetooth__crypto.a  zephyr/drivers/bluetooth/libdrivers__bluetooth.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nxp/hal_nxp/lib..__modules__hal__nxp.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  modules/mbedtls/libmodules__mbedtls.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/__w/zephyr/zephyr/twister-out/frdm_k64f_mk64f12/samples/bluetooth/peripheral_hr/sample.bluetooth.peripheral_hr.frdm_kw41z_shield/zephyr  zephyr/arch/common/libisr_tables.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  -Wl,--fatal-warnings  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF -L"/opt/toolchains/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -lc -lgcc && cd /__w/zephyr/zephyr/twister-out/frdm_k64f_mk64f12/samples/bluetooth/peripheral_hr/sample.bluetooth.peripheral_hr.frdm_kw41z_shield/zephyr && /usr/bin/cmake -E true
/opt/toolchains/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/mbedtls/libmbedTLSBase.a(zephyr_entropy.c.obj): in function `sys_rand_get':
/__w/zephyr/zephyr/twister-out/frdm_k64f_mk64f12/samples/bluetooth/peripheral_hr/sample.bluetooth.peripheral_hr.frdm_kw41z_shield/zephyr/include/generated/zephyr/syscalls/random.h:37: undefined reference to `z_impl_sys_rand_get'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Environment (please complete the following information):

  • OS: Linux
  • Toolchain Zephyr SDK 0.16.8
  • Commit SHA or Version used: 6c7b38f

Additional context
Seems like a solution would be to enable CONFIG_TEST_RANDOM_GENERATOR=y either for the boards or in the test scenarios.

@manuargue manuargue added bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP labels Nov 29, 2024
@manuargue manuargue added the priority: low Low impact/importance bug label Nov 29, 2024
manuargue added a commit to nxp-upstream/zephyr that referenced this issue Nov 29, 2024
This board lacks of RNG driver, hence use the test RNG for testing.

Fixes zephyrproject-rtos#82344

Signed-off-by: Manuel Argüelles <[email protected]>
manuargue added a commit to nxp-upstream/zephyr that referenced this issue Nov 29, 2024
Some boards like hexiwear/mk64f12 lack of RNG drivers, therefore enable
the testing RNG.

Fixes zephyrproject-rtos#82344

Signed-off-by: Manuel Argüelles <[email protected]>
manuargue added a commit to nxp-upstream/zephyr that referenced this issue Nov 29, 2024
Enable entropy generator as needed by these samples.

Fixes zephyrproject-rtos#82344

Signed-off-by: Manuel Argüelles <[email protected]>
manuargue added a commit to nxp-upstream/zephyr that referenced this issue Nov 29, 2024
Enable entropy generator as needed by these tests.

Fixes zephyrproject-rtos#82344

Signed-off-by: Manuel Argüelles <[email protected]>
@manuargue manuargue assigned jhedberg and unassigned dleach02 Dec 1, 2024
@hakehuang
Copy link
Collaborator

also impact NXP platforms with bluetooth shield #82390

@FRASTM
Copy link
Collaborator

FRASTM commented Dec 3, 2024

also seen on stm32 nucleo_g070rb target when building samples/bluetooth/peripheral_hr/ --shield frdm_kw41z

@manuargue manuargue added priority: medium Medium impact/importance bug and removed priority: low Low impact/importance bug labels Dec 3, 2024
@manuargue
Copy link
Member Author

@jhedberg bumping prio from low to medium as this issue is affecting multiple boards

@erwango
Copy link
Member

erwango commented Dec 3, 2024

Failing CI here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: medium Medium impact/importance bug
Projects
None yet
6 participants