Fixes for bootloader refactor build failures (#15638)

This commit is contained in:
Ryan 2022-01-06 06:55:46 +11:00 committed by GitHub
parent 99e11f4823
commit 5fb93934d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 53 additions and 121 deletions

View file

@ -143,6 +143,9 @@ ifneq ($(findstring STM32F042, $(MCU)),)
# This ensures that the EEPROM page buffer fits into RAM
USE_PROCESS_STACKSIZE = 0x600
USE_EXCEPTIONS_STACKSIZE = 0x300
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC400
endif
ifneq ($(findstring STM32F072, $(MCU)),)
@ -175,6 +178,9 @@ ifneq ($(findstring STM32F072, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F0
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC800
endif
ifneq ($(findstring STM32F103, $(MCU)),)
@ -239,6 +245,9 @@ ifneq ($(findstring STM32F303, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F3
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFFD800
endif
ifneq ($(findstring STM32F401, $(MCU)),)
@ -276,6 +285,9 @@ ifneq ($(findstring STM32F401, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32F405, $(MCU)),)
@ -308,6 +320,9 @@ ifneq ($(findstring STM32F405, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32F407, $(MCU)),)
@ -340,6 +355,9 @@ ifneq ($(findstring STM32F407, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32F411, $(MCU)),)
@ -377,6 +395,9 @@ ifneq ($(findstring STM32F411, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32F4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32F446, $(MCU)),)
@ -406,6 +427,9 @@ ifneq ($(findstring STM32F446, $(MCU)),)
BOARD ?= GENERIC_STM32_F446XE
USE_FPU ?= yes
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32G431, $(MCU)),)
@ -438,6 +462,9 @@ ifneq ($(findstring STM32G431, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32G4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring STM32G474, $(MCU)),)
@ -470,6 +497,9 @@ ifneq ($(findstring STM32G474, $(MCU)),)
# UF2 settings
UF2_FAMILY ?= STM32G4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq (,$(filter $(MCU),STM32L433 STM32L443))
@ -504,6 +534,9 @@ ifneq (,$(filter $(MCU),STM32L433 STM32L443))
# UF2 settings
UF2_FAMILY ?= STM32L4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq (,$(filter $(MCU),STM32L412 STM32L422))
@ -538,6 +571,9 @@ ifneq (,$(filter $(MCU),STM32L412 STM32L422))
# UF2 settings
UF2_FAMILY ?= STM32L4
# Bootloader address for STM32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
endif
ifneq ($(findstring WB32F3G71, $(MCU)),)
@ -567,6 +603,10 @@ ifneq ($(findstring WB32F3G71, $(MCU)),)
BOARD ?= GENERIC_WB32_F3G71XX
USE_FPU ?= no
# Bootloader address for WB32 DFU
STM32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
endif
ifneq ($(findstring GD32VF103, $(MCU)),)

View file

@ -17,7 +17,6 @@ As such, if you wish to override this API consider limiting use to writing to lo
| `config.h` override | Description | Default |
|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| `#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP` | Whether or not bootloader is to be executed during the early initialisation code of QMK. | `FALSE` |
| `#define STM32_BOOTLOADER_ADDRESS` | Relevant for single-bank STM32 MCUs, signifies the memory address to jump to bootloader. Consult [AN2606](https://www.st.com/content/st_com/en/search.html#q=an2606-t=resources-page=1) for the _System Memory_ address for your MCU. This value should be of the format `0x11111111`. | `<none>` |
| `#define STM32_BOOTLOADER_DUAL_BANK` | Relevant for dual-bank STM32 MCUs, signifies that a GPIO is to be toggled in order to enter bootloader mode. | `FALSE` |
| `#define STM32_BOOTLOADER_DUAL_BANK_GPIO` | Relevant for dual-bank STM32 MCUs, the pin to toggle when attempting to enter bootloader mode, e.g. `B8` | `<none>` |
| `#define STM32_BOOTLOADER_DUAL_BANK_POLARITY` | Relevant for dual-bank STM32 MCUs, the value to set the pin to in order to trigger charging of the RC circuit. e.g. `0` or `1`. | `0` |

View file

@ -1,7 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here (page 175):
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
* This also requires a patch to chibios:
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800

View file

@ -1,9 +1,11 @@
# MCU name
# Actually F070, but close enough
MCU = STM32F072
BOARD = DURGOD_STM32_F070
# Bootloader selection
BOOTLOADER = stm32-dfu
# Do not put the microcontroller into power saving mode
NO_SUSPEND_POWER_DOWN = yes

View file

@ -1,12 +1,8 @@
# MCU name
MCU = STM32F103
MCU_LDSCRIPT = stm32f103_bootloader
BOARD = ST_NUCLEO64_F103RB
CFLAGS += "-Wno-error=deprecated"
EXTRAFLAGS = -O0 -g
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control

View file

@ -208,9 +208,6 @@ static void stm32_gpio_init(void) {
* else.
*/
void __early_init(void) {
extern void enter_bootloader_mode_if_requested(void);
enter_bootloader_mode_if_requested();
stm32_gpio_init();
stm32_clock_init();
}

View file

@ -1,7 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
* This also requires a patch to chibios:
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -25,14 +25,6 @@ ARMV = 7
USE_FPU = yes
# Vector table for application
# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
OPT_DEFS =
# Options to pass to dfu-util when flashing
#DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
#DFU_SUFFIX_ARGS = -p DF11 -v 0483
# Build Options
# change yes to no to disable
#

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -2,7 +2,7 @@
MCU = atmega32a
# Bootloader selection
BOOTLOADER = atmel-dfu
BOOTLOADER = bootloadhid
# Build Options
# change yes to no to disable

View file

@ -1,6 +1,9 @@
# MCU name
MCU = STM32F401
# Bootloader selection
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable
#
@ -14,6 +17,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
EEPROM_DRIVER = i2c
# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE -DDEBUG_EEPROM_OUTPUT=TRUE
STM32_BOOTLOADER_ADDRESS = 0x1FFF0000

View file

@ -622,12 +622,7 @@ def arm_processor_rules(info_data, rules):
info_data['protocol'] = 'ChibiOS'
if 'bootloader' not in info_data:
if 'STM32' in info_data['processor']:
info_data['bootloader'] = 'stm32-dfu'
elif 'WB32' in info_data['processor']:
info_data['bootloader'] = 'wb32-dfu'
else:
info_data['bootloader'] = 'unknown'
info_data['bootloader'] = 'unknown'
if 'STM32' in info_data['processor']:
info_data['platform'] = 'STM32'

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFFC400

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here (page 175):
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800

View file

@ -1,5 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800

View file

@ -17,7 +17,7 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

View file

@ -17,7 +17,7 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

View file

@ -17,7 +17,7 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
#endif

View file

@ -1,23 +0,0 @@
/* Copyright 2018-2020 Nick Brassel (@tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here (page 175):
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
* This also requires a patch to chibios:
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000

View file

@ -17,7 +17,6 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000
#define PAL_STM32_OSPEED_HIGHEST PAL_STM32_OSPEED_HIGH

View file

@ -17,7 +17,6 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up by checking against ST's application note AN2606.
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFF0000
#define PAL_STM32_OSPEED_HIGHEST PAL_STM32_OSPEED_HIGH

View file

@ -1,12 +0,0 @@
/* Address for jumping to bootloader on WB32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.westberrytech.com/down/mcu/data/WB32F3G71xx_rm.pdf
*/
#ifndef WB32_BOOTLOADER_ADDRESS
# undef STM32_BOOTLOADER_ADDRESS
# define WB32_BOOTLOADER_ADDRESS 0x1FFFE000
# define STM32_BOOTLOADER_ADDRESS WB32_BOOTLOADER_ADDRESS
#else
# undef STM32_BOOTLOADER_ADDRESS
# define STM32_BOOTLOADER_ADDRESS WB32_BOOTLOADER_ADDRESS
#endif

View file

@ -1,7 +0,0 @@
/* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here:
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
* This also requires a patch to chibios:
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
*/
#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800

View file

@ -17,6 +17,7 @@
#include "bootloader.h"
#include <ch.h>
#include <hal.h>
#define DBGMCU_KEY_UNLOCK 0x4B5A6978
#define DBGMCU_CMD_RESET 0x1