[nRF Connect SDK]Assert while build after upgrading NCS2.0

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v2.0.0

I could build with NCS v1.9.1 but I cannot build with NCS2.0

[Build log]
In file included from C:/NCS200/v2.0.0/zephyr/include/zephyr/toolchain.h:50,
from C:/NCS200/v2.0.0/zephyr/include/zephyr/sys/errno_private.h:10,
from C:/NCS200/v2.0.0/zephyr/lib/libc/minimal/include/errno.h:32,
from C:/NCS200/v2.0.0/zephyr/include/zephyr/drivers/uart.h:23,
from C:/NCS200/v2.0.0/zephyr/drivers/serial/uart_nrfx_uarte.c:11:
c:\ncs200\v2.0.0\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:229:2: error: static assertion failed: "/soc/uart@40002000 has legacy *-pin properties defined although PINCTRL is enabled"
229 | BUILD_ASSERT(!IS_ENABLED(CONFIG_PINCTRL) || \
| ^~~~~~~~~~~~
C:/NCS200/v2.0.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2053:2: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
2053 | NRF_DT_CHECK_PIN_ASSIGNMENTS(UARTE(idx), 1, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/NCS200/v2.0.0/zephyr/drivers/serial/uart_nrfx_uarte.c:2143:1: note: in expansion of macro 'UART_NRF_UARTE_DEVICE'
2143 | UART_NRF_UARTE_DEVICE(0);
| ^~~~~~~~~~~~~~~~~~~~~

I read some articles in Nordic, but I cannot understand what made this issue.
Can you please help me?
I attached prj.conf and overlay for HW.

5164.peripheral_hids_keyboard.zip

Parents
  • Hi,

    In Migration notes for nRF Connect SDK v2.0.0 you can see that a new pin control API was introduced in Zephyr v3.0.0. There is a guide on how to migrate to the new pin control mechanism in the Pin Control documentation.

    In your case you need to change the pins in uart0 so that you instead have the following:

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

    Then you must add nodes with the pin configurations:

    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 14)>,
    				<NRF_PSEL(UART_RX, 0, 13)>,
    				<NRF_PSEL(UART_RTS, 0, 17)>,
    				<NRF_PSEL(UART_CTS, 0, 16)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 14)>,
    				<NRF_PSEL(UART_RX, 0, 13)>,
    				<NRF_PSEL(UART_RTS, 0, 17)>,
    				<NRF_PSEL(UART_CTS, 0, 16)>;
    			low-power-enable;
    		};
    	};
    };

    Make sure that pinctrl is enabled (CONFIG_PINCTRL=y). It should be enabled by default in the boards defconfig file in the Zephyr SDK in v2.0.0 (zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832_defconfig).

    Best regards,

    Marte

  • Thank you! it works.

    I could update NCS 2.0 with those changes
    1. include path <zephyr/ >: many of paths are changed.
    2. add pinctrl changes at app.overlay

Reply Children
No Data
Related