Skip to main content
Topic: Bootloader v4 (ds30 Loader) (Read 57253 times) previous topic - next topic

Re: Bootloader v4 (ds30 Loader)

Reply #181
Yes, but it would need to ignore the section because the bootloader will send bootloader protection error for operations in that region. Are BL overwrite errors already ignored when allow overwrite is checked?
Got a question? Please ask in the forum for the fastest answers.


Re: Bootloader v4 (ds30 Loader)

Reply #183
I think ideally, a separate setting that strips any code from the calculated bootloader page. The problem is that we need to include config bits for the v2 bootloader, but v4 bootloader (correctly) sees it as overwriting the bootloader. For a 'universal binary' we'd need a way for ds30 Loader to deal with this extra code. Ideally not sending it at all (notice in box: "stripped code from bootloader region"), but possibly ignoring all errors (verify and bl protection).
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #184
I made a small change to the v4.3 bootloader - a bad hello now  branches to the jumper/variable check at the end of receive before exiting. We can now add Sjaaks' function to print 'BOOTLOADER' if the user is watching the terminal.
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #185
I'm going to look at adding a verify check to the updater. I've seen some strange corner cases. Maybe we could catch them with a verify?
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #186
Were those caused by a bad flash? Is it on a special location or just random?

One thing I could think of are interrupts (which should be disabled during writing) The code hasn't one AFAIK, but perhaps it is enabled somewhere (perhaps old bootloader)??

from the memory manual:

Code: [Select]
; PUSH SR ; Disable interrupts, if enabled
MOV #0x00E0,W0
IOR SR

...
...

POP SR

Re: Bootloader v4 (ds30 Loader)

Reply #187
During testing the newterm branch, I ran again into the problem the write program flag is unchecked. after that it can't be set. although I solve the isssue that causes it to  uncheck (write fuses). removing those files are a bad idea (see older post of me bricking my BP)

Can it be made so it ignores it or recheck the option after it is solved? I can solve to get the settings.xml from svn and removing the recentfileX.xml.

Also an other point of improvement: Add a rescan comports option, as the BP needs to be connected at startup, if plugged in after the program has started it fails to see that com-poort. (if it has found it before it is selectable, it only fails the first time)

@ian, you already got some extra info about those cornercases?

Re: Bootloader v4 (ds30 Loader)

Reply #188
The corner cases are random. I'm never sure what to make of them - user error, computer error, Bus Pirate defect. There haven't been any major problems though. I haven't received a single Bus Pirate to reflash after an 'official' v4 upgrade. I don't count yours :)
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #189
A new bootloader v4.3/v4.4 compile is in the SVN:
http://code.google.com/p/the-bus-pirate ... /BPv3&v2go

Includes these changes:
*0.5s timeout (can now check for bootloader then download without reset, not one-shot only)
*added jumper test - if jumper, don't exit on 0.5s timeout
*added jump entry variable - if jump entry from firmware, don't exit on 0.5s timeout
*bad hello (space, enter, etc) prints 'BL4+' in the terminal and resets (can connect and upload after trigger, tested)
*v4.3 (upgrader) v4.4 (programmed with a PIC programmer)

I have not made an upgrader yet. I'll test it for a while and probably release it with the next firmware update. Any comments? Testers welcome.
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #190
Nice work!

I think it is fairly complete by now. If it is safe I'll test it for you.

How do you exit from the bootloader if you jumped from the buspirate?

Re: Bootloader v4 (ds30 Loader)

Reply #191
I think it's fine for a test.

A hard reset is the only way out, but that's a good idea anyways to make sure everything is in the reset state.
Got a question? Please ask in the forum for the fastest answers.

Re: Bootloader v4 (ds30 Loader)

Reply #192
Ok fine with me. A hard reset is a good idea indeed.

But I'm gonna mis placing my little red jumper I guess ;)

Re: Bootloader v4 (ds30 Loader)

Reply #193
Does the loader (hostside) accept .hex files which don't sets a proper jump to the jump userprog? And can I afterward program a normal firmware? Prefferable in just one run (ie without reseting).

I want to program an .hex (which contains data for the firmware) and program the firmware afterwards. I know how to combine these two by copy and paste in a textfile, but this requires a lot of manual steps...

(i'm still a bit scared to try it with the chance of bricking my bp)

Re: Bootloader v4 (ds30 Loader)

Reply #194
The loader will accept these files, but the bootloader always programs the correct jump instruction. As long as there's no data on the same pages, I believe they will be left alone and not erased.
Got a question? Please ask in the forum for the fastest answers.