# Photon and syncTime

**URL:** <https://community.particle.io/t/photon-and-synctime/12056>\
**Category:** Troubleshooting\
**Created:** [May 24, 2015, 6:19pm UTC](https://community.particle.io/t/photon-and-synctime/12056 "2015-05-24T18:19:55Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [July 22, 2015, 7:26pm UTC](https://community.particle.io/t/photon-and-synctime/12056/21 "2015-07-22T19:26:38Z")

</div>

Thanks. It looks as though the build was not successful since the CRC was not appended to the file.

Please look for any error messages at the end of the build process.

The way to know is to run

`xxd user-part.bin`

and inspect the last 4 bytes output. If they are `7856 3412` then the CRC has not been correctly written.

---

<div class="post-metadata">

**Author:** ![neo12ibraheem](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@neo12ibraheem](https://community.particle.io/u/neo12ibraheem)\
**Post date:** [July 22, 2015, 7:37pm UTC](https://community.particle.io/t/photon-and-synctime/12056/22 "2015-07-22T19:37:33Z")

</div>

Thanks @mdma,

This is the build output from NeatBeans:

```
C:/Particle/toolchain/Make/bin/make -C ../modules/photon/user-part 
make[1]: Entering directory `C:/Particle/firmware/modules/photon/user-part'
C:/Particle/toolchain/Make/bin/make -C ../../../user 
make[2]: Entering directory `C:/Particle/firmware/user'
Building file: src/application.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-6-m/src/src/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DSPARK_PLATFORM -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=6 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSPARK_PLATFORM_NET=BCM9WCDUSI09 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=2 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,3 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/lib/tropicssl/include -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/photon/api -I../platform/shared -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/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../dynalib/inc -I./src -I./libraries -I. -MD -MP -MF ../build/target/user/platform-6-m/src/src/application.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -std=gnu++11 -fno-exceptions -fno-rtti -fcheck-new -c -o ../build/target/user/platform-6-m/src/src/application.o src/application.cpp

Building target: ../build/target/user/platform-6-m/src/libuser.a
Invoking: ARM GCC Archiver
mkdir -p ../build/target/user/platform-6-m/src/
arm-none-eabi-ar -cr ../build/target/user/platform-6-m/src/libuser.a ../build/target/user/platform-6-m/src/src/application.o

make[2]: Leaving directory `C:/Particle/firmware/user'
C:/Particle/toolchain/Make/bin/make -C ../../../hal-dynalib 
make[2]: Entering directory `C:/Particle/firmware/hal-dynalib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/hal-dynalib'
C:/Particle/toolchain/Make/bin/make -C ../../../services-dynalib 
make[2]: Entering directory `C:/Particle/firmware/services-dynalib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/services-dynalib'
C:/Particle/toolchain/Make/bin/make -C ../../../system-dynalib 
make[2]: Entering directory `C:/Particle/firmware/system-dynalib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/system-dynalib'
C:/Particle/toolchain/Make/bin/make -C ../../../rt-dynalib 
make[2]: Entering directory `C:/Particle/firmware/rt-dynalib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/rt-dynalib'
C:/Particle/toolchain/Make/bin/make -C ../../../wiring 
make[2]: Entering directory `C:/Particle/firmware/wiring'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/wiring'
C:/Particle/toolchain/Make/bin/make -C ../../../communication-dynalib 
make[2]: Entering directory `C:/Particle/firmware/communication-dynalib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/communication-dynalib'
C:/Particle/toolchain/Make/bin/make -C ../../../platform 
make[2]: Entering directory `C:/Particle/firmware/platform'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `C:/Particle/firmware/platform'
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 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=2 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,3 -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/photon/api -I../../../system/inc -I../../../rt-dynalib/inc -I../../../wiring/inc -I../../../modules/photon/system-part1/inc -I../../../platform/shared -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/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 -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -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 --specs=nano.specs -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 -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 -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 --print %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` && \
	../../../build/bin/win32/sha256sum ../../../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 --print %s ../../../build/target/user-part/platform-6-m/user-part.bin.pre_crc` - 38)) conv=notrunc && \
	head -c $((`stat --print %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 --print %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.00122994 s, 26.0 kB/s
/usr/bin/sh: /cygdrive/c/Perl/bin/crc32: /usr/bin/perl: bad interpreter: Permission denied
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000363784 s, 0.0 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
   4596 144 332 5072 13d0	../../../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
make[1]: Leaving directory `C:/Particle/firmware/modules/photon/user-part'

BUILD SUCCESSFUL (total time: 6s)

```

Which shows success, although I can see this, which also suggests CRC:

```
/usr/bin/sh: /cygdrive/c/Perl/bin/crc32: /usr/bin/perl: bad interpreter: Permission denied
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 0.000363784 s, 0.0 kB/s
```

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [July 22, 2015, 7:50pm UTC](https://community.particle.io/t/photon-and-synctime/12056/23 "2015-07-22T19:50:06Z")

</div>

Yep, looks like crc is failing. I see it mentions cygwin in the path - I recommend installing MinGW and using the crc32 from there.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [August 24, 2015, 8:29pm UTC](https://community.particle.io/t/photon-and-synctime/12056/24 "2015-08-24T20:29:21Z")

</div>

Opened an issue for this here -\> [https://github.com/spark/firmware/issues/581](https://github.com/spark/firmware/issues/581)

Thanks,  
David

[Previous page](https://community.particle.io/t/photon-and-synctime/12056.md?page=1)
