Make i2c flasger reset the app block flag

This commit is contained in:
Ondrej Jirman 2021-09-05 01:53:42 +02:00
parent 574d68aa89
commit bf0c0e9c97
1 changed files with 4 additions and 1 deletions

View File

@ -410,7 +410,7 @@ int main(int ac, char* av[])
if (i == 10)
error("Reset command issued over I2C failed, stock firmware failed to report itself within 2.5s");
} else if (!strcmp(entry_type, "manual")) {
printf("Please power off the keyboard by holding the keyboard power key for > 12s, then release the power key and press it shortly, once, to power it on again.\n");
printf("Please power cycle the keyboard by removing and reinserting the pinephone.\n");
while (true) {
if (is_kb_stock_connected()) {
@ -488,6 +488,9 @@ int main(int ac, char* av[])
} else if (!strcmp(av[i], "reset")) {
printf("Restarting the MCU\n");
uint8_t cmd1[] = {0};
wr_buf(REG_SYS_USER_APP_BLOCK, cmd1, sizeof cmd1);
// send MCU reset command
uint8_t cmd[] = {REG_SYS_COMMAND_MCU_RESET};
wr_buf(REG_SYS_COMMAND, cmd, sizeof cmd);