Zephyr shell on an nRF52840 board

I'm trying to build a basic shell sample on a custom board based on nRF52840 

In the proj.conf file I have

CONFIG_SHELL=y
CONFIG_SHELL_GETOPT=y 
CONFIG_SHELL_BACKENDS=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_SHELL_ECHO_STATUS=y
I get the following compile error
'__device_dts_ord_DT_CHOSEN_zephyr_shell_uart_ORD' undeclared (first use in this function)
What am I missing?
Thank you
Parents
  • Hi,

    You need to add zephyr,shell-uart  to the chosen node in the devicetree file for your board. You can see an example of how this is done in the devicetree file for nRF52840 DK (zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts):

    / {
    	model = "Nordic nRF52840 DK NRF52840";
    	compatible = "nordic,nrf52840-dk-nrf52840";
    
    	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;
    	};

    Best regards,

    Marte

Reply
  • Hi,

    You need to add zephyr,shell-uart  to the chosen node in the devicetree file for your board. You can see an example of how this is done in the devicetree file for nRF52840 DK (zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts):

    / {
    	model = "Nordic nRF52840 DK NRF52840";
    	compatible = "nordic,nrf52840-dk-nrf52840";
    
    	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;
    	};

    Best regards,

    Marte

Children
No Data
Related