Skip to content

Commit 8d3f459

Browse files
twcook86danielinux
authored andcommitted
Regression test fixes
1 parent 0127072 commit 8d3f459

6 files changed

Lines changed: 103 additions & 88 deletions

File tree

config/examples/lpc55s69-tz.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ FLASH_MULTI_SECTOR_ERASE?=1
3131
WOLFCRYPT_TZ?=1
3232
WOLFCRYPT_TZ_PKCS11?=1
3333

34-
# 1024-byte sector to accomodate RSA4096
35-
WOLFBOOT_SECTOR_SIZE?=0x400
34+
# use 1024-byte sector to accomodate RSA4096 signature
35+
# WOLFBOOT_SECTOR_SIZE?=0x400
36+
WOLFBOOT_SECTOR_SIZE?=0x200
3637

37-
# 200KB boot, 80KB keyvault, 8KB NSC, 56KB partitions, 1024 swap
38+
# 200KB boot, 80KB keyvault, 8KB NSC, 56KB partitions, 512/1024 swap
3839
WOLFBOOT_KEYVAULT_ADDRESS?=0x10032000
3940
WOLFBOOT_KEYVAULT_SIZE?=0x14000
4041
WOLFBOOT_NSC_ADDRESS?=0x10046000

config/examples/lpc55s69.config

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,22 @@ DUALBANK_SWAP?=0
2929
PKA?=1
3030
FLASH_MULTI_SECTOR_ERASE?=1
3131

32-
# 1024-byte sector to accomodate RSA4096
33-
WOLFBOOT_SECTOR_SIZE?=0x400
32+
# use 1024-byte sector to accomodate RSA4096 signature
33+
# WOLFBOOT_SECTOR_SIZE?=0x400
34+
WOLFBOOT_SECTOR_SIZE?=0x200
3435

3536
# Default configuration
36-
# 40KB boot, 44KB partitions, 1024 swap
37-
#WOLFBOOT_PARTITION_SIZE?=0xB000
38-
#WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xD000
39-
#WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18000
40-
#WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x23000
37+
# 44KB boot, 52KB partitions, 512/1024 swap
38+
WOLFBOOT_PARTITION_SIZE?=0xB000
39+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0xD000
40+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18000
41+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x23000
4142

4243
# use these for test/benchmark
43-
WOLFBOOT_PARTITION_SIZE?=0x26000
44-
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10000
45-
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x36000
46-
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x5C000
44+
#WOLFBOOT_PARTITION_SIZE?=0x2b000
45+
#WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10000
46+
#WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x3b000
47+
#WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x66000
4748

48-
WOLFCRYPT_TEST?=1
49-
WOLFCRYPT_BENCHMARK?=1
49+
#WOLFCRYPT_TEST?=1
50+
#WOLFCRYPT_BENCHMARK?=1

include/user_settings.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,17 @@ extern int tolower(int c);
505505
#define CUSTOM_RAND_GENERATE_BLOCK my_rng_seed_gen
506506
extern int my_rng_seed_gen(unsigned char* output, unsigned int sz);
507507
#endif
508-
508+
509509
#define HAVE_AESGCM
510510
#define GCM_TABLE
511-
#define HAVE_AES_ECB
512-
#define WOLFSSL_AES_OFB
513-
#define WOLFSSL_AES_CFB
514-
#define WOLFSSL_AES_COUNTER
511+
512+
#if defined(WOLFSSL_NXP_LPC55S69) || defined(WOLFSSL_NXP_LPC55S69_NO_HWACCEL)
513+
#define HAVE_AES_ECB
514+
#define WOLFSSL_AES_OFB
515+
#define WOLFSSL_AES_CFB
516+
#define WOLFSSL_AES_COUNTER
517+
#define WOLFSSL_STATIC_MEMORY_TEST_SZ (30 * 1024)
518+
#endif
515519
#else
516520
#define HAVE_HASHDRBG
517521
#define WOLFSSL_AES_CFB

test-app/ARM-lpc55s69.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
_Min_Heap_Size = 0x00008000; /* minimal heap (not using malloc) */
1+
_Min_Heap_Size = 0x00000100; /* minimal heap (not using malloc) */
22
_Min_Stack_Size = 0x00008000; /* required amount of stack */
33

44
MEMORY
55
{
66
FLASH (rx) : ORIGIN = @WOLFBOOT_TEST_APP_ADDRESS@, LENGTH = @WOLFBOOT_TEST_APP_SIZE@
7-
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 96K
7+
RAM (rwx) : ORIGIN = 0x20020000, LENGTH = 160K
88
}
99

1010
SECTIONS

test-app/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ ifeq ($(WOLFCRYPT_SUPPORT),1)
182182
# Add SP C math (all architectures)
183183
APP_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c32.o
184184

185+
# Add RSA support (needed by test suite)
186+
APP_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/rsa.o
187+
185188
ifneq ($(NO_ASM),1)
186189
# SP Cortex M
187190
ifneq ($(filter ARM ARM_BE,$(ARCH)),)
@@ -738,10 +741,8 @@ ifeq ($(TARGET),lpc55s69)
738741
else
739742
CFLAGS+=-DWOLFSSL_NXP_LPC55S69_NO_HWACCEL
740743
endif
741-
LIBS+=--specs=nano.specs
742-
ifneq ($(WOLFCRYPT_SUPPORT),1)
743-
# Only use nosys stubs when not providing our own syscalls
744-
LDFLAGS+=--specs=nosys.specs
744+
ifeq ($(WOLFCRYPT_SUPPORT),1)
745+
LIBS+=--specs=nano.specs
745746
endif
746747
ifeq ($(WOLFCRYPT_BENCHMARK),1)
747748
# Benchmark needs float printf for results

test-app/app_lpc55s69.c

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ void main(void)
133133
uint8_t boot_state, update_state;
134134

135135
hal_init();
136-
systick_init();
137136
leds_init();
137+
#ifndef TZEN
138+
systick_init();
138139
__enable_irq();
140+
#endif
139141

140142
wolfBoot_printf("\n==================================\n");
141143
wolfBoot_printf("LPC55S69 wolfBoot demo Application\n");
@@ -205,63 +207,69 @@ void main(void)
205207
}
206208

207209

208-
// #include "sys/stat.h"
209-
// int _getpid(void)
210-
// {
211-
// return 1;
212-
// }
213-
214-
// int _kill(int pid, int sig)
215-
// {
216-
// (void)pid;
217-
// (void)sig;
218-
// return -1;
219-
// }
220-
221-
// void _exit(int status)
222-
// {
223-
// _kill(status, -1);
224-
// while (1) {}
225-
// }
226-
227-
// int _read(int file, char *ptr, int len)
228-
// {
229-
// (void)file;
230-
// (void)ptr;
231-
// (void)len;
232-
// return -1;
233-
// }
234-
235-
// int _write(int file, char *ptr, int len)
236-
// {
237-
// (void)file;
238-
// (void)ptr;
239-
// return len;
240-
// }
241-
242-
// int _close(int file)
243-
// {
244-
// (void)file;
245-
// return -1;
246-
// }
247-
248-
// int _isatty(int file)
249-
// {
250-
// (void)file;
251-
// return 1;
252-
// }
253-
254-
// int _lseek(int file, int ptr, int dir)
255-
// {
256-
// (void)file;
257-
// (void)ptr;
258-
// (void)dir;
259-
// return 0;
260-
// }
261-
262-
// int _fstat(int file, struct stat *st)
263-
// {
264-
// (void)file;
265-
// st->st_mode = S_IFCHR;
266-
// return 0;
267-
// }
210+
#include "sys/stat.h"
211+
int WEAKFUNCTION _getpid(void)
212+
{
213+
return 1;
214+
}
215+
216+
int WEAKFUNCTION _kill(int pid, int sig)
217+
{
218+
(void)pid;
219+
(void)sig;
220+
return -1;
221+
}
222+
223+
void WEAKFUNCTION _exit(int status)
224+
{
225+
_kill(status, -1);
226+
while (1) {}
227+
}
228+
229+
int WEAKFUNCTION _read(int file, char *ptr, int len)
230+
{
231+
(void)file;
232+
(void)ptr;
233+
(void)len;
234+
return -1;
235+
}
236+
237+
int WEAKFUNCTION _write(int file, char *ptr, int len)
238+
{
239+
(void)file;
240+
(void)ptr;
241+
return len;
242+
}
243+
244+
int WEAKFUNCTION _close(int file)
245+
{
246+
(void)file;
247+
return -1;
248+
}
249+
250+
int WEAKFUNCTION _isatty(int file)
251+
{
252+
(void)file;
253+
return 1;
254+
}
255+
256+
int WEAKFUNCTION _lseek(int file, int ptr, int dir)
257+
{
258+
(void)file;
259+
(void)ptr;
260+
(void)dir;
261+
return 0;
262+
}
263+
264+
int WEAKFUNCTION _fstat(int file, struct stat *st)
265+
{
266+
(void)file;
267+
st->st_mode = S_IFCHR;
268+
return 0;
269+
}
270+
271+
void WEAKFUNCTION *_sbrk(int incr)
272+
{
273+
(void)incr;
274+
return 0;
275+
}

0 commit comments

Comments
 (0)