Disabling PRINTK

Hello,

After migrating from NCS 1.8.0 to the latest NCS 2.7.0 version, I am no longer able to disable PRINTK, which we previously did to reduce flash memory usage, as we were critically close to the limit.

Currently, I am unable to achieve this. I ran the bluetooth_lbs example with prj_minimal.conf, where disabling PRINTK is mentioned, but I still see output from PRINTK.

warning: PRINTK (defined at subsys/debug/Kconfig:204) was assigned the value 'n' but got the value
'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_PRINTK and/or look up PRINTK in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: EARLY_CONSOLE (defined at subsys/debug/Kconfig:223) was assigned the value 'n' but got the
value 'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_EARLY_CONSOLE and/or look up
EARLY_CONSOLE in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

It is also not possible to disable it using the nRF Kconfig GUI.

Is there a way to disable it in this version?

  • Hello,

    PRINTK and EARLY_CONSOLE are selected by CONFIG_NCS_BOOT_BANNER and CONFIG_BOOT_BANNER, so these need to be disabled as well. If you want to disable the console and logger output, you can add the following lines to your project configuration file:

    CONFIG_LOG=n
    CONFIG_CONSOLE=n
    CONFIG_PRINTK=n
    CONFIG_UART_CONSOLE=n
    CONFIG_NCS_BOOT_BANNER=n
    CONFIG_BOOT_BANNER=n

    Best regards,

    Vidar

Related