Search found 1388 matches
- Sun Mar 15, 2020 7:38 pm
- Forum: General Discussion and Questions
- Topic: How to use String and free memory with gc.collect()
- Replies: 3
- Views: 2518
Re: How to use String and free memory with gc.collect()
The strings will be released when there is nothing else referring to them — so just setting one variable to None may not be enough, if you have already passed that string around and something is still using it. Also, there is no need to manually call gc.collect, it will get called automatically soon...
- Sun Mar 15, 2020 7:33 pm
- Forum: Hardware Projects
- Topic: Smallest MCU for micropython
- Replies: 15
- Views: 13298
Re: Smallest MCU for micropython
Do you need it to be small in physical dimensions, or by any other criteria, like simplicity of the minimal working circuit, or unit price? The NRF51822 that is used to run MicroPython on Micro:bit is both small physically (a 32-pin QFN package, IIRC), small in terms of available flash and RAM, and ...
- Sat Mar 14, 2020 10:07 pm
- Forum: General Discussion and Questions
- Topic: How to use String and free memory with gc.collect()
- Replies: 3
- Views: 2518
Re: How to use String and free memory with gc.collect()
MicroPython interns all string constants, so once loaded, they never get released.
- Sun Feb 23, 2020 9:21 am
- Forum: Development of MicroPython
- Topic: Slowing things down
- Replies: 3
- Views: 2820
Re: Slowing things down
Why do you need it to be slower? What are you trying to do?
Usually you do this by using some delays or timers.
Usually you do this by using some delays or timers.
- Sat Feb 01, 2020 1:13 pm
- Forum: Development of MicroPython
- Topic: Compiling _stage.mpy
- Replies: 4
- Views: 3940
Re: Compiling _stage.mpy
For anyone struggling with a similar problem, here is a missing piece of documentation: https://github.com/tve/micropython/comm ... dd114d4fae
- Thu Jan 16, 2020 4:48 pm
- Forum: General Discussion and Questions
- Topic: Combo of a C and python module?
- Replies: 6
- Views: 3820
Re: Combo of a C and python module?
You can allegedly do that in the newest version, by generating a .mpy module following: http://docs.micropython.org/en/latest/develop/natmod.html — look at the example at https://github.com/micropython/micropython/tree/master/examples/natmod/features2 However, I haven't managed to get a non-trivial ...
- Sun Dec 29, 2019 4:20 pm
- Forum: Development of MicroPython
- Topic: Compiling _stage.mpy
- Replies: 4
- Views: 3940
Re: Compiling _stage.mpy
I gave it another go. This time I installed the latest version of python3-elftools, which "fixed" the AttributeError. However, I still get the symbol not found error for "mp_obj_get_array", which is, come to think about it, very suspicious, because other symbols from the py/obj.c are found without p...
- Wed Dec 25, 2019 9:36 pm
- Forum: Development of MicroPython
- Topic: Compiling _stage.mpy
- Replies: 4
- Views: 3940
Re: Compiling _stage.mpy
The fight continues. After changing the "if s.data_size == 0:" line in mpy_ld.py to "if getattr(s, 'data_size', 0) == 0:" I get a new error. This time it can't find the symbol mp_obj_get_array, which is used in my code. What to do? The function is defined in py/obj.c, so I tried adding it to SRC. Un...
- Wed Dec 25, 2019 9:17 pm
- Forum: Development of MicroPython
- Topic: Compiling _stage.mpy
- Replies: 4
- Views: 3940
Re: Compiling _stage.mpy
I figured that one out, you can't use any _ROM_ functions, so the creation of classes is a bit more involved and has to be done in the init funcvtion. The framebuf module is a good example of that. However, now I'm getting: Traceback (most recent call last): File "../../../micropython/micropython/to...
- Wed Dec 25, 2019 7:33 pm
- Forum: Development of MicroPython
- Topic: Compiling _stage.mpy
- Replies: 4
- Views: 3940
Compiling _stage.mpy
Hello, I was very happy to see the native modules being added to release 1.12, as described at http://docs.micropython.org/en/latest/develop/natmod.html so I decided to go and try to compile my "stage" game library this way, because a lot of people wanting to use it are unable to compile their own f...