Skip to content

Commit 7c7f9d0

Browse files
committed
Fixes for unused variables
1 parent d513adc commit 7c7f9d0

27 files changed

+49
-80
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

hal/nrf5340.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ static uint32_t hal_shm_status_wait(ShmInfo_t* info, uint32_t status,
477477
uint32_t timeout_ms)
478478
{
479479
uint32_t status_ret = SHARED_STATUS_UNKNOWN;
480-
int ret = 0;
481480

482481
do {
483482
/* see if status shared already */
@@ -556,7 +555,7 @@ static void hal_net_check_version(void)
556555
{
557556
int ret;
558557
struct wolfBoot_image img;
559-
uint32_t timeout, status = 0;
558+
uint32_t status = 0;
560559

561560
#ifdef TARGET_nrf5340_app
562561
/* check the network core version */

hal/pic32c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ void pic32_clock_pll0_init(int refdiv, int fbdiv, int bw, int postdiv)
376376

377377
void pic32_clock_gclk_gen0(int mclk_div1, int cpudiv)
378378
{
379-
uint32_t reg;
380-
381379
/* setup clock division before changing the generator */
382380
if (mclk_div1 != 1)
383381
MCLK_DIV1 = mclk_div1;

hal/pic32cz.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636

3737
static void pic32_supc_vreg_pll_enable(void)
3838
{
39-
uint32_t reg;
40-
4139
SUPC_VREGCTRL |= SUPC_VREGCTRL_AVREGEN_PLLREG_EN
4240
<< SUPC_VREGCTRL_AVREGEN_SHIFT;
4341

hal/sama5d3.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,10 @@ static void mac_init(void)
223223

224224
static void ddr_init(void)
225225
{
226-
uint32_t val;
227226
uint32_t rtr, md, cr, tpr0, tpr1, tpr2;
228227
uint32_t col, row, cas, bank;
229228
uint32_t cal;
230229
uint32_t ba_offset = 0;
231-
uint32_t pmc_pcr;
232230
volatile uint32_t *dram_base = (volatile uint32_t *)DRAM_BASE;
233231

234232
/* Step 1: Calculate register values
@@ -551,8 +549,6 @@ static int nand_device_read(uint32_t row_address, uint8_t *data, int mode)
551549
{
552550
uint32_t col_address = 0x00;
553551
uint32_t tot_len = 0;
554-
uint32_t page_size = nand_flash.page_size;
555-
uint32_t pages_per_device = nand_flash.pages_per_device;
556552
uint32_t i;
557553

558554
if (mode == NAND_MODE_DATAPAGE) {
@@ -668,8 +664,6 @@ int ext_flash_read(uintptr_t address, uint8_t *data, int len)
668664

669665
static void pit_init(void)
670666
{
671-
uint32_t pmc_pcr;
672-
673667
/* Turn on clock for PIT */
674668
PMC_CLOCK_EN(PIT_PMCID);
675669

hal/spi/spi_drv_stm32.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ uint8_t RAMFUNCTION spi_read(void)
378378

379379
void RAMFUNCTION spi_write(const char byte)
380380
{
381-
int i;
382381
volatile uint32_t reg;
383382
do {
384383
reg = SPI1_SR;

hal/stm32_tz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static int is_range_nonsecure(uint32_t address, int len)
7979
uint32_t min2 = WOLFBOOT_PARTITION_UPDATE_ADDRESS;
8080
uint32_t max2 = FLASH_TOP + 1;
8181
uint32_t end;
82+
(void)boot_offset; /* calculated for reference, but not used */
8283
if (len < 0)
8384
return 0;
8485
end = (uint32_t)(address + len);
@@ -293,7 +294,6 @@ void hal_gtzc_init(void)
293294

294295
void hal_tz_sau_init(void)
295296
{
296-
uint32_t page_n = 0;
297297
/* SAU is set up before staging. Set up all areas as secure. */
298298

299299
/* Non-secure callable: NSC functions area */

0 commit comments

Comments
 (0)