• Okay @Gordon I went through the process and everything goes fine until I connect to the board in the webIDE. I get the following message in the console:

    Uncaught Error: Function "log" not found!
     at line 1 col 9

    I swear I didn't delete the log function :)

    Running something simple like 1+2 returns the correct answer.

    I put a simple text file on the SD card (text.txt) and then tried to read it out (it simply contains the word 'hello') like this:

    >var f = require("fs").readFile("test.txt");
    ERROR: Unable to mount SD card : NOT_READY

    Any tips?

    This is exactly what I did to get to this point:

    git clone -b RELEASE_1V69 https://github.com/espruino/Espruino.git­  espruino_1v69

    The relevant sections of my Makefile look like this:

    else ifdef STM32F4DISCOVERY

    and the boards/STM32F4DISCOVERY.py:

    devices = {
      'SD' :  { 'pin_cs' :  'B12',
                  'pin_di' :  'B15',
                  'pin_do' :  'B14',
                  'pin_clk':  'B13' },

    I then just ran the command make and out popped espruino_1v70_stm32f4discovery.bin (I was expecting a file with a 1v69 version).

    I must say I can't figure out how to use stm32loader.py. With both USB cables plugged into the Discovery board, without jumpers on the GND-PB2 and BOOT0-VDD pin pairs the board is mounted on /dev/ttyACM2.

    Running the following command:

    python scripts/stm32loader.py -k -p /dev/ttyACM2 -evw espruino_1v70_stm32f4discovery.bin

    I end up with the following error:

    Reading data from espruino_1v70_stm32f4discovery.bin
    Can't init. Ensure BOOT0=1, BOOT1=0, and reset device
    Traceback (most recent call last):
      File "scripts/stm32loader.py", line 554, in <module>
        bootversion = cmd.cmdGet()
      File "scripts/stm32loader.py", line 140, in cmdGet
        if self.cmdGeneric(0x00):
      File "scripts/stm32loader.py", line 137, in cmdGeneric
        return self._wait_for_ack(hex(cmd))
      File "scripts/stm32loader.py", line 101, in _wait_for_ack
        raise CmdException("Unrecognised response 0x%x to %s" % (ask, info))
    __main__.CmdException: Unrecognised response 0xff to 0x0

    So instead I use the stlink application as follows:

    • Disconnect power and put jumpers across the GND-PB2 and BOOT0-VDD pin pairs.
    • Connect up the USB ST-Link cable.
    • Run the following command:

      sudo ./st-flash write espruino_1v70_stm32f4discovery.bin 0x08000000

    Everything flashes fine and I can remove the jumpers and restart the board.