Combine u-boot and openwrt in the same single file and flash it to the onion board
-
we have onion2 board
I can see that the board come with the uboot already installed.1- First Question: what is the uboot used in the omega2 boards? I found 2 repositories of uboot in your Github:
https://github.com/OnionIoT/u-boot
or https://github.com/OnionIoT/omega2-bootloader ?2- are there a ready binary of the boot loader that I can download and use in my board?
3- are there a way to combine the uboot binary and the omega2 openwrt binary in a single file and then flash it to the omega2 board? with this way I will flash only 1 file in the factory instead of 2 files
-
@mohamedkallel said in Combine u-boot and openwrt in the same single file and flash it to the onion board:
1- First Question: what is the uboot used in the omega2 boards?
It's this repo: https://github.com/OnionIoT/omega2-bootloader
2- are there a ready binary of the boot loader that I can download and use in my board?
See http://repo.onioniot.com/omega2/bootloader/ for the binaries
And http://docs.onion.io/omega2-docs/Web-Recovery-flash-bootloader.html for info on how to update
Make sure to use omega2 bootloader images for Omega2 and Omega2S, and omega2p bootloader images for Omega2P and Omega2SP3- are there a way to combine the uboot binary and the omega2 openwrt binary in a single file and then flash it to the omega2 board? with this way I will flash only 1 file in the factory instead of 2 files
There are more partitions than just uboot and the linux partition. See this thread for more information and our recommendation: https://community.onion.io/topic/5011/spi-flash-image-generation/4
-
thank you for your feedback
where I can find the programmer application ?
-
@Lazar-Demin
after flashing uboot and Openwrt to the SPI flash, then I can get the HEX file with the flash programmer.
Now I want to clone this file to other devices, but there is some parameters that are unique per each device like the MAC address that I have to change in the HEX file. Could you please let me know what other parameters that I need to change in the image file for each device?
-
@mohamedkallel We recommend against using a flash programmer to write complete images to the flash.
@Lazar-Demin said in SPI Flash Image generation:
We recommend against using a flash programmer to write complete images to the flash.
For one thing, the factory (aka art) partition holds wifi radio configuration and MAC addresses that are programmed at the factory and are unique to each device.
If the factory partition is overwritten, you will need to boot the device (either into the bootloader or Linux) to, at minimum, write unique MAC addresses to the factory partition.
If you're already booting into Linux, then it makes sense to use the sysupgrade command to install a firmware image as @JeffZhou mentioned above.
This process will only update the firmware and kernel partitions, leaving the bootloader and factory partitions as they are.
As a second option, in case this isn't helpful since you need to "clone" the firmware setup of a device, we recommend looking at this FAQ post: https://community.onion.io/topic/4563/faq-is-it-possible-to-clone-the-firmware-running-on-an-omega2-device-and-copy-it-to-other-omega2-units
It doesn't overwrite the factory partition, but there are other trade-offs.
-
thank you for your feedback
I checked the default radio configuration and it's the same for all device.
Do you mean the SSID name?
-
@mohamedkallel the
factory
partition holds wifi radio configuration and MAC addresses that are programmed at the factory and are unique to each device.This is not the same as the linux networking and wireless configuration in
/etc/config
in the linux filesystem
-
@Lazar-Demin Could you please let me know what could be the radio config that the factory partition hold? could you please provide example or link
thank you
-
@mohamedkallel have you looked at using uci default scripts configure each individual device?
-
@crispyoz as @Lazar-Demin said it's not about the uci config. it's a config that was put in the factory partition (mtd2) like the Mac address.
-
@Lazar-Demin
I made a comparison between the mtd2 partitions of 2 boards. and here what I found:the difference in the lines 0000000 and 0000020 and 0000030 are about the Mac addresses.
but the difference in line 0000050 is not clear for me. could be this related to the radio ?
-
@mohamedkallel I don't understand why you'd want to change the MAC address, hence my question re UCI.
-
@crispyoz the idea is to generate final binary that contains all partitions (uboot, factory, firmware...) in order to flash it to all my devices in the factory production phase.
there is unique params for each device that are stored in mtd2 partition(factory partition). these params are:- Mac Addresses
- WiFi radio calibration data
I want to change these params in my production process before flashing each device
uci-default will not help me in such process
-
@mohamedkallel the wifi radio calibration stored in the factory partition is unique to each device. It's done in the factory as part of QA testing with the help of an RF calibration machine. We do not recommend changing these values.
Hence we do not recommend using a flash programmer to write complete images to the flash.