Skip to content
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

[K32W0] SDK 2.6.10 fixes & features #25342

Merged
merged 24 commits into from
Mar 7, 2023

Conversation

marius-alex-tache
Copy link
Contributor

@marius-alex-tache marius-alex-tache commented Feb 27, 2023

Changes to support latest K32W0 SDK release:

  • Enable factory data onboarding print.
  • Implement OTA custom payload processing. OTAImageProcessorImpl has become more customizable through delegating
    block processing to pre-registered OTATlvProcessor instances. New OTA image format: | OTA image header | TLV1 | ... | TLVn |. The new format can be generated using NXP's custom wrapper over the standard tool: scripts/tools/nxp/factory_data_generator/ota_image_tool.py. A customer can opt to enable the default processors by setting the gn
    arg chip_enable_ota_default_processors=1. Thus, the application, SSBL and factory data processors (if factory data enabled) will be registered. Note: This is not backwards compatible because of the TLV metadata needed
    for TLV processor selection.
  • Moved default OTA image processor implementation in a common K32W folder.
  • Platforms can now define two hooks:
    • OtaHookInit - for K32W0, it is defined in OTAHooks.cpp as a WEAK symbol.
    • OtaHookReset - resets the board after taking the corresponding actions.
  • The user can opt to enable logging during low power build.
  • Use full IC reset. Setting gResetSystemReset_d=1 will enable full reset of the IC by calling RESET_SystemReset. Otherwise, RESET_ArmReset will be called and the core will do a reboot while maintaining the RAM on, enabling exchange of information across reset.
  • Add bss discard section.
  • Add support for additional factory data fields: PartNumber, ProductLabel and ProductURL.
  • Add recovery mechanism for factory data.

Signed-off-by: Marius Tache marius.tache@nxp.com
Signed-off-by: Ethan Tan ethan.tan@nxp.com

@CLAassistant
Copy link

CLAassistant commented Feb 27, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

PR #25342: Size comparison from 753fa1c to 625c358

Increases (1 build for cc32xx)
platform target config section 753fa1c 625c358 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20256037 20256039 2 0.0
Full report (1 build for cc32xx)
platform target config section 753fa1c 625c358 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 642609 642609 0 0.0
(read/write) 203672 203672 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197072 197072 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930077 930077 0 0.0
.debug_aranges 87280 87280 0 0.0
.debug_frame 299816 299816 0 0.0
.debug_info 20256037 20256039 2 0.0
.debug_line 2655900 2655900 0 0.0
.debug_loc 2797195 2797195 0 0.0
.debug_ranges 281768 281768 0 0.0
.debug_str 3023188 3023188 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105761 105761 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377825 377825 0 0.0
.symtab 256224 256224 0 0.0
.text 534724 534724 0 0.0

@github-actions
Copy link

PR #25342: Size comparison from af511d7 to d76760c

Decreases (1 build for cc32xx)
platform target config section af511d7 d76760c8 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20256131 20256130 -1 -0.0
Full report (1 build for cc32xx)
platform target config section af511d7 d76760c8 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 642601 642601 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930126 930126 0 0.0
.debug_aranges 87280 87280 0 0.0
.debug_frame 299812 299812 0 0.0
.debug_info 20256131 20256130 -1 -0.0
.debug_line 2656120 2656120 0 0.0
.debug_loc 2797440 2797440 0 0.0
.debug_ranges 281768 281768 0 0.0
.debug_str 3023104 3023104 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105761 105761 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377825 377825 0 0.0
.symtab 256224 256224 0 0.0
.text 534716 534716 0 0.0

marius-alex-tache and others added 22 commits March 7, 2023 12:55
Moved default OTA image processor implementation in a common K32W folder.
Platforms should define two hooks:
* OtaHookInit - for K32W0, it is defined in OTAHooks.cpp as a WEAK symbol.
* OtaHookReset - resets the board after taking the corresponding actions.

Other than that, the implementation is generic. The actual OTA processing is
delegated to the registered OTA TLV processors.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
The user can opt to enable the logging in the low power build, but
at their own risk, since it could break LP timings/functionality.
The last statement is based on the initial introduction of the assert.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Setting gResetSystemReset_d to 1 will enable full reset of the IC
by calling RESET_SystemReset. Otherwise, RESET_ArmReset will be
called and the core will do a reboot while maintaining the RAM on,
enabling exchange of information across reset.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Unretainable data should be moved to a special section,
such that it's not included in the binary. This was observed
in the PDM library with external flash support.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
PartNumber, ProductLabel and ProductURL getter APIs were
moved under DeviceInstanceInfoProvider interface.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
If a power loss occurs during factory data update through OTA, the board
might be in a state in which it has erased factory data section, causing
the app task to fail at initialization.

During initialization, the factory data provider should check if a certain
predefined PDM id exists. If it does, then most likely the internal flash
section for factory data is empty, so a restore from external flash must
be done.

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

PR #25342: Size comparison from fc0e4a2 to 5a2fd89

Decreases (1 build for cc32xx)
platform target config section fc0e4a2 5a2fd89 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 2026706 20267066 -1 -0.0
Full report (1 build for cc32xx)
platform target config section fc0e4a2 5a2fd89 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 644425 644425 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930235 930235 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300028 300028 0 0.0
.debug_info 2026706 20267066 -1 -0.0
.debug_line 2659698 2659698 0 0.0
.debug_loc 2802749 2802749 0 0.0
.debug_ranges 282952 282952 0 0.0
.debug_str 3023892 3023892 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256624 256624 0 0.0
.text 536372 536372 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit 421ee66 into project-chip:master Mar 7, 2023
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
* [K32W0] Enable factory data onboarding print

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Implement OTA custom payload processing

OTAImageProcessorImpl has become more customizable through delegating
block processing to pre-registered OTATlvProcessor instances.

New OTA image format:
| OTA image header | TLV1 | ... | TLVn |

The new format can be generated using NXP's custom wrapper over the
standard tool: `scripts/tools/nxp/factory_data_generator/ota_image_tool.py

A customer can opt to enable the default processors by setting the gn
arg chip_enable_ota_default_processors=1. Thus, the application, SSBL
and factory data processors (if factory data enabled) will be registered.

Note: This is not backwards compatible because of the TLV metadata needed
for TLV processor selection.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Make OTAImageProcessorImpl generic

Moved default OTA image processor implementation in a common K32W folder.
Platforms should define two hooks:
* OtaHookInit - for K32W0, it is defined in OTAHooks.cpp as a WEAK symbol.
* OtaHookReset - resets the board after taking the corresponding actions.

Other than that, the implementation is generic. The actual OTA processing is
delegated to the registered OTA TLV processors.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Removed write from restore

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* disable high power config for k32w041am platform by default

* [K32W0] Remove logging assert in LP

The user can opt to enable the logging in the low power build, but
at their own risk, since it could break LP timings/functionality.
The last statement is based on the initial introduction of the assert.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Use full IC reset

Setting gResetSystemReset_d to 1 will enable full reset of the IC
by calling RESET_SystemReset. Otherwise, RESET_ArmReset will be
called and the core will do a reboot while maintaining the RAM on,
enabling exchange of information across reset.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Make ota_image_tool.py wrapper executable

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Add bss_discard section

Unretainable data should be moved to a special section,
such that it's not included in the binary. This was observed
in the PDM library with external flash support.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Add support for additional factory data fields

PartNumber, ProductLabel and ProductURL getter APIs were
moved under DeviceInstanceInfoProvider interface.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Add recovery mechanism for factory data

If a power loss occurs during factory data update through OTA, the board
might be in a state in which it has erased factory data section, causing
the app task to fail at initialization.

During initialization, the factory data provider should check if a certain
predefined PDM id exists. If it does, then most likely the internal flash
section for factory data is empty, so a restore from external flash must
be done.

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] public RamStorage.h and RamStorageKey.h two header files

* [K32W0] Fix gn check for OTAImageProcessorImpl

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Update SDK link in README files

* [K32W0] Update TLV header

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Mark OTA readme as orphan

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-markdown

* Restyled by autopep8

* Restyled by isort

* [K32W0] Fix readme misspells

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* [K32W0] Fix code-lints errors

Signed-off-by: Marius Tache <marius.tache@nxp.com>

* Restyled by prettier-markdown

---------

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Co-authored-by: tanyue518 <ethan.tan@nxp.com>
Co-authored-by: Restyled.io <commits@restyled.io>
@GabrielCouturier GabrielCouturier deleted the upstream-k32w0-2.6.10 branch November 10, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants