Skip to content

Commit bbd4e2b

Browse files
committed
[SAMA5D3] Stub for test application
1 parent 4cbfdf8 commit bbd4e2b

6 files changed

Lines changed: 107 additions & 1 deletion

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ ifeq ($(TARGET),nxp_t1024)
131131
endif
132132

133133
ifeq ($(TARGET),sama5d3)
134-
MAIN_TARGET:=wolfboot.bin
134+
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
135135
endif
136136

137+
137138
ifeq ($(FLASH_OTP_KEYSTORE),1)
138139
MAIN_TARGET+=tools/keytools/otp/otp-keystore-primer.bin
139140
endif

arch.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ ifeq ($(ARCH),ARM)
177177

178178
ifeq ($(TARGET),sama5d3)
179179
CORTEX_A5=1
180+
UPDATE_OBJS:=src/update_ram.o
181+
CFLAGS+=-DWOLFBOOT_DUALBOOT
180182
endif
181183

182184
## Cortex CPU

hal/sama5d3.ld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ SECTIONS
4545
_end_bss = .;
4646
}
4747
}
48+
49+
kernel_addr = 0x040000;
50+
update_addr = 0x080000;
51+
4852
_romsize = _end_data - _start_text;
4953
_sramsize = _end_bss - _start_text;
5054
END_STACK = _start_text;
5155
_stack_top = ORIGIN(DDR_MEM) + LENGTH(DDR_MEM);
5256
end = .; /* define a global symbol marking the end of application */
5357

58+

test-app/ARM-sama5d3.ld

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
OUTPUT_FORMAT("elf32-littlearm")
2+
OUTPUT_ARCH(arm)
3+
4+
MEMORY
5+
{
6+
DDR_MEM(rwx): ORIGIN = 0x00300000, LENGTH = 0x000100000
7+
}
8+
9+
ENTRY(reset_vector_entry)
10+
SECTIONS
11+
{
12+
.text : {
13+
_start_text = .;
14+
*(.text)
15+
*(.rodata)
16+
*(.rodata*)
17+
. = ALIGN(4);
18+
*(.glue_7)
19+
. = ALIGN(4);
20+
*(.eh_frame)
21+
. = ALIGN(4);
22+
_end_text = . ;
23+
}
24+
25+
/* collect all initialized .data sections */
26+
/* .data : AT ( ADDR (.text) + SIZEOF (.text) SIZEOF (.ARM.*) { */
27+
28+
. = ALIGN(4);
29+
.dummy : {
30+
_edummy = .;
31+
}
32+
33+
.data : AT (LOADADDR(.dummy)) {
34+
_start_data = .;
35+
*(.vectors)
36+
*(.data)
37+
_end_data = .;
38+
}
39+
40+
/* collect all uninitialized .bss sections */
41+
.bss (NOLOAD) : {
42+
. = ALIGN(4);
43+
_start_bss = .;
44+
*(.bss)
45+
_end_bss = .;
46+
}
47+
}
48+
_romsize = _end_data - _start_text;
49+
_sramsize = _end_bss - _start_text;
50+
END_STACK = _start_text;
51+
_stack_top = ORIGIN(DDR_MEM) + LENGTH(DDR_MEM);
52+
end = .; /* define a global symbol marking the end of application */
53+

test-app/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ ifeq ($(HASH),SHA3_384)
3636
endif
3737

3838

39+
3940
ifeq ($(TARGET),ti_hercules)
4041
APP_OBJS:=app_$(TARGET).o ../test-app/libwolfboot.o
4142
CFLAGS+=-I"../include"
@@ -144,6 +145,11 @@ ifeq ($(TARGET),stm32c0)
144145
LSCRIPT_TEMPLATE=ARM-stm32c0.ld
145146
endif
146147

148+
ifeq ($(TARGET),sama5d3)
149+
APP_OBJS+=../src/boot_arm32_start.o
150+
LSCRIPT_TEMPLATE:=$(ARCH)-$(TARGET).ld
151+
endif
152+
147153
ifeq ($(TARGET),stm32l4)
148154
APP_OBJS+=$(STM32CUBE)/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.o
149155
APP_OBJS+=$(STM32CUBE)/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.o

test-app/app_sama5d3.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* app_sama5d3.c
2+
*
3+
* Test bare-metal boot application
4+
*
5+
* Copyright (C) 2021 wolfSSL Inc.
6+
*
7+
* This file is part of wolfBoot.
8+
*
9+
* wolfBoot is free software; you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation; either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* wolfBoot is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program; if not, write to the Free Software
21+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
22+
*/
23+
24+
#include <stdlib.h>
25+
#include <stdint.h>
26+
#include <string.h>
27+
28+
#include "wolfboot/wolfboot.h"
29+
30+
#ifdef TARGET_sama5d3
31+
32+
volatile uint32_t time_elapsed = 0;
33+
void main(void) {
34+
35+
/* Wait for reboot */
36+
while(1)
37+
;
38+
}
39+
#endif /** TARGET_sama5d3 **/

0 commit comments

Comments
 (0)