[Solved] Unable to flash FastLED to third Photon

Hi, I have three Photons, each running a different LED solution (Neopixel strip, Neopixel stick and Neopixel ring). The first two photons can be flashed with the FastLED library, but the third one won’t flash or verify.

I’ve tested it with existing code, example code and even a blank .ino with only setup, update and #include “FastLED.h”.

This is the stack trace, and I’m no expert but it seems it’s trying to call the library twice or that there somehow already exists a library? Only my third and latest Photon have this issue.

Processing  /workspace/ledtest.ino
Checking library FastLED...
Installing library FastLED 3.1.5 to /workspace/lib/FastLED ...
Library FastLED 3.1.5 installed.
make -C ../modules/photon/user-part all
make[1]: Entering directory '/firmware/modules/photon/user-part'
make -C ../../../user 
make[2]: Entering directory '/firmware/user'
Building cpp file: /workspace//src/ledtest.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-6-m/workspace/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 -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=6 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DPARTICLE_NO_ARDUINO_COMPATIBILITY=0 -DSYSTEM_VERSION_STRING=0.6.1-rc.2 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -I/workspace//src -I./libraries -I/workspace//src -I/workspace//src -I/workspace//src -I/workspace//src -I/workspace/lib/FastLED/src -I. -MD -MP -MF ../build/target/user/platform-6-m/workspace/src/ledtest.o.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 -DSPARK_PLATFORM_NET=BCM9WCDUSI09 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSE_THREADING=0 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_SPI=SPI -DUSE_CS=A2 -DUSE_THREADING=0 -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=4 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,104 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/user/platform-6-m/workspace/src/ledtest.o /workspace//src/ledtest.cpp
In file included from /workspace//src/ledtest.cpp:1:0:
/workspace/lib/FastLED/src/FastLED.h:12:2: warning: #warning FastLED version 3001000 (Not really a warning, just telling you here.) [-Wcpp]
 #warning FastLED version 3001000  (Not really a warning, just telling you here.)
  ^
In file included from /workspace/lib/FastLED/src/led_sysdefs.h:16:0,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
/workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:26:0: warning: "cli" redefined [enabled by default]
 #define cli()  __disable_irq(); __disable_fault_irq();
 ^
In file included from ./inc/application.h:92:0,
                 from /workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:4,
                 from /workspace/lib/FastLED/src/led_sysdefs.h:16,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
../wiring/inc/spark_wiring_arduino.h:141:0: note: this is the location of the previous definition
 #define cli() (void)HAL_disable_irq()
 ^
In file included from /workspace/lib/FastLED/src/led_sysdefs.h:16:0,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
/workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:27:0: warning: "sei" redefined [enabled by default]
 #define sei() __enable_irq(); __enable_fault_irq();
 ^
In file included from ./inc/application.h:92:0,
                 from /workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:4,
                 from /workspace/lib/FastLED/src/led_sysdefs.h:16,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
../wiring/inc/spark_wiring_arduino.h:136:0: note: this is the location of the previous definition
 #define sei() HAL_enable_irq(0)
 ^
In file included from /workspace/lib/FastLED/src/led_sysdefs.h:16:0,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
/workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:36:32: error: conflicting declaration 'typedef volatile uint8_t RwReg'
 typedef volatile       uint8_t RwReg; /**< Read-Write 8-bit register (volatile unsigned int) */
                                ^

In file included from ./inc/application.h:92:0,
                 from /workspace/lib/FastLED/src/led_sysdefs_arm_stm32.h:4,
                 from /workspace/lib/FastLED/src/led_sysdefs.h:16,
                 from /workspace/lib/FastLED/src/FastLED.h:34,
                 from /workspace//src/ledtest.cpp:1:
../wiring/inc/spark_wiring_arduino.h:153:27: error: 'RwReg' has a previous declaration as 'typedef volatile uint32_t RwReg'
 typedef volatile uint32_t RwReg;
                           ^

../build/module.mk:267: recipe for target '../build/target/user/platform-6-m/workspace/src/ledtest.o' failed
make[2]: Leaving directory '/firmware/user'
make[2]: *** [../build/target/user/platform-6-m/workspace/src/ledtest.o] Error 1
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: *** [user] Error 2
make[1]: Leaving directory '/firmware/modules/photon/user-part'
../build/recurse.mk:11: recipe for target 'modules/photon/user-part' failed
make: *** [modules/photon/user-part] Error 2

Building is not really dependent on the device. So you should be able to build either project for any of your devices. Only OTA flashing will require a specific device to be selected.
So if one project builds for one Photon but not for another I guess the problem is actually the system version you have selected as target for that Photon and not the Photon as such.

To select a different version you need to tap the “>” icon next to the device name and select e.g. 0.6.0

See here
https://docs.particle.io/guide/getting-started/build/photon/#flashing-your-first-app
Especially “Select Your Device” and “Device details”

1 Like

Thanks for the reply, all devices are running 0.6.1-rc.2. I’m not sure what the actual issue is, but the third Photon flashes with say the Neopixel library, or Tinker. The first two devices are able to verify the code with FastLED, but the third one throws the above error for the same source code as used on the first two. I’m really puzzled.

Again, when you say “verify the code” it is absolutely irrelevant what Photon you’ve got selected.
So just “verify” - better use the term “build” - your code for one of the working Photons and then flash to the other one.

BTW, how do you build and flash?

1 Like

Sorry I should have been more specific. I’m using the cloud IDE. There are three options, Save, Verify and Flash. It appears that Verify does a build of the code on the device specified but doesn’t actually flash it to the device.

To summarise:

I have three photons, all on the same version of the firmware (0.6.1-rc.2). Using the Cloud IDE I’m able to build the same program to two of them, but the third gets the above error.

If you are using Web IDE and the selected device makes a difference then you need to check the target firmware selected in Web IDE the way I already described above.
Again it is absolutely irrelevant what version the targeted device has installed on the hardware - only the software setting in Web IDE makes the difference - believe me!

1 Like

I feel a bit daft now, but changing the target firmware to 0.6.0 made the device flash with no issues. I had target firmware set to 0.6.1-rc.2, the same as the firmware on the device. What’s the difference between target firmware and firmware on the device? Because it can’t flash down in versions, the firmware on the device is still 0.6.1-rc.2, yet it works.

The firmware on your device consists of multiple modules.

  • bootloader
  • 2 or 3 system modules (like an OS)
  • application module

Target version is the version your application firmware will be aimed for.
The installed system version only applies to the system modules.

In order to have an app module run on a device the system modules need to be of same or higher version. Thus a 0.6.0 app will happily run on a 0.6.1-rc.2 system. but not the other way round.

2 Likes

Thank you so much for solving the issue and the great explanation on the firmware versions.

2 Likes