Building from source with BOARD=PICO_R1_3

Posted on
  • 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 edit

    Is there something missing in my strategy?

    When I flash the official release firmware .bin file, it works fine.

  • make

    • add RELEASE=1
    • remove DFU_UPDATE_BUILD=1 because this is for BLE boards

    flash

    • use WEBIDE to flash the new firmware
    • use WEBIDE to communicate with the board
  • @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.

  • Just a few hours later and some perseverance and I got it working =) . The method under Linux is:

    make clean && BOARD=PICO BOOTLOADER=1 make
    

    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:

    sudo dfu-util -a 0 -s 0x08000000 -D bootloader_espruino_2v08.5_pico_1r3.bin
    

    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:

    make clean && BOARD=PICO make serialflash
    

    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)

    picocom --baud 9600 --flow n /dev/ttyACM0
    

    Then press Ctrl+C once.

    This will spawn a terminal with which to send Javascript commands and functions to the espruino.

  • Glad you got it sorted! This doesn't seem to be too well documented...

    Just for anyone else looking, it's the -s 0x08000000 that got you - since that overwrites the bootloader.

    make clean && BOARD=PICO RELEASE=1 make flash
    

    Calls st-flash not dfu-util for some reason, but it does choose the right base address so you can write directly without getting rid of the bootloader.

    Or scripts/create_pico_image_1v3.sh will create the full binary (Espruino & Bootloader) which you can write to 0x08000000

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Building from source with BOARD=PICO_R1_3

Posted by Avatar for user66772 @user66772

Actions