In mid-2014 I have started building locally for my Spark core. My setup is a project folder with core-common-lib
, core-communication-lib
, and core-firmware
. In core-firmware
I worked on application.cpp, added a few libraries etc. Compiling and putting the firmware on the Spark core worked fine.
A few months went by, and now I would like to work on the code again. I see two alternatives here:
A) I could just edit, recompile etc, and be safe.
B) I could try to pull in all the repository updates that have been made in the meantime, maybe gaining more stability, bug fixes and the like. But perhaps something will break? (Currently, I do work in Mercurial, not using the git files in the respective folders!)
What path would you recommend here? Thank you very much!
Use this branch with all the fixes: https://github.com/spark/firmware/tree/feature/hal
You only need this repo as all the other code is combined into one here
Oh thanks, that was fast! Does this mean I do …
git clone -b feature/hal GitHub - particle-iot/device-os: Device OS (Firmware) for Particle Devices
and then move my old code "by hand" to the new structure? Or is there an other recommended way?
@akrusen, I recommend simply doing a pull to update your repos. Nothing has changed radically though the make file might be updated I don’t think it will break anything. There may, however, be key updates to firmware functions which will require consideration (Network and WiFi functions). If your repos have these updates already, nothing will change.
The biggest changes are taking place in the HAL branch of the master, in preparation for the Photon and Electron. Once the HAL-based firmware is released, you will need to restructure your environment to compile your code (it actually becomes easier!). You may want to update your toolchain (gcc) to the latest 4.9 version as well.
Oh, and as @kennethlimcp, going to the HAL is a great idea
2 Likes
Hi everyone, thank you for the tips. Through this thread I learned about the hardware abstraction layer (HAL) branch, and switching to it was really easy.
This solved my biggest problem with local development: Project files strewn all over the firmware directories.
Now all my project files live outside the firmware
directory. From firmware/main
, I compile with make APPDIR=/Users/username/projectfiles
. As @peekay123 mentioned, it really is easier now. Great stuff!
3 Likes