Create Espressif 8266 Packages for FreeBSD

How would I go about getting these packages supported on my development machine which runs FreeBSD? Do I just clone the repositories and install with the Makefiles? Would installing all of these dependencies allow me to use the pio run command? How would we go about adding the binaries to your registry?

Could you test these packages by @sticilface? If they work for you, we will add it to PlatformIO Storage

Unfortunately the second link 404s. I will try and see if I can build the esptool-ck by myself since the build should be fixed for FreeBSD.

Update: I got esptool-ck to build and moved the entire contents of the directory to ~/.platformio/packages/tool-esptool/

I copied his first download link and moved the contents to ~/.platformio/packages/toolchain-xtensa/ and tried updating the file ~/.platfomio/appstate.json based on the comments in that thread, but it kept trying to install toolchain-xtensa @ ~1.40802.0

If you have any recommendations for updating the appstate.json I will try it out.

This is obsolete step for PlatformIO 2.0. You need to create package.json manifest in the root of folder. Thake a look at other packages how they are organized.

{
    "description": "xtensa-gcc",
    "name": "toolchain-xtensa",
    "system": "freebsd_amd64",
    "url": "https://github.com/jcmvbkbc/gcc-xtensa",
    "version": "1.40802.0"
}

Does it work?

Ah, thanks for the hint. I will try this when I am back at my computer tonight.

Okay, so it starts to compile but it cannot find xtensa-lx106-elf-g++ and xtensa-lx106-elf-ar

The full message is below:

$ platformio run -v
[Mon Sep 26 23:35:27 2016] Processing huzzah (platform: espressif8266, board: huzzah, framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Collected 23 compatible libraries
Looking for dependencies...
Project does not have dependencies
xtensa-lx106-elf-g++ -o .pioenvs/huzzah/src/main.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=030100 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -U__STRICT_ANSI__ -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/home/tim/.platformio/packages/framework-arduinoespressif8266/variants/adafruit -Isrc src/main.cpp
xtensa-lx106-elf-ar rcs .pioenvs/huzzah/libFrameworkArduinoVariant.a
xtensa-lx106-elf-g++: not found
xtensa-lx106-elf-ar: not found
xtensa-lx106-elf-g++ -o .pioenvs/huzzah/FrameworkArduino/Esp.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=030100 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -U__STRICT_ANSI__ -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/home/tim/.platformio/packages/framework-arduinoespressif8266/variants/adafruit /home/tim/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Esp.cpp
*** [.pioenvs/huzzah/src/main.o] Error 127
xtensa-lx106-elf-g++ -o .pioenvs/huzzah/FrameworkArduino/FS.o -c -fno-rtti -fno-exceptions -std=c++11 -Os -mlongcalls -mtext-section-literals -falign-functions=4 -ffunction-sections -fdata-sections -DARDUINO=20300 -DLWIP_OPEN_SRC -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DPLATFORMIO=030100 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12 -U__STRICT_ANSI__ -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include -I/home/tim/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/home/tim/.platformio/packages/framework-arduinoespressif8266/variants/adafruit /home/tim/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.cpp
*** [.pioenvs/huzzah/libFrameworkArduinoVariant.a] Error 127
xtensa-lx106-elf-g++: not found
*** [.pioenvs/huzzah/FrameworkArduino/Esp.o] Error 127
xtensa-lx106-elf-g++: not found
*** [.pioenvs/huzzah/FrameworkArduino/FS.o] Error 127
================================================================ [ERROR] Took 0.84 seconds ================================================================

Here are the locations of the files it cannot find:

$HOME/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf-g++
$HOME/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf-ar

They should be located in bin directory. Take a look at other PlatformIO toolchains:

Ah thanks. For some reason, the toolchain did not populate the include nor the bin directories.

Could you fix that toolchain?

Yeah, sure. I probably won’t get to it until this weekend though.

How are we getting on here?

I’m still interested in this. but @ivankravets mentioned that there would be the ability to “cloud” compile (but i’d like to do it locally? is this possible in 3.1.0 yet…

(i.e. send my sketch to my local server for compiling and retrieve the .elf and .bin ?)

What do you mean under Cloud Compile? For package or project?

I think next week I’ll release first beta. It’s named as “PIO Remote”. This service will have a lot COOL features.

I downloaded a package of the toolchain-xtensa for linux and and started looking through it. It’s structured very differently than the FreeBSD one. Running platformio run errors out because it can’t find stdlib.h and memory in the framework-arduinoespressif8266 directory. Is there some symbolic link or something that connects the includes directory of toolchain?

@sticilface do you have any ideas?

Hi,

Sorry. i’ve been pretty mental with work and stuff!

I’ve actually lost the jail i had set up for this! I’ve created a new one. but got as far as this

PackageManager: Installing toolchain-xtensa @ ~1.40802.0
Error: Could not find a version that satisfies the requirement '~1.40802.0' for your system 'freebsd_amd64'

so i could probably cobble together the old tool chain with the new one, comparing to linux one.
and see where i get!

ok so i got it to work by doing the following…

install python
pkg install python gcc

install pip
python -m ensurepip

install platformio
pip install -U platformio

configure a project
mkdir test cd test platformio init

copy the files from this zip to your ./platformio/packages/ folder

now it should compile. it will fail to run the final stage creating the bin… but it should compile. this is because the esp-tool is just the mac version to keep platformio quiet… i need to get help from ivan for the makefile for esp-tool…
https://github.com/igrr/esptool-ck/issues/43

I’ve uploaded all toolchains and tools. Thanks, @sticilface!!! :blush:

Could someone test it?

the esp-tool i’ve included won’t work though. it is jus the mac one, to make it think it is correct…

fixed it. forgot to use gmake instead!

im uploading the fixed files to github. can u repackage them for me when they are done.
The toolchain works though