@@ -552,3 +552,87 @@ make CROSS_COMPILE=aarch64-unknown-nto-qnx7.0.0-
552552#### Signing
553553
554554` tools/keytools/sign.py --rsa4096 --sha3 /srv/linux-rpi4/vmlinux.bin rsa4096.der 1 `
555+
556+ ## Cypress PSoC-62S2 (CY8CKIT-062S2)
557+
558+ The Cypress PSoC 62S2 is a dual-core Cortex-M4 & Cortex-M0+ MCU. The secure boot process is managed by the M0+.
559+ WolfBoot can be compiled as second stage flash bootloader to manage application verification and firmware updates.
560+
561+ ### Building
562+
563+ The following configuration has been tested using PSoC 62S2 Wi-Fi BT Pioneer Kit (CY8CKIT-052S2-43012).
564+
565+ #### Target specific requirements
566+
567+ wolfBoot uses the following components to access peripherals on the PSoC:
568+
569+ * [ Cypress Core Library] ( https://github.com/cypresssemiconductorco/core-lib )
570+ * [ PSoC 6 Peripheral Driver Library] ( https://github.com/cypresssemiconductorco/psoc6pdl )
571+ * [ CY8CKIT-062S2-43012 BSP] ( https://github.com/cypresssemiconductorco/TARGET_CY8CKIT-062S2-43012 )
572+
573+ Cypress provides a [ customized OpenOCD] ( https://github.com/cypresssemiconductorco/Openocd ) for programming the flash and
574+ debugging.
575+
576+ #### Build configuration
577+
578+ The following configuration has been tested on the PSoC CY8CKIT-62S2-43012:
579+
580+ ```
581+ make TARGET=psoc6
582+ NVM_FLASH_WRITEONCE=1
583+ CYPRESS_PDL=/home/dan/src/psoc6pdl
584+ CYPRESS_TARGET_LIB=/home/dan/src/TARGET_CY8CKIT-062S2-43012
585+ CYPRESS_CORE_LIB=/home/dan/src/core-lib
586+ WOLFBOOT_SECTOR_SIZE=4096
587+ ```
588+
589+ #### OpenOCD installation
590+
591+ Compile and install the customized OpenOCD.
592+
593+ Use the following configuration file when running ` openocd ` to connect to the PSoC6 board:
594+
595+ ```
596+ # openocd.cfg for PSoC-62S2
597+
598+ source [find interface/kitprog3.cfg]
599+ transport select swd
600+ adapter speed 1000
601+ source [find target/psoc6_2m.cfg]
602+ init
603+ reset init
604+ ```
605+
606+ ### Loading the firmware
607+
608+ To upload ` factory.bin ` to the device with OpenOCD, connect the device,
609+ run OpenOCD with the configuration from the previous section, then connect
610+ to the local openOCD server running on TCP port 4444 using ` telnet localhost 4444 ` .
611+
612+ From the telnet console, type:
613+
614+ ` program factory.bin 0x10000000 `
615+
616+ When the transfer is finished, you can either close openOCD or start a debugging session.
617+
618+ ### Debugging
619+
620+ Debugging with OpenOCD:
621+
622+ Use the OpenOCD configuration from the previous sections to run OpenOCD.
623+
624+ From another console, connect using gdb, e.g.:
625+
626+ ```
627+ arm-none-eabi-gdb
628+ (gdb) target remote:3333
629+ ```
630+
631+ To reset the board to start from the M0+ flash bootloader position (wolfBoot reset handler), use
632+ the monitor command sequence below:
633+
634+ ```
635+ (gdb) mon init
636+ (gdb) mon reset init
637+ (gdb) mon psoc6 reset_halt
638+ ```
0 commit comments