Search found 1359 matches

by deshipu
Thu Mar 26, 2020 11:08 pm
Forum: Hardware Projects
Topic: Smallest MCU for micropython
Replies: 5
Views: 380

Re: Smallest MCU for micropython

Same as you would flash any other firmware on that particular MCU—usually using a programmer device supporting the particular protocol that MCU uses. In case of NRF51 I think it's the SWIM protocol, so any programmer that handles that should work. If you don't care about price and stability, only ph...
by deshipu
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: 267

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...
by deshipu
Sun Mar 15, 2020 7:33 pm
Forum: Hardware Projects
Topic: Smallest MCU for micropython
Replies: 5
Views: 380

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 ...
by deshipu
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: 267

Re: How to use String and free memory with gc.collect()

MicroPython interns all string constants, so once loaded, they never get released.
by deshipu
Sun Feb 23, 2020 9:21 am
Forum: Development of MicroPython
Topic: Slowing things down
Replies: 3
Views: 280

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.
by deshipu
Sat Feb 01, 2020 1:13 pm
Forum: Development of MicroPython
Topic: Compiling _stage.mpy
Replies: 4
Views: 501

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
by deshipu
Thu Jan 16, 2020 4:48 pm
Forum: General Discussion and Questions
Topic: Combo of a C and python module?
Replies: 6
Views: 735

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 ...
by deshipu
Sun Dec 29, 2019 4:20 pm
Forum: Development of MicroPython
Topic: Compiling _stage.mpy
Replies: 4
Views: 501

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...
by deshipu
Wed Dec 25, 2019 9:36 pm
Forum: Development of MicroPython
Topic: Compiling _stage.mpy
Replies: 4
Views: 501

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...
by deshipu
Wed Dec 25, 2019 9:17 pm
Forum: Development of MicroPython
Topic: Compiling _stage.mpy
Replies: 4
Views: 501

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...