nrfx_spim_spis sample cannot be used UART to print

Hello all,

I'm using nrfx_spim_spis  non_blocking sample to make my nRF5340 DK as SPI SLAVE.

I don't need SPI MASTER, so I delete the SPIM code.

But I found that I can't use printk to print.

My SDK version is ncsv2.3.0.

Here is my project.

5518.SPIS.zip

Are there anything I need to change?

Thanks!

Parents Reply Children
  • Hi,

    Maybe my description is not accurate.

    The sample project uses log to print information while I just want to use printk.

    However, there is nothing print when I use printk.

    It seems uart0 disabled.

    I have already checked the output zephyr.dts. Status of uart0 is "okay".

    There is nothing print in RTT Viewer. And in debug mode the code works as usual.

    Besides, other samples will firstly print "*** Booting Zephyr OS build fcaa60a99fa9 ***" after booting while my SPIS project prints nothing.

    I wonder why the uart0 is not working properly.

    Thanks!

  • Hi, 
    I found that you can either remove 

    CONFIG_LOG=y
    CONFIG_LOG_PROCESS_THREAD=n

    Or if you set 
    CONFIG_LOG_PROCESS_THREAD=y then  you can print out on UART with printk. 

    The reason is that if you don't do CONFIG_LOG_PROCESS_THREAD=y, you would need to do LOG_PROCESS() to print out on UART. 



  • Hi,

    Thanks for your reply!

    When I set  CONFIG_LOG_PROCESS_THREAD=y, the printk could print out on UART.

    I still have a question why other samples can print on UART without CONFIG_LOG_PROCESS_THREAD=y, such as blinky.

    I have tried to keep their config files such as prj.conf and  .overlay consistent.

  • Hi, 
    I'm not aware that the blinky has any code to print anything on UART. 


    As I mentioned if you do CONFIG_LOG_PROCESS_THREAD=y, you need to do LOG_PROCESS() frequently (usually in the idle thread)
    If you want to see the banner *** Booting Zephyr OS build fcaa60a99fa9 *** then you need to set CONFIG_BOOT_BANNER=y

Related