Micropython code freezing.

85 views
Skip to first unread message

Mickey Mx

unread,
Oct 25, 2022, 5:29:11 PM10/25/22
to thonny
Aivar,

Are there any Thonny plug-in tools that facilitate code-freezing?

Mickey

Andy Piper

unread,
Oct 25, 2022, 5:59:48 PM10/25/22
to thonny
I'm not sure that this is something that Thonny could do.

Frozen MicroPython code is code that is part of the firmware, i.e. it is part of the MicroPython binary that you flash to your board, not something that you add afterwards (which is where Thonny comes in).

Did you have a specific requirement in mind here?


--
You received this message because you are subscribed to the Google Groups "thonny" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thonny+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thonny/44b4239a-687e-4124-90fd-efdb38e910b1n%40googlegroups.com.


--
Andy Piper | Kingston upon Thames, London (UK)
links: https://andypiper.me  | twitter: @andypiper 

Mickey Mx

unread,
Oct 25, 2022, 6:51:02 PM10/25/22
to thonny
Hi Andy,
I have an micropython application running on an ESP8266; the unit is normally in deep-sleep. When awakened by an external event, it makes several imports, then executes the event-handler. I've noticed a delay in the execution of the event-handler that can be attributed to the imports. Freezing the code would eliminate the excessive delay by including all code in firmware.

Mickey

Andy Piper

unread,
Oct 25, 2022, 7:32:30 PM10/25/22
to thonny
It may reduce the delay slightly, I guess.

In order to freeze your imported modules, you’ll need to rebuild MicroPython itself, and re flash your ESP8266. Thonny doesn’t execute full rebuilds of MicroPython, you’ll need to do that yourself from a command line build environment.

--
Sent from Gmail Mobile

Mickey Mx

unread,
Oct 25, 2022, 7:40:22 PM10/25/22
to thonny
Thanks Andy, From what I've heard from others on the topic; freezing can significantly improve response time due to imports when you're constantly re-booting as my application does.
BTW: It might be really useful to consider whether Thonny could incorporate the tools necessary for a micropython rebuild and re-flashing, as it does with the esptool; then Thonny would be a true IDE.
Reply all
Reply to author
Forward
0 new messages