GFW TrustZone support.#772
GFW TrustZone support.#772Ricardo Casallas (rcasallas-silabs) wants to merge 1 commit intorelease_2.8-1.5from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for Generator Firmware (GFW) TrustZone images by preventing NVM3 end address configuration in TrustZone non-secure contexts. The change ensures that setNvm3End() is only called when building with the provision generator in secure or non-TrustZone environments, as this operation requires secure privileges.
- Modified preprocessor condition to exclude
setNvm3End()call in TrustZone non-secure builds - Ensures NVM3 configuration is only performed in privileged contexts
fdf7e3e to
4cf156f
Compare
| return GFW_Flash_ErasePage(addr) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR; | ||
| #elif defined(_SILICON_LABS_32B_SERIES_2) | ||
| MSC_ErasePage((uint32_t *) addr); | ||
| return MSC_ErasePage((uint32_t *) addr) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR; |
There was a problem hiding this comment.
The return value logic appears inverted. MSC_ErasePage typically returns 0 (msc_Return_OK) on success, so a successful call would incorrectly return CHIP_ERROR_INTERNAL. The ternary condition should be inverted to match the GFW pattern or the MSC function's actual return convention should be verified.
| return GFW_Flash_WriteWord(addr, data, size) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR; | ||
| #elif defined(_SILICON_LABS_32B_SERIES_2) | ||
| MSC_WriteWord((uint32_t *) addr, data, size); | ||
| return MSC_WriteWord((uint32_t *) addr, data, size) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR; |
There was a problem hiding this comment.
The return value logic appears inverted. MSC_WriteWord typically returns 0 (msc_Return_OK) on success, so a successful call would incorrectly return CHIP_ERROR_INTERNAL. The ternary condition should be inverted to match the GFW pattern or the MSC function's actual return convention should be verified.
4cf156f to
dcb92bc
Compare
dcb92bc to
d93e147
Compare
|
|
||
| #endif // (defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED == 1) | ||
| } | ||
| #endif |
There was a problem hiding this comment.
| #endif | |
| #endif //ENABLE_WSTK_LEDS |
nit
| return CHIP_NO_ERROR; | ||
| #else | ||
| return CHIP_ERROR_NOT_IMPLEMENTED; | ||
| #endif |
There was a problem hiding this comment.
| #endif | |
| #endif //defined(SL_PROVISION_GENERATOR) && defined(SL_TRUSTZONE_NONSECURE) |
nit
| return CHIP_NO_ERROR; | ||
| #else | ||
| return CHIP_ERROR_NOT_IMPLEMENTED; | ||
| #endif |
There was a problem hiding this comment.
| #endif | |
| #endif //#if defined(SL_PROVISION_GENERATOR) && defined(SL_TRUSTZONE_NONSECURE) |
nit
Summary
Adds support for the Generator Firware (GFW) TrustZone images.
Related issues
Testing
Readability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines