mirror of https://github.com/wolfSSL/wolfBoot.git
stm32l0: add support for external SPI flash
parent
ad38bacfd8
commit
3682e66818
1
arch.mk
1
arch.mk
|
@ -46,6 +46,7 @@ ifeq ($(ARCH),ARM)
|
|||
|
||||
ifeq ($(TARGET),stm32l0)
|
||||
CORTEX_M0=1
|
||||
SPI_TARGET=stm32
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),stm32g0)
|
||||
|
|
|
@ -68,6 +68,20 @@
|
|||
#define SPI1_MOSI_PIN 7 /* SPI_MOSI PA7 */
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_stm32l0
|
||||
#define APB2_CLOCK_ER (*(volatile uint32_t *)(0x40021034))
|
||||
#define APB2_CLOCK_RST (*(volatile uint32_t *)(0x40021024))
|
||||
#define RCC_GPIO_CLOCK_ER (*(volatile uint32_t *)(0x4002102C))
|
||||
#define GPIOB_BASE (0x50000400)
|
||||
#define SPI_GPIO GPIOB_BASE
|
||||
#define SPI_CS_GPIO GPIOB_BASE
|
||||
#define SPI_CS_FLASH 8 /* Flash CS connected to GPIOB8 */
|
||||
#define SPI1_PIN_AF 0 /* Alternate function for SPI pins */
|
||||
#define SPI1_CLOCK_PIN 3 /* SPI_SCK: PB3 */
|
||||
#define SPI1_MISO_PIN 4 /* SPI_MISO PB4 */
|
||||
#define SPI1_MOSI_PIN 5 /* SPI_MOSI PB5 */
|
||||
#endif
|
||||
|
||||
#define SPI_PIO_BASE SPI_GPIO
|
||||
#define SPI_CS_PIO_BASE SPI_CS_GPIO
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <stdint.h>
|
||||
#include "image.h"
|
||||
|
||||
#if defined(PLATFORM_stm32f4) || defined(PLATFORM_stm32f7) || defined(PLATFORM_stm32wb)
|
||||
#if defined(PLATFORM_stm32f4) || defined(PLATFORM_stm32f7) || defined(PLATFORM_stm32wb) || defined(PLATFORM_stm32l0)
|
||||
#include "hal/spi/spi_drv_stm32.h"
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue