2026-03-29 7:20 AM
Hello everyone!
I am trying to get a custom board based on an STM32WBA5MMG to join my existing ZigBee network. As a first test, I have created a basic project in CubeMX, that configures STM32_WPAN to generate a ZigBee project with one OnOff-Endpoint and sets up USART2 for logging. When I generate a CMake-based project and try to compile it in VSCode with the STM32 extensions installed (without making any changes to what CubeMX generated), I get a bunch of linking errors and the build fails:
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: warning: /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/thumb/v8-m.main+fp/hard/crtn.o: missing .note.GNU-stack section implies executable stack
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: stm32_zigbee_test.elf section `.bss' will not fit in region `RAM'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 6064 bytes
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mcps_purge_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_purge_req+0x20): undefined reference to `ST_MAC_MCPSPurgeReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MCPSPurgeReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_purge_req+0x20): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mcps_data_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_data_req+0xde): undefined reference to `ST_MAC_MCPSDataReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MCPSDataReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_data_req+0xde): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_reset_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_reset_req+0x1e): undefined reference to `ST_MAC_MLMEResetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEResetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_reset_req+0x1e): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_get_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_get_req+0x15c): undefined reference to `ST_MAC_MLMEGetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEGetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_get_req+0x15c): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_poll_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_poll_req+0x30): undefined reference to `ST_MAC_MLMEPollReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEPollReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_poll_req+0x30): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_start_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_start_req+0x70): undefined reference to `ST_MAC_MLMEStartReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEStartReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_start_req+0x70): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_rxenable_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_rxenable_req+0x2c): undefined reference to `ST_MAC_MLMERxEnableReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMERxEnableReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_rxenable_req+0x2c): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_associate_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_req+0x62): undefined reference to `ST_MAC_MLMEAssociateReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEAssociateReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_req+0x62): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_associate_rsp':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_rsp+0x18): undefined reference to `ST_MAC_MLMEAssociateRes'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEAssociateRes): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_rsp+0x18): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_orphan_rsp':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_orphan_rsp+0x18): undefined reference to `ST_MAC_MLMEOrphanRes'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEOrphanRes): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_orphan_rsp+0x18): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_scan_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_scan_req+0x36): undefined reference to `ST_MAC_MLMEScanReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEScanReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_scan_req+0x36): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_set_attr_wait':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_set_attr_wait+0x20): undefined reference to `ST_MAC_MLMESetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMESetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_set_attr_wait+0x20): dangerous relocation: unsupported relocationMy system is:
I have attached the project below.
Does anyone know why this happens and how I can fix these linker errors?
Thanks in advance!
2026-03-30 8:51 AM
Hi @david072
Actually you are overflowing the RAM1
2026-04-01 1:34 AM
Hi @david072
you have two solutions to make your project link successfully
1- Lower your CFG_MM_POOL_SIZE in app_conf.h
/******************************************************************************
* MEMORY MANAGER
******************************************************************************/
#define CFG_MM_POOL_SIZE (47000U) /* bytes */
2- declare big buffers on RAM2
2026-04-04 7:56 AM - edited 2026-04-04 7:56 AM
Thanks for the response! I lowered the CFG_MM_POOL_SIZE definition in app_conf.h to 30000 fix the RAM overflowing issue. However it still cannot find definitions for the ST_MAC_MCPS* and ST_MAC_MLME* functions.
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: warning: /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/thumb/v8-m.main+fp/hard/crtn.o: missing .note.GNU-stack section implies executable stack
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mcps_purge_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_purge_req+0x20): undefined reference to `ST_MAC_MCPSPurgeReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MCPSPurgeReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_purge_req+0x20): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mcps_data_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_data_req+0xde): undefined reference to `ST_MAC_MCPSDataReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MCPSDataReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mcps_data_req+0xde): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_reset_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_reset_req+0x1e): undefined reference to `ST_MAC_MLMEResetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEResetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_reset_req+0x1e): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_get_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_get_req+0x15c): undefined reference to `ST_MAC_MLMEGetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEGetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_get_req+0x15c): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_poll_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_poll_req+0x30): undefined reference to `ST_MAC_MLMEPollReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEPollReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_poll_req+0x30): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_start_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_start_req+0x70): undefined reference to `ST_MAC_MLMEStartReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEStartReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_start_req+0x70): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_rxenable_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_rxenable_req+0x2c): undefined reference to `ST_MAC_MLMERxEnableReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMERxEnableReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_rxenable_req+0x2c): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_associate_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_req+0x62): undefined reference to `ST_MAC_MLMEAssociateReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEAssociateReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_req+0x62): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_associate_rsp':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_rsp+0x18): undefined reference to `ST_MAC_MLMEAssociateRes'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEAssociateRes): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_associate_rsp+0x18): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_orphan_rsp':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_orphan_rsp+0x18): undefined reference to `ST_MAC_MLMEOrphanRes'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEOrphanRes): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_orphan_rsp+0x18): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_mlme_scan_req':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_scan_req+0x36): undefined reference to `ST_MAC_MLMEScanReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMEScanReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_mlme_scan_req+0x36): dangerous relocation: unsupported relocation
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o): in function `zsdk_stmac_set_attr_wait':
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_set_attr_wait+0x20): undefined reference to `ST_MAC_MLMESetReq'
[build] /Users/dg/Library/Application Support/stm32cube/bundles/gnu-tools-for-stm32/14.3.1+st.2/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld: (ST_MAC_MLMESetReq): Unknown destination type (ARM/Thumb) in /Users/dg/stm32_zigbee_test/cmake/stm32cubemx/../../Middlewares/ST/STM32_WPAN/zigbee/stack/ZigBeeProR23_FFD.a(zigbee.stm32wba.mac.o)
[build] zigbee.stm32wba.mac.c:(.text.zsdk_stmac_set_attr_wait+0x20): dangerous relocation: unsupported relocation
[build] Memory region Used Size Region Size %age Used
[build] RAM: 47600 B 64 KB 72.63%
[build] RAM2: 0 B 64 KB 0.00%
[build] FLASH: 360572 B 1 MB 34.39%
[build] collect2: error: ld returned 1 exit statusI can see that the definitions are in the wba_mac_lib.a library, and it is being linked into the project, but the linker still cannot find the definitions for some reason.
2026-04-12 8:31 AM
After looking into it a bit more, the linker errors originate from an incorrect linking order in the cmake/stm32cubemx/CMakeLists.txt file. Namely, wba_mac_lib.a needs to be linked after ZigBeeProR23_FFD.a for it to work.
However, I am getting runtime issues now. Firstly, it is necessary to decrease CFG_AMM_VIRTUAL_STACK_ZIGBEE_INIT_BUFFER_SIZE in app_conf.h too, to avoid landing in the Error_Handler after AMM_Init. Then, one must configure GPDMA1 for USART2, since the WPAN logging framework expects to be able to use DMA for the logging.
With these changes, I am getting to the call to ZbInit in app_zigbee.c. However, the function fails and I hit an assert afterwards. Since the function is linked in from a static library, I am unsure how to troubleshoot this further, as I have no idea why the function is failing. I have tried supplying a logging callback via the setLogging parameter, but it does not look like this callback is being called before the function fails.
Does anyone know what is going wrong here?
Also, does anyone know how to correct the configuration in CubeMX to make it generate the correct buffer sizes in app_conf.h and to make it use the correct linking order for the static libraries?