Memory usage question #9389
Unanswered
tteague
asked this question in
Using MicroPython
Replies: 2 comments 6 replies
-
Each iteration creates new objects to hold the new values of |
Beta Was this translation helpful? Give feedback.
5 replies
-
Not only does it make sense, but it looks like the clue we needed. By converting the acceleration/deceleration code to use integers only we should be able to keep the project in micropython. Thanks to all of you for the discussion. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are trying to create a product using the RPI Pico (RP2040) that drives a stepper motor. During a single move gc must be disabled to avoid noticeable pauses in the stepping. Running the following script causes the board to crash with a MemoryError.
Reducing the loop count enough to allow completion shows that the 1-block count and the free memory usage are proportional to the loop count. The final mem_info() shows that this memory is recoverable, and we have tried adding gc.collect calls periodically, but that causes a noticeable glitch that the marketing dept won't accept.
Is there anything that we can do to avoid this problem short of rewriting the project in C?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions