Hello Particle community. I hope all are well. I have many machines that are still working just fine that use the Photon microcontroller. I was trying to update their code because the Cloud that they talk to via MQTT has also updated. To my surprise, it would seem I can not compile/flash with the Web IDE or with Particle Workbench (VS Code), like I normally did, or that I normally do now with Argon microcontrollers. It would be unrealistic and expensive to change out all the Photons in my machines for Argons or Photon2s. So, is there still a way to flash to Photons? Thank you.
You can still build for the Photon 1 in the Web IDE, Workbench, and Particle CLI. What error are you getting?
Hello Rick (rickkas7). Firstly, I would like to thank you very much for working during the holiday (at least it’s a holiday in my country).
Let’s focus on Particle Workbench (VS Code) since I usually use it. First, I configure the device. When doing so, I select Photon, then device OS version 3.3.1, which seems to be the latest version available for the Photon, and then I enter the device ID of the Photon. So far so good. Then I try to Cloud compile. It fails with a bunch of stuff in the terminal. However, this is that last part:
/root/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: module info static details not linked
collect2: error: ld returned 1 exit status
make[1]: *** [target/workspace.elf] Error 1
make[1]: Leaving directory `/firmware/modules/photon/user-part'
make: *** [modules/photon/user-part] Error 2
at makeError (c:\\Users\\nasas\\.vscode\\extensions\\particle.particle-vscode-core-1.16.43\\node_modules\\execa\\lib\\error.js:59:11)
at handlePromise (c:\\Users\\nasas\\.vscode\\extensions\\particle.particle-vscode-core-1.16.43\\node_modules\\execa\\index.js:114:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
The first thing I'd try is a Particle: Clean application and Device OS, then try and build the application again.
You could also try a Particle: Cloud compile instead of a local compile and see if that makes a difference.
What version of Device OS are you targeting for the Photon 1?
Hello Rick. I did “Particle: Clean application and Device OS” and then tried to Cloud compile. I am trying to compile for Device OS version 3.3.1, which is what the target Photon currently has and the target Photon is online and connected to Particle. Here is the last bit of the big output error message of the Cloud compile:
Building target: target/workspace.elf
Invoking: ARM GCC C++ Linker
mkdir -p target/
arm-none-eabi-g++ -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DPLATFORM_GEN=2 -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb --specs=nano.specs -DINCLUDE_PLATFORM=1 -fno-builtin -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=3.3.1 -DRELEASE_BUILD -Werror -Wextra -I./inc -I../../../user/inc -I../../../dynalib/inc -I../../../services/inc -I../../../third_party/nanopb/nanopb -I../../../hal/inc -I../../../hal/shared -I../../../hal/src/photon -I../../../hal/src/stm32f2xx -I../../../hal/src/stm32 -I../../../hal/network/util -I../../../hal/network -I../../../hal/src/photon/api -I../../../hal/src/photon/include -I../../../hal/src/photon/wiced/security/BESL/host/WICED/ -I../../../hal/src/photon/wiced/security/BESL/include -I../../../hal/src/photon/wiced/security/BESL -I../../../hal/src/photon/wiced/security/BESL/crypto -I../../../hal/src/photon/wiced/WWD/include/ -I../../../hal/src/photon/wiced/platform/include/ -I../../../hal/src/photon/wiced/platform/GCC/ -I../../../hal/src/photon/wiced/security/BESL/supplicant/ -I../../../hal/src/photon/libraries/crypto -I../../../hal/src/photon/libraries/daemons/DNS_redirect -I../../../third_party/miniz/miniz -I../../../system/inc -I../../../rt-dynalib/inc -I../../../wiring/inc -I../../../modules/photon/system-part1/inc -I../../../modules/shared/stm32f2xx/inc -I../../../platform/shared/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../../../platform/MCU/STM32F2xx/STM32_StdPeriph_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. -MD -MP -MF target/workspace.elf.d -ffunction-sections -fdata-sections -Wall -Wno-switch -fmessage-length=0 -Wno-error=deprecated-declarations -Wno-error=unused-parameter -Wimplicit-fallthrough=2 -Wno-expansion-to-defined -Wno-cast-function-type -Wno-unused-parameter -Wno-error=type-limits -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Werror=return-type -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DBOOTLOADER_SDK_3_3_0_PARTICLE -DPARTICLE_DCT_COMPATIBILITY -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,3302 -DMODULE_DEPENDENCY2=0,0,0 -D_GNU_SOURCE target//obj/src/user_module.o target//obj/src/module_info.o target//obj/src/user_export.o target//obj/src/newlib_stubs.o --output target/workspace.elf -Wl,--whole-archive ../../../hal/src/photon/lib/STM32F2xx_Peripheral_Libraries.a -Wl,--no-whole-archive -nostartfiles -Xlinker --gc-sections -fno-use-cxa-atexit -fno-lto -L../../../build/arm/linker/stm32f2xx -L../../../build/arm/linker/stm32f2xx/photon -L../../../build/target/user/platform-6-m -L../../../build/target/services-dynalib/platform-6-m/ -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../../../build/target/wiring_globals/platform-6-m/ -L../../../hal/src/photon/lib/ -L../../../build/arm/linker -Wl,--whole-archive -luser -lhal-dynalib -lservices-dynalib -lsystem-dynalib -lrt-dynalib -lwiring -lcommunication-dynalib -lplatform -lwiring_globals -Wl,--no-whole-archive -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,target/workspace.map
/root/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: module info static details not linked
collect2: error: ld returned 1 exit status
make[1]: *** [target/workspace.elf] Error 1
make[1]: Leaving directory `/firmware/modules/photon/user-part'
make: *** [modules/photon/user-part] Error 2
at makeError (c:\Users\nasas\.vscode\extensions\particle.particle-vscode-core-1.16.43\node_modules\execa\lib\error.js:59:11)
at handlePromise (c:\Users\nasas\.vscode\extensions\particle.particle-vscode-core-1.16.43\node_modules\execa\index.js:114:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Make sure you do not have a PRODUCT_VERSION() macro in your code. If you do, comment it out.
If you are using product firmware, add a PRODUCT_ID() macro.
You can't have a PRODUCT_VERSION without a PRODUCT_ID or you'll get that (not helpful) error.
Thanks Rick! That solved the issue. What a silly error. I swear, when making a new project, PRODUCT_VERSION was part of the standard template in the past. It’s not anymore (see attached image). So, include the PRODUCT_VERSION and the PRODUCT_ID, or don’t include either. Got it! Thanks again for working during the holiday. I really do appreciate it.
Sorry, I left out that the restriction on requiring PRODUCT_ID only applies to Gen 2 devices. In Device OS 4.x and later (which does not run on Gen 2 devices), PRODUCT_ID is not used at all, so you'd only have PRODUCT_VERSION.
Thank you for the clarification! It was indeed needed.
