Skip to content

MAX32666 fixes for old SDK#10733

Open
mattia-moffa wants to merge 2 commits into
wolfSSL:masterfrom
mattia-moffa:20260617-max32666-sha-streaming-old
Open

MAX32666 fixes for old SDK#10733
mattia-moffa wants to merge 2 commits into
wolfSSL:masterfrom
mattia-moffa:20260617-max32666-sha-streaming-old

Conversation

@mattia-moffa

Copy link
Copy Markdown
Member

Description

  • Allows streaming SHA implementation to work on the old SDK
  • Implements TRNG health test as bare-metal since old SDK doesn't implement it

Testing

Temporary test firmware: https://moffa.xyz/tmp/test_max32666.tar.gz

- Allows streaming SHA implementation to work on the old SDK
- Implements TRNG health test as bare-metal since old SDK doesn't
  implement it
@mattia-moffa mattia-moffa self-assigned this Jun 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the MAX32666/MAX3266x hardware port to support an older Maxim SDK by (1) providing a bare-metal TRNG health test implementation and (2) adapting the SHA accelerator register access differences needed for streaming SHA on the old SDK.

Changes:

  • Map MXC_TRNG_HealthTest to a new wolfSSL-provided implementation for old SDK builds.
  • Add an on-demand TRNG health test implementation for old SDK builds.
  • Add a compatibility macro to write to the correct TPU SHA input register field (din vs data_in) depending on SDK version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
wolfssl/wolfcrypt/port/maxim/max3266x.h Adjusts old-SDK macro mappings for TRNG health test and TPU init.
wolfcrypt/src/port/maxim/max3266x.c Implements old-SDK TRNG health test and updates SHA accelerator register writes for old SDK naming.
Comments suppressed due to low confidence (1)

wolfssl/wolfcrypt/port/maxim/max3266x.h:159

  • In the old-SDK section, MXC_SYS_PERIPH_CLOCK_TPU is defined twice, which can trigger macro-redefinition warnings (e.g., on Clang with -Wmacro-redefined) and makes the configuration harder to reason about. Keep a single definition.
    #define MXC_TPU_Init(clock)         SYS_TPU_Init(NULL)
    #define MXC_TPU_Shutdown            SYS_TPU_Shutdown
    #define MXC_SYS_PERIPH_CLOCK_TPU    SYS_PERIPH_CLOCK_TPU

    #define MXC_SYS_PERIPH_CLOCK_TPU    SYS_PERIPH_CLOCK_TPU
    #define MXC_SYS_PERIPH_CLOCK_TRNG   SYS_PERIPH_CLOCK_TRNG

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/src/port/maxim/max3266x.c
@mattia-moffa

Copy link
Copy Markdown
Member Author

Jenkins retest this please

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.

2 participants