Linking and merging issues: "cannot move location counter backwards"

I’m encountering some challenges while compiling firmware for the STM32H747 dual-core MCU using Mbed OS and would appreciate any insights or advice. While I’ve successfully compiled the same firmware for the STM32H743 (single-core), I’m facing two distinct problems with the STM32H747 (dual-core):

  1. Linker Error with Standard DISCO_H747I Target: I’m getting a linker error when using the standard DISCO_H747I target:
Link: MainFirmware
.../arm-none-eabi/bin/ld:BUILD/DISCO_H747I/debug/.link_script.ld:94 cannot move location counter backwards (from 00000000242f88e0 to 000000002407fc00)
collect2: error: ld returned 1 exit status

This suggests a potential issue with the memory layout in the linker script. I have examined the linker scripts and cmsis_nvic.h file for discrepancies but haven’t pinpointed the exact problem.

  1. Memory Overload with Custom Target in WSL:
    Using a custom target with a linker script similar to STM32H743’s, I encounter a different issue where the build process causes memory overload in WSL:
Link: MainFirmware
Elf2Bin: MainFirmware
Merging Regions
Filling region application with BUILD/H747XI/debug/MainFirmware_application.bin
[mbed] ERROR: "/usr/bin/python3" returned error.
Code: -9
Path: "/home/mbed"
Command: "/usr/bin/python3 -u /home/mbed/mbed-os/tools/make.py -D COMMIT_SHA=0 -D VERSION_BUILD=0 -t GCC_ARM -m H747XI --profile ./profiles/debug.json --source . --build BUILD/H747XI/debug --artifact-name MainFirmware --app-config ./mbed_app.json"

It seems the Python script for merging regions during the build is causing excessive memory usage. Monitoring with htop shows that the process overloads all available memory, whether I allocate 4GB or 16GB to WSL.

I aim to use only the M7 core of the STM32H747 and not the M4 core. Any experience or advice on configuring Mbed OS for single-core operation in a dual-core MCU, or knowledge of specific issues or considerations in such scenarios, would be greatly appreciated.