Setting up the uPyEasy build environment

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Post Reply
Message
Author
LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Setting up the uPyEasy build environment

#1 Post by LisaM » 23 Dec 2017, 15:14

This document can be found here: https://github.com/letscontrolit/uPyEas ... onment.pdf
So far, it's for the ESP32 (the others will be added) and only on Linux.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Setting up the uPyEasy build enviroment

#2 Post by LisaM » 10 Mar 2018, 20:10

The other ports will be added shortly...

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Setting up the uPyEasy build environment

#3 Post by LisaM » 17 Mar 2018, 17:08

Version 0.2 of the uPyEasy has been completed, a generic section was added. The unix, stm32,esp8266 and armbian dev environments are added as well. I'm happy the way it looks like, however feedback is welcome!

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: Setting up the uPyEasy build environment

#4 Post by AndrewJ » 17 Mar 2018, 22:15

Great work, Lisa - thanks :)
I'll try out the ESP32, and also the STM32 section in the next couple of days.
Andrew

raptor
Normal user
Posts: 25
Joined: 25 Oct 2016, 10:39
Location: Montana / Bulgaria

Re: Setting up the uPyEasy build environment

#5 Post by raptor » 20 Mar 2018, 11:25

Hello, Lisa :) Great work- Thanks :)

I need a little help. I'm trying to build firmware for esp32, following every step from instructions, but the following error occurred:

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
CC /home/ivanov/esp-idf/components/bootloader_support/src/bootloader_clock.c
CC /home/ivanov/esp-idf/components/bootloader_support/src/bootloader_flash.c
CC /home/ivanov/esp-idf/components/bootloader_support/src/bootloader_random.c
CC /home/ivanov/esp-idf/components/bootloader_support/src/bootloader_sha.c
CC /home/ivanov/esp-idf/components/bootloader_support/src/secure_boot_signatures.c
/home/ivanov/esp-idf/components/bootloader_support/src/secure_boot_signatures.c:22:18: fatal error: uECC.h: No such file or directory
compilation terminated.
Makefile:725: recipe for target 'build/bootloader//home/ivanov/esp-idf/components/bootloader_support/src/secure_boot_signatures.o' failed
make: *** [build/bootloader//home/ivanov/esp-idf/components/bootloader_support/src/secure_boot_signatures.o] Error 1

Also when I'm trying to copy modules from upyeasy source to ports/esp32/modules it tells me that urequests.py is broken and can't be replaced. I'm using Ubuntu 16.04 LTS.

Thanks in advance :)
Regards from Bulgaria.
raptor

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: Setting up the uPyEasy build environment

#6 Post by AndrewJ » 20 Mar 2018, 20:10

A quick update on my experience with the build environment setup.

I'm working on a Linux PC (Linux Mint) and I've now used @LisaM's instructions to set up environment(s) for ESP32 and STM32. I've now succeeded in building and flashing uPyEasy for both - Yay! :)

The ESP32 version runs ok on my Lolin32 Lite board, although the free space seems rather low - in the log, the GC lines are reporting free space as low as 8000 at times. But the free space on the main page is higher. (I don't understand why they are different.) I know Lisa is working on optimising things for ESP32.

The STM32 version "sort-of" works on my Chinese Pyboard-clone (same as Lisa's from the photos). It starts up but I can't yet connect to it from my browser on the Linux PC or ping it.

Has anyone else given the build setup a try?
Andrew

raptor
Normal user
Posts: 25
Joined: 25 Oct 2016, 10:39
Location: Montana / Bulgaria

Re: Setting up the uPyEasy build environment

#7 Post by raptor » 21 Mar 2018, 21:07

Hello, again! I've now succeeded in building and flashing uPyEasy on ESP32 WROOM. The problem was in description of how to fetch esp-idf:

$ git clone https://github.com/espressif/esp-idf.git
$ git checkout <Current supported ESP-IDF commit hash>
$ git submodule update –recursive

The right commands according to http://esp-idf.readthedocs.io/en/latest ... et-esp-idf is:

git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf/
git checkout <Current supported ESP-IDF commit hash>
git submodule update --recursive

Current supported ESP-IDF commit hash can be seen in /home/ivanov/micropython/ports/esp32/Makefile. In this case is 3ede9f011b50999b0560683f9419538c066dd09e.
My makefile in /home/ivanov/micropython/ports/esp32/ is:

ESPIDF = $(HOME)/esp-idf
PORT = /dev/ttyUSB0
BAUD = 115200
FLASH_MODE = dio
FLASH_SIZE = 4MB
CROSS_COMPILE = xtensa-esp32-elf-
include Makefile

After successful building and deploying I get

OSError: [Errno 2] ENOENT
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>> help()

This mean that main.py is missing and I must to create it manually like here: https://github.com/micropython/micropyt ... /issues/90

>>> f = open("main.py", "w")
>>> f.write("print(\"main.py: Hello\")\n")
24
>>> f.close()

Then restart and voila:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (265) cpu_start: Pro cpu up.
I (265) cpu_start: Single core mode
I (265) heap_init: Initializing. RAM available for dynamic allocation:
I (269) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (275) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (281) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (287) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (294) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (300) cpu_start: Pro cpu start user code
I (20) cpu_start: Starting scheduler on PRO CPU.
main.py: Hello
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>>
Regards from Bulgaria.
raptor

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: Setting up the uPyEasy build environment

#8 Post by AndrewJ » 22 Mar 2018, 18:20

AndrewJ wrote: 20 Mar 2018, 20:10 A quick update on my experience with the build environment setup.

I'm working on a Linux PC (Linux Mint) and I've now used @LisaM's instructions to set up environment(s) for ESP32 and STM32. I've now succeeded in building and flashing uPyEasy for both - Yay! :)

The ESP32 version runs ok on my Lolin32 Lite board, although the free space seems rather low - in the log, the GC lines are reporting free space as low as 8000 at times. But the free space on the main page is higher. (I don't understand why they are different.) I know Lisa is working on optimising things for ESP32.

The STM32 version "sort-of" works on my Chinese Pyboard-clone (same as Lisa's from the photos). It starts up but I can't yet connect to it from my browser on the Linux PC or ping it.

Has anyone else given the build setup a try?
Andrew
I need to rewind here.....
On STM32, I set up the toolchain and got it to build ok. Great, so far so good! Then I left it to work on ESP32 for quite a long time, and obviously mis-remembered where I had got to on STM. In fact now I've checked my notes, I hadn't actually gone the next step and deployed it. So that part of my previous message above was incorrect - sorry! :oops:

Now I've come back to it, and tried to deploy it, it isn't working for me. I did the following:-
1. Tried "make BOARD=PYBV11 deploy" (and also with sudo) - I got

Code: Select all

No module named usb.core. Makefile: 371 recipe for target 'deploe' failed. make [deploy] Error 1
2. Used dfu-util with the command from the Buiding Environment doc v0.2...

Code: Select all

sudo dfu-util -a 0 -d 0483:df11 -D build-PYBV11/firmware.dfu
which successfully downloaded to the STM32 board. Fantastic (I thought). :)

However! I was unable to connect to STM with screen, and no ttyASMx or ttyUSBx available. :shock: Tried rebooting the PC, resetting the STM32, reconnecting USB, still the same. Tried flashing again, but still no better.

Any ideas?? Where might I have gone wrong :?:
Andrew

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests