printk via RTT will not work, but printf does

Hello there,

I have looked through all of the various other related questions, but still cannot resolve this issue. I am trying to use RTT versus a UART for the console. I have confirmed that the printf operation works, but not printk. I have looked at all the various configuration settings and stepped through the code, and the call branches to "log_printk" versus "vprintk". 

I have the following config statements defined in the project file:

CONFIG_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_PRINTK=y
CONFIG_LOG_PRINTK=n

However in the output config file, the parameter CONFIG_LOG_PRINTK is always set as "y". Can you tell me why I cannot change this printk log parameter, it appears that this is stopping me from using printk to the RTT console.
Thanks,
Pam
Parents
  • Hi Torbjørn,

    Unfortunately that didn't help. I'm thinking the problem might be related to not being able to set CONFIG_LOG_PRINTK=n. I am getting a build error when I try to set it to "n" in the prj.conf file. Also, I think I am not allowed to set it within the Kconfig menu, the option is greyed out. Here is the build error I am seeing:

    warning: LOG_PRINTK (defined at c:\Soberlink\soberlink_sfw\trunk_NordicBLE\peripheral_uart\build\subsys\logging\Kconfig.processing:8) was assigned the value 'n' but
    got the value 'y'. See docs.zephyrproject.org/.../CONFIG_LOG_PRINTK.html
    and/or look up LOG_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.

    The reason I think the issue might be related to this logging feature is that when I single step through the printk() routine, the code then branches to the routine log_printk() versus vprintk().

    Thanks,

    Pam

  • Hi Pam

    Is there any particular reason you need to set CONFIG_LOG_PRINTK=n ?

    I was able to route the printk message to RTT in the peripheral_uart sample by adding the following configurations only:

    CONFIG_UART_RTT=y
    CONFIG_RTT_CONSOLE=y

    Best regards
    Torbjørn
     
Reply Children
No Data
Related