update bootloader

This commit is contained in:
bwisn 2022-03-06 11:16:33 +01:00
parent 0cc83e4886
commit 240745dc05
3 changed files with 4 additions and 24 deletions

View File

@ -21,9 +21,6 @@
#include "ap2_led.h"
#include "protocol.h"
#define RAM_MAGIC_LOCATION 0x20001ffc
#define IAP_MAGIC_VALUE 0x0000fab2
static const SerialConfig ledUartInitConfig = {
.speed = 115200,
};
@ -44,27 +41,6 @@ static uint8_t ledMcuWakeup[11] = {0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0x7
ble_capslock_t BLECapsLock = {._dummy = {0}, .caps_lock = false};
void bootloader_jump(void) {
// Send msg to shine to boot into IAP
annepro2SetIAP();
// wait for shine to boot into IAP
wait_ms(15);
// Load ble into IAP
annepro2_ble_bootload();
wait_ms(15);
// Magic key to set keyboard to IAP
// Its from reversing original boot loader
// If value is that it stays in boot loader aka IAP
*((uint32_t *)RAM_MAGIC_LOCATION) = IAP_MAGIC_VALUE;
// Load the main MCU into IAP
__disable_irq();
NVIC_SystemReset();
}
void keyboard_pre_init_kb(void) {
// Start LED UART
sdStart(&SD0, &ledUartInitConfig);

View File

@ -16,6 +16,8 @@ MCU_STARTUP = ht32f523xx
BOARD = ANNEPRO2_C15
BOOTLOADER=annepro2
# Options
# Keys

View File

@ -16,6 +16,8 @@ MCU_STARTUP = ht32f523xx
BOARD = ANNEPRO2_C18
BOOTLOADER=annepro2
# Options
# Keys