Problem bringing up custom board with custom board file

On a new board based on nRF9160 I am having trouble figuring out how to bring up the board.

I am using Azure IoT hub and can successfully build an application that can connect using the nRF9160DK_NRF9160 Non Secure board files. This is working both on the DK board and on my custom hardware board.

I have copied the nRF9160DK_NRF9160 board to my own board and renamed files and definitions to match my own board.

I can see that when using the DK board package I get a nrf9160dk_nrf9160_ns.conf file with some configuration that I do not find I my board files. I have copied these definitions into my prj.conf file.

When debugging my board using my custom board files (NS) I get this output on J-Link RTT:

00> *** Booting nRF Connect SDK v3.5.99-ncs1 ***
00> I: Starting bootloader
00> I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
00> I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
00> I: Boot source: none
00> I: Image index: 0, Swap type: none
00> I: Bootloader chainload address offset: 0x10000
00> I: Jumping to the first image slot

But when using the board definition for nRF9160DK_NRF9160 Non Secure I get this:

00> *** Booting nRF Connect SDK v3.5.99-ncs1 ***
00> [00:00:16.895,935] <inf> azure_iot_hub_sample: Azure IoT Hub sample started
00> [00:00:16.895,965] <inf> azure_iot_hub_sample: Bringing network interface up and connecting to the network
00> [00:00:17.124,908] <inf> nrf_modem_lib_trace: Trace thread ready

.... connecting and running.

What am I missing for my own board definition. I am working in the same project file with just the above two build definitions...

  • If I remove everything except status I am unable to compile. The pinctrl-0 is required.

    devicetree error: 'pinctrl-0' is marked as required in 'properties:' in C:/ncs/v2.6.1/zephyr/dts/bindings\serial\nordic,nrf-uarte.yaml, but does not appear in <Node /soc/peripheral@40000000/uart@a000 in 'C:/ncs/v2.6.1/zephyr/misc/empty_file.c'>

  • If i set the uart2 to status disabled, the application will run and connect.

    &uart2 {
        status = "disabled";
    };
  • Could it be related to the use of Segger RTT. In the project I really do not want to use any uart for console or logging. But since uarts kept on causing problems, I have kept uart0.

    I have the following in prj.conf that shoud stop console on uart and use RTT instread.

    # Logging
    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_NRF_MODEM_LIB_TRACE=n
  • The problem that I am stuck at, seems to be that the function stdio_uart() are called more than one time as soon as I declare more that one uart. It does not matter if it is uart1 or uart2 that are added.

    Both call are initializeing uart0

    I have just tried to swap the usage of uart0 and uart2, same result still an assertion.

    This ASSERT in line 94 of uart_stdout.c is causing the problem, the error is NRFX_ERROR_INVALID_STATE returned internally by nrtx_uarte_init().

    Both calls to stdio_uart() are initializing uart0.... through the Driver_USART.c module.

  • The problem that I am stuck at, seems to be that the function stdio_uart() are called more than one time as soon as I declare more that one uart. It does not matter if it is uart1 or uart2 that are added.

    Both call are initializeing uart0

    I have just tried to swap the usage of uart0 and uart2, same result still an assertion.

    This ASSERT in line 94 of uart_stdout.c is causing the problem, the error is NRFX_ERROR_INVALID_STATE returned internally by nrtx_uarte_init().

    Both calls to stdio_uart() are initializing uart0.... through the Driver_USART.c module.

    Looking on the call stack. 

    The first call is comming from main().
    But the second call is originating from SPU_IRQHandler() through dump_error....

Related