Error when building Modem_Shell for Thingy91 -> ld.bfd: region `FLASH' overflowed by 64612 bytes

When I execute the command:  west build -p -b thingy91_nrf9160_ns -- -DDTC_OVERLAY_FILE=ppp.overlay -DOVERLAY_CONFIG=overlay-ppp.conf

I get: 

ld.bfd: region `FLASH' overflowed by 64612 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/xavier/ncs/v2.2.99-dev3/nrf/samples/nrf9160/modem_shell/build

I only wish to use the modem shell for the PPP functionality, and do not care about including support that is not necessary to achieve PPP dial up service. Any suggestions on how to build this image with only PPP that will fit on the Thingy91 would be IMMENSELY appreciated!   

  • Hello, 

    Could you please test with latest tagged version v2.2.0? You are currently on the main branch. The nRF Connect SDK repository is described in our documentation. As stated, the main branch can often be unstable as this is where the latest development is added. The tagged versions are stable versions. 

    Are you able to share more information about you setup and environment?  I tested on my side on Linux, MacOS, and Windows, the latter using VS Code. extension. The former two built with success, however, with Windows I got the same issue. I updated the SDK and Toolchain, and it successfully built.

    Can you test on your side?

    Kind regards,
    Øyvind

  • I am using Linux Mint with the CLI tools. I have tested with v2.2.0 and get the same result.

    When I execute the command:  west build -p -b thingy91_nrf9160_ns -- -DDTC_OVERLAY_FILE=ppp.overlay -DOVERLAY_CONFIG=overlay-ppp.conf the build system errors out:

    /home/xavier/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
    /home/xavier/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 63528 bytes
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/xavier/ncs/v2.2.0/nrf/samples/nrf9160/modem_shell/build

    I have even tried with VSCode and I get the exact same result. I even installed v2.1.3 and v2.1.2 and get the exact same result each time. What doesn't make sense is that there seems to be enough space on the thingy91 because of this printed message during the build process:


    [280/280] Linking C executable zephyr/zephyr.elf
    Memory region   Used Size   Region Size   %age Used
    FLASH:               40410 B     48 KB             82.21%
    RAM:                   28024 B     197400 B       14.20%
    IDT_LIST:            0 GB           2 KB              0.00%


    What information would be helpful to you to see so I may provide it?

  • I managed to trim fat from the the image by tweaking the config files and had a successful build and flash for the Thingy91 by enabling only CONFIG_MOSH_LINK=y in prj.conf, and CONFIG_MOSH_PPP=y. in the overlay-ppp.conf files.

    Now, when I connect to the device via serial monitor, it outputs garbage every second or so.

    ie, ~�}#�!}!}(} }(}!}$}%�6m~~�}#�!}!}(} }(}!}$}%�6m~

    Have you tested PPP service with a Thingy91 before? All I did was disable support for everything but PPP and now the modem shell is broken. If I build an image with the exact same prj.conf but don't include the cmake options for PPP, the application works just fine and no garbage is output to the terminal. I'm out of ideas.

  • I am simply following these directions: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/modem_shell/README.html#ppp-support 

    Any insight on what would be causing the PPP session to output nonsense and disallow me to interact with the modem shell?

Related