From: Stephan Baerwolf Date: Wed, 1 Aug 2012 21:37:14 +0000 (+0200) Subject: change interface function "bootloader__so_spm" to avoid application crashes X-Git-Tag: 2010-07-27-stephan-201208020130~4 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/ab3b07eb65155234163e1caf94674737fef0afea?ds=inline change interface function "bootloader__so_spm" to avoid application crashes Signed-off-by: Stephan Baerwolf --- diff --git a/firmware/spminterface.h b/firmware/spminterface.h index 846ae87..384ae68 100644 --- a/firmware/spminterface.h +++ b/firmware/spminterface.h @@ -36,7 +36,7 @@ bootloader__do_spm: ;you may also want to disable wdt, since this routine may busy-loop ;================================================================== ;-->INPUT: -;spmcr (spmcrval determines SPM action) will be register: r10 +;spmcr (spmcrval determines SPM action) will be register: r18 ;MCU dependend RA(MPZ should be transfered within register: r11 ;lo8(Z) should be transfered within register: r12 ;hi8(Z) should be transfered within register: r13 @@ -56,13 +56,19 @@ mov r30, r12 mov r31, r13 wait: ;check for previous SPM complete -in temp1, SPMCR -sbrc temp1, SPMEN +in temp0, SPMCR +sbrc temp0, SPMEN rjmp wait out SPMCR, spmcrval ;SPM timed sequence spm +;avoid crash of userapplication +ldi spmcrval, ((1<