Skip to content

tc3xx HAL write fix#568

Merged
danielinux merged 1 commit intowolfSSL:masterfrom
bigbrett:tc3xx-hal-flash-write-fix
Apr 30, 2025
Merged

tc3xx HAL write fix#568
danielinux merged 1 commit intowolfSSL:masterfrom
bigbrett:tc3xx-hal-flash-write-fix

Conversation

@bigbrett
Copy link
Copy Markdown
Contributor

Quick fix to the tc3xx HAL to properly handle flash writes across sector boundaries.

Note: This is not necessary for current usage, but will be necessary for ELF loading.

Splitting this fix into is own PR so @billphipps can use it for some of his unrelated feature work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a fix in the tc3xx HAL to correctly handle flash writes that span across multiple sectors, ensuring proper operation for ELF loading in the future.

  • Implements a while-loop to process writes sector by sector.
  • Updates flash programming logic to perform read-modify-write when any page in a sector is not erased.
  • Activates LED indicators during programming for visual feedback.
Comments suppressed due to low confidence (1)

hal/aurix_tc3xx.c:392

  • The flag 'needsSectorRmw' is declared and initialized to 0 but never updated within the for-loop when flashIsErased indicates a non-erased page. Insert an assignment such as 'needsSectorRmw = 1;' inside the if-statement to trigger the appropriate read-modify-write behavior.
for (page = startPage; page <= endPage; page += IFXFLASH_PFLASH_PAGE_LENGTH) {

@bigbrett
Copy link
Copy Markdown
Contributor Author

CI Failure looks unrelated

Copy link
Copy Markdown
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I'll have additional changes as we move forward, mostly to propagate errors out.

@danielinux
Copy link
Copy Markdown
Member

I'll include this fix in the 2.5.0 release. Thanks!

@danielinux danielinux merged commit 21a726a into wolfSSL:master Apr 30, 2025
257 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants