Skip to content

Commit 0de446a

Browse files
committed
Fixes for unused variables
1 parent ecf1cb8 commit 0de446a

37 files changed

+65
-102
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ CFLAGS+= \
105105
# Setup default optimizations (for GCC)
106106
ifeq ($(USE_GCC_HEADLESS),1)
107107
CFLAGS+=-Wall -Wextra -Wno-main -ffreestanding -Wno-unused -nostartfiles
108-
CFLAGS+=-ffunction-sections -fdata-sections -fomit-frame-pointer
108+
CFLAGS+=-ffunction-sections -fdata-sections -fomit-frame-pointer -Wunused-variable
109109
LDFLAGS+=-Wl,-gc-sections -Wl,-Map=wolfboot.map -ffreestanding -nostartfiles
110110
# Not setting LDFLAGS directly since it is passed to the test-app
111111
LSCRIPT_FLAGS+=-T $(LSCRIPT)

arch.mk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,14 @@ ifeq ($(ARCH),ARM)
190190
ARCH_FLASH_OFFSET=0x08000000
191191
SPI_TARGET=stm32
192192
ifneq ($(PKA),0)
193-
PKA_EXTRA_OBJS+= $(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pka.o $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/st/stm32.o
194-
PKA_EXTRA_CFLAGS+=-DWOLFSSL_STM32_PKA -I$(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Inc \
195-
-Isrc -I$(STM32CUBE)/Drivers/BSP/P-NUCLEO-WB55.Nucleo/ -I$(STM32CUBE)/Drivers/CMSIS/Device/ST/STM32WBxx/Include \
196-
-I$(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Inc/ \
197-
-I$(STM32CUBE)/Drivers/CMSIS/Include \
198-
-Ihal \
199-
-DSTM32WB55xx
193+
PKA_EXTRA_OBJS+= $(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pka.o $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/st/stm32.o
194+
PKA_EXTRA_CFLAGS+=-DWOLFSSL_STM32WB -DWOLFSSL_STM32_PKA -DWOLFSSL_STM32_CUBEMX -DNO_STM32_HASH -DSTM32WB55xx
195+
PKA_EXTRA_CFLAGS+=-Isrc -Ihal \
196+
-I$(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Inc \
197+
-I$(STM32CUBE)/Drivers/BSP/P-NUCLEO-WB55.Nucleo/ \
198+
-I$(STM32CUBE)/Drivers/CMSIS/Device/ST/STM32WBxx/Include \
199+
-I$(STM32CUBE)/Drivers/STM32WBxx_HAL_Driver/Inc \
200+
-I$(STM32CUBE)/Drivers/CMSIS/Include
200201
endif
201202
endif
202203

config/examples/stm32l4-cube.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SPMATH?=1
1515
RAM_CODE?=0
1616
DUALBANK_SWAP?=0
1717
IMAGE_HEADER_SIZE?=0x200
18-
STM32CUBE?=$(HOME)/STM32Cube/Repository/STM32Cube_FW_L4_V1.17.0
18+
STM32CUBE?=$(HOME)/STM32Cube/Repository/STM32Cube_FW_L4_V1.18.1
1919
WOLFBOOT_SECTOR_SIZE=0x1000
2020
WOLFBOOT_PARTITION_SIZE=0x7A000
2121
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x0800A000

config/examples/stm32wb-pka-1mb.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x08083800
88
WOLFBOOT_PARTITION_SWAP_ADDRESS=0x080FF000
99
NVM_FLASH_WRITEONCE=1
1010
PKA=1
11+
STM32CUBE?=$(HOME)/STM32Cube/Repository/STM32Cube_FW_WB_V1.23.0
12+
NO_ARM_ASM=1

docs/wolfHSM.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ make test-sim-internal-flash-with-update
144144

145145
#### wolfHSM Server Mode Build
146146

147-
To build the simulator configured to use embedded wolfHSM server mode, use the `WOLFHSM_SERVER=1` makefile option. In this mode, wolfBoot includes the complete wolfHSM server and no external HSM server is required. Currently the wolfHSM server only supporst the certificate chain verification mode of authentication.
147+
To build the simulator configured to use embedded wolfHSM server mode, use the `WOLFHSM_SERVER=1` makefile option. In this mode, wolfBoot includes the complete wolfHSM server and no external HSM server is required. Currently the wolfHSM server only supports the certificate chain verification mode of authentication.
148148

149149
```sh
150150
# Grab the HSM server simulator configuration (with certificate chain verification)
@@ -228,7 +228,7 @@ When using wolfHSM server mode, no external server is required. wolfBoot include
228228
# Create a simulated NVM image for the POSIX flash file simulator containing the dummy root CA for cert chain verification.
229229
# You must build whnvmtool first if you haven't already, and ensure the file name matches the simulated NVM image file
230230
# name in hal/sim.c
231-
./lib/wolfHSM/tools/whnvmtool/whnvmtool --image=wolfBoot_wolfHSM_NVM.bin --size 16348 --invert-erased-byte tools/scripts/wolfBoot-wolfHSM-sim-dummy-certchain.nvminit
231+
./lib/wolfHSM/tools/whnvmtool/whnvmtool --image=wolfBoot_wolfHSM_NVM.bin --size 16348 --invert-erased-byte tools/scripts/wolfBoot-wolfHSM-sim-dummy-certchain.nvminit
232232

233233
# Run the wolfBoot simulator with embedded wolfHSM server to stage an update
234234
./wolfboot.elf update_trigger get_version

hal/lpc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "fsl_flashiap.h"
2727
#include "fsl_power.h"
2828

29-
static int flash_init = 0;
3029
uint32_t SystemCoreClock;
3130

3231
#ifdef NVM_FLASH_WRITEONCE

hal/mcxa.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#define BOARD_BOOTCLOCKFRO96M_CORE_CLOCK 96000000UL
3737

3838
static flash_config_t pflash;
39-
static int flash_init = 0;
4039

4140
uint32_t SystemCoreClock;
4241

hal/nrf5340.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ static uint32_t hal_shm_status_wait(ShmInfo_t* info, uint32_t status,
479479
uint32_t timeout_ms)
480480
{
481481
uint32_t status_ret = SHARED_STATUS_UNKNOWN;
482-
int ret = 0;
483482

484483
do {
485484
/* see if status shared already */
@@ -558,7 +557,7 @@ static void hal_net_check_version(void)
558557
{
559558
int ret;
560559
struct wolfBoot_image img;
561-
uint32_t timeout, status = 0;
560+
uint32_t status = 0;
562561

563562
#ifdef TARGET_nrf5340_app
564563
/* check the network core version */

hal/nxp_ls1028a.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ void xspi_flash_write(uintptr_t address, const uint8_t *data, uint32_t len)
537537
{
538538
uint32_t size = 0;
539539
uint32_t tx_data = 0;
540-
uint32_t size_wm = 0;
541540
uint32_t loop_cnt = 0;
542541
uint32_t remaining, rem_size = 0;
543542
uint32_t i = 0, j = 0;
@@ -839,8 +838,6 @@ void hal_init(void)
839838
{
840839
volatile uint32_t counter=0xFFFFul; /* used for delay */
841840
#ifdef DEBUG_UART
842-
uint32_t fw;
843-
844841
uart_init();
845842
wolfBoot_printf("wolfBoot Init\n");
846843
#endif

hal/nxp_p1021.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,9 @@ static void qe_upload_microcode(const struct qe_firmware *firmware,
12991299
static int qe_upload_firmware(const struct qe_firmware *firmware)
13001300
{
13011301
unsigned int i, j;
1302+
#ifdef ENABLE_QE_CRC32
13021303
uint32_t crc;
1304+
#endif
13031305
size_t calc_size = sizeof(struct qe_firmware);
13041306
size_t length;
13051307
const struct qe_header *hdr;

0 commit comments

Comments
 (0)