I'm working with a DVK that has an nrF52840 with a Sierra Wireless HL7800 modem. The modem is connected physically to UART1 while the UART0 is used for the following as shown in the dts:
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
I'm working with a DVK that has an nrF52840 with a Sierra Wireless HL7800 modem. The modem is connected physically to UART1 while the UART0 is used for the following as shown in the dts:
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
First I'd like to point out that you are not supposed to change the .dts or any of the other board files directly (although it probably works). The intended way is to create an .overlay file in your application folder. Then anything that is located in that will overwrite the .dts file for your application.
So if you are using the nRF52840, create a file called nrf52840dk_nrf52840.overlay in the same folder as your CMakeLists.txt and in there you can add those snippets. (I usually copy from the .dts file, so that I get the right indentations and brackets, and then remove anything I don't want to change, and then I change what I want to change).
As for the question, yes. You are onto something. If you need the console, it is possible to move it over to the USB, and I believe something like that can work. Did you test it?
If you do not need it, you can just disable the logging, which will free up the UART for your own use. You can also move the logging overt to RTT, so that the UART is free to use for your application.
If you have a look at the sample found in ncs\nrf\samples\bluetooth\peripheral_uart, then you will see that this one uses UART0 for the application, and then it uses RTT for logging. You can see this from the prj.conf:
# Config logger CONFIG_LOG=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_BACKEND_UART=n CONFIG_LOG_PRINTK=n
It actually doesn't disable the console, and the reason for this is that it on purpose uses printk() to print some messages over UART, but it also uses uart_tx() to send UART messages, and uart_cb() for reading.
Best regards,
Edvin
Thank you Edvin,
I will edit the overlay. I'm still learning this whole zephyr process. It seems that no matter which tutorial I start I always run into something that stalls me, or is out dated that doesn't match what I see, etc. I moved that over to "nrf usb" but haven't tested it yet. I do still need the console, because I still have to test the SMS messages I am getting from the HL7800 with AT commands.
For the nrf usb, it that the right identifier for the usb on the nrf52840?
Stephen
Oh okay, thanks for the clarification. I am looking at that now.
Thanks,
Stephen
I'm trying configure the UART0. Where can I go to understand how to create a UART node. I've gone through the first of the of the dev academy, but it doesn't seem to address this. I have a simple HMI with TX and RX, no flow-control that I need to connect to UART0. Trying to add it to the DTS overlay, but get the "Only uart nodes accepted in /soc/uart@40002000/." error.
So the only difference is that you want to disable the flow control? Try something like this:
&uart0 { compatible = "nordic,nrf-uarte"; status = "okay"; baudrate = <115200>; pinctrl-0 = <&uart0_default>; pinctrl-1 = <&uart0_sleep>; pinctrl-names = "default", "sleep"; /delete-property/ hw-flow-control; }; };
Best regards,
Edvin
When I've tried that before I get the warning "Unknown property" as you can see from the screen shot. I thought that meant I was using the wrong statement. I went through the yaml files to see what RTS and CTS were being called, but that didn't seem to help. Is that warning of "Unknown property" a problem?
Also, in regards to creating a custom node for my HMI, is there a tutorial on that? How do I get that to appear in the overlay? Right now it does not have a node assigned. There is an option to add a node, but I still would have to create a node for my HMI right? It just gives me a list of predefined nodes for other devices.
MontanaEE said:Is that warning of "Unknown property" a problem?
I tend to ignore this "Problems" tab, because it gives a lot of false warnings. Does the build log say anything about being an unknown property if you use the /delete-property/ line?
MontanaEE said:Also, in regards to creating a custom node for my HMI, is there a tutorial on that?
That may be possible, but it is not something I have tested before. I suspect it is part of writing your own zephyr driver for the HMI device. You can try to follow the DevAcademy nRF Connect SDK Intermediate course, and the lesson on writing your own drivers:
Best regards,
Edvin
MontanaEE said:Is that warning of "Unknown property" a problem?
I tend to ignore this "Problems" tab, because it gives a lot of false warnings. Does the build log say anything about being an unknown property if you use the /delete-property/ line?
MontanaEE said:Also, in regards to creating a custom node for my HMI, is there a tutorial on that?
That may be possible, but it is not something I have tested before. I suspect it is part of writing your own zephyr driver for the HMI device. You can try to follow the DevAcademy nRF Connect SDK Intermediate course, and the lesson on writing your own drivers:
Best regards,
Edvin