I (unfortunately) had to make my own forks of Zephyr and NRF to get around a build issue, and decided to implement a west.yml manifest in my application repository. I made this change, then re-ran "west init" and "west update" in a new working directory to download new git clones of everything. I updated my ZEPHYR_BASE environment variable, and was able to build with "west build -b nrf9160_pca10090ns ." in the new directory just fine, but when I load the application with "west flash -d build" it stops after MCUBoot with this:
***** Booting Zephyr OS v1.14.99-ncs1-1076-g582aa88991ba ***** [00:00:00.006,744] <inf> mcuboot: Starting bootloader [00:00:00.015,167] <inf> mcuboot: Primary image: magic=unset, copy_done=0x3, image_ok=0x3 [00:00:00.026,458] <inf> mcuboot: Scratch: magic=unset, copy_done=0x50, image_ok=0x3 [00:00:00.037,139] <inf> mcuboot: Boot source: primary slot [00:00:00.048,248] <inf> mcuboot: Swap type: none [00:00:00.054,992] <err> mcuboot: Unable to find bootable image
I've spent all morning double and triple-checking that there are no differences between the old and new directory trees. I've done "git clean -dxf" followed by recursive diffs, and found nothing different (outside of the .git directories). The exact tag/reference names being used to check out some directories differ between the two, but the commit hashes are the same on both.
I checked the environment variables before each build to ensure that wasn't an issue. (I learned that running zephyr-env.sh adds a script directory to the path, so if you re-use the same shell instance for builds in different Zephyr base directories you will likely be using the wrong script directory. But that wasn't my issue...)
I compared the build/zephyr/.config output between each directory, and found no differences other than ordering.
I captured a full "west build" output of a fresh build from each directory. I searched both to make sure neither ever mentioned the other directory. I edited out the differences I could explain (search-and-replace directory paths, remove ninja step numbers) and then ran a diff on the sorted outputs of both logs. It found only 2 things different:
- The size of the FLASH region reported when linking zephyr/zephyr_prebuilt.elf *decreased* by 340 bytes in the new version.
- When merging zephyr/mcuboot_primary_app.hex it did not include spm/zephyr/zephyr.hex in the new version (but did in the old)
I'm still digging, trying to find why the merge dependency changed. I'm guessing it is my issue since mcuboot could be looking in the wrong place or at an incomplete image without that hex file included.
If anyone else has ever bumped into this or has any suggestions of places to look, please speak up.