Skip to content

Commit 628fbe5

Browse files
committed
Using CMake from IDE directory
1 parent 10ddb3e commit 628fbe5

File tree

4 files changed

+86
-71
lines changed

4 files changed

+86
-71
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
set(WOLFBOOT_PATH ../../../../)
3+
set(CMAKE_CXX_COMPILER arm-none-eabi-gcc)
4+
5+
include(${PICO_SDK_PATH}/pico_sdk_init.cmake)
6+
7+
set(PICOTOOL_FETCH_FROM_GIT_PATH 1)
8+
9+
project(wolfboot)
10+
11+
# initialize the Raspberry Pi Pico SDK
12+
pico_sdk_init()
13+
14+
15+
add_executable(wolfboot
16+
${WOLFBOOT_PATH}/src/image.c
17+
${WOLFBOOT_PATH}/src/loader.c
18+
${WOLFBOOT_PATH}/src/update_flash.c
19+
${WOLFBOOT_PATH}/src/keystore.c
20+
${WOLFBOOT_PATH}/src/libwolfboot.c
21+
${WOLFBOOT_PATH}/src/boot_arm.c
22+
23+
${WOLFBOOT_PATH}/hal/rp2350.c
24+
25+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/sp_int.c
26+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/sp_cortexm.c
27+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/memory.c
28+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/random.c
29+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/sha256.c
30+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/sha512.c
31+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/aes.c
32+
${WOLFBOOT_PATH}/lib/wolfssl/wolfcrypt/src/ecc.c
33+
)
34+
35+
# Add cflags
36+
target_compile_options(wolfboot PRIVATE
37+
-D__WOLFBOOT
38+
-D__ARM_ARCH_6M__
39+
-DWOLFSSL_USER_SETTINGS
40+
-mcpu=cortex-m33
41+
-DCORTEX_M33
42+
-DWOLFSSL_SP_ASM
43+
-DWOLFSSL_SP_ARM_CORTEX_M_ASM
44+
-DWOLFSSL_ARM_ARCH=8
45+
-DARCH_FLASH_OFFSET=0x10000000
46+
-DWOLFBOOT_ORIGIN=0x10000000
47+
-DBOOTLOADER_PARTITION_SIZE=0x40000
48+
-DWOLFBOOT_ARCH_ARM
49+
-DTARGET_rp2350
50+
-DWOLFBOOT_SIGN_ECC256
51+
-DRAM_CODE
52+
-DFILL_BYTE=0xFF
53+
-Os
54+
-DWOLFBOOT_NO_MPU
55+
-DWOLFBOOT_HASH_SHA256
56+
-DIMAGE_HEADER_SIZE=1024
57+
-Wstack-usage=7632
58+
)
59+
60+
61+
target_include_directories(wolfboot PRIVATE
62+
${WOLFBOOT_PATH}/include
63+
${WOLFBOOT_PATH}/lib/wolfssl
64+
)
65+
66+
target_link_libraries(wolfboot pico_stdlib hardware_flash)
67+
68+
pico_enable_stdio_usb(wolfboot 1)
69+
pico_enable_stdio_uart(wolfboot 0)
70+
71+
72+
pico_add_extra_outputs(wolfboot)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Building wolfBoot for raspberry pico 2
2+
3+
```
4+
mkdir build
5+
cd build
6+
cmake .. -DPICO_SDK_PATH=path/to/pico-sdk -DFAMILY=rp2350
7+
make
8+
```
9+

hal/rp2350.ld

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/update_flash.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ int WP11_Library_Init(void);
3939
#endif
4040

4141
#ifdef RAM_CODE
42+
#ifndef TARGET_rp2350
4243
extern unsigned int _start_text;
44+
#else
45+
extern unsigned int __logical_binary_start;
46+
unsigned int _start_text = (unsigned int)&__logical_binary_start;
47+
#endif
4348
static volatile const uint32_t __attribute__((used)) wolfboot_version = WOLFBOOT_VERSION;
4449

4550
#ifdef EXT_FLASH

0 commit comments

Comments
 (0)