Skip to content

Calc ESP32 TIMER_SCALE scale by GPTIMER_CLK_SRC_DEFAULT #17316

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

Draft
wants to merge 764 commits into
base: master
Choose a base branch
from

Conversation

BSoD123456
Copy link

Firstly, I apologize for not knowing how to PR only a portion of the files. So please forgive the confusion of this PR.
Please only focus on the last 2 commits of "ports/esp32/machine_timer.h" and "ports/esp32/machine_timer.c".

Summary

In esp-edf v5.2, for esp32-c6, the default clock source used by timers is not XTAL_CLK or APB_CLK (they're all 40mhz in c6), but F80M_CLK (it's 80mhz). Therefore, using APB_CLK_FREQ to calculate TIMER_SCALE will cause the timer to run at double speed.

Testing

I ran the pre and post modification version on my ESP32C6 dev board, and confirmed that the pre modification timer was at double speed, while the post modification timer at normal speed.

embeddedt and others added 30 commits July 7, 2021 18:17
This would update lv_bindings when running 'make submodules'
export XDG_RUNTIME_DIR to remove SDL warning
export XDG_RUNTIME_DIR to remove SDL warning
Updated lv_bindings with espidf.h bugfix

Disabled ESP32-S2 because it is currently not supported by espidh.h
and by native modules that rely on espidf.h such as modrtch.c
.github/workflows/ports_esp32.yml added back

Updated lv_bindings with espidf.h bugfix

Disabled ESP32-S2 because it is currently not supported by espidh.h
and by native modules that rely on espidf.h such as modrtch.c
Added ESP32 workflow badge
Remove obsolete lvesp32
LVGL should be initialized before display driver
Added .gitpod, Dockerfile and badge to README
dpgeorge and others added 29 commits November 20, 2024 14:27
The `num_stas` was uninitialised and if it happened to take the value 0
then no results were returned.  It now has the correct maximum value.

Signed-off-by: Damien George <damien@micropython.org>
Configuring the AP for cyw43 writes to some buffers that are only sent to
the modem when the interface is brought up. This means you can't configure
the AP after calling active(True), the new settings seem to be accepted but
the radio doesn't change.

This is different to the WLAN behaviour on other ports. The esp8266 port
requires calling active(True) on the AP before configuring, even.

Fix this by bouncing the AP interface after a config change, if it's
active. Configuring with active(False) still works the same as before.

Adds a static variable to track interface active state, rather than relying
on the LWIP interface state. This is because the interface state is updated
by a driver callback and there's a race: if code calls active(True) and
then config(a=b) then the driver doesn't know it's active yet and the
changes aren't correctly applied.

It is possible this pattern will cause the AP to come up briefly with the
default "PICOabcd" SSID before being reconfigured, however (due to the
aforementioned race condition) it seems like this may not happen at all
before the new config is applied.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
- Previously the call to esp_wifi_set_channel() would be immediately
  overridden by calling esp_wifi_config(...) with the previous channel set.

- AP interface doesn't seem to need more than esp_wifi_config(...) to work.
  It will automatically configure 40MHz bandwidth and place the secondary
  channel using similar logic to what was being explicitly calculated here.

- However, calling esp_wifi_set_channel() on the STA interface is necessary
  if using this interface with ESP-NOW (without connecting to an AP). So
  the esp_wifi_set_channel() call is kept in for this purpose. Without
  this, tests/multi_espnow/70_channel.py fails.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
ESP32 has hardware V1 and S2/S3 has V2, and future chips
may have different versions.

This should still compile to the same binary before and after.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Closes micropython#13178.

TouchPad confirmed working on both chips, and fixes the the ESP32-S3
reading constant max value. Was unable to reproduce the bug on ESP32-S2 but
this may be due to my test setup, and it still works with the fix.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This fixes a bug in FrameBuffer.ellipse where it goes into an infinite loop
if both radii are 0.

This fixes the bug with a simple pre-check to see if both radii are 0, and
in that case sets a single pixel at the center. This is consistent with the
behaviour of the method when called with just one of the radii set to 0,
where it will draw a horizontal or vertical line of 1 pixel width.

The pixel is set with setpixel_checked so it should handle out-of-bounds
drawing correctly.

This fix also includes three new tests: one for the default behaviour, one
for drawing out-of-bounds, and one for when the sector mask is 0.

Fixes issue micropython#16053.

Signed-off-by: Corran Webster <cwebster@unital.dev>
The micro:bit board (and probably other boards using the music or display
module) locked up on soft reboot.  Reason was a buffer overflow caused by
an index counter, which was not reset on soft_reboot.

That's fixed in this commit.  Tested with a micro:bit board, performing a
series of soft reboots.

Signed-off-by: robert-hh <robert@hammelrath.com>
Recent MSVC versions have changed the definition of NAN to a non-constant
expression!  This is a bug, C standard says it should be a constant.

Good explanation and workaround at: https://stackoverflow.com/a/79199887

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Damien George <damien@micropython.org>
added to step 8 `mpy-cross/Makefile` to remove `-Werror` 
updated step 12 to find the micropython script in the `build-standard` directory
Updated README.md - update Unix (Mac OS) port instructions
…o update/micropython_v1.24.1-usermod

Patch release for mpremote, rp2 IGMP, esp32 PWM, SDCard, and AP channel

This is a patch release containing the following commits:
- tools/mpremote: fix UnboundLocalError in Transport.fs_writefile()
- esp32/machine_pwm: use IDF functions to calculate resolution correctly
- pic16bit: make it build with recent XC16 versions
- py/objdeque: fix buffer overflow in deque_subscr
- extmod/modlwip: fix IGMP address type when IPv6 is enabled
- esp32/machine_pwm: restore PWM support for ESP-IDF v5.0.x and v5.1.x
- esp32: workaround native code execution crash on ESP32-S2
- tools/mpremote: make sure stdout and stderr output appear in order
- tools/mpremote: add test for forced copy
- tools/mpremote: support trailing slash on dest for non-recursive copy
- esp32/modsocket: fix getaddrinfo hints to set AI_CANONNAME
- extmod/vfs_blockdev: support bool return from Python read/write blocks
- extmod/network_cyw43: fix isconnected() result on AP interface
- extmod/network_cyw43: fix uninitialised variable in status('stations')
- extmod/network_cyw43: allow configuring active AP interface
- esp32: fix setting WLAN channel in AP mode
- esp32: use hardware version for touchpad macro defines
- esp32: fix machine.TouchPad startup on ESP32-S2 and S3
- extmod/modframebuf: fix 0 radius bug in FrameBuffer.ellipse
- nrf/drivers/ticker: reset slow ticker callback count on soft reboot
- py/objfloat: workaround non-constant NAN definition on Windows MSVC

# Conflicts:
#	.github/workflows/code_formatting.yml
#	.github/workflows/code_size.yml
#	.github/workflows/commit_formatting.yml
#	.github/workflows/docs.yml
#	.github/workflows/examples.yml
#	.github/workflows/mpremote.yml
#	.github/workflows/mpy_format.yml
#	.github/workflows/ports.yml
#	.github/workflows/ports_cc3200.yml
#	.github/workflows/ports_esp32.yml
#	.github/workflows/ports_esp8266.yml
#	.github/workflows/ports_mimxrt.yml
#	.github/workflows/ports_nrf.yml
#	.github/workflows/ports_powerpc.yml
#	.github/workflows/ports_renesas-ra.yml
#	.github/workflows/ports_rp2.yml
#	.github/workflows/ports_samd.yml
#	.github/workflows/ports_stm32.yml
#	.github/workflows/ports_unix.yml
#	.github/workflows/ports_webassembly.yml
#	.github/workflows/ports_windows.yml
#	.github/workflows/ports_zephyr.yml
#	README.md
#	extmod/extmod.mk
#	ports/esp32/.gitignore
#	ports/esp32/CMakeLists.txt
#	ports/esp32/boards/ESP32_GENERIC/mpconfigboard.cmake
#	ports/esp32/boards/sdkconfig.base
#	ports/esp32/main.c
#	ports/esp32/main/CMakeLists.txt
#	ports/stm32/Makefile
#	ports/stm32/boards/STM32F7DISC/mpconfigboard.mk
#	ports/stm32/boards/manifest.py
#	ports/stm32/boards/stm32f7xx_hal_conf_base.h
#	ports/unix/Makefile
#	ports/unix/variants/manifest.py
#	ports/unix/variants/mpconfigvariant_common.h
#	ports/windows/mpconfigport.h
#	py/makeqstrdata.py
#	py/qstr.c
#	py/qstr.h
#	tools/ci.sh
#	tools/makemanifest.py
#	tools/mpy-tool.py
…nd M5Core2 board; remove ESP32 specific LVGL modules (soft links)
…repo; add a few build and deploy scripts; update lv_binding
Update to MicroPython v1.24.1 and use LVGL as MicroPython user module
- drivers/generic/st77xx: Support use on platforms without machine.PWM
* Update readme files and fix ESP-IDF path in scripts folder

* Update LVGL readme file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy