Zephyr v2.0.0 direct_test_mode build error custom nRF528420 board

We have a board that is to be certified by a Chinese test lab, so I need to create an image based on the direct_test_mode sample.

In Zephyr v2.0.0 I created a custom board based on the nrf52840_qiaa.dtsi.

When first building the project I got an error about an undefined pp channel so I add CONFIG_NRFX_PPI=y to the proj.conf file.

e: app/libapp.a(dtm.c.obj): in function `gppi_init':
C:\ncs\MS88SF2_RadioTest\MS88SF2_RadioDirect\src\dtm.c:685: undefined reference to `nrfx_ppi_channel_alloc'

When I tried to build the project again, I get an error which seems to mean that I have not defined something used in the custom board's device tree.

C:\ncs\MS88SF2_RadioTest\MS88SF2_RadioDirect\src\main.c:69: undefined reference to `__device_dts_ord_57'

It does not make any senses line#69.

My dts file:

And my proj.conf fiel:

What am I missing?

Thanks David

  • Sorry yesterday the support site was down. I am uploading again the files. You should be able to reproduce the problem. Now it will not let me upload the file types so i will upload the zipped project...

    I left the build directory since maybe it has a hint of the problem.

    Thanks David

    I left the buildMS88SF2_RadioDirect.zip

  • Hi David,

    The error was due to UART.

    First of all you need to add CONFIG_SERIAL=y to ami_ms88sf2_defconfig in order to enable serial drivers.

    Secondly, the Zephyr version used in nRF Connect SDK v2.0.0 introduced pin control, as you can see in the Migration notes for nRF Connect SDK v2.0.0. There is a pin control guide available in the Zephyr documentation here: Pin control, but what you need to do is to add CONFIG_PINCTRL=y to ami_ms88sf2_defconfig and then make the following changes in ami_ms88sf2.dts:

    Change uart0 to this:

    &uart0 {
        status = "okay";
        current-speed = < 19200 >;
        pinctrl-0 = < &uart0_default >;
        pinctrl-1 = < &uart0_sleep >;
        pinctrl-names = "default", "sleep";
    };

    Then add pinctrl, for example at the bottom of the file, like this:

    &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;
    		};
    	};
    };

    This is only for UART0. If you want to use UART1 as well you must also add that to pinctrl. Since you have not set any pins for UART1 I assume you do not want to use it. In that case you can set the status to "disabled" instead of "okay", because if not you will get errors unless you fix the pinctrl.

    Since you are using nRF52840 you can find how pinctrl is set for other peripherals in zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840-pinctrl.dtsi.

    Best regards,

    Marte

  • Thank you. With your suggested changes everything compiled. 

    Zephyr is an ever changing target, I have to say. It seems every version they changed the power management or redid something entirely.

    I did not think of the serial channel which of course the project uses.

    The make error printed did not give me any useful information.

    Thank you for your quick response.

    The bug report system should allow all project files to be uploaded.

    Thanks David

Related