Hello,
I cloned the spark repository and checked out the branch develop-0.5.x. I put the photon in dfu-util mode and then in firmware/main executed this command.
make clean all -s PLATFORM=photon COMPILE_LTO=n APP=tinker program-dfu MODULAR=n
which is monolithic build. It took a while to flash the code. To confirm my actions I kept the device in listening mode and run particle serial identify.
The firmware version changed to 0.5.3 as expected but the firmware version listed under my device in the particle IDE is still 0.6.1. Maybe it takes time so I checked after a few minutes and it’s still 0.6.1.
Now I wrote a blink LED app and tried:
particle flash --target 0.5.3 myDevice blink.ino
It says,
Flash device OK: Flash requires modules not present on device.
The over-the-air (OTA) flash code requires a modular build, since it only updates the user portion of the firmware. With monolithic build, you can’t do OTA since you would have to OTA the entire image including the part currently reading the firmware. As things are now, if you want monolithic I think you cannot do OTA and must do local build and flash.
The version and monolithic-ness are completely separate. It just means that if you want monolithic builds, you must build on your own computer and flash over USB, not over-the-air. The version number has nothing to do with it.
@dheerajdake, you can only update a monolithic image with another monolithic image as far as I know. So local compile and then flash the resulting image using CLI. This is what happens with the older Core. However, I would ping @mdma, @jvanier to confirm.
Monolithic builds are mostly useful for JTAG debugging these days since you get one file with all symbols in it. The modular build has 2 large files with the system code and 1 usually smaller file with user code so it’s good if you’re trying to save data while flashing over the air.
OTA flash is only supported for modular firmware on the Photon.
Get back to a modular build on your Photon with make clean all program-dfu PLATFORM=photon from the firmware/modules
Correct me if I am wrong. My assumption is that the version number points to the firmware release which contains the code for system-part1 and system-part2. Monolithic builds flash system-part1 and system-part2 along with user application code as opposed to modular builds which flash only the application code.
My goal is to use a previous firmware release say V0.5.3 in this case which is production ready release and then use OTA using particle cli to flash my application code. As of now I was not successful in doing this. I get the following error:
Flash device OK: Flash required modules not present on the device
You cannot use OTA flash with monolithic software.
The version of software you use is independent of monolithic or modular.
If you want to put V0.5.3 on a device and use OTA, you must use modular builds. If the device is currently running monolithic or you need to downgrade from a later version, follow the downgrading instructions to use DFU over USB to update the device in the specific order given on the releases page here https://github.com/spark/firmware/releases
My particle cli version is v1.20.1 and the system firmware version is 0.5.3. I downloaded the system-part1.bin and system-part2.bin for 0.6.1. I kept the device in blinking yellow mode and ran the following commands:
After downloading, I kept the device in listening mode and ran particle serial identify and then the system version got changed to 0.6.1 as desired. OTA is working too So far so good.
Now I wanted to get back to 0.5.3. So I downloaded the system part 1 and part 2 binaries and ran the following commands
The device acted like it was downloading something and after a while it rebooted and it acted like it was downloading something again. After a while I put the device in listening mode and ran
particle serial identify
The firmware version is V0.6.1 !.
I think the photon automatically reverted back to 0.6.1. I tried flashing 0.5.3 system binaries by keeping the photon in dfu-util mode over USB using