-
Notifications
You must be signed in to change notification settings - Fork 182
WIP: Align to micropython v1.20 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Damien George <[email protected]>
Total code size change of this and previous commit: bare-arm: +0 +0.000% minimal x86: +0 +0.000% unix x64: +32 +0.004% standard stm32: +24 +0.006% PYBV10 cc3200: +16 +0.009% esp8266: +20 +0.003% GENERIC esp32: +44 +0.003% GENERIC[incl +8(data)] mimxrt: +32 +0.009% TEENSY40 renesas-ra: +24 +0.004% RA6M2_EK nrf: +0 +0.000% pca10040 rp2: +24 +0.005% PICO samd: +32 +0.012% ADAFRUIT_ITSYBITSY_M4_EXPRESS Addresses issue micropython#7920. Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
LAN8710 uses the same drivers as LAN8720, so this commit just adds the names. Alternatively, both could be summarised under LAN87xx, like the esp-idf does.
Both the direction and the Pin used for ref_clk can now be configured. It Requires at least idf v4.4. The new keyword arguments to the constructor are: - ref_clk_mode=mode: with mode being Pin.IN or Pin.OUT. If it is not set, then the default configuration is used, which may be configured by kconfig settings. - ref_clk=pin_obj: which defines the Pin used for ref_clk. This is either Pin(0), Pin(16) or Pin(17). No check is done for the pin number. If it is the wrong one, it simply will not work. Besides that, no harm.
Add support for various SPI-based ethernet chips (W5500, KSZ8851SNL, DM9051) to the ESP32 port. This leverages the existing support in ESP-IDF for these chips -- which configures these chips in "MAC raw" mode -- and the existing support for network.LAN in the ESP32 port. In particular, this doesn't leverage the wiznet5k support that is used on the rp2 and stm32 ports (because that's for native use of lwIP). Tested on the POE Featherwing (with the SJIRQ solder jumper bridged) and a ESP32-S3 feather. A note about the interrupt pin: The W5500 implementation within ESP-IDF relies on hardware interrupt, and requires the interrupt pin from the W5500 to be wired to a GPIO. This is not the case by default on the Adafruit Ethernet FeatherWing, which makes it not directly compatible with this implementation.
`esp_eth_ioctl(ETH_CMD_S_MAC_ADDR)` sets the MAC address of the hardware device, but we also need to notify the upper layers of the change so that e.g. DHCP work properly.
Signed-off-by: Damien George <[email protected]>
Specifying DMA channel 2 causes an "invalid dma channel" error. In ESP-IDF, the only available channel for ESP32S3 is SPI_DMA_CH_AUTO=3.
It has been around for a long time and the API is mature enough. Signed-off-by: Damien George <[email protected]>
MicroPython doesn't need the shared library and disabling it in the configure could ease the build of a static version of MicroPython.
Based on and tested on the rp2 port. Signed-off-by: Liao Jingyi <liaojingyi2@gmail> Signed-off-by: Damien George <[email protected]>
Signed-off-by: enriquezgarc <[email protected]>
pre-commit manages its own dependencies otherwise (including Black), but this one is a C/C++ binary so needs to be installed independently. Signed-off-by: Angus Gratton <[email protected]>
Not all DFU bootloaders exit after download, this modifier is required for some boards to reset, otherwise they sit idle in DFU mode.
The major setting is about the PHY interface configuration. The configuration matches the Olimex ESP32 Gateway as well. Tested with esp-idf v4.2.4 and Olimex ESP32 POE boards.
Tested to work on an ESP32-MINI-1, which is a single core ESP32-U4DWH. Signed-off-by: Clayton Cronk <[email protected]>
This is available since ESP-IDF v4.4. Signed-off-by: Damien George <[email protected]>
The delay is 1 ms. It avoids the crashes reported by the issues micropython#8289, micropython#8792 and micropython#9236 with esp-idf versions >= 4.2, but does not solve an underlying problem in the esp-idf.
32-bit platforms only support a slice offset start of 24 bit max due to the limited size of the mp_obj_array_t.free member. Similarly on 64-bit platforms the limit is 56 bits. This commit adds an OverflowError if the user attempts to slice a memoryview beyond this limit. Signed-off-by: Damien George <[email protected]>
This is important for literal tuples, e.g. f"{a,b,}, {c}" --> "{}".format((a,b), (c),) which would otherwise result in either a syntax error or the wrong result. Fixes issue micropython#9635. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
Unless MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_D, these macros only work with values and "->"/"." expressions as their sole argument. In other words, the macros are broken with expressions which contain operations of lower precedence than the cast operator. Depending on situation, the old code either results in compiler error: MP_OBJ_TO_PTR(flag ? o1 : o2) expands into "(void *)flag ? o1 : o2", which some compiler configurations will reject (e.g. GCC -Wint-conversion -Wint-to-pointer-cast -Werror) Or in an incorrect address calculation: For ptr declared as "uint8_t *" the MP_OBJ_FROM_PTR(ptr + off) expands into ((mp_obj_t)ptr) + off, resulting in an obviously wrong address. Signed-off-by: Alex Riesen <[email protected]>
Signed-off-by: Damien George <[email protected]>
Signed-off-by: Damien George <[email protected]>
When accessing the argument of the irq function.
This will also catch / and /= when float support is disabled. Fixes issue micropython#10544. Signed-off-by: Damien George <[email protected]>
I'm hoping you have the time to update the RP2 port for the new pico_w support in MPY 1.20 |
I would like to, but I don't have an RP2 device to test it. |
I am using directions to compile the Raspberry Pi Pico port, and it's working for me: |
Did you check this? lv_micropython/ports/rp2/README.md Lines 110 to 116 in 808d72d
Another thing I would check is Garbage Collection. LVGL relies on MP gc so if anything goes wrong there it could cause nasty crashes. How do these failures look like? Do you have a stack trace for them? Can you connect a debugger? Or are these just Python errors? Regardless of the failures, were you able to run some hello world with a display? The tests are good for logic but don't test the display driver and the event loop. If you are able to run some examples such as the advanced_demo.py, I would be optimistic about the rest.
Could you open a GitHub issue for that on lv_binding_micropython? Currently I have very little time to put into it. For now I won't be able to debug this myself, but if you are willing to try, I'll be happy to discuss, provide feedback etc. Hopefully others would step in and help too. |
@embeddedt - I think the stm32 port and js port (renamed to webassembly) need to be fixed for Micropython v1.20 |
bb2fd00
to
52615da
Compare
c4c3b9c
to
bcaf844
Compare
Thank you so much for MP1.20 I found ./py/mpconfig.h shows,
I don't know why REPL shows, |
I've fixed STM32 compilation, however attempting to run
|
@sam0910 - Thank you very much for testing this branch on ESP32!
Probably I need to push the v1.20.0 tag to GitHub. @embeddedt - Thanks for the help! I believe the GC problem is specific to stm32 because I tested the unix port, and GC works fine there. In Micropython v1.20, some Python script scans the sources and looks for Maybe the source (driver/stm32/STM32F7DISC/modrk043fn48h.c) is not added to the correct Makefile variable. Perhaps we can add it to |
False alarm. My LVGL submodule was somehow out of date and therefore didn't have lvgl/lvgl#4269, which meant |
JS will definitely have a merge conflict but it is on a separate branch so I can update it later, shouldn't block any other development. |
Right. https://github.com/lvgl/lv_micropython/actions/runs/5305529951/jobs/9602554249 I suspect it's more than a simple merge problem. The js port was renamed "webassembly" and I'm not sure what other changes were done. |
JS port should be updated now. (I guess it should now be called the WASM port?) The real URL is now https://sim.lvgl.io/v9.0/micropython/ports/webassembly/index.html but I implemented a symlink so https://sim.lvgl.io/v9.0/micropython/ports/javascript/index.html still works too. Let me know if there are any issues. |
Thank you @embeddedt ! |
TODO: