Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bootloader_jump for dualbank STM32 respect STM32_BOOTLOADER_DUAL_BANK_DELAY #17178

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/platformdev_chibios_earlyinit.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ As such, if you wish to override this API consider limiting use to writing to lo
| `#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` |
| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100000` |
| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100` |

Kinetis MCUs have no configurable options.

Expand Down
4 changes: 2 additions & 2 deletions platforms/chibios/bootloaders/stm32_dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern uint32_t __ram0_end__;
# endif

# ifndef STM32_BOOTLOADER_DUAL_BANK_DELAY
# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100000
# define STM32_BOOTLOADER_DUAL_BANK_DELAY 100
# endif

__attribute__((weak)) void bootloader_jump(void) {
Expand All @@ -55,7 +55,7 @@ __attribute__((weak)) void bootloader_jump(void) {
# endif

// Wait for a while for the capacitor to charge
wait_ms(100);
wait_ms(STM32_BOOTLOADER_DUAL_BANK_DELAY);

// Issue a system reset to get the ROM bootloader to execute, with BOOT0 high
NVIC_SystemReset();
Expand Down