Setting up build environment

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Posts: 5
Joined: Fri Mar 10, 2017 4:56 pm

Setting up build environment

Postby ST58 » Fri Mar 10, 2017 5:05 pm

Hi, Real starter question here.
What are the steps and dependencies to setting up a build environment in Windows, so as to be able to build STM ports? Is this a good way to go? Is it better to use 'Bash' under Win10. Is 'bash' in Win 10 enough of a Linux environment to work? If Bash under win 10 is a better way to go, is there a step by step tutorial on installing all the dependencies etc. required? Another option is Mac OS - same question - is there a step by step tutorial on all the steps required to get the environment set up?
Apologies if this seems to basic a question - but we all have to start somewhere!

User avatar
Posts: 2264
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada

Re: Setting up build environment

Postby dhylands » Fri Mar 10, 2017 6:59 pm

You need a toolchain. I installed the Windows one from here:
You'll also need make and the regular toolchain. Using Win10 bash, I was able to build micropython but I couldn't flash it. I had to use the regular shell to do that.

You should probably do an apt-get install build-essentials

You can also use cygwin, or MinGW, or build it using MSVC if you want to use a non-gcc toolchain (although I haven't personally tried MSVC).

Posts: 5
Joined: Fri Mar 10, 2017 4:56 pm

Re: Setting up build environment

Postby ST58 » Mon Mar 13, 2017 9:10 am

From a previous thread by peter Kenyan
I installed using hyper V on windows. This worked with the a few missing steps on build..
On unix build you need to 'make axtls' first, then do make, then unix builds works fine. On STMHal you need to build the cross compiler first : 'make -C mpy-cross', after this stmhal boards build just fine.

However I would like to try building using bash under windows. This would have less overhead than a VM and easier access to the final *.hex, *.dfu files in windows for flashing etc. Would I use the same package install sequence in in bash as in the Ubuntu linix install?...

sudo apt-get install build-essential libreadline-dev libffi-dev git
git clone

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

Return to “Development of MicroPython”

Who is online

Users browsing this forum: No registered users and 1 guest