Skip to content

Commit 8992e45

Browse files
committed
Fixes for unused variables
1 parent d513adc commit 8992e45

33 files changed

+60
-90
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/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
@@ -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/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;

hal/nxp_t1024.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,6 @@ uint32_t io_read32(uint16_t port)
15381538
static int hal_pcie_init(void)
15391539
{
15401540
int ret;
1541-
int bus, i;
15421541
int law_idx = 8;
15431542
int tlb_idx = 14; /* next available TLB (after DDR) */
15441543
struct pci_enum_info enum_info;
@@ -1862,8 +1861,10 @@ struct qe_firmware {
18621861
/* Checks for valid QE firmware */
18631862
static int qe_check_firmware(const struct qe_firmware *firmware, const char* t)
18641863
{
1865-
unsigned int i, j;
1864+
unsigned int i;
1865+
#ifdef ENABLE_QE_CRC32
18661866
uint32_t crc;
1867+
#endif
18671868
size_t calc_size = sizeof(struct qe_firmware);
18681869
size_t length;
18691870
const struct qe_header *hdr;
@@ -2172,7 +2173,6 @@ static int fman_upload_firmware(const struct qe_firmware *firmware)
21722173
/* Loop through each microcode. */
21732174
for (i = 0; i < firmware->count; i++) {
21742175
const struct qe_microcode *ucode = &firmware->microcode[i];
2175-
uint32_t trapCount = 0;
21762176

21772177
/* Upload a microcode if it's present */
21782178
if (ucode->code_offset) {
@@ -2868,7 +2868,7 @@ extern uint32_t _bootpg_addr;
28682868
/* Startup additional cores with spin table and synchronize the timebase */
28692869
static void hal_mp_up(uint32_t bootpg)
28702870
{
2871-
uint32_t all_cores, active_cores, whoami, bpcr;
2871+
uint32_t all_cores, active_cores, whoami;
28722872
int timeout = 50, i;
28732873

28742874
whoami = get32(PIC_WHOAMI); /* Get current running core number */

hal/nxp_t2080.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static void hal_cpld_init(void)
491491

492492
void hal_init(void)
493493
{
494-
#ifdef DEBUG_UART
494+
#if defined(DEBUG_UART) && defined(ENABLE_CPLD)
495495
uint32_t fw;
496496
#endif
497497

0 commit comments

Comments
 (0)