I have an nRF5340 DK board. I have followed the online installation instructions and *believe* I have successfully installed (win 10) nRF Connect and Segger Embedded Studio (not to mention chocolatey, ninja, python, west, and all the rest). I can build and flash from either west and SES. I can execute any number of the sample programs.
As a next step, I want to add new hardware interfaces to an example. The example I chose the zephyr\samples\threads. Following the "nRF Connect SDK Tutorial - Part 2" I created a local project and got it running. To add a new HW interface I decided to add uart1 (I need use a uart to talk to another board) . Here's some code.
static int uart_init(void)
{
int err;
struct uart_data_t *rx;
uart1_device = device_get_binding(DT_LABEL(DT_NODELABEL(uart1)));
if (!uart1_device) {
printk("UART binding failed");
return -ENXIO;
}
My program always hits the "UART binding failed" case above. This is almost certainly because I don't understand how all of this device tree stuff works and how to configure it. Reading the "Part 2 Tutorial", I thought that maybe I could just add a local overlay file and put the following text in it:
&uart1 {
status = "okay";
current-speed = <115200>;
rx-pin = <44>;
tx-pin = <45>;
/delete-property/ rts-pin;
/delete-property/ cts-pin;
};
This didn't seem to work...nor did anything else I tried. Maybe I need to edit the Kconfig. Or the prj.conf. Or dts file. Or dtsi file.
Nordic has walkthroughs for modifying sample applications - developer.nordicsemi.com/.../gs_modifying.html
...but these all seem to guide me right to the point where I'm ready to configure my example for new hardware interfaces...and go no further.
I've tried reading the documentation for the device tree and in any practical sense, I am still profoundly ignorant of how this all works. I get that Nordic is doing this because it allows Zephyr to run on many different hardware platforms....which is cool. It is also very confusing ...not so cool.
Question: What am I doing wrong? Is there a better tutorial that shows real examples of how to change the device tree to enable/disable all the various HW interfaces on the DK?
MikeB