Bootloader for Omega2S and Omega2S+
Hi guys, sorry if this question was already asked, but I couldn't find any.
In the Onion's repo (http://repo.onion.io/omega2/) there are no bootloader or OS images available for Omaga2 S (the surface mount version). Where can I find any of these? Can you confirm that Omega2 images will not work (at least different pinout)?
All of the docs suggest using filesystem overlay on SD/eMMC and palcing ROM on the build-in flash storage. Is there any uboot config available with the ability to perform a full boot from eMMC/SD card? I do not want to use overlays.
there isnt any official boot loaders.
the closest I have gotten to no Onion OS's are Debian Mipsel (theres a guide on setting it up in a chroot)
There is another guide on Installing FreeBSD on the omega , using Uboot and an LMZA image.
But other than that. its the stock Busyboxish openwrt . (which is good for getting Iot devices working)
@Arek-Z @Lee-Lilleorg-Meilleur Actually, Omega2S's firmware is the same as for the Omega2 and Omega2S+ has the same firmware as Omega2S+. Please look at our firmware repo. You can use this guide to manually istall the firmware onto your Omega2S.
@Pavel-Metrokhin Thank you so much, I assumed that 2+ and 2S+ may have different firmware, as 2S+ has additional interfaces (PCIe).
Can you say something regarding working with uboot?
- Will I be able to build a working bootloader image from https://github.com/OnionIoT/omega2-bootloader?
- Is there any recommended workflow for changes in u-boot?
- Is there any way to unbrick the device when something goes wrong (except unsoldering NAND)?
- It seems that libraries for eMMC have been recently added to the bootloader (https://github.com/OnionIoT/omega2-bootloader/commit/239004c6fbb6c688b3718eed37ec3b3ecdef62d0). How to perform full boot from eMMC/SD? If it is considered not possible, are you working on this? Will it be possible in the close future?
@Arek-Z Glad to hear that!
- You can simply download the bootloader from our source repo.
- Can you please specify what changes do you want to make?
- Omega2S can be manually flashed with the latest firmware. You can refer to our documentation on Using UBoot to manually flash the firmware to the Omega2S. The reset button that needs to be pressed on the Dev Kit is called
- It is indeed possible. You can follow our documentation on How to Boot from External Storage, selecting the applicable storage that you want to boot from.
How to Boot from External Storage
- Good to know that I can use source repo for building working bootloader. Thank you!
- We'd like to put rootfs and kernel on eMMC storage and boot from it. This requires loading kernel from eMMC - which implies changes in u-boot. In the next step, we would like to implement A/B update strategy using mender (https://mender.io/product/how-it-works).
- I was rather wondering how to unbrick device after I flash broken u-boot image. Is unsoldering and flashing in external hardware the only way to unbrick?
- As I mentioned earlier, we'd like to boot from eMMC. I've already seen the "How to Boot from External Storage", but actually, it is overlay mechanism - rootfs and kernel is still on the 32M flash.
Is there any Onion documentation covering the process of flashing the bootloader? I looked around not long ago, but didn't manage to find any.
Douglas Kryder last edited by Douglas Kryder
Yup, that's what I found as well, and while those touch on building and using the bootloader, they don't cover anything related to flashing one. If Onion are publishing links to bootloader binaries and suggest that users flash them, I'd have thought there was a user friendly doc to go along with that.
I did manage to achieve my goal, so for my own purposes I'm good, but it was a process and a half, so I was hoping for something less complicated (and officially endorsed) to refer forum users to in future.
@Arek-Z I modified the bootloader on an omega2s+, based on the github repo of onion. This went fine without problems. For flashing, I use a FTDI SPI cable in combination with the most recent version of flashrom, which works out of the box. You can freely write the flash as long as you keep the processor in reset, so unbricking is not a problem and all required HW signals are available on the omega2s. Just make sure that you don't erase the second partition, I don't think you can restore that one.
In practical terms, I added a programming header that contains the SPI signals as well as ground, 3V3 and reset. When the programming header is inserted, a short keeps the processor in reset, so that the flash can be safely programmed. This method only works with the s/s+ version of the omega.
@wdu Awesome, thank you so much. This is the confirmation I needed!
There is actually a simplier way to flash the bootloader: by using the Bootloader web recovery mode. Please follow the instructions provided in our docs on how to flash the firmware via web recovery mode but when you get to the 192.168.8.8, you'll be presented with the page where you need to load the firmware or load a UBoot file.
You'll want to click
uBoot Updateand load the bootloader binary. This will start the bootloader installation process. You can get the officail Omega2 binaries from our us.
If you flash a broken bootloader, you need to physically desolder and reprogram the flash memory.
If you modify the bootloader and/or make any physical modifications (e.g. remove the flash and etc), Onion Corporation is not responsible for any damage to your device and the warranty will be voided. Proceed at your own risk.
Thank you for this useful explanation.
@Pavel-Metrokhin Thank you Pavel, we know this. However, web recovery is not available when u-boot is damaged. User wdu confirmed that it is possible to flash with SPI when you are unable to use web recovery.
- If you have working u-boot - use web recovery https://docs.onion.io/omega2-docs/Firmware-Flashing-Web-Recovery.html
- If you damaged u-boot - You do not have to unsolder memory for flashing with external hardware. You are able to flash the bootloader with SPI (not a trivial thing, however). To be able to flash the memory, you need to keep Omega's processor in reset state.
@Arek-Z Thanks for sharing this great solution!
Caio Mehlem last edited by Caio Mehlem
@wdu , hi! Can you share with us the details? Did you just write the binary to the raw flash memory? Starting at which address? I imagine at least some part of the 32MB of flash must be partitioned with a FS (jffs2?), so we must be careful not to overwrite it, right?
Can someone point me to or share the flash's map / partitioning scheme?
@Pavel-Metrokhin , can you please confirm if building the source @ https://github.com/OnionIoT/omega2-bootloader will generate the same bootloader provided @ http://repo.onion.io/omega2/bootloader/ ? In other words, is the GitHub repo complete and up to date or you build the provided bootloader from a private repo?