-
Notifications
You must be signed in to change notification settings - Fork 5
OSAL APIs to Firmware read, write & System reboot/TLV32 for Linux #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ismilak Regarding the earlier build errors for FreeRTOS/EFR32, as informed in the previous call - our intent was to only add the platform agnostic CSMP encode/decode changes for FreeRTOS/EFR32 in the interest of time - there could be trivial build errors on these platforms which could be addressed during integration. Linux taget built fine and was used for manual testing. |
I still think we are missing an OSAL API for rebooting. That said. After reviewing how the OTA DFU TLV handlers were implemented I understand why there are none. I was surprised to see that all of them were in a platform-specific file or folder. I didn't pay attention to that detail when I did my first quick review in December. I was expecting the OTA DFU logic (e.g., when imageBlock_post is called, do what you have to do then call osal_write_firmware, and so on) to be common to all platforms and located in a common folder. As it stands, we theoretically wouldn't need the OSAL read/write functions. We could call SiliconLabs APIs in efr32_wisun_tlvs.c. However, there's a lot of code duplication. We have 1168 common lines (out of 1319) between efr32_wisun_tlvs.c and linux_tlvs.c. This increases the maintenance burden and will slow down the adoption of new platforms. It's critical to minimize platform-specific code. As a CSMP agent consumer, what I'd like to see very explicitly exposed in the repo is what part of the repo is ready to be consumed as-is and which needs to be done to have a basic application. My vision is that it should be done in sample/ |
A reboot OSAL API can be implemented and the plan to implement this API was discussed to be implemented along with Reboot_Request TLV32 as they are directly related. The rest of the comments regarding xxx_tlvs.c implementation code for firmware upgrade is not very clear here and could be discussed in our sync-up call. Though there could be code which seems similar across osal platforms, the current implementation is inline to segregating code across Agent and platform specific Sample application - we need to discuss this further for better clarity on the proposal. Thanks. |
@silabs-ThibautC : As informed earlier in our discussions, the scope of this PR is to propose firmware read/write OSAL APIs. We had also confirmed earlier that OSAL API for reboot could be implemented along with TLV32 as a separate PR. Further restructuring/optimizing of existing code(firmware upgrade, etc.,) being proposed now are out of scope of this PR and let's take it up for discussion separately as your FreeRTOS/EFR32 integration progresses. Thanks. |
I only wanted to cover all the OSAL API updates or additions that could be required to perform a firmware update. We can talk about that in a second PR, I agree. The generic function I'd expect to see in a generic API would:
The definition of _Csmp_Slothdr is not generic enough and should probably be platform-dependent. In other words, an abstract definition of the storage location should be in osal.h. We cannot afford this kind of array: |
Please review/approve to conclude this PR. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress.
Looks fine to me. |
The API modifications will impact the work already done, but it looks good enough. We'll need to find another way of pushing new OSAL APIs in the future. |
Implement OSAL APIs (Firmware/slothdr read, write, System reboot + TLV32) for Linux
OSAL APIs definitions for Linux:
TLVs added:
Baseline issues fixed:
OSAL API signature: