Search found 49 matches

by cduran
Wed Aug 07, 2019 9:05 pm
Forum: Development of MicroPython
Topic: How to determine heap usage?
Replies: 2
Views: 219

How to determine heap usage?

Running mp on an ARM using the minimal build. I would like to know if there are any built in methods for analyzing heap usage.
by cduran
Wed Apr 24, 2019 2:26 pm
Forum: General Discussion and Questions
Topic: Microcontroller Quitting Mid-Script
Replies: 4
Views: 247

Re: Microcontroller Quitting Mid-Script

I have this same question. Are you suggesting a long jump? Will re-initializing python from within the C function work?
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: 259

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: 288

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: 288

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: 4107

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: 4107

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: 4107

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: 4107

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: 4107

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