Skip to main content
Topic: Allow to reset from bootloader? (Read 2105 times) previous topic - next topic

Allow to reset from bootloader?

Hi,

I'm incredibly lazy so...
It'll be helpful to be able to reset the device after flashing it (from terminal jump), without having to unplug/replug the device.
Sth like allowing command '#' while being in the bootloader.
And maybe make pirate-loader applying reset automatically after flashing.

Any technical reason why firmware "#" reset couldn't be ported into the bootloader?
Thanks
Phil

Re: Allow to reset from bootloader?

Reply #1
With the new bootloader if you send a not recognized character it jumps to usercode. I.e. press space after flashing should bring you to the normal operation.

BTW '#' should also work. ;)

Re: Allow to reset from bootloader?

Reply #2
I'm using bootloader v4.3:

HiZ>$
Are you sure? y
BOOTLOADER
BL4+BL4+BL4+BL4+BL4+BL4+BL4+BL4+BL4+BL4+BL4+

Whatever I type it replies "BL4+"
Same after reflashing.

Are you talking about a newer bootloader??
thanks
Phil

Re: Allow to reset from bootloader?

Reply #3
I added that in v4.3/4 so people know when they are stuck talking to the bootloader. It wouldn't be a big deal to add # as a command to jump to user space (I don't think, but I haven't hacked the bootloader in a while).
Got a question? Please ask in the forum for the fastest answers.

Re: Allow to reset from bootloader?

Reply #4
Here's a v4.5 bootloader that should check for # before saying BL4+ and then branch to exit. I have not tested it, and it also might only work before bootloading a new firmware. You'll need a programmer to install it, or you can package it into Sjaak's installer if you can figure that out :)

Code: [Select]
;------------------------------------------------------------------------------
; Receive hello
;------------------------------------------------------------------------------
rcall Receive
sub #HELLO, W0 ;check
bra z, helloOK ; prompt
sub #'#', W0 ;check
bra z, exit ; prompt

SendL   'B'
SendL   'L'
SendL   '4'
SendL   '+'
   bra    checkexit

I'm not sure how to add it to the main loop, it's so simple that I'd need to really study it before messing with it.
Got a question? Please ask in the forum for the fastest answers.

Re: Allow to reset from bootloader?

Reply #5
I'm sorry I was wrong there. I though it just prints and identifier and jumps back to the buspirate.

[quote author="ian"]
I added that in v4.3/4 so people know when they are stuck talking to the bootloader. It wouldn't be a big deal to add # as a command to jump to user space (I don't think, but I haven't hacked the bootloader in a while).
[/quote]

I would suggest print BL+ and then jumps to buspirate.

I haven't looked also at the bootloader for a long time. ;)