kopia lustrzana https://github.com/stlink-org/stlink
st-flash: auto-reset after mass erase
rodzic
7c2c953ff6
commit
823187216a
|
@ -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-
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue