Closed mythicaleinhorn closed 1 year ago
I was wondering how to upload a bootup logo to the pinecil v2.
Only the older original pinecil V1 models can use boot logo art for now since it uses DFU to do firmware updates and has a different MCU chip which accepts dfu image files.
The newer V2 has a BL706 MCU chip which takes "bin" files. The method to update the firmware can not use the same dfu flashers or dfu images from the past.
new Blisp flasher developed for the Pinecil V2 updating can not yet do boot logo art. For now Blisp can install IronOS firmware. Keep an eye for updates in the future. It's a little more complicated because of the way the BL706 is set up. I see that Ralim is working on this from an IronOS ticket.
I didn't feel like working around the limitations of the Blisp flashing tool, but got the bootup logo to work with relatively little effort. I did the following:
Advantage is that this uses the regular boot logo format, although the image is now embedded in the cpp sources. Thought I'd share. You should be able to figure it out, if not, let me know π
@wbokslag thank you for making this temporary work-around until ralim changes blisp for all.
are you able to write out a few more steps - some people this might be their first time doing something like this. since it's changing the source code and then you are flashing a modified pinecilv2.bin?
Of course. Here goes:
This post is intended as a workaround for getting a boot logo to work on a pinecil v2, as long as the blisp flashing tool does not support it. In this post, I'll go through all the steps to do the following:
Linux only, but you can certainly do it on windows too
You can get blisp in this repo: https://github.com/pine64/blisp. For me, the precompiled version did not work. As soon as I ran it, even without parameters, it complains about a wrong GLIBC version and exits. I thus pulled the sources, and followed the instructions in the readme. I ended up with blisp compiled. Keep this file, or copy it to /usr/local/bin/blisp to make it available system-wide
Go to the Bootup Logos folder and add the following to a new file patch.file
. The patch will make sure img2logo.py outputs another file (ends with .bin) that is the raw encoded image format, which is needed for our use
diff a/img2logo.py b/img2logo.py
index cdcaea3..083c253 100755
--- a/img2logo.py
+++ b/img2logo.py
@@ -232,6 +232,7 @@ def img2hex(
data.extend(get_screen_blob([0] * LCD_NUM_BYTES, image_bytes))
# Pad up to the full page size
+ size_without_padding = len(data)
if len(data) < LCD_PAGE_SIZE:
pad = [0] * (LCD_PAGE_SIZE - len(data))
data.extend(pad)
@@ -249,6 +250,15 @@ def img2hex(
split_name = [base,ext]
output_name = output_filename_base +split_name[0] +split_name[1]
DFUOutput.writeFile( output_name + ".dfu", data,
- Apply the patch with `patch < patch.file`
- Now run the image conversion script for your image. We take `IronOS.png` as an example
./img2logo.py --pinecil Images/IronOS.png converted
xxd -i convertedIronOS.png.bin
name
field from the docker-compose.yml
helped.
diff a/BootLogo.cpp b//BootLogo.cpp
index f21b8993..46f43f4e 100644
--- a/BootLogo.cpp
+++ b/BootLogo.cpp
@@ -13,7 +13,15 @@ void delay() {
}
}
+static unsigned char bootlogo[] = {
void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
// Read the first few bytes and figure out what format we are looking at if (OLD_LOGO_HEADER_VALUE == (reinterpret_cast<const uint32_t >(ptrLogoArea))) { showOldFormat(ptrLogoArea);
- Open the `BootLogo.cpp` file and add the image data inside the `bootlogo` character array.
- Build the firmware again
.\blisp.exe write --chip=bl70x --reset ./ci/artefacts/your_firmware.bin
Sure!
As far as I know, the Pinecil V2 cannot be bricked, as the bootloader can always be used to recover/reflash the firmware. Any bugs in the implementation can thus simply be reverted and/or a precompiled firmware may be flashed without issue. As far as I know, thus, don't shoot me if you do manage to brick it beyond repair :-)
Firmware updates can be pulled using git pull
and as long as the BootLogo.cpp
file did not contain changes really close to our addition, should work fine after recompilation and flashing. The requested pic is below
Happy to help,
Wouter
@wbokslag some people probably feinted when they saw detailed instructions to make a custom fw for this :astonished:
Here's a build of 2.21 with the animated IronOS bootlogo. Have fun :smiley:
If 2.21 gives you a black screen when you power up the pinecil, you can disable bluetooth as a temporary workaround. Either just repower it until you get a screen or hold + and repower it until you get the debug screen and press - to get to the main screen. (it felt like you get a screen faster with the + method to me). Then disable bluetooth in Advanced> bluetooth
Big thanks to @wbokslag for his guide :heart:
I made a video showing how to Install this specific "animated IRONOS logo" from the Zip file above that @PowerWiesel compiled and attached. anyone can easily use the IronOS animated boot logo art without compiling the firmware or doing any scary github code changes. unfortunately if you want something else, you have to follow instructions way above and try to do it yourself or bribe someone to make alternative for you.
Note: some people reported issues with newest 2.21. this may be related to bluetooth on it. If your screen is black, keep rebooting and press buttons, screen eventually appeared for people at which point, go to Advanced and turn off Bluetooth fixes it. Otherwise roll back to 2.20. Ralim is investigating the issue.
@PowerWiesel What are the upper limits to an animated bootlogo? How many frames are able to be included?
@PowerWiesel What are the upper limits to an animated bootlogo? How many frames are able to be included?
I can't give you a real answer, but I can tell you that the IronOS animation got 20 frames and give you the link to the animation pull request
Just try to convert the gif and you will see if it works
@PowerWiesel What are the upper limits to an animated bootlogo? How many frames are able to be included?
If I understand correctly, the frames are not stored entirely. Basically, there is a 1KB area reserved for the boot logo or animation. After the initial image, a "delta" is specified per frame, telling how the next frame differs from the previous. As such, you can have many frames if they resemble a lot, or only a few if they contain large changes between frames.
However, when using my 'workaround', the logo data is stored in the code, and is no longer bound to this 1kb limitation. I'm sure you can fit in a larger animation, but you might need to make some adjustments to the gif-to-bootanim script and/or the bootlogo display code for the pinecil. Shouldn't be too hard if you have any experience with this sort of thing.
Yep this is correct, the logo frames are either delta encoded or encoded as a whole frame (whatever is smaller for that frame).
Best advice is to try it and see, logos with largely static content with smaller animations will work better.
for me this commandline https://github.com/Ralim/IronOS-Meta#generating-the-logo-files did not work:
"Go back to Powershell and type this command (change infile.png to the name of your image):
python img2logo.py infile.png out -m for Miniware python img2logo.py infile.png out -p for Pinecil"
There is another description here: https://github.com/Ralim/IronOS/blob/dev/Documentation/Logo.md
This commandline did the job for me. Maybe someone can look into this, I think it should be corrected. thank you,
Ah thats my bad, Ill remove the out of date instructions in the readme here.
Here's a build of 2.21 with the animated IronOS bootlogo. Have fun π
If 2.21 gives you a black screen when you power up the pinecil, you can disable bluetooth as a temporary workaround. Either just repower it until you get a screen or hold + and repower it until you get the debug screen and press - to get to the main screen. (it felt like you get a screen faster with the + method to me). Then disable bluetooth in Advanced> bluetooth
Big thanks to @wbokslag for his guide β€οΈ
Any chance you can make one for 2.22?
Currently 2.22 is believed to fix the Bluetooth boot issues. What would be the use case?
I don't have the skills or time at the moment to compile a 2.22 version that includes the boot logo and I'd like to stay on the newest version with the boot logo but it's definitely not necessary
If I'm not mistaken, you just need to do this:
https://github.com/Ralim/IronOS/pull/1863#issuecomment-1872219783
Once the logo is flashed in the correct location it will survive upgrades as well :)
I was wondering how to upload a bootup logo to the pinecil v2. When I use the update instructions from the Pine64 wiki, I end up overwriting the whole flash with the bootup logo. I'm surprised it even flashes anything at all because in the wiki it talks about needing .bin files, but I used the .dfu file.