Adding CONFIG_LOG=y causes Flash overflow error

This is my environment

  • IDE: VSC
  • SDK: NCS v2.2.0
  • nRF52-DK

I've got a couple of different sets of firmware for different applications, and I am seeing this issue with all of them.

They all use Bluetooth and have the MCU Boot manager enabled, as I need the OTA Firmware Update functionality.

Setup like that, I can't enable logging.  The moment I do, I get this error:

c:/nordic/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: region `FLASH' overflowed by 23716 bytes

I've got no idea why this is occuring and whether its actually something I can get around somehow.

In the past, I've resolved this by simply printing debug statements out using printk(), and having a bunch of #ifdef DEBUG #end statements around the printk() statement so I can enable/disable those as I move through the firmware development.

But it would be good to get the logging working

Does anyone know how I can fix this?

Regards,

Mike

  • Mike Austin (LPI) said:
    Seems to be suggesting that even though I'm setting CONFIG_LOG_MODE_MINNAL=y, its not actually being set to that.

    Since you verify that this is set for the application, this warning is likely related to a child image.

    That you can verify in, for example, build/mcuboot/zephyr/.config.

    To debug this, I often do

    cd build/mcuboot
    ninja menuconfig
    

    And then search( / ) for the related configuration, then look at its info ( ? ), to see why it is set as "n", cause this let you view its depenedncies and how they are set.

    Mike Austin (LPI) said:
    So, somehow the minimal logging is not being set and full logging is adding 16kB.

    Hmmm. I dont quite remember now. From previous debugging, did you verify that the 16kB is from the application, or could it be from a child image?

Related