lvgl-micropython / lvgl_micropython

LVGL module for MicroPython
MIT License
82 stars 26 forks source link

Fix esp32 build #156

Closed MitchBradley closed 3 weeks ago

MitchBradley commented 3 weeks ago
  1. In the builder, copy_updated_files was renamed to copy_micropy_updates but the change was not propagated to esp32.py
  2. Various builders auto-create the directory micropy_updates/originals/esp32 using os.mkdir(), which fails if the intermediate directory 'originals' does not exist. os.makedirs() will create the entire path.
MitchBradley commented 3 weeks ago

I am really confused by the CI failure because it crashed on the line os.mkdir() which the PR changed to os.makedirs(). Could the CI action be checking out the wrong commit?

Update: it was an editing botch. I changed the wrong os.mkdir instance

MitchBradley commented 3 weeks ago

Okay, this time the CI failure appears to be while building for STM32 which, as far as I can tell, my changes did not touch.

kdschlosser commented 3 weeks ago

don't worry about the CI failures. I have yet to hammer out all of the little quirks in it. I have also not been keeping the STM32 stuff up to date because I don't know enough about the TSM32 to be able to get everything to work as it should. I have been waiting for someone to want to help with getting it to work properly but that has not happened yet and I don't believe that it is going to happen due to how bloody complex it is to write code for the STM32 due to all of the registers and not a whole lot of helper functions that make sense. The majority of things is bit operations on memory locations in order to tell the hardware what to do and how to behave. The ESP32 operates in the same way but they have at least provided an easy to use SDK so a less advanced user has something easier to understand and follow. Plus STM32's SDK and software just horrid to use.

I will look over your code and merge the PR if it is good.

MitchBradley commented 3 weeks ago

Re STM32 - I spent a couple of years doing commercial work on STM processors. It was frustrating because they kept rolling out different SDKs and wizards with fundamentally different paradigms. On the plus side, though, their hardware was solid and the documentation was accurate and for the most part complete. ESP32 docs tend to be a bit sketchy when you dig deep.

kdschlosser commented 3 weeks ago

things can be pretty glitchy sometimes and there are errors in the docs. when I catch the errors I report them so they can be fixed.

What I like about the ESP-IDF is it is easy to use. it's not a bunch of bit manipulation like what you see with the STM products. That being said that does make a program larger and use more memory when it runs but the user then has the option of looking at the code in the IDF and grabbing all of the bitwise operations used on the registers and they can bring those over into their program. The option is there. a person can use a combination of IDF and using bit registers if they want. With STM you only have the one choice and that's doing everything the hard way.

kdschlosser commented 3 weeks ago

the other thing I don't care for that much is the really small amount of flash and ram for how much is being spent. I do however like the sheer number of pins available but it sucks that you cannot choose what pins to use for things like SPI or I2C. you MUST use the ones they tell you to. they also don't support things like octal SPI and a lot of MCU's don't even support quad SPI. I don't think they can run up to 80mhz either... If Espressif would get their heads out of their asses and put together an MCU that has a larger amount of SRAM and more pins things would be golden. Ideally 1mb of SRAM and maybe another 20 pins. Then it would be gravy train on biscuit wheels. Bumping up the core speed wouldn't be a bad idea either. The new one they released that you cannot buy anywhere, not even from them fell short by removing the WiFi and not increasing the amount of SRAM.

kdschlosser commented 3 weeks ago

Thanks for fixing this I appreciate you for taking the time to do that.

Now I have to merge the changes into by branches.

IDK if you are interested in testing something out but I have a branch that adds a threading module and multiprocessing module so you can use both cores on the ESP32's. I did update readme in the branch for it so you can see how to use it.

MitchBradley commented 3 weeks ago

At the moment I don't have a good use case for MP / MT - apart from a large C++ app that isn't a good candidate for Python - and I am super busy with other stuff, so I probably won't get around to testing that.

Thanks for resolving the issues. I am getting ready to hand-off my LVGL/uPy project to someone who has offered to maintain and deploy it. It is the guy who has been asking questions about MacOS. We have a few potential users lined up already, so it might get some traction.