Today, we released v0.23.0 of the Golioth Firmware SDK. This release removes the synchronous API in favor of a single callback-based one, reworks the firmware update sample, and updates our Zephyr and nRF Connect SDK support. It also includes a long list of fixes, most of them on Zephyr. Several of the changes are breaking, so we recommend reading the changelog before upgrading.
One API, No Suffix
Until now, most SDK services came in two flavors. The _async functions queued a request and delivered the result to a callback. The _sync functions blocked the calling thread until a response arrived or a timeout expired. Two variants of nearly every function meant twice the surface to document, test and maintain. The synchronous variants also came with a trap: callbacks run on the client thread, so calling a blocking function from inside one could never work.
In v0.23.0 the synchronous functions are gone and the _async suffix is dropped from the ones that remain. Code that already used the asynchronous API only needs a rename, since the parameters are unchanged. Code that used the synchronous API replaces the timeout with a callback and a callback argument:
/* v0.22.0 */
err = golioth_lightdb_set_int_sync(client, "counter", counter, APP_TIMEOUT_S);
/* v0.23.0 */
err = golioth_lightdb_set_int(client, "counter", counter, on_counter_set, NULL);
The return value now only reports whether the request was queued. The result of the request itself is passed to the callback. Applications that really need to block can still do so by waiting for the callback, for example with a semaphore, as long as they are not waiting from inside another Golioth callback.
A few functions need more than a rename. The typed LightDB State getters are replaced by golioth_lightdb_get(), with the payload decoded in the callback using helpers such as golioth_payload_as_int(). golioth_ota_report_state_sync() had no asynchronous counterpart. It is replaced by the new golioth_ota_report_state(), which takes a callback and callback argument instead of the timeout. The one exception to all of this is golioth_stream_set_blockwise_sync(), which is unchanged.
Firmware Update Sample
In v0.22.0 we moved our reference firmware update implementation out of the core SDK and into the samples. This release continues that work on Zephyr. golioth_fw_update_init() and golioth_fw_update_init_with_config() are replaced by golioth_fw_update_run(), which runs on the calling thread and does not return. The application now decides which thread the update logic runs on.
Applications based on the sample also need two additional Kconfig options: CONFIG_IMG_ENABLE_IMAGE_CHECK=y and CONFIG_MBEDTLS_PSA_CRYPTO_C=y.
On nRF Connect SDK, the sample for the nRF9160 DK now keeps the MCUboot secondary slot in external flash. This changes the flash layout, so devices running an earlier build of the sample cannot be updated over the air. They must be reflashed, including MCUboot.
We also fixed a memory leak in golioth_ota_download_component() that occurred when a download could not be started.
Updated Platform Support
Firmware SDK v0.23.0 updates our support to Zephyr v4.3.0 and nRF Connect SDK v3.2.3 and the NXP FRDM-RW612 can now connect over WiFi, and it replaces the nRF52840 DK + ESP32 (ESP-AT) as a Continuously Verified Board. The golioth_esp_at shield has been removed from the SDK along with it. Applications that still build with --shield golioth_esp_at need to provide the shield in their own board root, for example by copying zephyr/boards/shields/golioth_esp_at/ from v0.22.0.
We fixed Ethernet on the FRDM-RW612 sometimes not coming up after boot. The fixes ship as Zephyr patches in zephyr/patches.yml, so run west patch apply after west update.
Finally, this release fixes several issues in the Zephyr port. A duplicated or late acknowledgement could complete the next block of a blockwise transfer, and requests failed when the server answered with a separate response. Thread stacks were not reused after a thread was destroyed, which could affect applications that re-create the Golioth client, as the certificate rotation sample does. The samples no longer crash when there is no network interface, and their WiFi and Ethernet connections are more reliable.


No comments yet! Start the discussion at forum.golioth.io