Unable to flash firmware from USB



  • I have never used this particular Onion Omega2+ but when I turn it on for the first time I noticed that I wasn't able to find the wireless network generated by the Omega.
    When I connect it to serial (I'm using the expansion dock) it shows:

      ____       _             ____
      / __ \___  (_)__  ___    / __ \__ _  ___ ___ ____ _
     / /_/ / _ \/ / _ \/ _ \  / /_/ /  ' \/ -_) _ `/ _ `/
     \____/_//_/_/\___/_//_/  \____/_/_/_/\__/\_, /\_,_/
     W H A T  W I L L  Y O U  I N V E N T ? /___/"
    
    Board: Onion Omega2 APSoC DRAM:  128 MB
    relocate_code Pointer at: 87f5c000
    flash manufacture id: c2, device id 20 19
    find flash: MX25L25635E
    *** Warning - bad CRC, using default environment
    
    ============================================ 
    Onion Omega2 UBoot Version: 4.3.0.3
    -------------------------------------------- 
    ASIC 7628_MP (Port5<->None)
    DRAM component: 1024 Mbits DDR, width 16
    DRAM bus: 16 bit
    Total memory: 128 MBytes
    Flash component: SPI Flash
    Date:Sep 19 2017  Time:15:11:41
    ============================================ 
    icache: sets:512, ways:4, linesz:32 ,total:65536
    dcache: sets:256, ways:4, linesz:32 ,total:32768 
    CPU freq = 575 MHZ
    Estimated memory size = 128 Mbytes
    Resetting MT7628 PHY.
    Initializing MT7688 GPIO system.
    wifi mac address = 004C02084D10.
    
    
    **************************************
    * Hold Reset button for more options *
    *************************************
    
    Boot Linux from Flash NO RESET PRESSED.
    ## Booting image at bc050000 ...
    Bad Magic Number,0400AC01
    

    So I tried to flash the last firmware from USB, as showed in the docs, but when I do it the Omega give me this error:

    ***************************************
    * [!] This will take several minutes  *
    * please do not power off your Omega2 *
    ***************************************
    
    
    *ERROR: CTL:TIMEOUT X
    BBB_reset
    usb_control_msg: request: 0xFF, requesttype: 0x21
    value 0x0 index 0x0 length 0x0
    ERROR: CTL:TIMEOUT X
    

    I have tried with 3 different types of USB stick and it always shows the same error.
    I am working to a university project and, due to the lockdown, is really difficult to receive more material from the campus so I don't have the ethernet shield to access to the Web recovery mode. There is something that I can do to try flashing the bootloader in some other way?
    Is it possible to do something from the boot command line? Because I am not even able to access to failsafe mode.



  • @Alberto-Zandara Why can't you get into failsafe mode? It takes a few tries to get it to work usually as it is very quick.can you post a screen shot of what you are seeing when you try.



  • Also, an option is to format an sdcard in ext4 format and load the firmware file on that and mount it while in safemode and use sysupgrade



  • @jmztaylor But if he cannot get into safe mode, that is not an option. Hence my question.



  • @crispyoz sorry if I answer you only now and thank you for your help (thank you also @jmztaylor), anyway I tried an infinite number of times to press F and [Enter] to access the failsafe mode but it doesen't work. Looking at the serial capture that I uploaded, you can also notice how the booting process doesn't even initialize the Kernel. For this reason it does not display the line (I have found it on the internet) :

    Press the [f] key and hit [enter] to enter failsafe mode                        
    Press the [1], [2], [3] or [4] key and hit [enter] to select the debug[    5.58)
     level
    

    It definitly stop here and than it doesn't show anything else:

    Boot Linux from Flash NO RESET PRESSED.
    ## Booting image at bc050000 ...
    Bad Magic Number,0400AC01
    


  • @Alberto-Zandara The bad magic number that was your original issue suggests your u-boot is up the spout which would also explain why you are unable to access safe mode.

    I do have one lingering thought, what terminal are you using and what emulation? I wonder if while you can use numeric keys to select to boot from USB, your terminal may not be correctly sending the letter "f" (or enter) and hence you may not be able to get into safe mode.



  • I tried to enter safe mode from putty in windows and from screen in Ubuntu and in both cases it shows:

    Please select option:
       [ Enter ]: Boot Omega2.
       [ 0 ]: Start Web recovery mode.
       [ 1 ]: Start command line mode.
       [ 2 ]: Flash firmware from USB storage.
    
    Option [f] selected.
    
    Boot Linux from Flash.
    ## Booting image at bc050000 ...
    Bad Magic Number,0400AC00
    

    And it doesn't work.
    Are there any ways to copy the firmware from the USB stick to the linux partition of the Omega2 through the u-boot command line?



  • @Alberto-Zandara let me ask, if in options presented here, you press 4 and enter key, do what is the output?

    Press the [f] key and hit [enter] to enter failsafe mode                        
    Press the [1], [2], [3] or [4] key and hit [enter] to select the debug[    5.58)
     level
    


  • Sorry @crispyoz, maybe I was not clear, my unit does not display this row, this is all it shows:

      ____       _             ____
     / __ \___  (_)__  ___    / __ \__ _  ___ ___ ____ _
    / /_/ / _ \/ / _ \/ _ \  / /_/ /  ' \/ -_) _ `/ _ `/
    \____/_//_/_/\___/_//_/  \____/_/_/_/\__/\_, /\_,_/
    W H A T  W I L L  Y O U  I N V E N T ? /___/"
    
    Board: Onion Omega2 APSoC DRAM:  128 MB
    relocate_code Pointer at: 87f5c000
    flash manufacture id: c2, device id 20 19
    find flash: MX25L25635E
    *** Warning - bad CRC, using default environment
    
    ============================================ 
    Onion Omega2 UBoot Version: 4.3.0.3
    -------------------------------------------- 
    ASIC 7628_MP (Port5<->None)
    DRAM component: 1024 Mbits DDR, width 16
    DRAM bus: 16 bit
    Total memory: 128 MBytes
    Flash component: SPI Flash
    Date:Sep 19 2017  Time:15:11:41
    ============================================ 
    icache: sets:512, ways:4, linesz:32 ,total:65536
    dcache: sets:256, ways:4, linesz:32 ,total:32768 
    CPU freq = 575 MHZ
    Estimated memory size = 128 Mbytes
    Resetting MT7628 PHY.
    Initializing MT7688 GPIO system.
    wifi mac address = 004C02084D10.
    
    
    **************************************
    * Hold Reset button for more options *
    *************************************
    
    Boot Linux from Flash NO RESET PRESSED.
    ## Booting image at bc050000 ...
    Bad Magic Number,0400AC01
    

    And nothing else.



  • @Alberto-Zandara Sorry I didn't understand that point because in your earlier message you showed a screen shot of the flash menu.

    I just want to reset back to the beginning so everything is clear.

    If you try factory reset what happens?



  • @Alberto-Zandara

    Ref:

    A: https://docs.onion.io/omega2-docs/Firmware-Flashing-Web-Recovery.html
    B: https://github.com/OnionIoT/Omega2/blob/master/Schematics/Omega2S-Reference-Schematic.pdf, that details the schematic for Ethernet, Section 10/100 WAN port, Option 2. Four resistors and 5 capacitors are required.
    ETH-PHY-SCH.png

    Don't worry about the 49.9R; I used 150 Ω with 100nF caps and it works.

    Steps:

    1: Prepare and Ethernet connection that make use of the TX+/-, RX+/- available on the Expansion dock using [B]

    Here is the image:
    Omg-Eth-Phy.png

    2: Use the web-recovery method.
    Doesn't necessarily have to use 192.168.8.8 as mentioned in [A]. If you are on network 192.168.10.x, you can configure Omega2+ to use,say, 192.168.10.18 by choosing option "[1]: Start command line mode" at boot loader and changing the env

    Omega2 # printenv
    bootcmd=tftp
    ..
    ipaddr=192.168.8.8
    ..
    stderr=serial

    Omega2 # setenv ipaddr 192.168.10.18

    Omega2 # printenv
    bootcmd=tftp
    ..
    ipaddr=192.168.10.18 (if the previous entry was wrong, say, <setenv ipaddr=192.168.10.18>, it wouldn't have the ipaddr line when you do printenv again)
    ..

    Omega2 # saveenv
    Saving Environment to SPI Flash...
    ..

    Omega2 # reset (while holding the the RESET button pressed)

    At the bootloader choose option 0 as in [A] and proceed with web-recovery, in this case point browser to http://192.168.10.18

    Thanks..


  • administrators

    Wanted to chime in here: the latest version of the bootloader fixes the USB flashing method!

    All of the relevant info can be found here: https://community.onion.io/topic/4132/bootloader-update-fix-for-flashing-firmware-from-usb-storage

    Just note that you'll need to use the Web Recovery method to update the bootloader. Might be easiest to get your hands on an ethernet expansion.



  • Hi guys. Thank you everybody so much for all these answers, it is so nice to see that the community is still really active. I come back on the problem after a few months because I would really like to use this Onion again. Now when I connect it to the USB the computer detects it but in serial connection nothing happen and the ligh on the Omega doesn't even turn on. I bought a CH341A to flash it with SPI, there is someone that knows how should I do it and which firmware should I flash? (Sorry but I've never done an SPI flash before)



Looks like your connection to Community was lost, please wait while we try to reconnect.