Search found 16 matches

by chrizztus
Mon May 20, 2019 2:14 pm
Forum: Programs, Libraries and Tools
Topic: MemoryError on importing large files
Replies: 4
Views: 3656

Re: MemoryError on importing large files

And if it's an option for you, try freezing the rarely-changing modules into a firmware build. (By putting the code in boards/<BOARD>/modules). This means that they'll execute from ROM, saving even more RAM for your main program. Thanks jimmo. We usually try to freeze python modules, especially if ...
by chrizztus
Mon May 20, 2019 2:09 pm
Forum: Programs, Libraries and Tools
Topic: MemoryError on importing large files
Replies: 4
Views: 3656

Re: MemoryError on importing large files

It's because the large file needs to be compiled into bytecode. When the smaller files are being compiled the compilation process takes less memory with the smaller files. You could also try pre compiling the large python file into a .mpy file (using mpy-cross) and uploading the .mpy file. I unders...
by chrizztus
Mon May 20, 2019 12:33 pm
Forum: Programs, Libraries and Tools
Topic: MemoryError on importing large files
Replies: 4
Views: 3656

MemoryError on importing large files

Hi community, for a robotic project I build a python framework consisting of several files. The files implement the robots behaviour, mainly line following and sensing colors. When I upload these files and run the code everything works fine. Since the framework is a work-in-progress framework we eve...
by chrizztus
Sat Jan 19, 2019 10:46 pm
Forum: Development of MicroPython
Topic: AttributeError on restarting MicroPython Task
Replies: 4
Views: 2783

[Solved] Re: AttributeError on restarting MicroPython Task

Hi Dave, thanks again for your reply and the detailed information. I had a quick look at the map file and found one entry which I think might be of interest: COMMON 0x000000002000de04 0x1c8 ./libmicropython.a(mpstate.o) 0x000000002000de04 mp_state_ctx Luckily on memsetting this address (actually its...
by chrizztus
Fri Jan 18, 2019 11:54 pm
Forum: Development of MicroPython
Topic: AttributeError on restarting MicroPython Task
Replies: 4
Views: 2783

Re: AttributeError on restarting MicroPython Task

When micropython starts the bss is normally cleared. I suspect what might be happening is that the bss has old non-zero data in it and this is causing some code to not be executed when you restart micropython. I suspected this as well and tried a memset(heap,0,MP_HEAP_SIZE); before calling gc_init(...
by chrizztus
Fri Jan 18, 2019 9:47 pm
Forum: Development of MicroPython
Topic: AttributeError on restarting MicroPython Task
Replies: 4
Views: 2783

AttributeError on restarting MicroPython Task

Dear community, since days I try to get rid of this issue every now and then. I'm running MicroPython as a FreeRTOS task on a nrf52832 dk. When I power the board my (frozen) main.py runs as intended. main.py itself depends on several (frozen) modules for playing sound, handle button events, blinking...
by chrizztus
Wed Oct 17, 2018 6:52 am
Forum: General Discussion and Questions
Topic: How to properly feed lexer from file?
Replies: 2
Views: 2279

Re: How to properly feed lexer from file?

stijn wrote:
Tue Oct 16, 2018 3:09 pm
not sure if that is possible for your port?
unfortunately not since as I said I'm using littlefs filesystem [1]. But the posix implementation looks promising for my needs. Thanks for pointing that out.

[1] https://github.com/ARMmbed/littlefs
by chrizztus
Tue Oct 16, 2018 2:57 pm
Forum: General Discussion and Questions
Topic: How to properly feed lexer from file?
Replies: 2
Views: 2279

How to properly feed lexer from file?

Hi, on my nrf52832 we have a tiny littlefs file system of 100kB size. My goal is to upload python files and execute them using execfile('uploaded.py') Therefore I figured out I need to implement mp_lexer_new_from_file(const char* filename) function. But: since I have constrained RAM resources I cann...
by chrizztus
Fri Apr 20, 2018 1:55 pm
Forum: Development of MicroPython
Topic: [SOLVED] Need advice with 'execfile'
Replies: 3
Views: 3083

[SOLVED] Need advice with 'execfile'

Ok, I found out by myself. Obviously it makes a difference whether the project was cleaned before enabling builtin modules. Otherwise it might lead into compile errors.
Greetings
Christian
by chrizztus
Fri Apr 20, 2018 11:09 am
Forum: Development of MicroPython
Topic: [SOLVED] Need advice with 'execfile'
Replies: 3
Views: 3083

[SOLVED] Need advice with 'execfile'

Hi, on activating execfile option by enabling: #define MICROPY_PY_BUILTINS_EXECFILE (1) I'm getting the following compile error: CC micropython/py/modbuiltins.c In file included from ./micropython/py/objint.h:30:0, from micropython/py/modbuiltins.c:31: micropython/py/modbuiltins.c:657:19: error: 'MP...