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

9160 MCUBoot external flash second slot

I've been referencing these two tickets pretty closely How to specify signing the key with MCUBoot - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com) and MCUBoot’s secondary image on external flash on nrf9160 - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com) to accomplish this task. I'm using NCS v1.7.0 on a custom board. I still run into errors when MCUBoot is running (I modified MCUBoot slightly but was experiencing the issue before this): 

*** Booting Zephyr OS build v2.6.99-ncs1  ***
00> 
00> gpio_dev 0xa0b4 setting pin 4 high
00> 
00> [00:00:00.257,476] <inf> mcuboot: Starting bootloader
00> NRF_FLASH_DRV_NAME flash dev 0xa0cc
00> 
00> [00:00:00.257,781] <wrn> mcuboot: Failed reading sectors; BOOT_MAX_IMG_SECTORS=1024 - too small?
00> [00:00:00.257,812] <err> os: ***** MPU FAULT *****
00> [00:00:00.257,812] <err> os:   Instruction Access Violation
00> [00:00:00.257,843] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x2001497c[0m
00> [00:00:00.257,843] <err> os: r3/a4:  0x00000020 r12/ip:  0xfef7f9b5 r14/lr:  0x00000f6b
00> [00:00:00.257,843] <err> os:  xpsr:  0x69100000
00> [00:00:00.257,873] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
00> [00:00:00.257,873] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
00> [00:00:00.257,873] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
00> [00:00:00.257,904] <err> os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
00> [00:00:00.257,904] <err> os: fpscr:  0x0000a0cc
00> [00:00:00.257,904] <err> os: Faulting instruction address (r15/pc): 0xfef7f9b4
00> [00:00:00.257,904] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
00> [00:00:00.257,904] <err> os: Current thread: 0x20014880 (unknown)
00> [00:00:00.808,502] <err> fatal_error: Resetting system
00> [00:00:00.252,288] <err> spi_nor: Device id 00 00 00 does not match config c2 20 16

I've triple checked everything and I've yet to make any progress. Are there any known issues surrounding what I'm trying to attempt? I saw https://github.com/nrfconnect/sdk-mcuboot/pull/200 in the second ticket; however after reading the PR it seems to be a non-issue.

  • Hi,

     

    esisk said:
    I figured that it was failing because the spi_nor driver was not being enabled in my non-secure application. Once I copied the same configuration variables from my {board_name}.conf file used for MCUBoot into a {board_name_ns}.conf file, the library initialized successfully and I could remotely update the application. I'll continue to test but my understanding of setting this all has improved and the cryptic root issue I was having has been found.

    I'm glad to hear that you were able to successfully update your application with this configuration!

    esisk said:
    I'd appreciate it Håkon if you could explain to me the difference between a {board_name}.conf file and the normal prj.conf file?

    I'd love to!

    Let's say that you have a generic "external flash" project that you're using as a part of your testing, which you want to run on several devices, like the nRF52840 and nRF9160.

    nRF52840 you'd want to configure to use QSPI, and nRF9160 you'd want to configure to use SPI.

     

    In the prj.conf, you setup the common CONFIG_ entries, while in the boards/$my_board.conf (and $my_board.overlay), you setup each individual configuration and hardware setup, ie. QSPI for 52840 and SPI for 9160.

    The source code looks similar and the firmware shall run similar on both devices, but the transport layer (and pin configuration) will be different.

     

    Kind regards,

    Håkon

Related