Skip to content

Commit 1e3c0bc

Browse files
authored
Merge pull request #36 from AlexLanzano/stm32l1
[stm32l1] Implement initial support for stm32l1
2 parents a0694ae + 620a21c commit 1e3c0bc

41 files changed

Lines changed: 2762 additions & 90 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/boards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
board: [stm32wb55xx_nucleo, stm32wba55cg_nucleo, pic32cz_curiosity_ultra, stm32h563zi_nucleo, stm32f411_blackpill, stm32c031_nucleo, stm32f091rc_nucleo, stm32f302r8_nucleo]
14+
board: [stm32wb55xx_nucleo, stm32wba55cg_nucleo, pic32cz_curiosity_ultra, stm32h563zi_nucleo, stm32f411_blackpill, stm32c031_nucleo, stm32f091rc_nucleo, stm32f302r8_nucleo, stm32l152re_nucleo]
1515
extra_cflags: ["", "-DWHAL_CFG_NO_TIMEOUT"]
1616
include:
1717
- board: stm32wb55xx_nucleo

boards/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ build configuration.
2121
| WeAct BlackPill STM32F411 | STM32F4 | Cortex-M4 | `stm32f411_blackpill/` |
2222
| ST NUCLEO-H563ZI | STM32H5 | Cortex-M33 | `stm32h563zi_nucleo/` |
2323
| ST NUCLEO-WB55RG | STM32WB | Cortex-M4 | `stm32wb55xx_nucleo/` |
24+
| ST NUCLEO-L152RE | STM32L1 | Cortex-M3 | `stm32l152re_nucleo/` |
2425
| ST NUCLEO-WBA55CG | STM32WBA | Cortex-M33 | `stm32wba55cg_nucleo/` |
2526

2627
## Board Directory Contents

boards/stm32c031_nucleo/board.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ enum {
2626
};
2727

2828
#define BOARD_LED_PIN 0
29-
#define BOARD_LED_PORT_OFFSET 0x000 /* GPIOA */
30-
#define BOARD_LED_PIN_NUM 5
3129

3230
#define BOARD_FLASH_START_ADDR 0x08000000
3331
#define BOARD_FLASH_SIZE 0x8000

boards/stm32f091rc_nucleo/board.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ enum {
3131
};
3232

3333
#define BOARD_LED_PIN 0
34-
#define BOARD_LED_PORT_OFFSET 0x000 /* GPIOA */
35-
#define BOARD_LED_PIN_NUM 5
3634

3735
#define BOARD_FLASH_START_ADDR 0x08000000
3836
#define BOARD_FLASH_SIZE 0x40000

boards/stm32f302r8_nucleo/board.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ enum {
3131
};
3232

3333
#define BOARD_LED_PIN 0
34-
#define BOARD_LED_PORT_OFFSET 0x400 /* GPIOB */
35-
#define BOARD_LED_PIN_NUM 13
3634

3735
#define BOARD_FLASH_START_ADDR 0x08000000
3836
#define BOARD_FLASH_SIZE 0x10000
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
_BOARD_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
2+
3+
PLATFORM = stm32l1
4+
TESTS ?= clock gpio timer flash uart spi i2c
5+
6+
GCC = $(GCC_PATH)arm-none-eabi-gcc
7+
LD = $(GCC_PATH)arm-none-eabi-gcc
8+
OBJCOPY = $(GCC_PATH)arm-none-eabi-objcopy
9+
10+
CFLAGS += -Wall -Werror $(INCLUDE) -g3 \
11+
-ffreestanding -nostdlib \
12+
-mcpu=cortex-m3 -mthumb \
13+
-DPLATFORM_STM32L1 -MMD -MP \
14+
-DWHAL_CFG_GPIO_API_MAPPING_STM32L1 \
15+
-DWHAL_CFG_CLOCK_API_MAPPING_STM32L1 \
16+
-DWHAL_CFG_UART_API_MAPPING_STM32L1 \
17+
-DWHAL_CFG_SPI_API_MAPPING_STM32L1 \
18+
-DWHAL_CFG_I2C_API_MAPPING_STM32L1 \
19+
$(if $(filter iwdg,$(WATCHDOG)),-DBOARD_WATCHDOG_IWDG) \
20+
$(if $(filter wwdg,$(WATCHDOG)),-DBOARD_WATCHDOG_WWDG)
21+
LDFLAGS = -mcpu=cortex-m3 -mthumb \
22+
-ffreestanding -nostartfiles -Wl,--omagic -static
23+
24+
LINKER_SCRIPT ?= $(_BOARD_DIR)/linker.ld
25+
26+
INCLUDE += -I$(_BOARD_DIR) -I$(WHAL_DIR)/boards/peripheral
27+
28+
BOARD_SOURCE = $(_BOARD_DIR)/ivt.c
29+
BOARD_SOURCE += $(_BOARD_DIR)/board.c
30+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*.c)
31+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/timer.c)
32+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/supply.c)
33+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/flash.c)
34+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/rng.c)
35+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/crypto.c)
36+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/sensor.c)
37+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/block.c)
38+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/watchdog.c)
39+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/stm32l1_*.c)
40+
BOARD_SOURCE += $(wildcard $(WHAL_DIR)/src/*/systick.c)
41+
42+
# Peripheral devices
43+
include $(WHAL_DIR)/boards/peripheral/Makefile.inc

0 commit comments

Comments
 (0)