Apologies, as I’ve searched for a while and not found a relevant topic or documentation on this subject. I’ve been trying to read input over the USB serial, and have been met with frustration. I assume this is possible because of the at_client example, but I could be mistaken.

I’ve tried using the comms.c/.h code from pyrinas, and mapped it to ‘uart0’, but when it sets the RX callback, it gets error code -134. I assume the zephyr system is possibly using that callback? Any clarification would be helpful.

Thanks in advance

    I was looking to read serial information from my custom firmware. I’ve been able to successfully build, load, and read my firmware’s output over usb serial (via printk), but I’m at a loss on how to have my firmware read input over usb serial.

    Ahh gotcha.

    You can enable the shell to go across your default console by editing your config:

    CONFIG_SHELL=y
    CONFIG_AT_SHELL=y

    The later CONFIG_AT_SHELL only works with NCS.

    Once compiled and running you should be able to see a shell prompt on boot. You can use it as if you’re using a terminal after that. If you want to create your own shell command, you can check out how Nordic made there in the source: https://github.com/nrfconnect/sdk-nrf/tree/main/lib/at_shell

    So there is no equivalent of the arduino Serial.read then? I saw there was stdio.h but no symbol is found for scanf…

    Unfortunately Zephyr is a bit different than Arduino. Reading direct text input is done through the shell. It would be best to start there.

      Nice! Let me know if you have any other questions.

      Terms and Conditions | Privacy Policy