code flashed in nrf52840 dk board but not executing its task for any code

i am using vs code for programing and flashing the code.

I have previously run all led blinking code, printing code in serial monitor  given by nordic academy then board inbuilt led`s were blinking and successfully printing on com port as per code written. the last code i performed in nrf52840 dk board successfully was uart communication code (https://github.com/NordicDeveloperAcademy/ncs-fund/blob/main/v2.x.x/lesson5/fund_less5_exer1_solution/src/main.c) for that the physical connection was:-

nrf52840 dk        USB_to_serial

po.06                   RX

po.08                   TX

Po.00                   GND

As nrf52840 dk has two uart interface uart0 and uart1 that`s why i just wanted to check that uart1 is also working or not so to do that i just replaced uart1 in place of uart0. for referance i have attached below image also.

and  flashed the program in board but led`s were not blinking on sending 0,1,2,3from uart interface (USB_to_serial interface).

[ here i have done one wrong thing that i didn`t change the physical pin connection for uart1]

to confirm that is there any thing wrong with that code , i ran the simple led blinking code ( which was from nordic academy ) but nothing was happening .

so i uploaded other sample code but in response nothing was happening.

so the problem is that code is uploading successfully but not executing . i don`t  why this happening , is it stuck in any mode.

( link for code which i used all of them were fro here https://github.com/NordicDeveloperAcademy/ncs-fund/tree/main/v2.x.x).

Parents Reply Children
  • Hi, 

    You need nRF52840dk_nrf52840.overlay to overwrite the device tree to use uart1:

    /*
     * Copyright (c) 2021-2023 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
     */
    
    &uart1 {
    	status = "okay";
    	pinctrl-0 = <&uart1_default_alt>;
    	pinctrl-1 = <&uart1_sleep_alt>;
    	pinctrl-names = "default", "sleep";
    };
    
    &uart0 {
    	pinctrl-0 = <&uart0_default_alt>;
    	pinctrl-1 = <&uart0_sleep_alt>;
    	pinctrl-names = "default", "sleep";
    };
    
    &zephyr_udc0 {
    	cdc_acm_uart0: cdc_acm_uart0 {
    		compatible = "zephyr,cdc-acm-uart";
    	};
    };
    
    &pinctrl {
    	uart1_default_alt: uart1_default_alt {
    		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)>;
    		};
    	};
    
    	uart1_sleep_alt: uart1_sleep_alt {
    		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;
    		};
    	};
    
    	uart0_default_alt: uart0_default_alt {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>,
    				<NRF_PSEL(UART_TX, 1, 2)>;
    		};
    	};
    
    	uart0_sleep_alt: uart0_sleep_alt {
    		group1 {
    			psels = <NRF_PSEL(UART_RX, 1, 1)>,
    				<NRF_PSEL(UART_TX, 1, 2)>;
    			low-power-enable;
    		};
    	};
    
    };
    
    / {
    	chosen {
    		ncs,zigbee-uart = &uart1;
    	};
    };

    Here is my test project fund_less5_exer1_solution_uart1.7z for NCS v2.3.0.

    Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.

    -Amanda H.

  • Thank you  for your time .

    My problem is solved and now my 52840 dk board working properly. Actually there was problem of pin conflict so i just deleted installed toolchain and sdk 2.3.0 files and again installed everything from nrf connect for desktop.

Related