I have a problem with printk/LOG in one program (samples/sensor/bmi160). All my programs, except this one, gives me serial output from both logging (LOG_INF etc) and printf/printk. The program in question gives me printk and LOG_xxx to my nRF9160DK board, but only LOG_xxx to my custom nRF9160 board. Very annoying. What parameter suppresses printk on one board but not the other, and is also program specific (since printk works with the custom board for all my other programs). I've compared application specific files (e.g. prj.conf) across working programs and the questionable program without luck.
Here is the prj.conf:
CONFIG_GPIO=y CONFIG_GPIO_NRFX=y CONFIG_STDOUT_CONSOLE=y CONFIG_SERIAL=y CONFIG_SENSOR=y # SPI CONFIG_SPI=y CONFIG_SPI_NRFX=y CONFIG_SPI_2=y CONFIG_SPI_NRFX=y CONFIG_MAIN_STACK_SIZE=4096 CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=256 CONFIG_I2C=n CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_BMI160=y CONFIG_BMI160_TRIGGER_OWN_THREAD=y CONFIG_BMI160_TRIGGER=y #Debug Specific CONFIG_DEBUG=n CONFIG_LOG=y CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_LOG_MAX_LEVEL=4 CONFIG_LOG_BACKEND_UART=y
I also tried to add this to the bmi160 driver Kconfig:
config PRINTK
bool "Send printk() to console"
default y
help
This option directs printk() debugging output to the supported
console device, rather than suppressing the generation
of printk() output entirely. Output is sent immediately, without
any mutual exclusion or buffering.