-
@MaBe Thank you for your response sir. please see my edit above in OP post.
I removed DFU_UPDATE_BUILD=1 and added RELEASE=1 as you suggested, and still the device is not showing up as TTY to send javascript to. The WebIDE also doesn't recognize the device after flashing.
-
I am trying to build the new pico firmware from source.
I have soldered jumpers from the BTN / BOOT0 pads so I can quickly change chip modes.
I edited ./boards/PICO_R1_3.py so that the libraries included are as follows:
'build' : { ... 'libraries' : [ 'USB_HID', 'NET', # 'GRAPHICS', # 'TV', 'FILESYSTEM', 'CRYPTO','SHA256','SHA512', # 'TLS', 'NEOPIXEL' ],
Then I ran:
source scripts/provision.sh PICO_R1_3 make clean && BOARD=PICO_R1_3 DFU_UPDATE_BUILD=1 make sudo dfu-util -a 0 -s 0x08000000 -D espruino_2v08.5_pico_1r3.bin
When I plug the pico into USB again without holding the button and without the aforementioned jumpers connected, the usual single red LED blink doesn't happen and it doesn't accept the following:
echo "digitalWrite(LED1,1);" >> /dev/ttyACM0
EDIT******
picocom --baud 9600 --flow n /dev/ttyACM0
allows me to interface with the espruino in the same way the WebIDE would. I am trying to use all free software on the command line. My main problem is the binary that is made by the make command doesn't provide a TTY on the /dev/ttyACM0 device as is normally provided on the official binary. I'm a free software purist and want to use only the basic tools.
*** end editIs there something missing in my strategy?
When I flash the official release firmware .bin file, it works fine.
-
I understand that once i fix theCommand not found
issue,make
will sort itself out by taking instructions from the makefileWhat method do you normally use to add a command to the path? In my limitted understanding, I managed to get the/etc/environment
file to work for me before, but if there's a better way, please comment. I'm here again with a freshly installed Ubuntu 14.04 VM.The build process was successful on Arch Linux without a VM. I installed the compiler in the following manner:
yaourt arm-none-eabi-gcc49-linaro
The AUR package took about 30 minutes to build on a 4GHz Core i7
And Espruino took maybe 5 minute to build.Now for the hardware step
-
Hmm good point DrAzzy. I'm attempting to make a virtual pin registry for in case I want to use multiplexers and shift registers in tandem with each other. In a custom wrapper for espruino, those devices could be used as a source of pins, by switching the selector pins in the background to accommodate calls to a virtual pin. I have already created a workaround without too many lines. But I will try Object.keys(global) . I totally forgot about javascript being rooted in Java where everything stems from the Object object lol. And thanks for getPinMode Gordon. It's definitely worth it to leave pins such as A9 usable by any project.
My workaround so far is such that I create virtual pin objects starting with 'Z0' through 'Z7' when initiating a 74HC595 shift register, then slapping them with a "digital output only" flag.
-
-
I think I'm going to answer my own question...
Pin A9 of the on-board STM32 microcontroller is always connected to the fused USB 5V voltage reference.
The digitalWrite function essentially connects the USB voltage pin to GND, thus creating a short circuit on the USB port. This means there is no longer power going to the board AT ALL. It has been "disconnected".bows
-
I am running a try {} block in which i test each possible pin name to see if it will respond to a digitalWrite.
var pins = [A0,A1,A2,A3,A4,A5,A6,A7,A8,A10, B1,B2, B3,B4,B5,B6,B7,B8,B9,B10]; var i; for (i = 0; i < pins.length; i++) { var pintrial = true; try { digitalWrite(pins[i],1); digitalWrite(pins[i],0); } catch(e) { pintrial = false; console.log(e); } finally { console.log(pintrial); } }
Neither B2 or A9 exist on the pico board, but B2 is accepted by this pin testing approach and A9 causes the device to disconnect itself.
Does anybody have an explanation for this? I can work around it, but I'm curious nonetheless.
-
The output of:
arm-none-eabi-gcc --version
is:
arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
so it's not 5.4 like you said earlier. I'll work on the tar-extraction method now.
EDIT
I removed the compiler package with
Then, downloaded the tarball ```gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2``` It has a SHA1 hash of ```e87bbefaccbb43d30c084faeb945f4e96e7ec780``` unpacked it into my home folder, and afterward, listing home folder contents with ls:
Desktop Downloads examples.desktop Music Public Videos
Documents Espruino gcc-arm-none-eabi-5_4-2016q3 Pictures TemplatesThen I editted the ```/etc/environment``` file to be ```PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/user/gcc-arm-none-eabi-5_4-2016q3"``` Rebooted then ```cd ~/Espruino```. At this point, ```make``` returns
LD espruino
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make: *** [espruino] Error 1and ```STM32F411DISCOVERY=1 RELEASE=1 make``` returns
CC targets/stm32/jshardware.o
make: gcc-arm-none-eabi: Command not found
make: *** [targets/stm32/jshardware.o] Error 127
``` -
The output of:
arm-none-eabi-gcc --version
is:
arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
so it's not 5.4 like you said earlier. I'll work on the tar-extraction method now.
-
Okay I'm back. This time, I ditched Arch for Ubuntu 14.04 temporarily (This is a gnome-boxes VM) . And I ran the following commands starting inside the home folder:
sudo apt-get install git ### install git dependency git clone https://github.com/espruino/Espruino ### download the repository into the home folder as ~/Espruino/ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa ### add the untrusted ppa as instructed by launchpad.net sudo apt-get update ### refresh repository databases sudo apt-get install apt-file sudo apt-file update ### apt-file needed to search for the proper toolchain package apt-file search arm-none ### conduct search; shows gcc-arm-none-eabi sudo apt-get install gcc-arm-none-eabi cd Espruino/ ### will receive an error here if not in home folder STM32F411DISCOVERY=1 RELEASE=1 make ### as per Espruino github instructions
I received the following error:
cc1: some warnings being treated as errors make: *** [targets/stm32/jshardware.o] Error 1 make: *** wait: No child processes. Stop.
The stack trace is very long, but I can provide it if necessary via a bash output file.
-
the contents of
/usr/lib/gcc/arm-none-eabi/6.2.0/include/stdint.h
are:
ifndef _GCC_WRAP_STDINT_H if __STDC_HOSTED__ if defined __cplusplus && __cplusplus >= 201103L undef __STDC_LIMIT_MACROS define __STDC_LIMIT_MACROS undef __STDC_CONSTANT_MACROS define __STDC_CONSTANT_MACROS endif include_next <stdint.h> else include "stdint-gcc.h" endif define _GCC_WRAP_STDINT_H endif
[NOTE: in the contents above, I removed the "#" at the beginning of each line to prevent forum language from seeping through like this]
[#endif](https://forum.espruino.com/search/?q=%23endif)
, seems like it is trying to call itself, via
# include_next <stdint.h>
and failing.
-
In fact I had downloaded a zip. But today I tried the
git clone https://github.com/espruino/Espruino
method. And sort of good news, I got a different error.
[user@hostname Espruino]$ sudo STM32F411DISCOVERY=1 WIZNET=1 make CC src/jslex.o In file included from /home/user/Downloads/building-espruino-411/Espruino/targetlibs/arm/core_cm4.h:143:0, from /home/user/Downloads/building-espruino-411/Espruino/targetlibs/stm32f4/lib/stm32f411xe.h:160, from /home/user/Downloads/building-espruino-411/Espruino/targetlibs/stm32f4/lib/stm32f4xx.h:173, from /home/user/Downloads/building-espruino-411/Espruino/gen/platform_config.h:13, from src/jsutils.h:17, from src/jslex.h:17, from src/jslex.c:14: /usr/lib/gcc/arm-none-eabi/6.2.0/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory # include_next <stdint.h> ^ compilation terminated. make: *** [Makefile:1884: src/jslex.o] Error 1 [user@hostname Espruino]$
I see it knew to grab my /usr/lib/gcc/arm-none-eabi this time, so i assume it's not a path problem.
-
Hello, I'm not at all familiar with compiling code, beyond some trusted AUR packages for Linux. All of this is quite foreign. After recieving this error, I went looking in espruino-master which i pulled down previously. I found many ".o" files adjacent to many like-named ".c" and ".h" files. Why are only a few of these ".o" files missing, while they're clearly needed to build a binary?
[user@hostname Espruino-master]$ sudo STM32F411DISCOVERY=1 RELEASE=1 WIZNET=1 make serialflash [sudo] password for user: fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git ... more fatal errors ... fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git CC libs/network/wiznet/network_wiznet.o In file included from /home/user/Downloads/Espruino-master/src/jsvar.h:17:0, from /home/user/Downloads/Espruino-master/src/jsparse.h:17, from /home/user/Downloads/Espruino-master/src/jsinteractive.h:17, from libs/network/wiznet/network_wiznet.c:14: /home/user/Downloads/Espruino-master/src/jsutils.h:20:20: fatal error: string.h: No such file or directory [#include](https://forum.espruino.com/search/?q=%23include) <string.h> ^ compilation terminated. make: *** [Makefile:1875: libs/network/wiznet/network_wiznet.o] Error 1 [user@hostname Espruino-master]$
Also noteworthy is that im using a FT232RL USB-Serial converter and plugging into a breadboard with bare STM32F411CEU6 broken out to 0.1". No peripherals, just the capacitors that ST and my 3.3V regulator calls for. Pin 44(BOOT0) is connected to 3.3V and pin 20(PB2) is connected to GND
Are Rx and Tx supposed to cross on their way from FT232RL to STM32?
Any pointers are appreciated, thank you
Just a few hours later and some perseverance and I got it working =) . The method under Linux is:
Then short BTN to BOOT0 under the board, indicated by a "<<" on the schematic circuit diagram.
Plug the device into the USB port while holding down the button and run the following command:
If the command exits without displaying a progress bar, pull the board out of USB, plug it in again with the button held, and issue the above command again. Just a little finicky.
Once the bootloader is successfully flashed, unplug and remove the BTN / BOOT0 short, plug it back in with the button held. The red and green LEDs on the board should alternate lighting up.
Now issue the following command:
The firmware will build and the STM32F401 will automatically decide which address to place the remainder of the firmware in its flash memory.
Unplug the board, plug it back in (no need to short or hold any button down this time)
Then press Ctrl+C once.
This will spawn a terminal with which to send Javascript commands and functions to the espruino.