build micropython for STM32F7DISC on windows

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

build micropython for STM32F7DISC on windows

Post by Peter.Kenyon » Wed Mar 23, 2016 6:12 pm

Hi, could anyone point me to any information on building upy on a windows machine, all the info seems to be Linux.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: build micropython for STM32F7DISC on windows

Post by dhylands » Wed Mar 23, 2016 6:48 pm

Building STM32F7DISC is essentially the same as building for the pyboard. The biggest difference is that you need to specify a BOARD.

Code: Select all

make BOARD=STM32F7DISC
When no BOARD is provided, then it defaults to PYBV10 (which is the pyboard BOARD designator). If you find yourself working with a particular board alot, then you can create a GNUmakefile or a makefile which contains something like the following:

Code: Select all

$(info Executing GNUmakefile)
BOARD = STM32F7DISC
$(info BOARD = $(BOARD))
include Makefile
then when you type make it automatically sets the BOARD for you. You can still override by passing BOARD= when you invoke make.

Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

Re: build micropython for STM32F7DISC on windows

Post by Peter.Kenyon » Wed Mar 23, 2016 6:57 pm

thanks dave, but I was hoping for even more hand holding (sorry), ive installed the arm toolchain, but windows doesn't have make so I downloaded a make for win32 and I get a tr problem, I'm thinking I might need a whole bunch of stuff to get this to build, maybe it would be easier to stick mint? on a spare itx board and use that.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: build micropython for STM32F7DISC on windows

Post by Roberthh » Wed Mar 23, 2016 7:27 pm

On long run, the best would be to install a Linux VM. Both Virtualbox and VMWare work pretty well and are free of charge for private use. Even if you get the build working for now, it may change again, and then you're constantly wasting energy at the build environment instead of dealing with MicroPython and your own projects. That's at least what I do. On my Windows machine I have a Linux VM, and on my Linux machine a Windows VM.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: build micropython for STM32F7DISC on windows

Post by stijn » Wed Mar 23, 2016 8:00 pm

A VM is likely the easiest (minus possible occasional problems getting devices connected to it over usb, not sure about the current state but I've had problems with tat in the past), but have you tried using msys or cygwin? They have package managers, make, ... which should make it easier than installing everything seperately and hoping it works together.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: build micropython for STM32F7DISC on windows

Post by dhylands » Wed Mar 23, 2016 8:13 pm

Another option is to install cygwin or MinGW. I've successfully built micropython using the cygwin environement.

Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

Re: build micropython for STM32F7DISC on windows

Post by Peter.Kenyon » Thu Mar 24, 2016 6:37 am

ok thanks chaps, looks like its time to expt but at least I have some pointers of where to start

Neil
Posts: 15
Joined: Tue Jul 14, 2015 8:51 pm

Re: build micropython for STM32F7DISC on windows

Post by Neil » Thu Mar 24, 2016 8:33 am

I recently created a setup on windows using this guide and everything seems to build fine,

http://www.jann.cc/2013/10/10/embedded_ ... ndows.html

Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

Re: build micropython for STM32F7DISC on windows

Post by Peter.Kenyon » Thu Mar 24, 2016 2:09 pm

I decided to go the vm route, never tried hyper v so what the heck....

Enabled HyperV on windows 10...
Programs and Features
Turn Windows Features on or off
X Hyper-V
Reboot
Download Ubuntu 14.04.4-desktop-amd64.iso
Open HyperV manager
Create a network bridge connection
Create a new virtual machine
using iso ubuntu
start vm
connect to vm and install ubuntu
login

sudo apt-get install build-essential libreadline-dev libffi-dev git
git clone https://github.com/micropython/micropython.git

1). sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi
2). sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
3). sudo apt-get update
4). sudo apt-get install gcc-arm-embedded

cd micropython\unix
make
Works fine

cd micropython\stmhal
make
download dfu to pyboard - works fine

make BOARD=STM32F7DISC
creates .dfu file - havent tested it yet

Notes:
HyperV doesnt support usb apparently so cant program the device.
which also makes it a pain to get at the resultant .dfu files.
So I apt-get install openssh-server and then on host machine
use ssh client to connect to vm over bridge connection

Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

Re: build micropython for STM32F7DISC on windows

Post by Peter.Kenyon » Thu Mar 24, 2016 3:41 pm

.... made the mods as suggested by dhylands, in order to enable dfu mode.
nb the power jumper needs to be set correctly. : : : I :
insert uusb into cn13, hold down dfu pin and reset. device goes into dfu mode
upload firmware reset and lo and behold a usb uart with upy....
Excellent stuff dh Damien et al.....

Post Reply