You are reading a single comment by @cephdon and its replies. Click here to read the full conversation.
  • OK. I finally figured out how everything has to work and I got a new version of the Espruino software on the v1.3 device from a compile on OSX.

    Here is what I did:
    1) Get the prebuild OSX GNU ARM Tools 4.8 from here: https://launchpad.net/gcc-arm-embedded. I updated my patch to place the binaries at the front, you could also update the makefile as described in other tutorials. How you do that is up to you.

    2) Install CoreUtils from macports or something. I issued the command sudo port install coreutils to get it. You will need it for 'gdu' to get the size of the resulting binary. 'du' on OSX does not have a '-b' option to get the size of a file in bytes. Installing coreutils will get you a binary named gdu that does have that option (the name was changed to not conflict with system binaries).

    3) The file named scripts/check_size.sh will need to be modified. Simply change du to gdu to get it working, then save the file.

    4) -Wl,--gc-sections: There is a variable named MACOSX in the Makefile. This variable is set to '1' if we are building on Darwin. One of the consequences is that -Wl,--gc-sections is not applied if we are cross compiling. This is the source of the problems when compiling on OSX. The spirit seems to be to detect if we are building native on OSX and do something special for it. To Fix this issue, do the following:
    remove:

    ifeq ($(shell uname),Darwin)
    MACOSX=1
    endif

    from the top and merge it with the ifndef located in the linux section so that it looks like this:

    else
    BOARD=LINUX
    LINUX=1
    USE_FILESYSTEM=1
    USB=1
    USE_GRAPHICS=1
    ifeq ($(shell uname),Darwin)
    MACOSX=1
    else
    USE_LCD_SDL=1
    # http libs need some tweaks before net can compile
    USE_NET=1
    endif
    endif

    Note that I moved USE_LCD_SDL into the else section above. Without it, native builds fail. It happens on OSX and I noticed that it happend on the build server. At least for me, that is because I don't have libSDL installed, but I probably wouldn't be using it when on my OSX box anyway.

    5) plug-in your board to the computer and find out the serial port name. I use the WebIDE for that, just hit refresh if it doesn't show up right away. Then update the Makefile and find the location that says something like:
    STM32LOADER_FLAGS+=-k -p /dev/ttyPortName

    I just search for the word STM32LOADER_FLAGS then replace the /dev/portname with the name of the port where your device is located. Mine was /dev/tty.usbmodemfa121.

    6) In the Espruino directory, issue the command ESPRUINO_1V3=1 Release=1 make to build the software for the Espruino boards. After the build completes, you should see something like this:

    LD espruino_1v52_espruino_1r3.elf
    GEN espruino_1v52_espruino_1r3.lst
    GEN espruino_1v52_espruino_1r3.bin
    bash scripts/check_size.sh espruino_1v51_espruino_1r3.bin
    PASS - size of 214504 is under 215040 bytes

    7) Now to flash your board, issue the following command at the command prompt: ESPRUINO_1V3=1 Release=1 make serialflash

    Your board will get updated and the next time you connect you will be running on new software.

About

Avatar for cephdon @cephdon started