NRF Connect example on custom board

My board has some leds and buttons managed by same pins of nrf52833dk (PCA10100 board).

I programmed my custom board with examples\peripheral\blinky_freertos\hex\blinky_FreeRTOS_pca10100.hex

from nRF5_SDK_for_Thread_and_Zigbee SDK, and led blinks as expected.

I then programmed my board with v2.2.0\zephyr\samples\basic\blinky\build\zephyr\zephyr.hex

from nRF Connect 2.2.0

with commands

west build -b nrf52833dk_nrf52833 --pristine

west flash

but now led doesn't blink and also program seems not work at all.

 

Both examples work fine with nrf52833dk.

Does nRF Connect examples requires additional settings respect nRF5 SDK ?
Thanks

Best Regards

Parents
  • Hi Roberto,

    The command west build -b nrf52833dk_nrf52833 is specifically to build on the nRF52833DK. But since you are building on a different build_target (board), you should specify it's name. Please refer the building and running guide for the nRF Connect SDK.

    Best Regards,

    Priyanka

  • As a first test I found that blinky_FreeRTOS_pca10100.hex works fine also for my board, so it seems hw is OK.

    I've already modified DB dts for my board, tast_nrf52833.dts is as follow

    /*
     * Copyright (c) 2019 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    /dts-v1/;
    #include <nordic/nrf52833_qiaa.dtsi>
    #include "tast_nrf52833-pinctrl.dtsi"
    
    / {
    	model = "Nordic TAST NRF52833";
    	compatible = "nordic,tast-nrf52833";
    
    	chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,bt-mon-uart = &uart0;
    		zephyr,bt-c2h-uart = &uart0;
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    //		zephyr,ieee802154 = &ieee802154;
    	};
    
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
    			label = "Green LED 0";
    		};
    		led1: led_1 {
    			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
    			label = "Green LED 1";
    		};
    		led2: led_2 {
    			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
    			label = "Green LED 2";
    		};
    		led3: led_3 {
    			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
    			label = "Green LED 3";
    		};
    	};
    
    //	pwmleds {
    //		compatible = "pwm-leds";
    //		pwm_led0: pwm_led_0 {
    //			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
    //		};
    //	};
    
    	buttons {
    		compatible = "gpio-keys";
    //		button0: button_0 {
    //			gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 0";
    //		};
    //		button1: button_1 {
    //			gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 1";
    //		};
    //		button2: button_2 {
    //			gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 2";
    //		};
    		button3: button_3 {
    			gpios = <&gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Push button switch 3";
    		};
    	};
    
    	/* These aliases are provided for compatibility with samples */
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		led3 = &led3;
    //		pwm-led0 = &pwm_led0;
    //		sw0 = &button0;
    //		sw1 = &button1;
    //		sw2 = &button2;
    		sw3 = &button3;
    		bootloader-led0 = &led0;
    //		mcuboot-button0 = &button0;
    		mcuboot-led0 = &led0;
    //		watchdog0 = &wdt0;
    	};
    };
    
    &gpiote {
    	status = "okay";
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    arduino_serial: &uart1 {
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart1_default>;
    	pinctrl-1 = <&uart1_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    
    &flash0 {
    
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x00000000 0xC000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0x0000C000 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x0003E000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x00070000 0xA000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x0007A000 0x00006000>;
    		};
    	};
    };
    

    and tast_nrf52833-pinctrl.dtsi is

    /*
     * Copyright (c) 2022 Nordic Semiconductor
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    			bias-pull-up;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>;
    			bias-pull-up;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_TX, 1, 2)>;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>,
    				<NRF_PSEL(UART_TX, 1, 2)>;
    			low-power-enable;
    		};
    	};
    
    };
    

    Led 0, 1, 2 and Button 3 are managed by the same pin of nrf52833dk.

    So, what is wrong ?

    Thank you

Reply
  • As a first test I found that blinky_FreeRTOS_pca10100.hex works fine also for my board, so it seems hw is OK.

    I've already modified DB dts for my board, tast_nrf52833.dts is as follow

    /*
     * Copyright (c) 2019 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    /dts-v1/;
    #include <nordic/nrf52833_qiaa.dtsi>
    #include "tast_nrf52833-pinctrl.dtsi"
    
    / {
    	model = "Nordic TAST NRF52833";
    	compatible = "nordic,tast-nrf52833";
    
    	chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,bt-mon-uart = &uart0;
    		zephyr,bt-c2h-uart = &uart0;
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    //		zephyr,ieee802154 = &ieee802154;
    	};
    
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
    			label = "Green LED 0";
    		};
    		led1: led_1 {
    			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
    			label = "Green LED 1";
    		};
    		led2: led_2 {
    			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
    			label = "Green LED 2";
    		};
    		led3: led_3 {
    			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
    			label = "Green LED 3";
    		};
    	};
    
    //	pwmleds {
    //		compatible = "pwm-leds";
    //		pwm_led0: pwm_led_0 {
    //			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
    //		};
    //	};
    
    	buttons {
    		compatible = "gpio-keys";
    //		button0: button_0 {
    //			gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 0";
    //		};
    //		button1: button_1 {
    //			gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 1";
    //		};
    //		button2: button_2 {
    //			gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    //			label = "Push button switch 2";
    //		};
    		button3: button_3 {
    			gpios = <&gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Push button switch 3";
    		};
    	};
    
    	/* These aliases are provided for compatibility with samples */
    	aliases {
    		led0 = &led0;
    		led1 = &led1;
    		led2 = &led2;
    		led3 = &led3;
    //		pwm-led0 = &pwm_led0;
    //		sw0 = &button0;
    //		sw1 = &button1;
    //		sw2 = &button2;
    		sw3 = &button3;
    		bootloader-led0 = &led0;
    //		mcuboot-button0 = &button0;
    		mcuboot-led0 = &led0;
    //		watchdog0 = &wdt0;
    	};
    };
    
    &gpiote {
    	status = "okay";
    };
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    arduino_serial: &uart1 {
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart1_default>;
    	pinctrl-1 = <&uart1_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    
    &flash0 {
    
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x00000000 0xC000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0x0000C000 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x0003E000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x00070000 0xA000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x0007A000 0x00006000>;
    		};
    	};
    };
    

    and tast_nrf52833-pinctrl.dtsi is

    /*
     * Copyright (c) 2022 Nordic Semiconductor
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    			bias-pull-up;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 8)>,
    				<NRF_PSEL(UART_RTS, 0, 5)>,
    				<NRF_PSEL(UART_CTS, 0, 7)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>;
    			bias-pull-up;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_TX, 1, 2)>;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>,
    				<NRF_PSEL(UART_TX, 1, 2)>;
    			low-power-enable;
    		};
    	};
    
    };
    

    Led 0, 1, 2 and Button 3 are managed by the same pin of nrf52833dk.

    So, what is wrong ?

    Thank you

Children
Related