Flash overflow?

Hello,

I'm trying to merge together a couple of sample projects to make a prototype (in particular, the LTE-BLE gateway, and AWS-IoT samples) - to run on the nRF 9160DK

When I try and compile, I get the following errors:

/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `text' will not fit in region `FLASH'

/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 119504 bytes

How can I resolve this please? Or is it just too big to try and fit onto the Dev Kit?

Regards,

Ben

Parents
  • Hi Ben,

    The error does mean that your compiled application is too big to fit on the memory. May I ask how you arrive at this application?

    It might be helpful if you can share your compiled Devicetree and Kconfig. They are in the files named zephyr.dts and .config, under <build directory>/zephyr.

    Regards,

    Hieu

  • Hi - I'm trying to add BLE scanning into the AWS_IoT sample (the BLE was copied from the BLE_LTE sample)

    0207.zephyr.dts5078.config.txt

  • Hi Susheel - thank you for the reply.

    Is this what you need to see?:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331
    command opcode 0x0c03 timeout with err -11
    [00:00:10.267,791] <err> os: r0/a1: 0x00000003 r1/a2: 0x00000002 r2/a3: 0x00000001
    [00:00:10.267,791] <err> os: r3/a4: 0x0000014b r12/ip: 0x00000004 r14/lr: 0x00028e11
    [00:00:10.267,822] <err> os: xpsr: 0x41000000
    [00:00:10.267,822] <err> os: Faulting instruction address (r15/pc): 0x00028e1c
    [00:00:10.267,883] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:10.267,913] <err> os: Current thread: 0x20010ec0 (main)
    [00:00:10.323,974] <err> fatal_error: Resetting system
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Ben

  • This seems like a hardfault on stack over on main thread. Have you tried to increase the CONFIG_MAIN_STACK_SIZE in your prj.conf?

    If you are using or nRF extension on Visual Studio code  you can see the GUI for KConfig and increase the value of the main stack to see if this issue gets solved. 

    Also, It is a good idea to enable the Thread_Analyzer while in development phase of your project to have.a good idea on the stack usage on threads you are using in your sofware delevelopment.

  • That doesn't seem to be working :-(

    Is this the right place to set this?

  • Not sure if you have that much amount of RAM left to reserve for stack for main thread. I would normally increase it by 1024 or 2048 bytes at a time. Set to probably 8096 and not to 32k. Did you click on the "save to file" button on the top right corner?

  • Hi - sorry for the delay

    I tried again and made sure I clicked 'save to file' - it tells me that it to /build/zephyr/.config

    I can verify that this worked by inspection of that file, and because VS Code says 'In build: 8192' if I try to add CONFIG_MAIN_STACK_SIZE manually to prj.conf

    I still get the exact same error when I run the code!

Reply
  • Hi - sorry for the delay

    I tried again and made sure I clicked 'save to file' - it tells me that it to /build/zephyr/.config

    I can verify that this worked by inspection of that file, and because VS Code says 'In build: 8192' if I try to add CONFIG_MAIN_STACK_SIZE manually to prj.conf

    I still get the exact same error when I run the code!

Children
No Data