I'm evaluating Puck.js for a project that would require modifying existing custom firmware with jswrap. To get started I figured I would start with the basic steps of re-building the libraries.
After following the instructions within /master/README_Building.md and installing BASH under Windows 10 I can successfully build for Espruino, but I am running into problems for cross compilation for Puck.js.
sudo apt-get update
sudo pip install nrfutil
sudo apt-get install -y \
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
sudo mv gcc-arm-none-eabi-5_4-2016q3-20160926 /usr/local
make clean && DFU_UPDATE_BUILD=1 BOARD=PUCKJS RELEASE=1 make
ls -l *puckjs*
First I assume line 8 should read since that is the folder that is created from the prior step:
sudo mv gcc-arm-none-eabi-5_4-2016q3 /usr/local
The error I'm encountering during the build process:
#@#:~/source/repos/github/espruino/Espruino$ make clean && DFU_UPDATE_BUILD=1 BOARD=PUCKJS RELEASE=1 make
Generating platform configs
Generating pin info
Generating JS wrappers
WRAPPERSOURCES = src/jswrap_array.c src/jswrap_arraybuffer.c src/jswrap_dataview.c src/jswrap_date.c src/jswrap_error.c src/jswrap_espruino.c src/jswrap_flash.c src/jswrap_functions.c src/jswrap_interactive.c src/jswrap_io.c src/jswrap_json.c src/jswrap_modules.c src/jswrap_pin.c src/jswrap_number.c src/jswrap_object.c src/jswrap_onewire.c src/jswrap_pipe.c src/jswrap_process.c src/jswrap_promise.c src/jswrap_serial.c src/jswrap_spi_i2c.c src/jswrap_stream.c src/jswrap_string.c src/jswrap_waveform.c libs/math/jswrap_math.c libs/graphics/jswrap_graphics.c libs/network/jswrap_net.c libs/network/http/jswrap_http.c libs/network/js/jswrap_jsnetwork.c libs/bluetooth/jswrap_bluetooth.c libs/puckjs/jswrap_puck.c libs/crypto/jswrap_crypto.c libs/neopixel/jswrap_neopixel.c
DEFINES = -DGIT_COMMIT=101dff8c97e2e12fdb90ad129a4bdfb7a7dc11a6 -DNO_ASSERT -DRELEASE -DBUILDNUMBER="163" -DHAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND=1 -DUSE_BOOTLOADER -DUSE_DEBUGGER -DUSE_TAB_COMPLETE -DUSE_HEATSHRINK -DUSE_MATH -DUSE_GRAPHICS -DUSE_NET -DBLUETOOTH -DUSE_CRYPTO -DUSE_NEOPIXEL -DUSE_NFC -DNFC_HAL_ENABLED=1 -DSWI_DISABLE0 -DSOFTDEVICE_PRESENT -DNRF52 -DCONFIG_GPIO_AS_PINRESET -DS132 -DBLE_STACK_SUPPORT_REQD -DNRF_SD_BLE_API_VERSION=3 -DPUCKJS -DNRF52832 -DARM -DLINK_TIME_OPTIMISATION -DEMBEDDED
/usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc: 1: /usr/local/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc: Syntax error: word unexpected (expecting ")")
make: *** [libs/compression/heatshrink/heatshrink_encoder.o] Error 2
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
Any help would be appreciated.
Maybe try just running the compiler? arm-none-eabi-gcc - it looks like there's some problem with it.
Can you try running source scripts/provision.sh PUCKJS and then building? That'll pull all the tools into the Espruino directory and set up the paths for you, which is the nice easy way to do it - it's possible there's something odd about /usr/local on Bash for Windows 10.
source scripts/provision.sh PUCKJS
Thanks for the quick reply. I'll try running that this evening when I get a chance to dive back into this.
When I run source scripts/provision.sh PUCKJS that goes off without a hitch. The first time it did install gcc-arm-embed in the Espruino directory as a new folder "gcc-arm-none-eabi-6-2017-q1-update".
I take it I just need to change the export path to that location.
Regards and thank you,
Yes, I bet that's it then. It must be something about /usr/local...
provision.sh won't download the files if they already exist, so it's actually pretty quick to just call that every time you want to start cross compilation. Otherwise you could add the relevant paths to .profile in your home directory.
That appears to have done it. I can make clean && make for BOARD=PUCKJS and a new PUCKJS file is put into the boards folder. Alternately a simple make clean && make creates a LINUX file in the boards folder, and either or a new espruino file in the Espruino directory. So all appears to be normal.
I did have to add a line to my hosts file to include 127.0.0.1 YOURCOMPUTERNAME
so bash would stop with the unable to resolve host lines.
Now that I know I'm setup to compile under normal circumstances I can get on with the heavy lifting.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem