BLE Direct Test Mode, UART communication not working on nRF9160 DK / nRF52840

Hi, I have been experimenting with the Direct Test Mode program. I am using an nRF9160 DK, specifically the bluetooth chip nRF52840.

The Direct Test Mode is not officially supported by this dev kit, but I was able to compile it by creating a .conf file with just the following line:

The program works as expected with nRF Connect's Direct Test Mode app, except that I was not able to get UART communication working. printk-commands are not getitng through, which is my main use case for the UART connection as I want to do some debugging with the printing.

Any specific tips on how to get the UART and printk working? I am lost on what I should try next.

Parents
  • Hello zachary_z,

    Have you confirmed that you are interacting with the correct VCOM port?

    If you are sure, could you please share the compiled Kconfig file (.config) and DTS file (zephyr.dts)?

    Hieu

  • Hi, here are the .config and zephyr.dts files' contents.

    The VCOM port was not the problem. I had success with UART with another program. I tried all the available VCOM ports with the specified baud rates and also other baud rates with no success, so I think this is not the problem.

  • Both files look fine. I take it that you tested baud rate of 19200 and used a DTM specific application, such as our PC Direct Test Mode app, then?

    In that case, I have to try and reproduce this. The Easter holiday has just started in our location, so I might take long to answer in the upcoming 1-2 weeks. I hope you can understand.

  • Hello zachary_z,

    I was able to get the DTM test running just fine with the same steps you did.

    It was just a matter of finding the correct COM port for me.

    As for printk(), I missed this fact, but the DTM sample doesn't enable the Console (CONFIG_CONSOLE), so printk() doesn't work. That's expected, as the UART port is dedicated for the special DTM protocol.

    Could you please review your setup for anything that might have been overlooked?

    Hieu

  • Greetings,

    Thanks for the clarifications. For my uses, the DTM protocol over UART is not important. I have tried modifying the sample code such that instead of a DTM protocol, I can send individual hex commands to the main function executing the command. My purpose for the UART is simple communication for debugging. So, my current question is: how do I disable the DTM protocol in the sample and enable sending printk messages over UART? It's OK to have the DTM commands hardcoded etc. I imagine I need to add CONFIG_CONSOLE=y to the config, but I think there's more to it.

Reply
  • Greetings,

    Thanks for the clarifications. For my uses, the DTM protocol over UART is not important. I have tried modifying the sample code such that instead of a DTM protocol, I can send individual hex commands to the main function executing the command. My purpose for the UART is simple communication for debugging. So, my current question is: how do I disable the DTM protocol in the sample and enable sending printk messages over UART? It's OK to have the DTM commands hardcoded etc. I imagine I need to add CONFIG_CONSOLE=y to the config, but I think there's more to it.

Children