Safe mode after building system and app firmware from source

Thanks @mdma on the crc info and module descriptor format (extremely useful and sensible). Based on my original 's' output, it looks like both system-part1, 2 and user image failed CRC checks on the Photon. Would I be correct in assuming that the system is running anyway but the user image is not.

I have checked the tail end of the compile, linker and file preparation but I see no errors in the processing (see below of the user-part linker).

However, on closer inspection I see that the checksum generated by arm-none-eabi-objcopy > *.pre_crc files ends in 7856 3412 which you mentioned in thread Photon and syncTime - #20 by mdma saying that the CRC has not been generated properly (presumably by ..objcopy)

By the looks of things, my Debian install has the required crc32, shasum and stat all working. Any further thoughts. If you feel this is a Debian issue, I am happy to build the recommended Ubuntu box if really needed but AFAICS, this should compile fine on Debian.

Side issue: I am not sure of the purpose of the 'test' command in the Create Flash Image section as it's presumably testing for a bad 'magic checksum number' but the results of the test do not appear to be used to raise an error if the test fails, perhaps leading to my situation.

Thanks
Gary

Building target: ../../../build/target/user-part/platform-6-m/user-part.elf
Invoking: ARM GCC C++ Linker
mkdir -p ../../../build/target/user-part/platform-6-m/
arm-none-eabi-g++ -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DINCLUDE_PLATFORM=1 -fno-builtin -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.4.5-rc.2 -DRELEASE_BUILD -Werror -I./inc -I../../../user/inc -I../../../dynalib/inc -I../../../services/inc -I../../../hal/inc -I../../../hal/shared -I../../../hal/src/photon -I../../../hal/src/stm32f2xx -I../../../hal/src/stm32 -I../../../hal/src/photon/api -I../../../system/inc -I../../../rt-dynalib/inc -I../../../wiring/inc -I../../../modules/photon/system-part1/inc -I../../../platform/shared/inc -I../../../platform/MCU/STM32F2xx/CMSIS/Include -I../../../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../../../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../../../platform/MCU/shared/STM32/inc -I../../../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I. -MD -MP -MF ../../../build/target/user-part/platform-6-m/user-part.elf.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=3 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,6 -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb ../../../build/target/user-part/platform-6-m/src/module_info.o ../../../build/target/user-part/platform-6-m/src/user_export.o ../../../build/target/user-part/platform-6-m/src/user_module.o ../../../build/target/user-part/platform-6-m/src/newlib_stubs.o --output ../../../build/target/user-part/platform-6-m/user-part.elf -Wl,--whole-archive ../../../hal/src/photon/lib/STM32F2xx_Peripheral_Libraries.a -Wl,--no-whole-archive -L../../../build/target/user/platform-6-m/src/ -L../../../build/target/services-dynalib/arm/ -L../../../build/target/hal-dynalib/platform-6-m/ -L../../../build/target/system-dynalib/platform-6-m/ -L../../../build/target/rt-dynalib/platform-6-m/ -L../../../build/target/wiring/platform-6-m/ -L../../../build/target/communication-dynalib/platform-6-m/ -L../../../build/target/platform/platform-6-m/ -L../../../hal/src/photon/lib/ -Wl,--whole-archive -luser -lhal-dynalib -lservices-dynalib -lsystem-dynalib -lrt-dynalib -lwiring -lcommunication-dynalib -lplatform -Wl,--no-whole-archive -L../../../build/arm/linker -lnosys -L../../../modules/photon/system-part2 -L../../../modules/photon/system-part1 -L. -T./linker.ld -Wl,--defsym,USER_FIRMWARE_IMAGE_SIZE=0x20000 -Wl,--defsym,USER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -Wl,-Map,../../../build/target/user-part/platform-6-m/user-part.map -lstdc++_nano -lm -Wl,--start-group -lgcc -lg_nano -lc_nano -Wl,--end-group -Wl,--start-group -lgcc -lc_nano -Wl,--end-group -nostartfiles -Xlinker --gc-sections

Invoking: ARM GNU Create Flash Image
arm-none-eabi-objcopy -O binary ../../../build/target/user-part/platform-6-m/user-part.elf ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc
if [ -s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc ]; then
head -c $((stat -c %s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc - 38)) ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-6-m/user-part.bin.no_crc &&
tail -c 38 ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-6-m/user-part.bin.crc_block &&
test "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20280078563412" = xxd -p -c 500 ../../../build/target/user-part/platform-6-m/user-part.bin.crc_block &&
shasum -a 256 ../../../build/target/user-part/platform-6-m/user-part.bin.no_crc | cut -c 1-65 | xxd -r -p | dd bs=1 of=../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc seek=$((stat -c %s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc - 38)) conv=notrunc &&
head -c $((stat -c %s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc - 4)) ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc > ../../../build/target/user-part/platform-6-m/user-part.bin.no_crc &&
crc32 ../../../build/target/user-part/platform-6-m/user-part.bin.no_crc | cut -c 1-10 | xxd -r -p | dd bs=1 of=../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc seek=$((stat -c %s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc - 4)) conv=notrunc ;
fi
32+0 records in
32+0 records out
32 bytes (32 B) copied, 0.0147744 s, 2.2 kB/s
5+0 records in
5+0 records out
5 bytes (5 B) copied, 0.000497399 s, 10.1 kB/s
[ ! -f ../../../build/target/user-part/platform-6-m/user-part.bin ] || rm ../../../build/target/user-part/platform-6-m/user-part.bin
mv ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc ../../../build/target/user-part/platform-6-m/user-part.bin

arm-none-eabi-objcopy -O ihex ../../../build/target/user-part/platform-6-m/user-part.elf ../../../build/target/user-part/platform-6-m/user-part.hex
arm-none-eabi-size --format=berkeley ../../../build/target/user-part/platform-6-m/user-part.elf
text data bss dec hex filename
4292 152 304 4748 128c ../../../build/target/user-part/platform-6-m/user-part.elf
arm-none-eabi-objdump -h -S ../../../build/target/user-part/platform-6-m/user-part.elf > ../../../build/target/user-part/platform-6-m/user-part.lst