Skip to content

Commit 7b0bee5

Browse files
authored
Merge pull request wolfSSL#773 from twcook86/lpc55s69_crypto_2
Fix lingering lpc55s69 issues
2 parents 1ce8234 + 6093b68 commit 7b0bee5

6 files changed

Lines changed: 11 additions & 17 deletions

File tree

arch.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ ifeq ($(TARGET),lpc55s69)
12541254
-I$(MCUXPRESSO)/drivers/rng_1 \
12551255
-I$(MCUXPRESSO_CMSIS)/Include \
12561256
-I$(MCUXPRESSO_CMSIS)/Core/Include
1257+
CFLAGS+=-DWOLFSSL_NXP_RNG_1
12571258
CFLAGS+=-DCPU_$(MCUXPRESSO_CPU)
12581259
CFLAGS+=-DFSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL=1
12591260
CFLAGS+=-DFSL_SDK_DISABLE_DRIVER_RESET_CONTROL=1
@@ -1274,14 +1275,12 @@ ifeq ($(TARGET),lpc55s69)
12741275
$(MCUXPRESSO)/drivers/flexcomm/usart/fsl_usart.o
12751276
endif
12761277
ifeq ($(PKA),1)
1277-
CFLAGS+=-DWOLFSSL_NXP_LPC55S69_WITH_HWACCEL
1278+
CFLAGS+=-DWOLFSSL_NXP_LPC55S6X
12781279
OBJS+=\
12791280
$(MCUXPRESSO)/drivers/casper/fsl_casper.o \
12801281
$(MCUXPRESSO)/drivers/hashcrypt/fsl_hashcrypt.o \
12811282
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/nxp/casper_port.o \
12821283
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/nxp/hashcrypt_port.o
1283-
else
1284-
CFLAGS+=-DWOLFSSL_NXP_LPC55S69_NO_HWACCEL
12851284
endif
12861285
endif
12871286

hal/lpc55s69.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,13 @@ void hal_init(void)
102102
#ifdef __WOLFBOOT
103103
/* lpc55s69 must run < 100 MHz for flash write/erase to work */
104104
BOARD_BootClockFROHF96M();
105-
// BOARD_BootClockPLL150M();
106105

107106
# ifdef DEBUG_UART
108107
uart_init();
109108
uart_write("lpc55s69 init\n", 14);
110109
# endif
111110

112-
# ifdef WOLFSSL_NXP_LPC55S69_WITH_HWACCEL
111+
# ifdef WOLFSSL_NXP_LPC55S6X
113112
CLOCK_EnableClock(kCLOCK_HashCrypt);
114113
wc_hashcrypt_init();
115114
CLOCK_EnableClock(kCLOCK_Casper);
@@ -118,10 +117,8 @@ void hal_init(void)
118117

119118
CLOCK_EnableClock(kCLOCK_Rng);
120119
RESET_PeripheralReset(kRNG_RST_SHIFT_RSTn);
121-
122-
#endif /* __WOLFBOOT */
123-
124120
RNG_Init(RNG);
121+
#endif /* __WOLFBOOT */
125122

126123
#if defined(__WOLFBOOT) || !defined(TZEN)
127124
memset(&pflash, 0, sizeof(pflash));

include/user_settings.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,7 @@ extern int tolower(int c);
511511
#define NO_AES_CBC
512512
#else
513513
#if defined(WOLFCRYPT_TEST) || defined(WOLFCRYPT_BENCHMARK)
514-
#if defined(WOLFSSL_NXP_LPC55S69_WITH_HWACCEL) \
515-
|| defined(WOLFSSL_NXP_LPC55S69_NO_HWACCEL)
514+
#ifdef TARGET_lpc55s69
516515
/* use actual rng hardware for seed, HASHDRBG for generation */
517516
#define HAVE_HASHDRBG
518517
#define HAVE_AES_ECB
@@ -607,10 +606,6 @@ extern int tolower(int c);
607606

608607
/* wolfCrypt Test/Benchmark Configuration */
609608
#ifdef WOLFCRYPT_TEST
610-
#ifdef WOLFSSL_NXP_LPC55S69_WITH_HWACCEL
611-
/* lpc55s69 hashcrypt hw does not support interleaving */
612-
#define NO_WOLFSSL_SHA256_INTERLEAVE
613-
#endif
614609
/* Skip extended tests to save memory */
615610
#define NO_CRYPT_TEST_EXTENDED
616611
/* Use smaller certificate buffers */

test-app/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ endif
734734

735735
ifeq ($(TARGET),lpc55s69)
736736
CFLAGS+=-ffunction-sections -fdata-sections
737+
CFLAGS+=-DWOLFSSL_NXP_RNG_1
737738
ifeq ($(TZEN),1)
738739
LSCRIPT_TEMPLATE=ARM-lpc55s69-ns.ld
739740
CFLAGS:=$(filter-out -mcmse, $(CFLAGS))
@@ -751,14 +752,12 @@ ifeq ($(TARGET),lpc55s69)
751752
$(MCUXPRESSO)/drivers/lpc_gpio/fsl_gpio.o \
752753
$(MCUXPRESSO)/drivers/rng_1/fsl_rng.o
753754
ifeq ($(PKA),1)
754-
CFLAGS+=-DWOLFSSL_NXP_LPC55S69_WITH_HWACCEL
755+
CFLAGS+=-DWOLFSSL_NXP_LPC55S6X
755756
APP_OBJS+=\
756757
$(MCUXPRESSO)/drivers/casper/fsl_casper.o \
757758
$(MCUXPRESSO)/drivers/hashcrypt/fsl_hashcrypt.o \
758759
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/nxp/casper_port.o \
759760
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/nxp/hashcrypt_port.o
760-
else
761-
CFLAGS+=-DWOLFSSL_NXP_LPC55S69_NO_HWACCEL
762761
endif
763762
ifeq ($(WOLFCRYPT_SUPPORT),1)
764763
LDFLAGS+=--specs=nano.specs

tools/scripts/lpc55s69/lpc55s69_debug.cmm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SYStem.Up
2323
;; STOP in wolfBoot...
2424
data.load "&basedir\wolfboot.elf" /nocode
2525
symbol.sourcepath.TranslateSUBpath "\home\tcook\wolf\wolfBoot" "&basedir"
26+
symbol.sourcepath.TranslateSUBpath "\home\tcook\wolf\NXP" "&basedir\..\NXP"
2627
Register.Set PC isr_reset
2728
Register.Set MSP END_STACK
2829
break.set main /onchip /temporary

tools/scripts/lpc55s69/lpc55s69_flash_update.cmm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ SYStem.Up
2020

2121
DO ~~/demo/arm/flash/lpc55xx PREPAREONLY
2222

23+
; Change from 32KiB sector size to 512
24+
flash.delete 1.
25+
flash.create 1. 0x00000000--0x00097fff 0x200 TARGET Long
2326

2427
FLASH.ReProgram ALL
2528
Data.LOAD.Binary "&basedir\test-app\image_v2_signed.bin" 0x18000

0 commit comments

Comments
 (0)