Exercise 3

Modifying the devicetree

In this exercise, we will customize our device’s devicetree, specifically in this application by changing the baudrate at which information is sent to the console.

1. Create an overlay file in the application directory (the same location as CMakeLists.txt and prj.conf) with the name of the board you’re using, in our case nrf52833dk_nrf52833.overlay.

2. We want to change the baud rate for the UART instance used when printing to console, which is UART0. The baud rate is the property current-speed in the nrf-uart, which is defined and specified in nrf-uart-common.yaml lines 16-38. Add the following to the overlay file to change this property

&uart0 {
	current-speed = <9600>;
};

3. Build and flash the sample to the board and observe that the resulting log output is gibberish.

4. Change the speed in your terminal emulator to match the speed set in the overlay file, 9600 bps. Now the

Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.