Search found 54 matches

by BramPeeters
Tue Jan 07, 2020 3:10 pm
Forum: Development of MicroPython
Topic: Difference in mpy output on target versus host
Replies: 10
Views: 1026

Re: Difference in mpy output on target versus host

Sadly fixing the name difference does not make the result equal (the names are the same now, i put an empty filename in the host cross compiler. Eg in the first bytes there are already differences (I have added image with birds eye view of differences) mpy-cross: 4D 03 02 1F AF 16 28 02 00 00 00 00 ...
by BramPeeters
Mon Jan 06, 2020 9:04 pm
Forum: Development of MicroPython
Topic: Difference in mpy output on target versus host
Replies: 10
Views: 1026

Re: Difference in mpy output on target versus host

Can you explain how you compile the files on device? How do you compare? And witch board do you use? There are various ways I can access the device's file system (let it act as usb mass storage device, or over a network connection, ... ) So current procedure was to place a script text file in the f...
by BramPeeters
Mon Jan 06, 2020 5:46 pm
Forum: Development of MicroPython
Topic: Difference in mpy output on target versus host
Replies: 10
Views: 1026

Re: Difference in mpy output on target versus host

Potentially we could move to something like this in the future (and always nice to have something to start from :P) , but for now as step 1 I would like the understand why the PC compiled files are different from the target/device compiled ones :)
by BramPeeters
Mon Jan 06, 2020 4:04 pm
Forum: Development of MicroPython
Topic: Difference in mpy output on target versus host
Replies: 10
Views: 1026

Re: Difference in mpy output on target versus host

It sounds to me, that you old solution, compiles py -> mpy files directly on the device ?!? And now you would like to compile it on PC and send it to device?!? Exactly, target == device btw. my experience on ESP8266 is, that .mpy compilation will not save enough RAM It seems on our board it would m...
by BramPeeters
Mon Jan 06, 2020 1:54 pm
Forum: Development of MicroPython
Topic: Difference in mpy output on target versus host
Replies: 10
Views: 1026

Difference in mpy output on target versus host

Hi, Due to running into memory size constraints with on target compilation of scripts I am looking into compiling from py to mpy on an external host and transferring the compiled program to the target. At first sight it actually seems to work but if I compare an mpy file compiled on the target versu...
by BramPeeters
Fri Dec 21, 2018 6:44 pm
Forum: Development of MicroPython
Topic: Right way of synchronizing C and Micropython
Replies: 4
Views: 1172

Re: Right way of synchronizing C and Micropython

What makes you say micropython is running a single thread ? I don't know the esp platform, but on eg an stm with freertos under it i have several micropython threads. Wether or not they are capable of interrupting each other depends on your use of the GIL. (I enabled it so that my python threads do ...
by BramPeeters
Thu Oct 11, 2018 9:28 am
Forum: Development of MicroPython
Topic: Finaliser/__del__
Replies: 10
Views: 2018

Re: Finaliser/__del__

A limitation not yet mentioned here seems to be that with the current state of code, __del__ is not called when the the object is freed not by the garbage collector, but with a gc_free. ( I assume this will change at some point since there is a TODO for it) And a side question: any reason why m_new_...
by BramPeeters
Sun Oct 07, 2018 4:38 pm
Forum: Development of MicroPython
Topic: [Solved]Catch exception raised in C in python
Replies: 5
Views: 1025

Re: [Solved]Catch exception raised in C in python

Ok, thanks for the pointers/explanation !
by BramPeeters
Tue Oct 02, 2018 3:34 pm
Forum: Development of MicroPython
Topic: [Solved]Catch exception raised in C in python
Replies: 5
Views: 1025

Re: Catch exception raised in C in python

You describe exactly what I was trying to do and after rechecking it in fact it works perfect, thank you! How does it work under the hood, does try 'try' instruction (temporary) replace the target jump address ? The reason it did not seem to work before is because I was still using an old .py script...
by BramPeeters
Tue Oct 02, 2018 2:40 pm
Forum: Development of MicroPython
Topic: [Solved]Catch exception raised in C in python
Replies: 5
Views: 1025

[Solved]Catch exception raised in C in python

Hi. I just read an (old) thread about this topic (https://forum.micropython.org/viewtopic.php?f=2&t=178) which seems to indicate that it is possible to 'catch' an 'exception' in a python try-except block that is raised in C. However i am not able to reproduce that nor do I understand how to get it w...