cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE Linker Script wrong?

PDeng
Associate II

Hello community,

I'm getting started with the STM32WB55 Nucleo board and worked through some examples. To get a better understanding I chose to start a new project from scratch. I used CubeIDE (came from Atollic TS and CubeMX anyways) and initalised the MCU (as seen in the workshop tutorials). The MCU immidiately dropped into Hard Fault Error. I investigated a bit and compared the code to the p2p_server example. Everything seemed fine, except the linker script. The _estack variable didn't match. As soon as I adapted it, all seemed to work fine but the app_ble_init() was never called. I really invested a lot of time tracking the error down but could not find anything. Then I simply copied the linker script from the p2p_example to my project and suddently everything worked fine.

It seems like a workaround for me. Can anybody enlighten me what is going on there?

Thanks in advance!

Best regards,

Philipp

1 REPLY 1
Christophe Arnal
ST Employee

​Hello,

In the current version, CubeMx is not able to generate correct linker file for BLE application if you start a project from scratch.

All BLE applications share the same linker file so you can just use one from any example.

The data shared between CPU1 and CPU2 shall be located in SRAM2. The default linker file puts all these buffers in the SRAM1 so they are not accessible by the CPU2.

These section are :

MAPPING_TABLE ( at the start of SRAM2A when IPCCDBA option byte is set to 0 - user option byte - default configuration)

MB_MEM1

MB_MEM2

If for any reason you need to build your own linker file, please make sure that these 3 sections are mapped into SRAM2 with MAPPING_TABLE at the start of the SRAM2A when IPCCDBA = 0.

Regards.