cortexa: Add timeout to reset spin.
This commit is contained in:
parent
8b4342394f
commit
6b3c3d3473
|
@ -441,12 +441,16 @@ static void cortexa_reset(target *t)
|
||||||
platform_srst_set_val(false);
|
platform_srst_set_val(false);
|
||||||
|
|
||||||
/* Spin until Xilinx reconnects us */
|
/* Spin until Xilinx reconnects us */
|
||||||
|
platform_timeout timeout;
|
||||||
|
platform_timeout_set(&timeout, 1000);
|
||||||
volatile struct exception e;
|
volatile struct exception e;
|
||||||
do {
|
do {
|
||||||
TRY_CATCH (e, EXCEPTION_ALL) {
|
TRY_CATCH (e, EXCEPTION_ALL) {
|
||||||
apb_read(t, DBGDIDR);
|
apb_read(t, DBGDIDR);
|
||||||
}
|
}
|
||||||
} while (e.type == EXCEPTION_ERROR);
|
} while (!platform_timeout_is_expired(&timeout) && e.type == EXCEPTION_ERROR);
|
||||||
|
if (e.type == EXCEPTION_ERROR)
|
||||||
|
raise_exception(e.type, e.msg);
|
||||||
|
|
||||||
platform_delay(100);
|
platform_delay(100);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue