🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Just find out a way to convert UiFlow microPython codes into .bin file

    UiFlow 2.0
    1
    1
    559
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kurikoK
      kuriko
      last edited by kuriko

      The method is very simple: download the UiFlow firmware source code, copy the microPython code generated in UiFlow to main.py, change the boot option so that the device runs main.py after powering on, compile the UiFlow firmware, and you will get a .bin file running directly into main.py.

      Step 1: Setting up ESP-IDF environment and download UiFlow source code

      https://github.com/m5stack/uiflow-micropython
      Follow the "How to build" instrument to setting up ESP-IDF environment and clone the UiFlow source code.

      Step 2: Change the main.py file and modify boot option

      Open up location /m5stack/fs/user/main.py and paste your code generated by UiFlow.
      Open up location /m5stack/fs/user/boot.py and edit line 37-40

      try:
              boot_option = nvs.get_u8("boot_option")
          except:
              boot_option = 1  # default
      

      into

      boot_option = 0 
      

      By editing these codes, your device will directly runs main.py after booting. Don't forget to save the files.

      Step 3: Build the firmware and flash into your device

      Just follow the "Building the firmware" instrument, it will generate a .bin file in /m5stack/build-%YOUR_BOARD_NAME%/ and flash it into your device
      Now you have your own .bin with microPython codes, you can publish it in the "User Custom" of M5Burner or other places.

      If there is any better or easier way, please discuss it with me.

      Good morning, and welcome to the Black Mesa Transit System.

      1 Reply Last reply Reply Quote 1
      • First post
        Last post