Skip to content

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

@manuargue

Description

@manuargue

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.

Metadata

Metadata

Assignees

Labels

area: RandomRandom subsystembugThe issue is a bug, or the PR is fixing a bugpriority: highHigh impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions