Welcome to Our Community

Some features disabled for guests. Register Today.

BlackBox X32 - Manually Backup your stock firmware

Discussion in 'Controller Boards' started by Shell M. Shrader, Dec 9, 2022.

  1. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    For those planning to do custom firmware on their BlackBox X32 or just want to have the factory shipped firmware as the ultimate backup, here is the standard procedure for backing up an ESP32 board:

    1.). You need python installed. Follow the appropriate procedure for your client computer to install it.


    2.) Install esptool via pip:
    Code:
    pip install esptool

    3.) See if esptool can detect your controller:
    Code:
    esptool.py flash_id
    You should get a response similar to below:
    Code:
    esptool.py v4.4
    Found 1 serial ports
    Serial port /dev/ttyUSB0
    Connecting..............
    Detecting chip type... Unsupported detection protocol, switching and trying again...
    Connecting.....
    Detecting chip type... ESP32
    Chip is ESP32-D0WDQ6 (revision v1.0)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    Crystal is 40MHz
    MAC: xxx
    Uploading stub...
    Running stub...
    Stub running...
    Manufacturer: 5e
    Device: 4016
    Detected flash size: 4MB
    Hard resetting via RTS pin...
    If esptool reports that the controller is in the wrong boot mode, try the following. Otherwise, skip to the next step.

    Put the X32 into download mode. To do this, hold down the MODE button and hit reset while continuing to hold down MODE.

    While still holding down MODE, execute the following from the client computer you have connected to your BB32's via USB:
    Code:
    esptool.py flash_id

    4.) Take note of the Serial Port as you'll need it in this step. To do a full backup of your controller, execute the following (repeat the process for putting the X32 into download mode if you had to follow it above):
    Code:
    esptool.py --baud 115200 --port <SERIAL_PORT> read_flash 0x0 0x400000 BlackBox_X32_Backup.bin

    If you ever need to fallback to this firmware later, execute the following:
    Code:
    esptool.py --baud 115200 --port <SERIAL_PORT> write_flash 0x0 BlackBox_X32_Backup.bin

    Grbl_Esp32 firmwares can be found here: Grbl_Esp32/firmware at main · synman/Grbl_Esp32

    FluidNC (basic) config.yaml can be found here: FluidNC/OB_BlackBox_X32.yaml at 4af173b928f6032263e434cb41de2b33d2fe0f43 · bdring/FluidNC
     
    #1 Shell M. Shrader, Dec 9, 2022
    Last edited: Dec 21, 2022
    Mark Carew likes this.
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    Also always available on git: History for grblhal-grbl3axis.bin - OpenBuilds/OpenBuilds-CONTROL

    If the Run/Flash jumper is in the Flash position (factory default) - autoreset is enabled - no need for the button sequence :)
     
    Shell M. Shrader likes this.
  3. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    Ah, thanks Peter! I don't use OpenBuilds-CONTROL and completely forgot it manages all of this.

    So, let's call this the "old school" approach :)
     
    Peter Van Der Walt likes this.
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    Standard tooling is good. But yeah, we are friendly enough to save people who forget to backup too. Latest is always best though as we'll be fixing bugs as we go along. If things go bad, grab latest CONTROL, and fresh flash from there
     
  5. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    hmm, esptool refused to do anything useful until I held down that "pin".
     
  6. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    Adding '--before default_reset' might help? We use the standard nodemcu autoreset circuit that pulls down IO0 during flashing too.

    [​IMG]
     
  7. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    at least from my pi, it is not a "card not present" transaction, LOL. I haven't tried to connect locally from my mac.

    Similar, but different for usb_reset too:
     
    Peter Van Der Walt likes this.
  8. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    This is one sweet looking board.

    PXL_20221213_032346980.jpg

    It is odd I can't get esptool to automatically toggle the boot mode. I thought for sure I was going to find this jumper in the wrong position.
     
  9. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    Thanks! It was a challenging one to lay out - because the layout was inherited from older BlackBox that had a lot less going on it, ATmegas are smaller than ESP32s :)

    Have you tried from a Windows PC just as a sanity check - some linux drivers doesn't do the RTS/DTR thing perfectly timed
     
  10. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    no, but I have swapped out my pi4 for a zotac pi225 running Debian 11.5. ... Same flash behavior on it, but it did solve another issue I was having with the FTDI driver and other devices.
     
  11. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    esptool version? On windows we've not update the included binary in a while, still including esptool.py v2.6 - and it works
     
  12. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    doh

    Code:
    pi@octopi-qbp:~ $ pip show esptool
    Name: esptool
    Version: 4.4
    Summary: A serial utility to communicate & flash code to Espressif chips.
    Home-page: https://github.com/espressif/esptool/
    Author: Fredrik Ahlberg (themadinventor) & Angus Gratton (projectgus) & Espressif Systems
    Author-email:
    License: GPLv2+
    Location: /home/pi/.local/lib/python3.9/site-packages
    Requires: bitstring, ecdsa, reedsolo, pyserial, cryptography
    Required-by: 
    I'll try a downgraded verion of it.
     
  13. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285
    We're far behind, but have not had a need to update yet :)
    Almost doubt it but you never know... holding thumbs (oops thats a local saying)!
    (Holding Thumbs: This gesture, known as "holding thumbs" (Afrikaans "duim vashou") probably originated in Germanic countries as "thumb pressing" or in Dutch. It generally is used as a gesture of encouragement or solidarity, showing concern and wishing luck, much like some usages of the English-and-colonial "crossing fingers".)
     
    #13 Peter Van Der Walt, Dec 19, 2022
    Last edited: Dec 19, 2022
  14. Shell M. Shrader

    Builder

    Joined:
    Dec 9, 2022
    Messages:
    19
    Likes Received:
    13
    so I tried again on the zotac pi-225 (it's tiny dual core intel celeron with usb-c) and esptool.py is reseting the port fine.

    There's something about that FTDI driver and the pi.
     
    Peter Van Der Walt likes this.
  15. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,879
    Likes Received:
    4,285

    Attached Files:

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice