Search found 47 matches

by cduran
Thu Nov 01, 2018 4:38 pm
Forum: Development of MicroPython
Topic: Corresponding get for mp_obj_get_ function for long?
Replies: 1
Views: 103

Corresponding get for mp_obj_get_ function for long?

How can I retrieve a long (in my case 32bit value) from a mp object?
by cduran
Thu Nov 01, 2018 4:26 pm
Forum: Development of MicroPython
Topic: mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits
Replies: 2
Views: 129

Re: mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits

Fixed my problem.

Setting MICROPY_LONGINT_IMPL to MICROPY_LONGINT_IMPL_LONGLONG did the trick.
by cduran
Wed Oct 31, 2018 5:20 pm
Forum: Development of MicroPython
Topic: mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits
Replies: 2
Views: 129

mp_obj_new_int causing uncaught exception when value passed is greater than 30 bits

Like the subject line says.

I'm using mp_obj_new_int to pass values between C and python. When I try to pass a number that is greater than 30 bits long I get an "uncaught exception".

Should I be using a different function for larger integers?
by cduran
Wed Oct 11, 2017 3:55 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

What are you initializing stack_top to? It looks like you're passing in an uninitialized global which will be NULL. For a desktop port (windows, unix, etc) I would expect that you'd pass in the address of a variable located on the stack. Or use mp_stack_ctrl_init which does that (takes the address ...
by cduran
Mon Oct 09, 2017 6:13 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

So this is the content of my mpconfigport.h is there something I'm missing or needs to be different? #include <stdint.h> // options to control how Micro Python is built #define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_ALLOC_PATH_MAX (256) #define MICROPY_ALLOC_PARSE_CHUNK_INIT (16) #define MIC...
by cduran
Fri Oct 06, 2017 3:05 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

Using QT I developed a sort of debugger for python code running on my firmware. For this I used the same build of micropython just so that I have a dublicate of mp that will behave just like the one on my firmware. Hi cduran . Please let us know how you implemented this debugger here https://forum....
by cduran
Thu Oct 05, 2017 3:45 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

What are you initializing stack_top to? It looks like you're passing in an uninitialized global which will be NULL. For a desktop port (windows, unix, etc) I would expect that you'd pass in the address of a variable located on the stack. Or use mp_stack_ctrl_init which does that (takes the address ...
by cduran
Mon Oct 02, 2017 7:03 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

The next thing to check is that your port does all of the appropriate micropython initializations. i.e. calls gc_init and mp_init I'm using the following to initialize: #define BYTES_IN_KB 1024 #define KB_IN_PYTHON_HEAP 32 #define PYTHON_HEAP_SIZE (KB_IN_PYTHON_HEAP * BYTES_IN_KB) ... static char *...
by cduran
Tue Sep 26, 2017 6:26 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

Using extern C just satisfies the linker. You need to make sure that once you're in MicroPython land, if you call ANY C++ code that it does not throw an exception, or it will totally mess up the MicroPython exception stack. As long as MicroPython doesn't call any C++ functions which may throw an ex...
by cduran
Tue Sep 26, 2017 2:39 pm
Forum: Development of MicroPython
Topic: Looking for help using MP in Windows with QT
Replies: 20
Views: 3192

Re: Looking for help using MP in Windows with QT

stijn wrote:Can't you just run this under the debugger and see what's goiing on? In particular, inspect the values of type and call in the code shown.
The debugger isn't working inside the C code.