Failing to FLASH my program onto PUCK

Posted on
  • I hand soldered accelerometer/gyro chips to MDBT42 modules, mount them on my cycling shoe, stream the motion data to Android and iPhone apps recording and displaying cadence and foot angles. I wrote the MDBT programs with Arduino sketch and programmed them with ST-Link V2. Rather than continue building my own hardware I thought I'd use PUCK.
    Using Chrome I can successfully flash espruino onto my PUCK (I want to be able to restore the PUCK to it's original function). When I try flashing my program I simply get an error message "Sorry, the firmware update has failed." Using Android DFU update I can flash espruino, but again my firmware fails.
    I first tried flashing to my hand-wired boards years ago when I had found an nrfutil.exe Windows program that appeared designed to create downloadable zip files for just this purpose. This nrfutil program displays package information for both the espruino zip file and my own zip file.
    This might be enough information for someone to realize that I'm trying something impossible. If this is actually something that is supposed to work I can provide more detail.
    Here is an overview of my project:
    https://bicyclepedalmonitoring.blogspot.­com/2022/04/introduction.html

  • It is probably about SoftDevice/SDK/bootloader version. Espruino is using SDK12 and SoftDevice S132 3.x. If Arduino is using different version (which is quite likely) you need to first have DFU package for upgrading/downgrading SoftDevice+Bootloader before you can upload application DFU zip. Depending on your skills making this SoftDevice+Bootloader zip may be "something impossible" and using ST-Link with Puck instead of uploading DFU may be easier.

  • Also it is much harder if arduino DFU bootloader is at different location - this then needs also change in UICR and is almost impossible to do OTA. If you wish you can upload full hex of your code that you would flash with st-link to blank device - from that it is possible to extract softdevice and bootloader and check the location of bootloader. If is is the same as in espruino then making the upgrade zip package is just using nrfutil with parts from the hex file.

    EDIT: if you have nrfutil installed in linux it also installs commands like hex2bin.py hex2dump.py hexdiff.py hexinfo.py hexmerge.py so it is actually enough to post output of hexinfo like this

    $ hexinfo.py bin/espruino_2v19.690_amiibolink.hex
    - file: 'bin/espruino_2v19.690_amiibolink.hex'
      entry: 0x1000F401
      data:
      - { first: 0x00000000, last: 0x00000963, length: 0x00000964 }
      - { first: 0x00001000, last: 0x0001EBEF, length: 0x0001DBF0 }
      - { first: 0x0001F000, last: 0x00057A5F, length: 0x00038A60 }
      - { first: 0x00078000, last: 0x0007CE43, length: 0x00004E44 }
      - { first: 0x0007E000, last: 0x0007E323, length: 0x00000324 }
      - { first: 0x0007F000, last: 0x0007F323, length: 0x00000324 }
      - { first: 0x10001014, last: 0x1000101B, length: 0x00000008 }
    

    from that it is clear. Also the hexmerge.py can extract parts like this hexmerge.py -o bootloader.hex bin/espruino_2v19.690_amiibolink.hex:0x0­0078000:0x0007CE43 so that you can make bootloader hex usable for nrfutil pkg generate

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

Failing to FLASH my program onto PUCK

Posted by Avatar for user157087 @user157087

Actions