stm32l0: use cortexm_run_stub.

This commit is contained in:
Gareth McMullin 2015-03-29 16:47:55 -07:00
parent 012922ed00
commit 779dcf0f69
1 changed files with 2 additions and 12 deletions

View File

@ -372,12 +372,7 @@ static int stm32lx_nvm_prog_erase_stubbed(target *t,
target_mem_write(t, STM32Lx_STUB_INFO_PHYS, &info, sizeof(info));
/* Execute stub */
cortexm_pc_write(t, STM32Lx_STUB_PHYS);
if (target_check_error(t))
return -1;
target_halt_resume(t, 0);
while (!target_halt_wait(t))
;
cortexm_run_stub(t, STM32Lx_STUB_PHYS, 0, 0, 0, 0);
if (target_mem_read32(t, STM32Lx_NVM_SR(nvm))
& STM32Lx_NVM_SR_ERR_M)
@ -448,12 +443,7 @@ static int stm32lx_nvm_prog_write_stubbed(target *t,
&info, sizeof(info));
/* Execute stub */
cortexm_pc_write(t, STM32Lx_STUB_PHYS);
if (target_check_error(t))
return -1;
target_halt_resume(t, 0);
while (!target_halt_wait(t))
;
cortexm_run_stub(t, STM32Lx_STUB_PHYS, 0, 0, 0, 0);
if (target_mem_read32(t, STM32Lx_NVM_SR(nvm))
& STM32Lx_NVM_SR_ERR_M)