Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Sjaak

2281
Bus Pirate Development / Bootloader v4 (ds30 Loader)
Hmm really strange. Isn't it something the bootloader does (the jumping)? Gets that page erased (0xC00)?

Perhaps better idea to make an 'installer' ;) I did look into it yesterday night and it shouldn't be hard to write. I'll look into it tonight.
2282
Bus Pirate Development / Bootloader v4 (ds30 Loader)
I stripped the firmware (attached) for installing the new bootloader a bit.. the filesize came down from 242kb to 4711bytes. When uploaded at 9600baud it should take a mere 5 sec (4.9 to be precise :P) I dunno if you need the interruptvectors (i don't see any reason) then it can be further trimmed down to approx half (also attached).. If the last one does work it only takes less then 2 sec...!

Could you give it a try? :D

Another option is write a small program that first erases the last flash block, write the fuse, write the new bootloader, erase the first page, write the reset vector, write interruptvectors (if necessary) then jump to new bootloader (or reset). This option will be as safe as it can gets, especially powered from a laptop.
2283
Bus Pirate Support / Re: BP v3 Arrived
Since i was not the only one with a broken mode led, this is what I did:

I tried resolder it (with normal 15W unit!!). I used a clean tip and some solder with resin in it and tipped the  two solder joints. For me this fixed it ( and now I want to share it with the rest of the world :P)

BTW the hardware I2C did work for me. (but we could use the extra bytes that become free if hardware support is left out ;P)

@ian: don't type this fast!! I can't keep up :P
2284
Bus Pirate Development / Bootloader v4 (ds30 Loader)
Ian,

Did you try to include that line in the test hex?

Code: [Select]
:020000040001F9
:0857F800DFF900007F3F000013

this should write just the config bits (at least that is wat the hex suppose to do, I dunno if the bootloader/P24QN program does some translating, but it appears that it just sends the .hex over) Aft

you can do that with in a cmd shell:
Code: [Select]
copy fuses.hex + newbootloader.hex final.hex

alternatively you could strip the empty lines to speed things up (less time to let things go wrong) Should be no problem according to the intelhex standard.
2286
Bus Pirate Development / Bootloader v4 (ds30 Loader)
Cool! you are making lots of progress in short amount of time. You also learned a bit of C#!! :P

Did you contact the author also about moving some checks into the loader (there is plenty space for that)?

- don't allow to erase the running bootloader (dunno if the program can read the program counter?)
- after clearing the first page write immediate a jump to bootloader
- after an timeout/communication error the user program is tried to run ( a jump to twee words before the loader which is a goto to the user app). This is ok when the jump at 0x0000 is to the bootloader (after a reset the bl is run again and programming can be resumed/retried) Can be solved by adding a command for exit. Need also some tweaking of the client.

I think I can whip up some asm to do the second and third part tonight.
2287
Bus Pirate Development / Bootloader v4 (ds30 Loader)
As promised I made the hex file which only programs the fuses.

Code: [Select]
:020000040001F9
:0857F800DFF900007F3F000013

If you add this (derived from setfuses.hex) to the very first lines of the intermediate firmware (the upgrade so to speak) it will assure that the fuses programmed first. Then we can let people burn it with the old program, without too much risk :) better to also advise using a laptop (less prone to power outage to be almost really sure :P)

so the upgrade procedure will be:

- start P24QP program (or script)
- connect to device
- load intermediate firmware
- clear device
- write device (ignore verify errors from 0x400 -0xbff) *)

- do the C30 steps (couldn't try it because of no programmer ;))

*) could be avoided when the appropriate line are delete from the hex

Shouldn't you check if pin goes down and then for up in the modified? to rule out the possibility of a bad board/solder/pin?

add this between 226 een 227
Code: [Select]
bset  LATB, #RB0
btss  PORTB,#RB1
bra   quit

perhaps repeat it 10 times like the old loader?

Code: [Select]

repeatchk:
 bset  LATB, #RB0
 btss  PORTB,#RB1
 bra   quit
 bclr  LATB, #RB0
 btsc  PORTB,#RB1
 bra   quit
 dec   WCNT, WCNT
 bra   nz, repeatchk

All my asm comes with _no_ warranty whatsoever !!
2288
Bus Pirate Development / Bootloader v4 (ds30 Loader)
wow! Nothing to do today? :P

Let me see if i come home easily today because of the snow here... I can make a small .hex to program the fuses first, this will make it a bit more safe ;)

Perhaps i could also make a script to use the new loader, the protocol is very easy.
2289
Bus Pirate Development / Bootloader v4 (ds30 Loader)
Hmm I just checked the homepage (overlooked it somehow :S ). It appears the clientside of the tool does the sanity checks. So I think that will be OK. However I think it is better to incorperate the checks in the bootloader, but my asm skills suck very big time....

There is BTW a newer version, and i dunno what the impact will be..
2290
Bus Pirate Development / Re: Some minor improvements ;)
Before you apply it to the nightly build I got a improvement for the dvm.patch ;)

I improved the accurasy of the volt displaying a bit. It now displays an extra digit:

Code: [Select]
1-WIRE>W
POWER SUPPLIES ON
1-WIRE>i
Bus Pirate v3
Firmware 3v3-nightly (SVN 175 BS+PO+DVM2)
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
*----------*
POWER SUPPLIES ON
Voltage monitors: 5V: 5.05 | 3.3V: 3.35 | VPULLUP: 5.05 |
a/A/@ controls AUX pin
Open drain outputs (H=Hi-Z, L=GND)
Pull-up resistors OFF
Bitorder configuration not allowed
*----------*
1-WIRE>

It should be ok because the ADC is 10bit and the max voltage is 6V6 (2* 3V3), so 1 bit is 0V006. I could display another extra digit, but  i think is gives a false sense of extra accurasy. (i remember some math lessons about significance of digits, but very vague :P).
2291
Bus Pirate Development / Bootloader v4 (ds30 Loader)
It looks like a fairly complete bootloader to me :D

However (;)) I noticed the following:

- no protection of the fuses
- no protection of the bootloader itself
- in case of a failure (transmissiontimout) it jumps to the user code but it is uncertain if this is valid code or the jumptable (usrapp) is correct. I would prefer to restart the loader (bra __reset).

The first two things can be solved in the client by sanity checking the input. (or keep on reading ;))

If the bootloader is smaller then flashblocksize - configfuses then I would place it in the last block. Then the fuses are protected. An disadvantage is that the reset vector/isr vectors are in the first block and no protection for those.

After compiling i got the bootloader from A400 - A4FF . If I understand correctly it is 256 programwords (3 bytes/word?). the pagesize (the smallest possible chunk which can be erased is 1024 programwords? If this is true it can be fitted in the last page, together with the fuses. It will also leave space for some little checks (protecting the last page/fuses and assure the reset vector points to the bootloader). It will leave approx 0xA800 words for the buspirate program (minus some vectors)

I think the reason to place it in the second last page is to allow programming the fuses without wiping the bootloader itself. To set a fuse you need to clear the page (every bit to 1), but the program runs from there. After an erase it encounters only nops and eventually hangs (reset vector point to bootloader and keep executing nop, reset etc)
2292
Bus Pirate Development / Bootloader v4 (ds30 Loader)
Cool!!! you are very fast! I just arived home after work.

Is it perhaps better to move de loader to the same location (to assure backward compatibility and no different compile settings) as the old one? The only change (besides the start block)  is it should program the fuses after an erase of the last block and protect the first block.

I'll look into the source, perhaps some helpfull things in there to overcome more wasted space ;)
2293
Bus Pirate Support / Re: BP3 firmware update problem
I would look into the manner of upgrading the bootloader but I got two problems:

- My mode led is broken
- no PIC programmer

I could whip something up for someone else to try. (Someone with a programmer that is :)) Finally some old hacking skills will come in handy :D

Your guess is right about the fuses. Writing beyond a800 will give lots of troubles if that data is not static. with flash you can 'program' a '1' to '0' but you can't do the other way. The other way is clearing a page (setting all bits to '1') and reprogram it.

The datasheet mentions something about 64Kb (0xFFFF) that's why I think it is in the middle. I should read it sometimes more indept ;P
2294
Bus Pirate Support / Re: BP3 firmware update problem
When you erase the page where the fuses are stored, the whole page contains all 1's (or 0xFFFFFF) The result is that both fuses are set to 0xFFFF. This would disable the bootloader (see post of Ian). Hence I would program the fuses before anything else (the fuses.hex).

I'll run some tests myself tonight to be sure (lets hope I don't brick anything, because I don't have a pic programmer)

Is there BTW a lowcost pic24F programmer? Just for my peace of mind ;P

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01802450568session_write_close ( )...(null):0
20.01852582192ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01862582968Database_MySQL->query( ).../DatabaseHandler.php:119
40.06102721728Database_MySQL->error( ).../Db-mysql.class.php:273