Search found 80 matches

by cduran
Fri Mar 03, 2017 9:01 pm
Forum: Development of MicroPython
Topic: Embedding with frozen code
Replies: 7
Views: 7863

Re: Embedding with frozen code

In your main.c file you can call pyexec_frozen_module("main.py"); replacing main.py with the name of your frozen module. This is what I do on the teensy. I haven't tried with frozen bytecode, just frozen python code. Thanks that worked well for source code, however it didn't work with byte code (mp...
by cduran
Tue Feb 28, 2017 10:22 pm
Forum: Development of MicroPython
Topic: Embedding with frozen code
Replies: 7
Views: 7863

Re: Embedding with frozen code

I'm using the minimal build, how would I go about loading the frozen module? So far I have the following: 1) Compile my frozen py file into an mpy with mpy-cross 2) Used the make-frozen script on the mpy file 3) Included the C file into my project (I named it frozen-helpers, does it need some specif...
by cduran
Mon Feb 27, 2017 10:54 pm
Forum: Development of MicroPython
Topic: Getting Unknown Exception thrown but no traceback
Replies: 3
Views: 2931

Re: Getting Unknown Exception thrown but no traceback

How do I load that byte code? I don't have a file system and the only way feasible was through byte strings, if I create byte arrays of the compiled byte code, what function does mp have for me to load it?
by cduran
Mon Feb 27, 2017 8:54 pm
Forum: Development of MicroPython
Topic: Getting Unknown Exception thrown but no traceback
Replies: 3
Views: 2931

Getting Unknown Exception thrown but no traceback

I'm using the minimal build of mp running on an ATMEL ATSAME70Q21. At the initialization of mp (and my firmware in general) I load several (around 70+) py scripts using the following code: void add_script(const char *src) { debugf(src); mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_g...
by cduran
Mon Dec 05, 2016 9:39 pm
Forum: Development of MicroPython
Topic: Do I need to enable the Heap?
Replies: 0
Views: 3614

Do I need to enable the Heap?

I'm currently using mp with no OS as part of my firmware. I want to keep is as lean as possible, I would like to know if I could forgo enabling the heap. Currently to run the necessary scripts I have to have a 4k heap.
by cduran
Tue Aug 30, 2016 7:27 pm
Forum: Development of MicroPython
Topic: How do I load precompiled python scripts?
Replies: 4
Views: 11182

Re: How do I load precompiled python scripts?

At another place there was the question discussed, whether the compiler can be omitted from the binaries. The outcome was, that this is not worth the effort, since the code space saving is minor. I see, if that's the case I wont bother omitting the compiler, but I still would like to transfer the s...
by cduran
Tue Aug 30, 2016 7:25 pm
Forum: Development of MicroPython
Topic: How do I load precompiled python scripts?
Replies: 4
Views: 11182

Re: How do I load precompiled python scripts?

I'm using the minimal project. I don't have a file system (or an OS for that matter), but there is a custom loader would fetch the compiled scripts and load them into a specific flash location.
by cduran
Tue Aug 30, 2016 3:19 pm
Forum: Development of MicroPython
Topic: How do I load precompiled python scripts?
Replies: 4
Views: 11182

How do I load precompiled python scripts?

I want to eliminate the mp compiler and load precompiled python scripts from memory. I just need to be pointed in the right direction.
by cduran
Wed Aug 17, 2016 5:43 pm
Forum: Development of MicroPython
Topic: How to fix script hanging?
Replies: 3
Views: 3521

Re: How to fix script hanging?

I'm also using the Minimal implementation of MP
by cduran
Wed Aug 17, 2016 5:27 pm
Forum: Development of MicroPython
Topic: How to fix script hanging?
Replies: 3
Views: 3521

Re: How to fix script hanging?

For my purpose I rather that MP exit and let my firmware continue running. The firmware functions have much higher priority than the mp scripts, and they can't be halted due to script errors.