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...

  • I was able to reproduce the issue, and observe the following log from TF-M

    FATAL ERROR: Platform external interrupt (IRQn): 0x00000003
    Platform Exception: SPU Fault
    

    When I remove everything but the CONFIG_MODBUS and CONFIG_BOOTLOADER_MCUBOOT I also get this error.

    The error is specifc for your boards build target, and not for the nRF9160dk.

    Here is the modified project:

    azure_iot_hub_2_urd.zip

    When I put your board inside the project like that, you can build it from the project by selecting the board in VS Code from "Custom boards".

    This is as far as I go now.
    Next up, you should compare board files for nRF9160DK and your custom board until you find which difference causes the issue.

  • I had to leave the problem for a while.Now I'm back and really needs this device to run.

    Since it seems that it is the board configuration, I restarted with a new copy of the nrf9160_dk_nrf9160 board, and slowly adopted to my hardware, removing unused declarations and adding new.

    I am testing on the nrf9160_dk hardware.

    When I introduce uart2 in the dts file the applications fails.

     The difference betwwen an application running or not running is this dts statement: When this is added application wont run.

    &uart2 {
        status = "okay";
        current-speed = <9600>;
        pinctrl-0 = <&uart_rs485_default>;
        pinctrl-1 = <&uart_rs485_sleep>;
        pinctrl-names = "default", "sleep";
    };

    The application fails to start hanging in an assertion. I will fail in this function on the first ASSERT_HIGH (this is from uarts_stdout.c):
    void stdio_init(void)
    {
        int32_t ret;
        ret = STDIO_DRIVER.Initialize(NULL);
        ASSERT_HIGH(ret);

        ret = STDIO_DRIVER.PowerControl(ARM_POWER_FULL);
        ASSERT_HIGH(ret);
    The application I am running is without any modifications to the sample, except configuration values for DPS. I am running same application with nrf9160_dk_nrf9160 board and my modified version of the same.
  • I have made a demonstration of the problem in the attached project. Im on version 2.6.1 of SDK and toolchain.

    This only requires a nRF9160_DK board.

    The project have two build versions. One is the original nrf9160_dk_nrf9160 board configuration. The other is the one that I have made from a copy. I have removed declaration of I/O I do not need. 

    In the attached version both builds will run and connect to the network.

    pmi8004a2_nrf9160.zip

    PMI8004c.zip

    But in the pmi8004a2_nrf9160 board, the file pmi8004a2_nrf9160_common.dtsi contains an outcommented declation of uart2 as described above.

    If this declaration is reintroduced, the application will not run. 

    Any change that you can take a look?

  • Here is a guess:

    https://infocenter.nordicsemi.com/topic/ps_nrf9160/memory.html?cp=2_1_0_3_1_1#topic

    UART2 has ID10. You cannot use peripherals with the same ID at the same time.
    Make sure you do not have any of the other ID 10.

    Thomas said:
    &uart2 {
        status = "okay";
        current-speed = <9600>;
        pinctrl-0 = <&uart_rs485_default>;
        pinctrl-1 = <&uart_rs485_sleep>;
        pinctrl-names = "default", "sleep";
    };

    Try to remove everything but the status, does that still crash stuff?

    Try to set this to "disabled", does that crash stuff?

  • Same happens if I change the declaration to be &uart1 {...
    I have checked the ID, it is spi and twi that uses ID 10, I am not using any of these...

Related