Skip to content

Commit 0bde885

Browse files
authored
Merge pull request #35 from akospasztor/31-gcc
Release v1.1.1
2 parents 0372f9f + 6ec46b5 commit 0bde885

File tree

12 files changed

+65803
-58
lines changed

12 files changed

+65803
-58
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.vscode/
2+
*.pyc
23
**/EWARM/*.dep
34
**/EWARM/settings/
45
**/EWARM/**/Exe/
56
**/EWARM/**/List/
67
**/EWARM/**/Obj/
7-
*.pyc
8+
**/GCC/build/

Diff for: CHANGELOG.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# Changelog for STM32 Bootloader
22

3-
## [Unreleased]
4-
- Check checksum of application found on SD card before programming
3+
4+
## 1.1.1
5+
Released: 2020-05-27 | Download: [1.1.1](https://github.com/akospasztor/stm32-bootloader/releases/tag/v1.1.1)
6+
### Added
7+
- GNU Arm Embedded Toolchain support for the STM32L496-Discovery project example
8+
- Automatic source code formatting with clang-format
9+
- Source code format check with CI
10+
### Changed
11+
- Replaced GitHub Actions with Azure Pipelines
12+
### Fixed
13+
- Doxygen warnings are fixed
14+
- READMEs are updated
15+
516

617
## 1.1.0
718
Released: 2019-10-26 | Download: [1.1.0](https://github.com/akospasztor/stm32-bootloader/releases/tag/v1.1.0)

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Customizable Bootloader for STM32 microcontrollers. This project includes demons
44

55
Each example uses the same bootloader library located in the `lib/stm32-bootloader` folder. The examples are located in the `projects` folder and they come with a separate, dedicated README file with description related to that specific implementation.
66

7+
Update: the `STM32L496-Discovery` example supports compiling and building the project with the GNU Arm Embedded Toolchain out-of-the-box, in addition to IAR EWARM. Check out the project README for further information.
8+
79
Please refer to <https://akospasztor.github.io/stm32-bootloader> for complete documentation of the bootloader library source code.
810

911
![Build Status](https://dev.azure.com/akospasztor/stm32-bootloader/_apis/build/status/akospasztor.stm32-bootloader?branchName=master)
@@ -79,7 +81,7 @@ The application image has to be in binary format. If the checksum verification i
7981

8082
__Important notes__:
8183
- In order to perform a successful application jump from the bootloader, the vector table of the application firmware should be relocated. On system reset, the vector table is fixed at address 0x00000000. When creating an application, the microcontroller startup code sets the vector table offset to 0x0000 in the `system_stm32xxxx.c` file by default. This has to be either disabled (the bootloader can be configured to perform the vector table relocation before the jump) or manually set the vector table offset register (VTOR) to the appropriate offset value which is the start address of the application space. For more information, please refer to [[1]](#references).
82-
- The linker settings of the application firmware need to be adjusted from their default settings so that the start address of FLASH reflects the actual start address of the application space.
84+
- The linker settings of the application firmware need to be adjusted from their default settings so that the start address of flash reflects the actual start address of the application space.
8385

8486
## Configuration
8587
The bootloader can be widely configured in the `bootloader.h` file. The file includes detailed comments and descriptions related to the configurable parameters and definitions.

Diff for: lib/stm32-bootloader/bootloader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* Private defines -----------------------------------------------------------*/
2020
#define BOOTLOADER_VERSION_MAJOR 1 /*!< Major version */
2121
#define BOOTLOADER_VERSION_MINOR 1 /*!< Minor version */
22-
#define BOOTLOADER_VERSION_PATCH 0 /*!< Patch version */
22+
#define BOOTLOADER_VERSION_PATCH 1 /*!< Patch version */
2323
#define BOOTLOADER_VERSION_RC 0 /*!< Release candidate version */
2424

2525
/* Private typedef -----------------------------------------------------------*/

Diff for: projects/STM32L496-Discovery/GCC/Makefile

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Configuration ################################################################
2+
# Target name
3+
TARGET = stm32-bootloader
4+
# Debug configuration selector
5+
DEBUG = 1
6+
# Optimization level
7+
OPT = -Og
8+
# Build path
9+
BUILD_DIR = build
10+
11+
# Defines ######################################################################
12+
# Assembly defines
13+
ASM_DEFS =
14+
15+
# C defines
16+
C_DEFS = \
17+
-DUSE_HAL_DRIVER \
18+
-DSTM32L496xx
19+
20+
# Includes #####################################################################
21+
# Assembly includes
22+
ASM_INCLUDES =
23+
24+
# C includes
25+
C_INCLUDES = \
26+
-I../include \
27+
-I../../../lib/stm32-bootloader \
28+
-I../../../lib/fatfs \
29+
-I../../../drivers/CMSIS/Include \
30+
-I../../../drivers/CMSIS/Device/ST/STM32L4xx/Include \
31+
-I../../../drivers/STM32L4xx_HAL_Driver/Inc
32+
33+
# Source files #################################################################
34+
# Assembly source files
35+
ASM_SOURCES = \
36+
startup_stm32l496xx.s
37+
38+
# C source files
39+
C_SOURCES = \
40+
$(wildcard ../source/*.c) \
41+
$(wildcard ../../../lib/stm32-bootloader/*.c) \
42+
$(wildcard ../../../lib/fatfs/*.c) \
43+
../../../lib/fatfs/option/unicode.c \
44+
$(wildcard ../../../drivers/STM32L4xx_HAL_Driver/Src/*.c)
45+
46+
# Toolchain ####################################################################
47+
CUSTOMPATH = "C:/Program Files (x86)/GNU Tools ARM Embedded/8 2019-q3-update/bin"
48+
PREFIX = arm-none-eabi-
49+
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
50+
# either it can be added to the PATH environment variable.
51+
ifdef GCC_PATH
52+
CC = $(GCC_PATH)/$(PREFIX)gcc
53+
AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
54+
CP = $(GCC_PATH)/$(PREFIX)objcopy
55+
SZ = $(GCC_PATH)/$(PREFIX)size
56+
else
57+
CC = $(CUSTOMPATH)/$(PREFIX)gcc
58+
AS = $(CUSTOMPATH)/$(PREFIX)gcc -x assembler-with-cpp
59+
CP = $(CUSTOMPATH)/$(PREFIX)objcopy
60+
SZ = $(CUSTOMPATH)/$(PREFIX)size
61+
endif
62+
HEX = $(CP) -O ihex
63+
BIN = $(CP) -O binary -S
64+
65+
# Compiler flags ###############################################################
66+
# CPU
67+
CPU = -mcpu=cortex-m4
68+
# FPU
69+
FPU = -mfpu=fpv4-sp-d16
70+
# Float-abi
71+
FLOAT-ABI = -mfloat-abi=hard
72+
# MCU
73+
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
74+
75+
# Create compiler flags
76+
ASFLAGS = $(MCU) $(ASM_DEFS) $(ASM_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
77+
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
78+
79+
# Generate debug information
80+
ifeq ($(DEBUG), 1)
81+
CFLAGS += -g -gdwarf-2
82+
endif
83+
84+
# Generate dependency information
85+
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
86+
87+
# Linker flags #################################################################
88+
# Linker script
89+
LDSCRIPT = stm32l496xx_flash.ld
90+
91+
# Libraries
92+
LIBS = -lc -lm -lnosys
93+
LIBDIR =
94+
95+
# Create linker flags
96+
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
97+
98+
# Build target #################################################################
99+
# Default: build all
100+
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
101+
102+
# List of C objects
103+
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
104+
vpath %.c $(sort $(dir $(C_SOURCES)))
105+
106+
# List of ASM objects
107+
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
108+
vpath %.s $(sort $(dir $(ASM_SOURCES)))
109+
110+
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
111+
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
112+
113+
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
114+
$(AS) -c $(ASFLAGS) $< -o $@
115+
116+
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
117+
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
118+
$(SZ) $@
119+
120+
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
121+
$(HEX) $< $@
122+
123+
$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
124+
$(BIN) $< $@
125+
126+
$(BUILD_DIR):
127+
mkdir $@
128+
129+
# Clean
130+
clean:
131+
-rm -rf $(BUILD_DIR)
132+
133+
# Dependencies
134+
-include $(wildcard $(BUILD_DIR)/*.d)

0 commit comments

Comments
 (0)