Project

General

Profile

Actions

Flashing » History » Revision 4

« Previous | Revision 4/8 (diff) | Next »
tsaitgaist, 08/13/2018 04:44 PM
use link to automatically uploaded firmware binaries


Flashing

There are several ways to flash firmware images, depending on the image you can to flash.

DFU

SIMtrace 2 comes with a USB DFU bootloader pre-installed which allows to flash the application firmware over USB using the dfu-util utility.

To get dfu-util:

sudo apt-get install dfu-util

To flash the firmware:

sudo dfu-util --device 1d50:PID --cfg 1 --alt 1 --reset --download BOARD-APP-dfu.bin

PID is the USB product ID for the corresponding hardware platform: BOARD is the name of the target board for which the firmware image has been built:

APP is the firmware application name as listed in the firmware section.

You can find pre-built images on the firmware section.

To prevent having to use sudo in order to use dfu-util on SIMtrace 2, grant access permission to the USB device to the current user:

# add current user to plugdev group (user needs to re-login for this change to take effect)
sudo adduser $USERNAME plugdev
# grant access permission to SIMtrace 2 for plugdev group
sudo wget --output-file=/etc/udev/rules.d/99-simtrace2.rules https://git.osmocom.org/simtrace2/plain/host/99-simtrace2.rules 
# reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Forcing DFU

dfu-util should reset the board and start the DFU bootloader.
Try the command a second time if it did not work at first.
If this still does not work, you can force the board to boot the DFU bootloader:
  • on SIMtrace boards keep the BOOTLOADER button pressed while shortly pressing on the RESET button
  • on sysmoQMOD boards short the TX and RX pins next to the micro-controller while powering the board.

If the USB DFU bootloader is missing, defective, or needs to be updated, use the JTAG or SAMBA methods to flash the bootloader firmware.

SAMBA

The SAM3S micro-controller comes with an embedded bootloader called SAMBA, allowing to flash firmwares over USB.
The SAMBA bootloader can be used to flash the DFU bootloader.

To activate the SAMBA bootloader on SIMtrace boards:
  1. short the ERASE pin on the top of the board with the nearby 3V3 pin using a jumper
  2. connect SIMtrace over USB to power it up (no LED will light up) and wait 1 second
  3. remove the jumper shorting ERASE to 3V3
To activate the SAMBA bootloader on sysmoQMOD boards:
  1. connect using an USB to UART adapter to the serial port on the SAM3S micro-controller opposite of the one you want to reflash
  2. the serial configuration is 115200 8N1
  3. enter 'y'
  4. wait 1 second
  5. enter 'Y'
To verifry if the SAMBA bootloader has been started:
  1. using lsusb you should find the following entry:
    ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader
    
  2. using journalctl -f ensure the board has been recognized as USB ACM device:
    kernel: usb 2-2: new full-speed USB device number 4 using xhci_hcd
    kernel: usb 2-2: New USB device found, idVendor=03eb, idProduct=6124
    kernel: usb 2-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    kernel: cdc_acm 2-2:1.0: ttyACM0: USB ACM device
    kernel: usbcore: registered new interface driver cdc_acm
    kernel: cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    
To flash using the SAMBA bootloader:
  1. install the bossac utility to flash using the SAMBA protocol
    sudo apt install bossac
    
  2. download the DFU bootloader firmware image corresponding to your board:
  3. flash the USB DFU firmware using bossac (note: erase ensures no main application remains so to force booting the USB DFU bootloader; boot=1 ensures the micro-controller will boot from the internal flash instead of the embedded bootloader next time it is powered up)
    sudo bossac --port /dev/ttyACM0 --erase --write BOARD-dfu-flash.bin --verify --boot=1
    
    1. using the following firmware image:
  1. to prevent using sudo, grant to current user the permission to access USB serial devices (e.g. /dev/ttyACM0). Note: this change only takes effect after re-logging-in
    sudo adduser $USERNAME dialout
    

Once the USB DFU bootloader is flashed, when re-pluging the SIMtrace 2 device over USB, you can flash the main application firmware using the DFU method.

JTAG

It is also possible to flash or debug SIMtrace boards over JTAG using the ARM 20-pin JTAG header on the top of the board.

To flash the USB DFU firmware using JTAG:
  1. install the JTAG utility openOCD
    sudo apt install openocd
    
  2. flash the USB DFU bootloader firmware
    openocd --file interface/jlink.cfg --file target/at91sam3sXX.cfg --command "init" --command "halt" --command "flash write_bank 0 simtrace-dfu-flash.bin 0" --command "at91sam3 gpnvm set 1" --command "reset" --command "shutdown" 
    
    • replace interface/jlink.cfg with the configuration file for your JTAG debugging adapter
    • at91sam3 gpnvm set 1 ensures the micro-controller will boot from the internal flash (i.e. not from the embedded SAMBA bootloader)

The SAM3S also offers the low pin-count SWD alternative to JTAG, allowing to use an inexpensive ST-Link V2 (clone) to flash (and debug):

openocd --file interface/stlink-v2.cfg --command "set CPUTAPID 0x2ba01477" --file target/at91sam3sXX.cfg --command "init" --command "halt" --command "flash write_bank 0 simtrace-dfu-flash.bin 0" --command "at91sam3 gpnvm set 1" --command "reset" --command "shutdown" 

SWD pinout:

Once the USB DFU bootloader is flashed, when re-pluging SIMtrace 2 over USB, you can flash the main application firmware using the DFU method.

Files (4)
simtrace-jumper-mini.jpg View simtrace-jumper-mini.jpg 66.9 KB tsaitgaist, 07/10/2018 03:37 PM
sysmoqmod-dfu.jpg View sysmoqmod-dfu.jpg 125 KB tsaitgaist, 07/10/2018 03:37 PM
simtrace-board-buttons.jpg View simtrace-board-buttons.jpg 96.7 KB tsaitgaist, 07/10/2018 03:44 PM
simtrace_swd.jpg View simtrace_swd.jpg 49.5 KB tsaitgaist, 07/10/2018 04:06 PM

Updated by tsaitgaist over 5 years ago · 4 revisions

Add picture from clipboard (Maximum size: 48.8 MB)