Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify pirate-loader code to handle both v3 and v4 #68

Open
agatti opened this issue Sep 25, 2017 · 12 comments
Open

Unify pirate-loader code to handle both v3 and v4 #68

agatti opened this issue Sep 25, 2017 · 12 comments

Comments

@agatti
Copy link

agatti commented Sep 25, 2017

Right now there are two separate pirate-loader codebases, one for each model. Ideally there should be only one tool to be used for uploading both firmware types.

@kallisti5
Copy link

kallisti5 commented Sep 25, 2017

I assume this is about:

  • Bootloaders/BPv3-bootloader/pirate-loader
  • Bootloaders/BPv4-bootloader/pirate-loader

A quick diff shows that the BPv4 pirate-loader only seems to be a slightly newer version of the BPv3 pirate-loader.

diff -Naur BPv4-bootloader/pirate-loader/pirate-loader.c BPv3-bootloader/pirate-loader/pirate-loader.c

Are we sure the pirate-loader in Bootloaders/BPv4-bootloader/pirate-loader doesn't work with the BPv3? The only requirement seems to be "v4+ bootloader".

It appears there are special steps + code to upgrade the v2 bootloader to v4.

From what i've gathered...

  • BPv3
    • bootloader v4.1 (Bootloaders/BPv3-bootloader/firmware-v4.1)
    • bootloader v4.3 (Bootloaders/BPv3-bootloader/firmware-v4.3)
    • bootloader v4.5 (Bootloaders/BPv3-bootloader/firmware-v4.5) (SparkFun release version)
    • bootloader v4.5 (Bootloaders/BPv3-bootloader/firmware-v4.5 @ !7.1) (bootloader jump fix)
  • BPv4
    • bootloader v1.0 (Bootloaders/BPv4-bootloader/firmware-v1) (Seeed studio release version?)
    • bootloader v1.1 (Bootloaders/BPv4-bootloader/firmware-v1 @ ~7.1) (bootloader jump fix)

@agatti
Copy link
Author

agatti commented Sep 25, 2017

Technically there's v4.5 as well for v3 and v1.1 for v4, which include the jump to bootloader fix. However, I have no idea on whether BPv4's pirate-loader works on v3 and whether that can flash bootloaders too. If that's the case, then we should move pirate-loader from Bootloaders/BPv4-bootloader/pirate-loader to tools/ and remove other copies.

@kallisti5
Copy link

Correct. Tomorrow I will:

  • Downgrade my BPv3 + BPv4 to as close to the original release as I can using the PicKit 2
  • Attempt upgrades on both purely using the latest pirate-loader.

Any additional steps? Since both came with the latest bootloader (from what I can tell) it seems like all I need to do is drop the firmware version to pre-v6.2

It sounds like we'll need a documented workaround of people needing a PicKit if anyone updated beyond the Dangerous Prototypes v6.1 release on the BPv3 or BPv4?

@agatti
Copy link
Author

agatti commented Sep 25, 2017

For v4 there should be no real workaround needed I think, but for v3 things can get hairy pretty quickly and bricking the device is a real possibility, so yes, some documentation is needed.

As far as additional steps go, short of trying to upgrade v3's bootloader to v4.5 from all released bootloader versions maybe there isn't anything left to do - but this is something that can be done later.

@kallisti5
Copy link

kallisti5 commented Sep 25, 2017

Technically there's v4.5 as well for v3 and v1.1 for v4, which include the jump to bootloader fix.

I updated the list of bootloaders above. Do we want to bump the bootloader versions? I didn't see it done in e2bd0a0 or 2bfccf2

I assume the BL version is the VER_H and VER_L in bootloader.c for BPv4? (4 + a, 4.10 , 4.1 )
EDIT: yech. So the BPv4 "1.0 bootloader" is really internally 4.10? Really DangerousPrototypes?
EDIT2: BPv3's v4.5 bootloader is at least 4.5 via BLVERSION in the assembly.

@agatti
Copy link
Author

agatti commented Sep 25, 2017

Ouch, sorry for not bumping the v4 bootloader version - please bump it up then.

On the other hand, the v3 bootloader directory needs a good scrub for sure!

@kallisti5
Copy link

ok. working on a cleanup commit now.

@kallisti5
Copy link

#69

tldr:

  • BPv4-bootloader has the latest BPv4 bootloader
    • BPv4 pirate-loader moved to Bootloaders/pirate-loader
  • BPv3-bootloader has the latest BPv3 bootloader
    • old has older bootloaders + the unknown upgrade stuff

@agatti
Copy link
Author

agatti commented Sep 25, 2017

Awesome, let's merge the whole lot once the firmware/bootloaders update tests prove successful then.

@agatti agatti modified the milestones: 7.2, 7.1 release Sep 25, 2017
@kallisti5
Copy link

Sounds good. I'll append the version bumps in that PR as well.

@USBEprom
Copy link

@kallisti5

For what I know and experimented pirate-loader does work with Bus Pirate v3 by allowing me to upgrade bootloader from v4.4 to v4.5:

http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75&sid=c72e26d3dde472fbd8ab7226df6d3db8

http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=75&sid=c72e26d3dde472fbd8ab7226df6d3db8#p67127

Just out of curiosity.

kallisti5 wrote:

bootloader v4.5 (Bootloaders/BPv3-bootloader/firmware-v4.5) (SparkFun release version)

About bootloader 4.5, what is SparkFun release version?
Truthfully speaking I have never heard of it and I would love to know more.
Is there somewhere its code?
Thanks.

@agatti
Copy link
Author

agatti commented Sep 5, 2018

Moving to 7.2...

@agatti agatti modified the milestones: 7.1 release, 7.2 Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants