Search found 54 matches

by BramPeeters
Tue Sep 11, 2018 7:45 pm
Forum: Development of MicroPython
Topic: [SOLVED]garbage collector + stack of startup task
Replies: 30
Views: 16576

Re: garbage collector + stack of startup task

Hi, Actually, I am now pretty convinced it is a bug, because if i fixed it my problem was gone :) >The VERIFY_PTR macro says "if the pointer doesn't point into the heap, don't worry about it . . . because the gc is only supposed to touch the heap" Exactly, which is why there is a bug because the ini...
by BramPeeters
Tue Sep 11, 2018 9:46 am
Forum: Development of MicroPython
Topic: [SOLVED]garbage collector + stack of startup task
Replies: 30
Views: 16576

[SOLVED]garbage collector + stack of startup task

Hi, I am running into a problem that a thread that was blocked some time and then continues crashes if the garbage collector was active in the mean time, so obviously something gets cleaned up that shouldn't (it works if i do not do collect). So I am trying to understand the GC code to figure out wh...
by BramPeeters
Fri Jun 15, 2018 8:33 am
Forum: Development of MicroPython
Topic: Finaliser/__del__
Replies: 10
Views: 8025

Re: Finaliser/__del__

Thanks for the suggestions, super interesting (I had already encountered the __enter__/__exit__ functions in the lock implementation when adding semaphore support, but was not too familiar with the context manager details) At the moment the __del__ method still seems to hold the advantage though, be...
by BramPeeters
Thu Jun 14, 2018 4:31 pm
Forum: Development of MicroPython
Topic: Finaliser/__del__
Replies: 10
Views: 8025

Finaliser/__del__

Hi, Sanity check:I am looking for a way to get some kind of callback when the GC decides to remove an object to clean up some stuff. After digging in the code I think I have found that i need to enable 'MICROPY_ENABLE_FINALISER' , and then add a method __del__ to the local dictionary of the object t...
by BramPeeters
Mon Apr 16, 2018 4:47 pm
Forum: Development of MicroPython
Topic: Structure of an (interrupt) handler that does a callback
Replies: 3
Views: 2688

Re: Structure of an (interrupt) handler that does a callback

I would expect waiting for the GIL will make sure the heap is protected ?
(as i said, i am not calling for a "real" interrupt, so i can wait for it)
by BramPeeters
Mon Apr 16, 2018 4:23 pm
Forum: Development of MicroPython
Topic: Structure of an (interrupt) handler that does a callback
Replies: 3
Views: 2688

Structure of an (interrupt) handler that does a callback

Hi, Looking at the stm32 can code, the general structure of an interrupt handler that does a callback seems to be int handler ( ) { int l_nResult = e_RETURNVALUE_Success; pyb_obj_t * self = xxx; mp_sched_lock(); gc_lock(); nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { mp_call_function_x( l_pSelf->callba...
by BramPeeters
Sat Apr 14, 2018 12:10 am
Forum: Development of MicroPython
Topic: Documentation generation from C comments
Replies: 3
Views: 2591

Re: Documentation generation from C comments

Too bad :(

Thanks for the clarification !
by BramPeeters
Wed Apr 11, 2018 9:46 am
Forum: Development of MicroPython
Topic: Documentation generation from C comments
Replies: 3
Views: 2591

Documentation generation from C comments

Hi, I was wondering how the documentation is generated for C 'drivers', eg pin.c The end result i can see eg at https://docs.micropython.org/en/latest/pyboard/library/pyb.Pin.html, and apparently a document generation tool sphinx is used. Now i see 'formatted' comments partially matching this in eg ...
by BramPeeters
Wed Mar 28, 2018 9:17 pm
Forum: Development of MicroPython
Topic: Best way for event handler
Replies: 0
Views: 1670

Best way for event handler

Hi, I am using micropython on an stm32 on top of freertos with thread support in micropython and GIL. I am trying to figure out the best way to process 'events' arriving from other freertos tasks in micropython. If the event originated from an interrupt I will decouple it to normal freertos task lev...
by BramPeeters
Thu Mar 01, 2018 9:04 pm
Forum: General Discussion and Questions
Topic: mp-cross and precompiled but not frozen scripts
Replies: 5
Views: 3472

Re: mp-cross and precompiled but not frozen scripts

Thanks for the links, i already found the official docs one but the others are more in depth. I do notice however that if i use mp-cross to generate an mpy file and then load that file as 'byte array' (currently for testing i just compile the resulting mpy in as a comma separated byte array, in the ...