Shop OBEX P1 Docs P2 Docs Learn Events
FLEXBOOT - A secondary 1kB bootloader in Flash for the P2 — Parallax Forums

FLEXBOOT - A secondary 1kB bootloader in Flash for the P2

Sorry for the FLEX part, I've just borrowed it to get your attention! This may be a bit premature since I haven't really written any code but I was thinking that I could write a new bootloader for the P2 which would reside in the first 1kB of Flash and be loaded automatically by the ROM loader. The reason for a secondary bootloader is simply to make the boot process faster and more flexible. A user binary can simply be written to an area in Flash and bootloader can load this in using the streamer on RCFAST in the same manner that Chip showed us in spiflash.spin2. Not only Flash but also SD boot can be improved in terms of speed as well since hubexec code can be a little slow for large binaries. There are lots of other options that can be added in too to enhance the ROM bootloader. I suppose that if the user writes their clock configuration into Flash then it is safe to switch to the higher speed for booting as well or the default could even be set for a 20MHz clock input unless otherwise specified.

What I like to do is to ship my P2D2 boards with an enhanced and flexible bootloader in Flash since it will also boot TAQOZ Reloaded faster as well.

Maybe someone has done something like this already, but if not, what are your thoughts?


Comments

  • RossHRossH Posts: 5,347
    Catalina has a very simple Flash boot loader for the P2. Based on an original created by ozpropdev, and then modified by Rayman (I think!). It just allows you to load any binary program into Flash so that it will load into Hub RAM and execute on boot.

    See the flash_payload batch file in the bin directory, which uses the bindump utility, and the Flash_loader_1.2_mod2.spin2 file from the target_p2 directory.

    But if you come up with something more sophisticated and flexible, I will certainly steal it! :)

    Ross.
  • One idea I tinkered with in my original flash loader was multiple binaries and the first stage loader tested some buttons to select alternate configurations.
    The plan was to expand that to detect specific hardware and load optimized rd relevant versions.

    Would work nicely for demos too. :)
  • That's a good start and I plan to steal any good ideas too. I had thoughts about multiple boot images too and how to handle them as well but I didn't want to complicate it for now. Just make it flexible and fast.
  • Cluso99Cluso99 Posts: 18,069
    Agreed Peter. I think there is plenty of scope for improvements here.
    So many things able to be done, but so little time ;)
  • @Cluso99 Well you did the original SD bootloader so maybe you'd like to it "properly" this time :)
    Now that we have real silicon and a known clock and we are not constrained from using a cog, then let's do it.
Sign In or Register to comment.