Search found 10 matches

by Maksym Galemin
Thu Jan 31, 2019 9:29 am
Forum: Programs, Libraries and Tools
Topic: Compression for uzlib
Replies: 1
Views: 142

Compression for uzlib

I'm wondering why uzlib module doesn't support compression? Surely, in the current implementation of tgzip example (uzlib ver. 2.9.2) the whole input file should be copied into RAM, but looking at the source code I can't find anything that makes splitting the input file into a number of data chunks ...
by Maksym Galemin
Tue Jan 22, 2019 8:43 am
Forum: General Discussion and Questions
Topic: Understanding Fatal Error with respect to STM32
Replies: 9
Views: 382

Re: Understanding Fatal Error with respect to STM32

I would start with capturing your debug UART port output defined @ mp_hal_stdout_tx_strn() and looking for "\nFATAL ERROR:\n" strings in order to find out the actual error (as a parameter to __fatal_error() function).
by Maksym Galemin
Tue Jan 22, 2019 8:37 am
Forum: General Discussion and Questions
Topic: Print statement management in micropython
Replies: 2
Views: 125

Re: Print statement management in micropython

Regarding the memory management including some useful debugging techniques: https://docs.micropython.org/en/latest/reference/constrained.html#the-heap I don't think print() itself explicitly allocates any memory according to the mp_builtin_print() function ( py/modbuiltins.c ). However, your argumen...
by Maksym Galemin
Tue Jan 22, 2019 12:14 am
Forum: General Discussion and Questions
Topic: Understanding Fatal Error with respect to STM32
Replies: 9
Views: 382

Re: Understanding Fatal Error with respect to STM32

Any particular fatal errors like MemManage or HardFault?
Have you tried to set a breakpoint @ __fatal_error() function in ports/stm32/main.c (or in your HW STM32 port)?
by Maksym Galemin
Mon Jan 14, 2019 11:21 am
Forum: Development of MicroPython
Topic: Subclassing native classes
Replies: 2
Views: 224

Re: Subclassing native classes

As per the Exception.__init__ method does not exist. item I think the limitation is that you should use super().__init__() instead of BaseNativeClass.__init__() in constructors of your subclasses derived from native classes. And I guess you should check native_base_init_wrapper() function from py/ob...
by Maksym Galemin
Fri Dec 21, 2018 8:48 pm
Forum: Development of MicroPython
Topic: Right way of synchronizing C and Micropython
Replies: 4
Views: 620

Re: Right way of synchronizing C and Micropython

Use case is any library with MicroPython interface that performs some async work, creates threads, handles interrupts etc. I would expect this to be rather common. I would say more common is avoiding any undocumented, highly experimental features with unstable API like preemptive multitasking in Mi...
by Maksym Galemin
Fri Dec 21, 2018 9:43 am
Forum: Development of MicroPython
Topic: Right way of synchronizing C and Micropython
Replies: 4
Views: 620

Re: Right way of synchronizing C and Micropython

I don't fully understand your use case, but usually the right way to protect a C/C++ structure from concurrent access is by using a mutex in your C/C++ code.
by Maksym Galemin
Fri Dec 21, 2018 2:56 am
Forum: General Discussion and Questions
Topic: Using pickle for classes
Replies: 0
Views: 106

Using pickle for classes

I'm struggling to understand how I can pickle arbitrary classes in MicroPython. Currently uP pickle is implemented using repr() and it looks like in order for a class to be pickleable it has to implement __repr__() method with a specific output format (similar to creating an object of the class). Is...
by Maksym Galemin
Wed May 30, 2018 1:34 am
Forum: Development of MicroPython
Topic: Reading global Python variable from C code
Replies: 4
Views: 554

Re: Reading global Python variable from C code

Thanks a lot for your responses jickster and stijn! I'll try to use mp_load_global/mp_store_global and mp_load_name/mp_store_name with gc_lock/gc_unlock guards and extra synchronisation first.
by Maksym Galemin
Tue May 29, 2018 1:02 am
Forum: Development of MicroPython
Topic: Reading global Python variable from C code
Replies: 4
Views: 554

Reading global Python variable from C code

Hi all, I'm in the process of replacing the existing ladder logic/function block diagram embedded scripting application with MicroPython on our STM32 product and it's progressing really well. It's such a great relieve to switch to normal Python programming after a few years of GUI mouse programming ...