Flashing Modified Device OS with Buildscript 1.15.0

Hi @radek !

I need to flash a modified device os (4.2.0) and was trying to use buildscript 1.15.0.

We've recently made changes to the buildscript makefile in order to support some changes with local flashing. See the notes about that here

Are you using the buildscript makefile directly with make? If so can you share the command you are using?

I should note that the toolchain makefile is not intended to be invoked directly. The make targets you see here are essentially invoked by the Workbench IDE, which will provide all the appropriate parameters based on your project settings.
The makefile will work if invoked directly, but as you are finding out, it can be a bit difficult to get it to do exactly what you intend.

I think the easiest way to build and flash device OS with your own local modification is through Workbench using the Custom Device OSLocation setting.
More information on that is available here

What does the comparison between DEVICE_OS_VERSION and source means?

It's a literal comparison to the string source. Invoking the makefile with DEVICE_OS_VERSION set to source is the way Workbench gets the toolchain to compile the local Device OS source.

It seems like flash-all-source-steps will only fire if the device os version I am flashing is different than what's currently on the device. Is this correct?

No, the target flash-app-and-source-os will unconditionally flash the locally compiled Device OS. It does not check the device for its running version.

Also, I found that after using flash-all-source-steps as the target instead of flash-all, the wild card to flash the system-part would not fire, which was the result of me only supplying PLATFORM and not PLATFORM_ID. I thought only one was needed, not really a problem, just an inconvenience.

Yes, the flash-app-and-source-os target relies on $(PLATFORM_ID) to find the locally compiled Device OS binary path. When the makefile is invoked via Workbench commands (ie Particle: Compile application & DeviceOS (local)) all of the necessary variables will be set according to your project settings.
If you are invoking the script manually, you will have to supply that variable as well.

2 Likes