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 - megafix

1
Bus Pirate Development / Re: Bus Pirate - Community Firmware 7.0
I predict the next question :-) Why did it work with previous firmwares?

Because someone changed

asm volatile ("mov #BLJUMPADDRESS, w1 n" //bootloader location" goto w1 n");

to

skip_pgc_pgd_check = true;
asm volatile ("RESET");

The new style flags skip_pgc_pgd_check. Then it does a reset and expects the bootloader to check the contents of skip_pgc_pgd_check. It should decide to stay in the bootloader instead of branching to the application. This will only work with an updated bootloader (>=4.5).

The old style did a direct jump so it will work with any bootloader revision.
2
Bus Pirate Development / Re: Bus Pirate - Community Firmware 7.0
As far as I understood by now there are three different bootloaders for the BPv3 hardware. All are slight modifications of the original ds30loader 1.0.2.

4.1 is identical to 4.2
4.3 is identical to 4.4
4.5 (I don't know if 4.6 ever went into production)

We have even sublevels that are programmed at the factory during production. The odd sublevels are updates performed by users in the field. Otherwise they should be identical.

Please correct me if above assumptions are wrong.

I compared 4.4 to 4.5 and the updates are minor. A new 4 byte firmware signature check has been added into 4.5.

What exactly do you mean by "it fails to enter into bootloader"? Looking at the code it's just a few instructions being triggered by entering "$" and a reset being performed. Almost identical to entering "#". Does it reenter the firmware (application) instead of executing the bootloader?

I spent some time looking at the code and might have identified the root cause....

The inability to enter bootloader mode is caused by proc_menu.c (static bool __attribute__((address(0x27FA),persistent)) skip_pgc_pgd_check;).

It is referenced in ds30loader.s (.section *, bss, address(0x27FA) / skip_pgc_pgd_check: .space 2) of bootloader 4.5. Previous BPv3 bootloaders (<4.5) don't know anything about skip_pgc_pgd_check so it won't work without putting a jumper between the two pins.

With BPv4 you won't hit this problem because skip_pgc_pgd_check was present in it's first bootloader revision.
4
Bus Pirate Development / Re: Bootloader v4.x to v4.3 upgrader
Merging bootloader v4.5 into BPv3-bootloader-upgrade-v4xtov4.3.hex is easy. There is no need for additional documentation.
You already successfully built the updated bootloader v4.5.
Take a look at the comments in firmware.h
Code: [Select]
// test firmware (size should be exactly 1 page!)
// replace with the right bootloader
// export the page containing the firmware from MPLAB as a HEX
// convert the HEX to a byte array with the .html javascript converter
// if the bootloader is in the last page (Bus Pirate) don;t forget the config words
Paste the updated bootloader into firmware.h and change the last two lines from
Code: [Select]
0x37, 0xB8, 0xFE, 0x00, 0x03, 0x04,   // 127
0x00, 0xDF, 0xF9, 0x00, 0x7F, 0x3F,  // 128 (config fuses, stay the same)
to
Code: [Select]
0x37, 0xB8, 0xFE, 0x00, 0x05, 0x04,   // 127
0x00, 0xDF, 0xF9, 0x00, 0x7F, 0x3F,  // 128 (config fuses, stay the same)};
Afterwards rebuild upgrader-v4tov4.