BrakTooth

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
tr0ff
Posts: 1
Joined: Wed Sep 15, 2021 5:41 am

BrakTooth

Post by tr0ff » Wed Sep 15, 2021 5:58 am

Hi there,


will the MicroPython firmware build with the latest Espressif-SDK?

Is the ESP-BrakTooth fix included in the latest MicroPython release?
In the recommendations on readme.md i couldnt found some informations about the esp-idf patchlevel.
On page 4 the security advisory . lists the patched releases of esp-idf
are these patches are compatible with micropython and will be used for the latest downloads?

butzel
Posts: 3
Joined: Sat Jun 10, 2017 10:02 pm

Re: BrakTooth

Post by butzel » Wed Sep 15, 2021 9:39 am

    Hallo Tr0ff,

    MicroPython is Opensource,you can try it on your own system ;-)
    • First download and install ESP-IDF (in this example I used 4.2,with commit id 3212d62b2bf)

      Code: Select all

      WORKDIR="$HOME/workspace/micropython"
      mkdir -p $WORKDIR
      
      ## ESP-IDF clone
      # Clone ESP-IDF from github
      git clone -b v4.2 --recursive https://github.com/espressif/esp-idf.git
      cd $WORKDIR/esp-idf
      
      # checkout your desired patch
      git checkout 3212d62b2bf5bbfb7d399762770e872478c7ecdd
      git submodule update --init --recursive
      
      # Install ESP-IDF
      ./install.sh
      . ./export.sh
      
    • Of course you also need the MicroPython sources:

      Code: Select all

      ## MicroPython
      # Clone MicroPython from github
      
      cd $WORKDIR
      git clone https://github.com/micropython/micropython.git
      
      # build mpy-cross
      cd $WORKDIR/micropython/mpy-cross
      make -j4
      
    • Now you can build your firmware and test it

      Code: Select all

      # first we need to set some environment variables 
      WORKDIR="$HOME/workspace/micropython"
      export PATH="$WORKDIR/esp-idf/xtensa-esp32-elf/bin:$PATH"
      export IDF_PATH="$WORKDIR/esp-idf"
      
      cd $IDF_PATH
      source export.sh
      
      #optional customize BOARD-Variable to your hardware
      #export BOARD=GENERIC_SPIRAM
       
      ## Build Firmware
      #make clean 
      cd $WORKDIR/micropython/ports/esp32
      make submodules
      make -j4
      
      # make deploy 
      esptool.py  -p /dev/ttyUSB0 -b 460800 write_flash -z 0x1000 build-GENERIC/firmware.bin
      
      Then connect to your ESP32 and reboot it.
      You should see today's builddate

      Code: Select all

      screen /dev/ttyUSB0  # exit with [ctrl]+[a],  [shift]+[k], [y]  
      >>> import machine
      >>> machine.reset()
      
    I hope this helps you.
    are these patches are compatible with micropython
    It looks like my example above worked with the breaktooth-commit.
    Is the ESP-BrakTooth fix included in the latest MicroPython release?
    But I have no idea how to see which ESP-IDF is being used for a specific MicroPython build.

    Post Reply