Page 1 of 1

what version of MicroPython is it?

Posted: Mon Dec 09, 2019 6:40 pm
by Capstan
I'm trying to read data in from a json file and ensure that it is string type. In the official docs the conversion would be done like so;

https://docs.micropython.org/en/latest/ ... s.html#str

Code: Select all

print(str(b'abc', encoding='utf8'))
On the cam that code results in;
"NotImplementedError: keyword argument(s) not yet implemented - use normal args instead"

Re: what version of MicroPython is it?

Posted: Mon Dec 09, 2019 7:46 pm
by iabdalkader
1.11 with some upstream patches.

Re: what version of MicroPython is it?

Posted: Wed Dec 11, 2019 4:23 pm
by Capstan
I see that the _thread module is present in the FW. I have some code from elsewhere that uses threads and trying to port it, but the thread function isn't being called. Is _thread fully implemented in the H7?

Documentation is here;
https://docs.python.org/3.5/library/_th ... le-_thread

When I call;
_thread.start_new_thread(function, args[, kwargs])

... it executes without complaint but the function doesn't appear to run.

Re: what version of MicroPython is it?

Posted: Wed Dec 11, 2019 5:21 pm
by iabdalkader
No threading is not supported, you're going to have to use timer callbacks.

Re: what version of MicroPython is it?

Posted: Thu Dec 12, 2019 11:42 am
by Capstan
I'm looking at your timer_control.py example.

Code: Select all

def tick(timer):            
    blue_led.toggle()
    
tim = Timer(4, freq=1)      # create a timer object using timer 4 - trigger at 1Hz
tim.callback(tick)          # set the callback to our tick function
I assume timer 4 is a hardware timer? How many timers are there and what are the available numbers?

Re: what version of MicroPython is it?

Posted: Thu Dec 12, 2019 3:28 pm
by iabdalkader
Hi, you should be able to use all the timers (up to 17 on the H7) except 1,3,4,5, 6 which are reserved for other stuff. I was just double checking timers on the H7 before I reply and found out that not all of them are working as expected, I'm going to fix this in the next couple of days and send patches to micropython. For now you can use tim 2, 12, 14 (and 4 and 6 if you must) I'll keep you posted on this.

Re: what version of MicroPython is it?

Posted: Thu Dec 12, 2019 5:06 pm
by Capstan
Interesting! Thanks for the info. I am thinking I will write a general-purpose wrapper class that keeps track of what timers are available so other code doesn't have to know.

Re: what version of MicroPython is it?

Posted: Tue Dec 17, 2019 1:41 pm
by iabdalkader
Hi, the issues with timers have been fixed, if you update to the latest firmware on github you can use TIM2, TIM3 and TIM7->TIM14 on the F7/OMV3 and TIM2,TIM3,TIM7,TIM8 and TIM12->TIM17 on the H7/OMV4.

Re: what version of MicroPython is it?

Posted: Tue Dec 17, 2019 4:37 pm
by Capstan
Fast work, you are the man! I downloaded the release zip and extracted, not sure which directory to use. OPENMV4? OPENMV4R?

Nevermind, found in another thread;
"The OPENMV4/firmware.bin is the right file to use."