Skip to content
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

Investigate ESP32 MCU Speed #835

Open
NevynUK opened this issue Mar 12, 2025 · 0 comments
Open

Investigate ESP32 MCU Speed #835

NevynUK opened this issue Mar 12, 2025 · 0 comments

Comments

@NevynUK
Copy link

NevynUK commented Mar 12, 2025

The current MCU speed for the ESP32 is set to 160 MHz. This was chosen as a compromise between speed and power consumption.

The ESP32 can be set to run at the following speed:

  • 80 MHz
  • 160 MHz
  • 240 MHz

We have the option of changing the MCU speed either at compile time or dynamically at run time.

Static MCU Speed Change

If we increase the speed at compile time then this would be fixed and would result in increased power draw which could be an issue for deployed boards.

Dynamic Speed Change

We can change the speed dynamically but doing so causes a small glitch in the UART comms between the STM and ESP chips. This could cause an issue if we allow the speed to be changed while the chip is running a managed application and the application is working with WiFi or Bluetooth.

There is no issue if the speed is changed early enough in the startup sequence as the two chips are not talking to each other for the first few milliseconds. Doing this would not disrupt the communication between the two chips although the log output is occasionally corrupted but this is cosmetic and the system soon recovers. Also, the log output is purely for internal diagnostic purposes.

Proposal

  • We add an element to the configuration file meadow.config.yaml that allows the MCU speed to be set to one of the three values.
  • The MCU default speed remains at 160 MHz
  • Any attempt to set the speed to anything other than one of the allowed speeds will be ignored.
  • Changing the speed will cause the desired speed to be recorded on the ESP32
  • The ESP32 will read the stored speed request at start up and change the speed accordingly. Note that this means that the system will need to be rebooted in order for the change to come into effect. This would not be an issue though as the board would go through a disable / enable cycle as we only allow file writes if the system is disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant