st-flash: auto-reset after mass erase

pull/1312/head
nightwalker-87 2023-04-30 20:46:37 +02:00
rodzic 7c2c953ff6
commit 823187216a
4 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
# The flash loader code cannot be compiled by the system gcc. This
# makefile use arm-none-eabi-gcc for this purpose
# The flash loader code cannot be compiled by the system gcc.
# This makefile uses arm-none-eabi-gcc for this purpose.
CROSS_COMPILE ?= arm-none-eabi-

Wyświetl plik

@ -1,9 +1,9 @@
/* Entry Point */
ENTRY( copy )
ENTRY(copy)
/* Specify the memory areas */
MEMORY
{
RAM ( xrw) : ORIGIN = 0x20000000 , LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000 , LENGTH = 64K
}

Wyświetl plik

@ -188,6 +188,12 @@ int main(int ac, char** av) {
goto on_error;
}
printf("Mass erase completed successfully.\n");
// reset after erase
if (stlink_reset(sl, RESET_AUTO)) {
printf("Failed to reset device\n");
goto on_error;
}
} else if (o.cmd == CMD_RESET) {

Wyświetl plik

@ -391,7 +391,7 @@ int stlink_flash_loader_run(stlink_t *sl, flash_loader_t* fl, stm32_addr_t targe
* firmware size.
*/
if ((int32_t)rr.r[2] > 0 || (int32_t)rr.r[2] < -7) {
ELOG("Write error\n");
ELOG("Flash loader write error\n");
goto error;
}