Skip to content

add support for Microchip PIC32CZ and PIC32CK#571

Merged
danielinux merged 10 commits intowolfSSL:masterfrom
rizlik:pic32c
Jun 9, 2025
Merged

add support for Microchip PIC32CZ and PIC32CK#571
danielinux merged 10 commits intowolfSSL:masterfrom
rizlik:pic32c

Conversation

@rizlik
Copy link
Contributor

@rizlik rizlik commented May 14, 2025

Know limitation:

  • gcc support only
  • limited TZ support for PIC32CK
  • No data/code cache support
Board Config Bootloader (bytes) Image (bytes) Boot Time (s)
PIC32CK SHA2 only 7,848 512,000 0.313
PIC32CK SHA384 only 17,348 512,000 0.576
PIC32CK SHA3 only 7,552 512,000 0.889
PIC32CK SHA2 only,small 4,520 512,000 0.404
PIC32CK RSA2048 14,216 512,000 0.334
PIC32CK RSA3072 14,356 512,000 0.354
PIC32CK RSA4096 14,504 512,000 0.374
PIC32CK RSA4096 / SHA384 24,172 512,000 0.636
PIC32CK ECDSA256 20,904 512,000 0.333
PIC32CK ECDSA384 20,388 512,000 0.657
PIC32CK ECDSA521 24,100 512,000 0.778
PIC32CK ECDSA256, small stack 21,252 512,000 0.657
PIC32CK ECDSA256, fast math 20,388 512,000 0.657
PIC32CK ECDSA256, no asm 13,304 512,000 0.758
PIC32CK ECDSA384, no asm 14,676 512,000 1.495
PIC32CK ECDSA521, no asm 13,540 512,000 3.061
PIC32CK ECDSA384 / SHA384 29,856 512,000 0.909
PIC32CK ED25519 / SHA384, small 9,920 512,000 2.738
PIC32CK ED25519 / SHA384, fast 27,108 512,000 2.152
PIC32CK ED448 16,632 512,000 6.789
PIC32CK ML_DSA-44 18,556 512,000 0.344
PIC32CK ML_DSA-65 19,196 512,000 0.364
PIC32CK ML_DSA-87 19,836 512,000 0.394
PIC32CK LMS 1-10-8 10,564 512,000 0.465
PIC32CK XMSS-SHA2_10_256 11,356 512,000 0.485
PIC32CK ML_DSA-65 hybrid ECDSA384 33,304 512,000 0.707
PIC32CK ML_DSA-87 hybrid ECDSA521 38,260 512,000 0.869
Board Config Bootloader (bytes) Image (bytes) Boot Time (s)
PIC32CZ SHA2 only 7848 512000 0.293
PIC32CZ SHA384 only 17348 512000 0.435
PIC32CZ SHA3 only 7552 512000 0.768
PIC32CZ SHA2 only,small 4516 512000 0.283
PIC32CZ RSA2048 14216 512000 0.303
PIC32CZ RSA3072 14356 512000 0.313
PIC32CZ RSA4096 14504 512000 0.347
PIC32CZ RSA4096 / SHA384 24172 512000 0.505
PIC32CZ ECDSA256 20940 512000 0.303
PIC32CZ ECDSA384 20412 512000 0.579
PIC32CZ ECDSA521 24132 512000 0.716
PIC32CZ ECDSA256, small stack 21284 512000 0.545
PIC32CZ ECDSA256, fast math 20412 512000 0.579
PIC32CZ ECDSA256, no asm 13308 512000 0.666
PIC32CZ ECDSA384, no asm 14704 512000 1.433
PIC32CZ ECDSA521, no asm 13560 512000 2.662
PIC32CZ ECDSA384 / SHA384 29896 512000 0.737
PIC32CZ ED25519 / SHA384, small 9928 512000 2.586
PIC32CZ ED25519 / SHA384, fast 27108 512000 2.212
PIC32CZ ED448 16620 512000 6.707
PIC32CZ ML_DSA-44 18612 512000 0.303
PIC32CZ ML_DSA-65 19252 512000 0.322
PIC32CZ ML_DSA-87 19892 512000 0.354
PIC32CZ LMS 1-10-8 10564 512000 0.434
PIC32CZ XMSS-SHA2_10_256 11340 512000 0.414
PIC32CZ ML_DSA-65 hybrid ECDSA384 33400 512000 0.616
PIC32CZ ML_DSA-87 hybrid ECDSA521 38364 512000 0.788

@rizlik rizlik requested a review from danielinux May 14, 2025 13:37
@rizlik rizlik requested a review from dgarske May 14, 2025 13:56
@dgarske dgarske requested a review from Copilot May 14, 2025 14:51
Copy link
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 adds support for Microchip PIC32CZ and PIC32CK by introducing new target-specific applications, HAL implementations, linker scripts, and configuration files. Key changes include:

  • Adding test applications and HAL support files for PIC32CZ and PIC32CK.
  • Updating Makefile, arch.mk, and configuration examples to incorporate the new targets.
  • Enhancing documentation to detail the new target configuration and programming/testing procedures.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test-app/app_pic32cz.c Adds a test application for the PIC32CZ target.
test-app/app_pic32ck.c Adds a test application for the PIC32CK target (note header error).
Makefile, arch.mk Updates build configuration to support new targets.
hal/.c, hal/.h, *.ld New HAL implementations, register definitions, and linker scripts for both PIC32CZ and PIC32CK.
docs/Targets.md, config/examples Updates documentation and configuration for the new targets.

dgarske
dgarske previously approved these changes May 14, 2025
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Looks clean to me on initial review. I plan to test on actual hardware later this week.

Copy link
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 adds support for the Microchip PIC32CZ and PIC32CK families to wolfBoot by introducing new target-specific code, linker scripts, board test applications, configuration files, and build workflow updates.

  • Adds PIC32CZ and PIC32CK application and hardware abstraction layer (HAL) files.
  • Provides updated linker scripts and configuration examples.
  • Updates the documentation and build system to support the new targets.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test-app/app_pic32cz.c New test application for PIC32CZ
test-app/app_pic32ck.c New test application for PIC32CK
test-app/Makefile Added object definitions for PIC32CZ/C targets
include/hal.h Minor include update
hal/pic32cz_registers.h New register definitions for PIC32CZ
hal/pic32cz.ld New linker script for PIC32CZ
hal/pic32cz.c New HAL implementation for PIC32CZ
hal/pic32ck_registers.h New register definitions for PIC32CK
hal/pic32ck.ld New linker script for PIC32CK
hal/pic32ck.c New HAL implementation for PIC32CK
hal/pic32c.h New common interface for PIC32 targets
hal/hal.c Added additional flash test functions
docs/Targets.md Documentation updates for new targets
config/examples/pic32cz.config Example configuration for PIC32CZ
config/examples/pic32ck.config Example configuration for PIC32CK
arch.mk Build system update to handle PIC32CZ/C targets
.github/workflows/test-build-pic32cx.yml New GitHub workflow to build PIC32CZ and PIC32CK targets

@rizlik rizlik removed their assignment May 16, 2025
Copy link
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.

Minor comments/doc adjustments. Port looks good.

@danielinux danielinux assigned rizlik and unassigned danielinux May 21, 2025
@rizlik rizlik requested a review from danielinux May 21, 2025 10:18
danielinux
danielinux previously approved these changes May 21, 2025
Copy link
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.

All issues resolved. This looks very good now. Thanks!

@danielinux danielinux requested a review from Copilot May 21, 2025 10:29
@danielinux danielinux assigned dgarske and unassigned rizlik May 21, 2025
Copy link
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 pull request adds support for Microchip PIC32CZ and PIC32CK targets by introducing new test applications, linker scripts, register definitions, HAL implementations, configuration files, and documentation updates. Key changes include:

  • New test applications for PIC32CZ and PIC32CK (app_pic32cz.c and app_pic32ck.c) to demonstrate boot LED behavior.
  • Addition of target-specific linker scripts, register definitions, and HAL implementations.
  • Updates to the Makefile, configuration examples, and Targets documentation to integrate the new targets.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

File Description
test-app/app_pic32cz.c and app_pic32ck.c New bare-metal applications for PIC32CZ and PIC32CK with direct register manipulation for LED control.
Makefile, arch.mk, and configuration files Integration of target-specific build flags and object files for PIC32CZ and PIC32CK.
HAL and linker script files New HAL implementations and linker scripts supporting the new targets.
docs/Targets.md Documentation updates detailing configuration and programming for PIC32CZ and PIC32CK.

… and CZ targets. Added note about power cycle after programming.
dgarske
dgarske previously approved these changes Jun 6, 2025
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Excellent work! Fully tested both PIC32CK and PIC32CZ 91

@dgarske dgarske assigned danielinux and unassigned dgarske Jun 6, 2025
@dgarske dgarske requested a review from danielinux June 6, 2025 20:59
Copy link
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.

Some typos / minor grammar in Targets.md.

@danielinux danielinux merged commit 77ede65 into wolfSSL:master Jun 9, 2025
260 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.

3 participants