Execution region error when using BLE examples on STM32WB15CC

Hi! I am working on setting up BLE communication across two STM32WB15CCs: my goal is to use one board as the client, and the other as the server. I am using the BLE_GattClient_CharacteristicWrite and BLE_GattServer_CharacteristicWrite examples from the mbed-os-example-ble page (GitHub - ARMmbed/mbed-os-example-ble: BLE demos using mbed OS and mbed cli).

However, when I attempt to compile the code with NUCLEO-WB15CC selected as my target hardware, the build fails with the following error:

L6221E: Execution region RW_IRAM1 with Execution range [0x20000140,0x20003c78) overlaps with Execution region ARM_LIB_STACK with Execution range [0x20002c00,0x20003000).

On the other hand, the build works when I set the target hardware to NUCLEO-WB55RG.

I suspect the issue has something to do with the smaller SRAM1 on the NUCLEO-WB15CC (12kB vs. 192kB on the 55RG) and the fix may involve editing the linker files to move the start of IRAM1 elsewhere. But, I do not know how to figure out the proper addressing/sizing for RAM, or if that is even the issue.

Any help would be greatly appreciated!

Hi
Maybe you can check this?

Regards,

Thank you! I had seen that; unfortunately, there is no ROM size I’ve been able to put into mbed_app.json that resolves the error.

Specifically:

Without the mbed_app.json file, I get this output during the build:

Using ROM region application in this build.
Region application: size 0x32800, offset 0x8000000

If I put in a ROM size that is smaller, say by entering the following into my mbed_app.json:

{
    "target_overrides": {
        "NUCLEO_WB15CC": {
            "target.mbed_rom_size": "0x20000"
        }
    }
}

I get several errors (745) while building; I show some below. They are all similar (like the ones labeled L6406E below), except the last error (labeled L6407E):

L6406E: No space in execution regions with .ANY selector matching ../../build/mbed-os/hal/source/mbed_us_ticker_api.NUCLEO_WB15CC.o(.text.block_us_ticker_free).
L6406E: No space in execution regions with .ANY selector matching ../../build/mbed-os/platform/source/FileHandle.NUCLEO_WB15CC.o(.text._ZN4mbed10FileHandleD2Ev).
L6406E: No space in execution regions with .ANY selector matching /opt/ARMCompiler6.15.13/bin/../lib/libcxx/libcpp_w.l(new.cpp.o)(.rodata._ZSt7nothrow).
L6407E: Sections of aggregate size 0x2024 bytes could not fit into .ANY selector(s).

And to confirm the change to ROM size worked, this is part of my build output:

Using ROM region application in this build.
Region application: size 0x20000, offset 0x8000000

If I put in a size that is larger, I get the same error as before. Here’s my mbed_app.json:

{
    "target_overrides": {
        "NUCLEO_WB15CC": {
            "target.mbed_rom_size": "0x60000"
        }
    }
}

And here is my error:

L6221E: Execution region RW_IRAM1 with Execution range [0x20000140,0x20003c78) overlaps with Execution region ARM_LIB_STACK with Execution range [0x20002c00,0x20003000).

Am I missing something from that page – should I be trying some other fix? Thank you!

I built BLE_GattServer_CharacteristicWrite for NUCLEO_WB55RG which has 808K FLASH and 192K SRAM1:

Total Static RAM memory (data + bss): 19610(+19610) bytes
Total Flash memory (text + data): 143580(+143580) bytes

NUCLEO_WB15CC has only 202K FLASH (seems OK) and 12K of SRAM1…
So this application could not match in this MCU…