Skip to content

lpc55s69 hw crypto#757

Open
twcook86 wants to merge 20 commits intowolfSSL:masterfrom
twcook86:lpc55s69_crypto
Open

lpc55s69 hw crypto#757
twcook86 wants to merge 20 commits intowolfSSL:masterfrom
twcook86:lpc55s69_crypto

Conversation

@twcook86
Copy link
Copy Markdown
Contributor

No description provided.

@twcook86 twcook86 requested a review from danielinux April 22, 2026 17:35
@danielinux danielinux requested a review from Copilot April 22, 2026 17:37
@danielinux danielinux self-assigned this Apr 22, 2026
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds LPC55S69 hardware-crypto enablement and supporting tooling for flashing/debug plus wolfCrypt test/benchmark support on the test application.

Changes:

  • Add Lauterbach .cmm scripts for factory flashing, update-image flashing, and debug setup.
  • Enable/parameterize LPC55S69 crypto acceleration build knobs (PKA), RNG/HashCrypt/Casper integration, and wolfCrypt test/benchmark execution.
  • Update LPC55S69 linker/config defaults (RAM size, partitions, hash algorithm) to accommodate new crypto/test needs.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tools/scripts/lpc55s69/lpc55s69_flash_update.cmm Adds Lauterbach script to program a signed update image.
tools/scripts/lpc55s69/lpc55s69_flash_factory_bin.cmm Adds Lauterbach script to erase and flash a factory image.
tools/scripts/lpc55s69/lpc55s69_debug.cmm Adds Lauterbach script to load symbols and set breakpoints for debugging.
test-app/wolfcrypt_support.c Uses LPC55S69 SysTick millisecond counter for timing APIs used by wolfCrypt tests/benchmarks.
test-app/syscalls.c Adds vsnprintf forward declaration to route printf-family functions.
test-app/startup_arm.c Maps SysTick ISR name for LPC55S69 builds.
test-app/app_lpc55s69.c Adds SysTick timebase, wolfCrypt test/benchmark runner, and weak syscall stubs.
test-app/Makefile Adds RSA object and LPC55S69 hardware-crypto build/ld flags (PKA vs no-hwaccel).
test-app/ARM-lpc55s69.ld Increases RAM, adds heap/stack region symbols used by runtime/debug.
include/user_settings.h Adjusts RNG/DRBG and cipher settings for LPC55S69 (incl. interleave limitation).
hal/lpc55s69.c Initializes HashCrypt/Casper and adjusts RNG peripheral handling based on hwaccel macros.
config/examples/lpc55s69.config Updates defaults (SHA256, PKA off, partition locations) and documents larger-sector option.
config/examples/lpc55s69-tz.config Same as above for TZ build.
arch.mk Adds include paths and objects for LPC55S69 Casper/HashCrypt/RNG under PKA builds.
Comments suppressed due to low confidence (1)

hal/lpc55s69.c:1

  • The return values of wc_hashcrypt_init() / wc_casper_init() are ignored. If initialization fails (clocking, reset state, secure/non-secure access, etc.), later crypto operations may fail in harder-to-debug ways. Recommend checking the return codes and either logging (when DEBUG_UART) and/or failing fast in a controlled way.
/* lpc55s69.c

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

Comment thread tools/scripts/lpc55s69/lpc55s69_flash_update.cmm Outdated
Comment thread tools/scripts/lpc55s69/lpc55s69_flash_factory_bin.cmm Outdated
Comment thread tools/scripts/lpc55s69/lpc55s69_debug.cmm Outdated
Comment thread test-app/syscalls.c Outdated
Comment thread test-app/app_lpc55s69.c
Comment thread test-app/Makefile
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread config/examples/lpc55s69.config Outdated
Comment thread config/examples/lpc55s69-tz.config Outdated
Copy link
Copy Markdown
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

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

do not tie RNG to NO_HWACCEL. CASPER/HASHCRYPT acceleration can be disabled while the hardware RNG is still required by WOLFCRYPT_SECURE_MODE, e.g. when compiling with trustzone.

You still need something like:

  ifeq ($(WOLFCRYPT_TZ),1)
    OBJS+=$(MCUXPRESSO)/drivers/rng_1/fsl_rng.o
  endif

when PKA=0.

Then in hal/lpc55s69.c, you should remove the WOLFSSL_NXP_LPC55S69_NO_HWACCEL guards around RNG_Init() and RNG_GetRandomData(), or replace them with a dedicated RNG macro if you need one

@twcook86
Copy link
Copy Markdown
Contributor Author

do not tie RNG to NO_HWACCEL. CASPER/HASHCRYPT acceleration can be disabled while the hardware RNG is still required by WOLFCRYPT_SECURE_MODE, e.g. when compiling with trustzone.

You still need something like:

  ifeq ($(WOLFCRYPT_TZ),1)
    OBJS+=$(MCUXPRESSO)/drivers/rng_1/fsl_rng.o
  endif

when PKA=0.

Then in hal/lpc55s69.c, you should remove the WOLFSSL_NXP_LPC55S69_NO_HWACCEL guards around RNG_Init() and RNG_GetRandomData(), or replace them with a dedicated RNG macro if you need one

reworked the rng code, clleaned up various other areas. I think all the pr issues should be addressed at this point.

@twcook86 twcook86 requested a review from danielinux April 24, 2026 02:39
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.

3 participants