Skip to content

Commit 4d49a7a

Browse files
authored
Merge pull request #29 from dgarske/ext_spi
Fixes for external SPI build option "SPI_FLASH=1"
2 parents 0deaef8 + 6ed1e5c commit 4d49a7a

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

include/spi_flash.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@
3636
#include <stdint.h>
3737

3838
uint16_t spi_flash_probe(void);
39+
void spi_release(void);
40+
3941
void spi_flash_sector_erase(uint32_t address);
4042
int spi_flash_read(uint32_t address, void *data, int len);
4143
int spi_flash_write(uint32_t address, const void *data, int len);
4244

4345
#else
4446

4547
#define spi_flash_probe() do{}while(0)
48+
#define spi_release() do{}while(0)
4649

4750
#endif /* SPI_FLASH */
4851

src/image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int wolfBoot_verify_signature(uint8_t *hash, uint8_t *sig)
120120
}
121121
#endif /* WOLFBOOT_SIGN_RSA2048 */
122122

123-
static uint8_t get_header_ext(struct wolfBoot_image *img, uint16_t type, uint8_t **ptr);
123+
static uint16_t get_header_ext(struct wolfBoot_image *img, uint16_t type, uint8_t **ptr);
124124

125125
static uint16_t get_header(struct wolfBoot_image *img, uint16_t type, uint8_t **ptr)
126126
{

src/spi_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int spi_flash_write_page(uint32_t address, const void *data, int len)
133133
static int spi_flash_write_sb(uint32_t address, const void *data, int len)
134134
{
135135
const uint8_t *buf = data;
136-
const uint8_t verify;
136+
uint8_t verify = 0;
137137
int j = 0;
138138
wait_busy();
139139
if (len < 1)

test-app/app_stm32f4.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@
3333

3434
#ifdef PLATFORM_stm32f4
3535

36-
#ifdef SPI_FLASH
37-
extern void spi_release(void);
38-
#else
39-
#define spi_release() do{}while(0)
40-
#endif
41-
42-
4336
#define UART1 (0x40011000)
4437

4538
#define UART1_SR (*(volatile uint32_t *)(UART1))

0 commit comments

Comments
 (0)