Ralim / IronOS-dfu

Minimal USB-DFU for Miniware products with OLED driver support
GNU General Public License v3.0
36 stars 8 forks source link

Figure out OLED dfu mode text #1

Closed Ralim closed 2 years ago

Ralim commented 2 years ago

Need to figure out what we want to show on the OLED while in DFU mode. Thanks to the amazing dfu code we are based off, we have room.

So open to ideas.

Currently thinking, that miniware like we want to show something on the screen. We could be boring and show just a version number on the screen. Or we could put anything on the screen while in DFU mode.

So really.. Open to ideas of wishlist / thoughts.

Noting, at the moment this is not flashible, so cant really test this on device yet. (I'm working on the migration plan.. soon)

@discip Since your comments nerd sniped me into looking into a cleaner bootloader... and you are also skilled with pixel drawing... Would love your thoughts/input there.

discip commented 2 years ago

Good evening Sir, I am honestly surprised of how quick this escalated into materialization. 😃

I don't know if this is possible, but how about:

Being able to switch between at least 2 screens. The screens might be as suggested:

  1. detailed information (whatever is reasonable)
  2. a custom logo or animation (will post some later) 😊
Ralim commented 2 years ago

Hehe, though I did find some very good code to base the idea off.

This would only be while your in DFU mode; so not sure about logos. Definitely not enforcing logo on boot (TS80P) 👀

Open to any ideas you have. Will take a bit more tooling before I'm in need of anything :)

For info, thinking of just putting on the screen static data (like bootloader version)

Ralim commented 2 years ago

So I've been thinking, what if when entering DFU mode:

  1. Show a USB style logo for a bit
  2. Drop down to then showing text
  3. -> "USB DFU" + version
  4. And then if you press buttons we show other info or some such?

Still figuring out how I want this to work, but what I'm thinking is:

Planned features:

  1. Backup your stock bootloader
  2. Flash any other bootloader to your device (With some safety)
  3. Supports the OLED screen
  4. Designed for working with the Miniware Irons.. But should work on any STM32F1 part with minimal (or no) modifications

How it works

This bootloader builds in two versions for each supported hardware. A bootloader and a runtime version.

Bootloader

The bootloader version is intended to be used as your device bootloader. It will only go into USB-DFU mode if there is no application flashed to the device or if a button is held down when booting.

So in this mode, it would act like a mix of the Pinecil and miniware bootloaders. Where it shows you on the screen that your in DFU mode, but is flashed / works like the Pinecil with dfu-util. And entered by holding the button like Miniware.

Runtime

In runtime mode, it is expected to be running where your main firmware would be. In this mode it can be used to read/write the actual bootloader on the device. In this mode we compute some form of checksum of the bootloader, this way we can publish known checksums of the bootloaders that are out there. Also means that after flashing a new bootloader, we could re-compute it and then the user can validate their flash before rebooting.

discip commented 2 years ago

Good evening, seems I haven't gotten you right about:

This would only be while your in DFU mode; so not sure about logos.

I combined both of your statements:

Or we could put anything on the screen while in DFU mode.

and

... and you are also skilled with pixel drawing...

and concluded, that you want graphics there. 😅

Definitely not enforcing logo on boot (TS80P) 👀

Thank you so much! 😃

I am excited and definitively like the ideas you posted above:

For info, thinking of just putting on the screen static data (like bootloader version)

So I've been thinking, ...

If I am able to support, I will do!

Have you already a design in mind?

  1. Show a USB style logo for a bit

regards

Ralim commented 2 years ago

Sorry so when I say "show a USB logo" I'm sorta meaning that to be open to showing something there.

So thinking about what would be best to show while in dfu mode.

(Not sure if that's an ironos logo, a USB logo, just text :shrug:)

But also meant for this so that you can out forward any ideas you have or thoughts on what would make sense.

One idea is to just show graphics until user presses a button then show info. Other could just just show graphics for 1 second... Not sure :) so I'm mostly trying to figure out what would be good, and open to ideas

discip commented 2 years ago

Good morning Sir, I finally managed to put out a first attempt of an animated IronOS logo. It consists of 23 sprites 😅, so I don't know if this will work, but this maybe could be the intro. 🤷‍♂️

When I saw the work of @TRaMeLL regarding the logo,:

It's not a bullet, it's a tip: IronOS_Logo-2

Originally posted by @TRaMeLL in https://github.com/Ralim/IronOS/discussions/1119#discussioncomment-1708997

I immediately liked it for the most part and as he was good with it being used,:

@federicodilo, I do not mind that my images are used somewhere, for that they are created, if they end up in IronOS, I will be glad. ...

Originally posted by @TRaMeLL in https://github.com/Ralim/IronOS/discussions/1119#discussioncomment-1735525

I decided to modify it to my likings and that's what it ended up in. IronOS

and a loop (to inspect the animation [10 fps]) IronOS_lp

discip commented 2 years ago

@Ralim One thing I thought about is the brightness of the display while in DFU mode. Would be nice if it was set to the lowest value possible. 😃

Ralim commented 2 years ago

I've currently set it sorta halfway, might drop it down a bit more.

The logo looks great and works well too.

This is nearly at a testable stage, by end of week I hope to have it finished up for testing.

Ralim commented 2 years ago

Okay currently going with fairly simple displays for now. But ❤️ for the logo, it works fantasticly.