cancel
Showing results for 
Search instead for 
Did you mean: 

Linking errors in basic STM32WBA ZigBee OnOff-Server project

david072
Associate II

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 relocation

My system is:

  • MacOS Tahoe 26.3.1
  • STM32CubeMX 6.17.0
  • Project for STM32WBA5MMG Module
  • STM32Cube MCU Package for STM32WBA Series 1.9.0
  • CMake project with GCC Toolchain
  • STM32Cube extensions for VSCode

I have attached the project below.

Does anyone know why this happens and how I can fix these linker errors?

Thanks in advance!

4 REPLIES 4
Nawres GHARBI
ST Employee

Hi @david072 

Actually you are overflowing the RAM1

[build] Memory region         Used Size  Region Size  %age Used
[build]              RAM:       78256 B        64 KB    119.41%
[build]             RAM2:           0 B        64 KB      0.00%
[build]            FLASH:      361280 B         1 MB     34.45%
 
please check you memory usage config, I will try to help you and find the best config
Nawres GHARBI
ST Employee

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

 

david072
Associate II

Hi @Nawres GHARBI 

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 status

I 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.

david072
Associate II

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?