Pure Micro Python without Ui-Flow on my M5Stack core2



  • Hello friends,
    I just want to make myself pure Micro Python without Ui-Flow on my M5Stack core2.
    (Program otherwise with MS code and the Pycom-WipY modules).

    (I absolutely need Blueetooth!)
    Which Micro Python version do I need to use for this?
    (Downloadlink?)
    Where can I get the latest lib for M5Stack-Core2?
    (Downloadlink?)
    How do I integrate the Lib for M5Stack-Core2 then?

    Why isn't there an option with the M5Stack burner to do it right away with Micro Python only, without Ui-Flow?
    Who can help me further?

    Translated with www.DeepL.com/Translator (free version)


  • M5Stack

    Hey @Wolli01 unfortunately this option isn't available right now but you can take a look into it yourself if you have the know how, the screen of m5core2 uses littlevgl library which has been ported to micropython https://github.com/lvgl/lv_binding_micropython for the micropython firmware you can just go to micropython.org and download one of the firmwares for generic esp32. As for the various modules there has never been an official github with these available, I have one for mpu6886 and axp on my personal github which should work though. I'm afraid this is going to be like a jigsaw puzzle, piecing various resources together to create the firmware you want



  • Thanks for the info.



  • @lukasmaximus
    http://micropython.org/download/esp32/
    Which file must be taken for the M5Stack Basic and for the Core 2? There are plenty of different ones.
    Do you have a small example to output the text hello in the main.py?
    The lib. Dateine I have downloaded all from your GitHub account and installed under the lib folder.
    I've been trying for hours but the screen always stays blank. It would be nice if you could help.

    Translated with www.DeepL.com/Translator (free version)


  • M5Stack

    Hi @Wolli01 as for the M5 Basic you can refer to my video https://www.youtube.com/watch?v=GPRNUCBTVy4 As for M5Core2 I cant tell you as I haven't got round to testing pure micropython on this device. If the screen is not displaying anything are you sure you have a micropython driver in the flash and have initialized the screen in your code?



  • @lukasmaximus
    Is it possible now to see the actual Micropython libs?
    For example is it possible to see the code of the libs to see how the function for the cor2 touch screen work etc?



  • The latest lv_micropython can be built for the 'M5CORE2'-board.
    (I used ESP-IDF v4.0.2 on Ubuntu 20.04)

    Stuff I tested successfully on my M5Core2:

    • display with lvgl widgets
    • touchscreen
    • WLAN
    • RTC
    • SDCard (read)

    Might be interesting for people searching pure Micropython + lvgl on the Core2.



  • @dhed
    hi Dhed, is it possible for you to share the last bin pure lv_micropython firmware for M5CORE ?
    it's been several days i 'm trying to compile it but i'm a win64 user... it's hard for me.



  • @favnec5 said in Pure Micro Python without Ui-Flow on my M5Stack core2:

    @dhed
    hi Dhed, is it possible for you to share the last bin pure lv_micropython firmware for M5CORE ?
    it's been several days i 'm trying to compile it but i'm a win64 user... it's hard for me.

    Here's my compiled firmware: zippyshare-link.
    Should be flashable with:

    esptool.py --chip esp32 -p COM3 -b 460800 erase_flash
    esptool.py -p COM3 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 16MB 0x8000 partition-table.bin 0x1000 bootloader.bin 0x10000 micropython.bin
    

    (flashing works even under Windows with the ESP-IDF toolchain installed)



  • @dhed
    Hi, thank you for your firmware.
    I try lot of things. There is a problem to use SDCard with display driver a the same SPI. SDCard is down :-/
    Do you know this problem ?



  • @favnec5
    My workaround for this (known) problem:

    1. during boot mount the sdcard and load files to ram
    2. then unmout the sdcard
    3. initialize the display

    something like:

    import uos
    from machine import Pin, SDCard
    
    sdcard = SDCard(slot=2, sck=Pin(18), miso=Pin(38), mosi=Pin(23),  cs=Pin(4), freq=40000000)
    uos.mount(sdcard, '/sd')
    ...
    uos.umount('/sd')
    sdcard.deinit()
    

    before initializing the display:

    from ili9XXX import ili9341
    lcd = ili9341(spihost=1, mosi=23, miso=38, clk=18, dc=15, cs=5, invert=True, rot=0xC0, width=320, height=240, rst=-1, power=-1, backlight=-1)
    

    I'm loading weathericons to use with openweathermap that way.



  • Hi, the problem is, for me, that i need to write files to the sdCard like a datalogger. I think old lobo’s version do the job but not lv_micropython… @m5stack : official pure m5stack needed to use the core 2 functionalities OR hidden start menu version of uiflow.



  • @favnec5 Here is another Micropython port for the Core2. Already thried that with my core2: https://github.com/thuehlinger/micropython-core2

    Another note: you do not need to use another firmware, you can use Micropython directly by just not using uiflow. See my repo https://github.com/hjgode/m5home within the lv dir: lv_test.py
    Be warned, the LV Binding is not very well documented and often only links to the C API.