Arduino Forum

Products => Portenta => Topic started by: cabuck on Jul 22, 2020, 04:41 pm

Title: Implementation of MicroPython
Post by: cabuck on Jul 22, 2020, 04:41 pm
I sent an email to arduino@support.cc to request information regarding the implementation of MicroPython.


The answer was that MicroPython basic tutorials for Portenta H7 will be available very soon from the Arduino IDE library and website.


That was a month ago, I still check tutorial pages every day.


Does anyone have an update about the implementation of Micropython on Portenta H7?
Title: Re: Implementation of MicroPython
Post by: jerteach on Jul 23, 2020, 01:44 am
I don't think things are very positive on this front. Checkout. I am interested in the Javascript but I have this bad feeling that hasn't even been started.

https://github.com/arduino/summer-of-code/issues?q=is%3Aissue+is%3Aopen+portenta (https://github.com/arduino/summer-of-code/issues?q=is%3Aissue+is%3Aopen+portenta)
Title: Re: Implementation of MicroPython
Post by: jahr on Jul 24, 2020, 10:28 am
Hello cabuck,

check this:

https://github.com/openmv/micropython/tree/openmv-1.12/ports/stm32/boards/PORTENTA

I have not tested it yet ...
Title: Re: Implementation of MicroPython
Post by: jerteach on Oct 09, 2020, 01:19 pm
At least this question is answered.

For programming the Portenta using microPython you need this OpenMV IDE. Yes an entirely different IDE,  https://openmv.io/pages/download (https://openmv.io/pages/download) 

Be careful I think you need to convert the Portenta bootloader to a new version (see the examples) before using this or you could get into a permanent bootloader loop, If you have never done that before on a microcontroller it is be really bad.

The new IDE is for using the new PortentaVisionShield (https://store.arduino.cc/usa/portenta-vision-shield) but I think you can use it with just the portenta, (not fully sure). Anyone having any success with it?


Title: Re: Implementation of MicroPython
Post by: trimchess on Oct 16, 2020, 10:15 am
>... but I think you can use it with just the portenta, (not fully sure). Anyone having any success with it?
I could run a minimal MicroPython Script on the Portenta (the hardware HelloWorld) according to the OpenMV Tutorial. But I can't start the Script without the OpenMV IDE.
When you are connected via OpenMV, you have mounted the "filesystem" from the Portenta. But it is without any structure. There is only the root directory available, not things like /flash etc.
On the pyboard, there is a boot.py script, then you can copy your main.py script on the drive. I expected this base structure:
/flash/boot.py
and the I would upload my main.py:
/flash/boot.py
/flash/main.py
After booting, the boot.py script is executed and then your main script is started.
Questions:
How exactly runs MicroPython on the Portenta?

If needed, where can I find the boot.py?
Is there also a /flash directory needed or can one copy this files on root?
Does Arduino officially support MicroPython on the Portenta? 
In my mind, the Arduino Portenta story is a bit handcraft and it makes not really a professional impression. Let us wait for better times ;-)
Title: Re: Implementation of MicroPython
Post by: jerteach on Oct 17, 2020, 05:15 am
>... but I think you can use it with just the portenta, (not fully sure). Anyone having any success with it?
I agree with your findings. I would like to be able to drag a main.py to the folder and have it run. Have it run both when USB connected and on battery power. It does not seem to load away from the openMV IDE. I think it can, just not used to the systems yet. 

There is a whole new forum at 

https://forums.openmv.io/viewforum.php?f=7 (http://"https://forums.openmv.io/viewforum.php?f=7")

Not yet sure how I feel about the whole farming out micropython to a different company. Feels to easy for both companies to say "That's not my job." I have a similar concern about the new PortentaVisionShield. See new post.


Title: Re: Implementation of MicroPython
Post by: trimchess on Oct 22, 2020, 11:16 am
jerteach did a good job! I give her a summary of your steps on Facbook's Portenta group in the way I implemented them.
- Download unzip the new firmware from https://github.com/openmv/openmv/releases/tag/v3.6.9 (https://github.com/openmv/openmv/releases/tag/v3.6.9?fbclid=IwAR2UUslGd9QoNM10KqIHhQNkPFBLnMtFgk7ABz71Tu6NTs9dheIKoNfP850)
- Connnect the OpenVM IDE with your Portenta
- From the OpenVM IDE load the new firmware to the Portenta:
tools > Bootloader (Load Firmware)
- Browse to the unzipped firmware.bin file (E:\tools\OpenMV_IDE_2_6_5\share\qtcreator\firmware\PORTENTA\firmware.bin) on my environmet
- Run
I did not enable "Erase internal filesystem"
- Copy a MicroPython main.py file on the portenta drive(I used the embedded hello world)
- Disconnect and close your IDE
- Press Portentas Reset Button
> And now the LED flashes like expected!