Problems building micropython-1.9.2 from source

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
Jim.S
Posts: 80
Joined: Fri Dec 18, 2015 7:36 pm

Problems building micropython-1.9.2 from source

Post by Jim.S » Fri Mar 02, 2018 9:00 pm

I'm trying to build Micropython 1.9.2 for the Micro:bit from source but am running into problems

To my amazement, I successfully build the default micropython v1.7.9 on my Linux Mint 17 box, from source, by following the instructions in http://microbit-micropython.readthedocs ... ation.html to the letter (big thanks to whoever wrote the instructions)

I am now trying to build Micropython-0.9 (which I assume is the same as 1.9.2) but am running into this problem when I run the command "yt build"

[98/279] Building CXX object ym/ble-nrf51822/source/CMakeFiles/ble-nrf5182...it/micropython-0.9/yotta_modules/ble-nrf51822/source/nRF5xGattServer.cpp.o
ninja: build stopped: subcommand failed.


I have tried two routes to download the source
first I tried git from the command line, i.e.
git clone -n https://github.com/bbcmicrobit/micropython/
git checkout e17de0954178d88aa2a1d70b6e6ebc43f5456607


next I downloaded micropython-0.9.zip from github website, unzipped it and then used yotta i.a.w the instructions stated above

but seem to run into the same problem - I accept I may not be using git or yotta properly, but am somewhat confused as it seems to have worked with the 1.7.9 branch

(Be warned, Once I have solved this problem I want to understand how I can include python modules in the firmware, specifically if I can and where I put them in the firmware source directory structure. Adafruit's tutorial on building micropython the source for the esp 8266 (https://learn.adafruit.com/micropython- ... en-modules) has "modules" and "scripts" directories where I assume you can put python modules and scripts for freezing into the firmware)

jickster
Posts: 219
Joined: Thu Sep 07, 2017 8:57 pm

Re: Problems building micropython-1.9.2 from source

Post by jickster » Sun Mar 04, 2018 4:16 am

yt looks to be a separate executable that you need to download.


Sent from my iPhone using Tapatalk

Jim.S
Posts: 80
Joined: Fri Dec 18, 2015 7:36 pm

Re: Problems building micropython-1.9.2 from source

Post by Jim.S » Sun Mar 04, 2018 1:08 pm

Sorry, I didn't explain very well. what I did was
1. download 'micropython-master.zip" from github (using my browser, because I am not confident i know what I am doing with git from the command line)
2 unzip it
3 go to the top level directory/folder, the one with config.json in it, and use the following "yotta" commands
  • yt target bbc-microbit-classic-gcc-nosd
    yt up
    yt build
This works perfectly on my Linux Mint 17 box and makes a working 1.7.9 firmware, however if I down load, micropython-0.9.zip and try the same I get the following error (yeah, I know it is a different error to what I got the first time, as shown in my first post)
..../MicroBit/micropython-0.9/yotta_modules/ble-nrf51822/source/nRF5xGap.cpp:906:61: error: 'BLEProtocol::AddressType_t' is not a class or namespace
if (whitelistAddresses.addr_type == BLEProtocol::AddressType_t::RANDOM_PRIVATE_RESOLVABLE) {
^
[98/279] Building CXX object ym/ble-nrf51822/source/CMakeFiles/ble-nrf51.../micropython-0.9/yotta_modules/ble-nrf51822/source/nRF5xGattServer.cpp.o
ninja: build stopped: subcommand failed.

jickster
Posts: 219
Joined: Thu Sep 07, 2017 8:57 pm

Problems building micropython-1.9.2 from source

Post by jickster » Mon Mar 05, 2018 2:04 am

Issue appears to be version of gcc used is too old

Code: Select all

 The build works fine for me, with arm-none-eabi-gcc 6.1.1.

I think the problem is that the "old" gcc version you use can't handle the advanced C++ feature that's used by the code (BLEProtocol::AddressType_t is a typedef of an enum within a struct within a namespace). We can't fix such problems here, so please report the bug upstream at the yotta module here: https://github.com/ARMmbed/ble-nrf51822

https://github.com/ARMmbed/ble-nrf51822/issues/133



Sent from my iPhone using Tapatalk

Jim.S
Posts: 80
Joined: Fri Dec 18, 2015 7:36 pm

Re: Problems building micropython-1.9.2 from source

Post by Jim.S » Mon Mar 05, 2018 6:26 am

that makes sense, I am running an older version of Mint, so presumably has a older version of gcc, I was going to bite the bullet and upgrade, so I will do it sooner rather than later

Thanks!

Post Reply