How to: Update/Upload firmware in the Xiaomi Modchip.


You need the following:

  • STM32CubeProgrammer : Click
  • Programmer: ST-link v2 or V3 ,Super cheap option: Click
  • Hex/ELF files: Click (Pro for for air purifier PRO, V1.0 For the 3H/2S)
  • Xiaomi Modchip

Step 1

Open STM32CubeProgrammer:


Press open file (Next to device memory) And navigate/load to the correct HEX/ELF file.

STM32CubeProgrammer With the correct Elf File loaded.

Step 2: Connect

DIY Xiaomi modchip (Shout out to Vlad from Serbia) You did an amazing job 🤘🤘🤘🤘 ps. Thanks for keeping the Flamingo allive.

Connect/Solder/Use pogo-pins to the ST-link with the following pinout:

  • TP1= SWDIO
  • TP2= +3v3
  • TP3= GND
  • TP5= SWCLK

Step 3: Flash

Plug in the ST-Link (sometimes you need to perform an update of the programmer itself. Just follow the onscreen steps)

Now press connect

Correctly connected programmer.

Now press the Blue Download button. This should start the flashing.

Well Done Clapping GIF by MOODMAN
Badabing Badaboom you’re done.


  1. Hello I have problem get live this project, I cant connect with ST-link over test points, if I solder back to bluepill it work normally, and I can connect and flash firmware, but if I bring it back to mod PCB it not work, I have asemble three boards but still no luck bring it to live. If I flash in bluepill and get back to mod pcb still not work, I have 3H. Any tips what I can try or messure. I use v1.0 firmware. thanks

    1. Please check 3v3 on all pins on the MCU. I made a mistake in one version of the PCBA’s so maybe you’ve ordered an older version. You can fix it by doing this:Fix
      Solder a small wire between R3 and R4 to the top of C2/C1

      1. Yeah it is 3V3 missing track, I repair it with little wire from TP2 to caps positive now it’s working thanks.

        1. Hey Igor, Thanks for confirming! I’ve changed the gerbers on Github to prevent this.

          Good luck with your Modchip ^^

Leave a comment

Your email address will not be published. Required fields are marked *