Avatar for arminarm

arminarm

Member since Jun 2014 • Last active Jul 2014
  • 2 conversations
  • 8 comments

Most recent activity

  • in General
    Avatar for arminarm

    I see you just tweaked the "raspberry-pi-check" in the Makefile. Thanks for that!
    Post edited to reflect those changes.
    (edit: also the linenumbers. Not sure how long I can keep that up ;)
    (edit2: also noticed you have to actually comment out one or more of the "USE_NET", "USE_GRAPHICS", or "USE_FILESYSTEM" vars to keep it within size restrictions while using "-03". Setting them to "0" just doesn't cut it.)

    • 7 comments
    • 4,322 views
  • in General
    Avatar for arminarm

    Just posted a how-to on compiling Espruino on a Raspberry Pi with Raspbian here: http://forum.espruino.com/conversations/­1671/ (in battle with forum software ;)

    I did run into the "-O3" versus "-Os" gotcha. Never noticed before, because the ARMinARM board doesn't use your bootloader obviously and also has more room in the Flash department. Very interesting. What toolchain are you using?

  • in General
    Avatar for arminarm

    If you want to compile and upload the latest version of Espruino yourself -and you happen to have a Raspberry Pi running Raspbian- here's how to do it. For reference, this topic explains how to do it in a Linux Virtual Machine: http://forum.espruino.com/conversations/­151/

    Before powering up the Raspberry Pi, connect the Espruino board to the Pi with a USB cable. Sometimes if you plug in the Espruino board while the Pi is running, it will reboot because of the sudden power draw. With a USB hub, you can plug in and unplug the Espruino board to your heart's content.

    On the latest version of Raspbian (2014-06-20) you have all the basic tools you need (except for the necessary toolchain to compile it, and maybe 'minicom' or 'screen' to test if it worked). Older versions of Raspbian may lack some of these, so let's just try to install them all. Packages you already have will be ignored anyway.

    sudo apt-get install git python-serial minicom screen
    

    You'll need an 'arm-none-eabi-gcc' toolchain for Raspbian to compile Espruino. I have a script on github that automatically downloads and install it.

    wget https://raw.githubusercontent.com/ARMinA­RM/arminarm/master/bin/install_toolchain­.sh
    
    sh install_toolchain.sh
    

    The toolchain by default will be installed in '/opt/arminarm/*' on the Raspbian SD card. The next step shouldn't be necessary, but if you get complaints that 'arm-none-eabi-something' can't be found, you'll have to tell Raspbian where to look for it:

    export PATH=$PATH:/opt/arminarm/bin
    

    If you want Raspbian to remember this path permanently, you may want to add it to the .bashrc file in your home directory. Put the same line as above at the end of the file, without the 'export'.

    The toolchain is now covered. Next get the latest Espruino from github, and step into the Espruino directory.

    git clone https://github.com/espruino/Espruino
    
    cd Espruino
    

    At the moment the "fully fledged" .bin file is a little bit too big to be uploaded to the Espruino. The toolchain Gordon is using probably handles "O3" optimization better than mine. One way to fix this is to optimize for size. Gordon mentions in aforementioned topic that save() doesn't work in this case, which is unfortunate. I'm hoping to learn more about that specific compiler Gordon is using.

    In the Makefile, search for "else ifdef ESPRUINO_1V3". This is where the compile flags and vars are set for the Espruino board. Currently, that's on line 101. The vars for the next board (OLIMEXINO_STM32) start at line 111 (so that's 10 lines below where it starts).

    The line before the OLIMEXINO_STM32 one (line 110, the last line for the Espruino board) says:

    OPTIMIZEFLAGS+=-O3
    

    Change the "-O3" part into "-Os"

    OPTIMIZEFLAGS+=-Os
    

    If you insist on being able to use save(), you could also still use "-O3" and comment out one or more of the "USE_NET", "USE_GRAPHICS", or "USE_FILESYSTEM" vars, whichever you don't intend to use.

    Save the Makefile. We're ready to build and upload in a single step:

    ESPRUINO_1V3=1 RELEASE=1 make serialflash
    

    This would be a good moment to put the Espruino board into bootloader mode. Press and release the RST button while holding BTN1. The blue LED will fade in and out.

    The compiling is done in a couple of minutes. The last step takes the longest. It will say 'LD espruino_1v67_espruino_1r3.elf' (or whatever version number is the current one) and seems to hang. It's not hanging, it's just really busy. So busy that it keeps quiet for about 5 minutes.

    After that, it'll show that it's uploading a lot of bytes and reading them back in. When you're back on a commandline prompt, the latest version of Espruino is uploaded to your board and ready to go!

    Press the reset button on the Espruino board, and start minicom:

    minicom -D /dev/ttyACM0 -b 9600 
    

    Or screen. Whatever blows your skirt up.

    screen /dev/ttyACM0 9600
    

    Please let me know if you run into trouble.

  • in General
    Avatar for arminarm

    Having the board file + edits in the Makefile in your repo will still make my life (a lot) easier. Thanks! :)

    I'll try and do a how-to tonight.

  • in General
    Avatar for arminarm

    Thanks for your comments.

    Sure, I'll do a cleanup and a pull request. Does that mean you're going to compile the ARMinARM version and distribute it together with versions for other boards? That would be awesome and make my life a lot easier. The reason for the fork and download scripts for the precompiled .bin I provide is that I didn't want to bother you with it. I figured you'd have a lot of work when half the world and their mother decides to sell boards that also run Espruino. You're making this too easy :)

    If you don't mind I'll wait a few weeks when I'm 100% sure these boards are actually going out to people. I'm only 99.99% sure now, but in it for the long run, so no rush. And I don't want you to be doing any work for nothing. By that time I may have also had the chance to have a better look at how to build the documentation. The pinout in the .py file are still the pins I copied from the Espruino board file, and do not match the ARMinARM board.

    I had to build the toolchain for the Raspberry Pi myself. It's based on the Yagarto toolchain. The build scripts can be found here: https://github.com/ARMinARM/arm-toolchai­n-build-scripts
    That takes ~20 hours to build on a Raspberry Pi (I really should be cross compiling this), so there's a precompiled version here: https://github.com/ARMinARM/arminarm-bin­
    It's downloaded and installed by the script files here: https://github.com/ARMinARM/arminarm ('install_toolchain.sh' in the bin directory, which is called by the 'setup' menu)

    I'll make a post about how to compile a nightly build of Espruino on the Raspberry Pi in more detail when I get the chance (soonish).

    Good point about the other cool stuff about Espruino. The website is in its early stages as well, so for now I was hoping people will look on the Espruino website for details (and maybe even buy an Espruino board, that'll be good). I will definitely add the 'espruino_command.py' script though, and write something about it. Because that is indeed very cool.

  • cli

    in General
    Avatar for arminarm

    This is awesome!

    I just posted a topic here: http://forum.espruino.com/conversations/­1642/ to say hi and thank you to Gordon. Hi and thank you to you too!

    I forked your repo here: https://github.com/ARMinARM/esp-cli/tree­/arminarm (you may have already seen that on your github dashboard).

    Notice how I had to hack around a little, to make esp-cli recognize /dev/ttyAMA0. I basically changed the search for available serial ports to 'connect('/dev/ttyAMA0');'. I never thought that was going to work, but it did and here we are :-)

    Is there a way to stay closer to your original version, and add '/dev/ttyAMA0' to a search path or some such? I didn't find that where I was looking for it (obviously the wrong place).

    For you as well; if you think I somehow misrepresented you, please let me know (also check the Espruino page on http://www.onandoffables.com).

    Thanks again!

  • in General
    Avatar for arminarm

    Hi,

    I'm working on an STM32 breakout board for the Raspberry Pi. It's called "ARMinARM", and it also runs Espruino (next to CMSIS and libopencm3 examples, eLua and libmaple so far). One of the goals was to have everything (code editing, compiling, uploading and debugging) done on the Raspberry Pi without the need for extra debugging hardware or Windows computers. Also be compact, sturdy and hackable.

    The project page is here: http://www.onandoffables.com
    The ARMinARM branch of Espruino: https://github.com/ARMinARM/Espruino/tre­e/arminarm (pins for documentation and images not updated (yet))

    I really love how easy it was to port Espruino over. Basically just copying a .py file and changing some variables. Good work on that! :-)

    Unfortunately chromium isn't able to run the webIDE on the Raspberry Pi. All the ARMinARM specific tools that I make available for the Raspberry Pi are commandline based, so it's not weird to use gzip's awesome esp-cli commandline tool to communicate with Espruino. I will post a 'thank you' in his topic as well.

    Please let me know if you (Gordon) feel if I somehow misrepresented you or Espruino. I would hate it if that happened.

    Anyway, just saying 'hi' and a big 'thank you'! Event based programming on a microcontroller makes so much sense! And I love the Espruino kickstarter board :-)

Actions