This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Building a custom board in VS Code for nRF9160, and getting an error

I'm trying to build a custom board in VS Code to use with the nRF9160. I'm using a Thingy91, so I took the board file for that, and copied it into the project directory. (the board file I copied from is from C:\Users\<USERNAME>\ncs\v1.9.1\nrf\boards\arm\thingy91_nrf9160). The project I'm using is the AWS_IoT sample from Nordic.

I then renamed all the files so that "thingy91" was just replaced with "NCB". I followed all instructions that were in the Q&A (https://devzone.nordicsemi.com/f/nordic-q-a/68856/how-to-create-a-custom-board-for-nrf9160) and I followed the directions exactly as detailed in the webinar (https://webinars.nordicsemi.com/getting-started-with-custom-5).

So the custom board is now "NCB_nrf9160_ns" instead of "thingy91_nrf9160_ns".

I then programmed device using a J-Link.

However, programming the code onto the thingy91, the program fails to run, and I get this message on LTE Link Monitor (the last message with the "cancel startup", the software then stays in a while loop).

*** Booting Zephyr OS build v2.7.99-ncs1 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0xc000
I: Jumping to the first image slot
E: Protect mcuboot flash failed, cancel startup.

How do I get this working?

Thank you.

  • After moving the ncb_nrf9160.conf file into the child_image directory, the original problem happens again ("Protect mcuboot flash failed, cancel startup.").

    Also, I'm not sure if it's related, but I noticed there's one additional file I have that isn't in your list: boards/arm/ncb_nrf9160/nrf52840_reset.c.

  • JonnyMN said:
    Also, I'm not sure if it's related, but I noticed there's one additional file I have that isn't in your list: boards/arm/ncb_nrf9160/nrf52840_reset.c.

    No, this is fine if you have in your folder. Should not affect the message you get. 

    JonnyMN said:
    After moving the ncb_nrf9160.conf file into the child_image directory, the original problem happens again ("Protect mcuboot flash failed, cancel startup.").

    Sorry, you need to rename it to child_image\mcuboot.conf

    Let me know how that works for you. Remember to do a pristine build.

Related