Skip to content
bodziow edited this page Jan 22, 2017 · 8 revisions

simlabTrace

simlabTrace is a software (firmware) for the SIMtrace hardware based on AT91SAM7.
Please see http://bb.osmocom.org/trac/wiki/SIMtrace for more details about the SIMtrace.
The firmware consists of two separate modules:

  • SIM forwarder (to be used with simLAB software)
    Implements a CDC driver (USB Communication Device Class) to communicate with a mobile phone connected to the SIMtrace hardware using Flex-PCB cable. The communication between the SIMtrace and the mobile phone takes place on the USART/ISO7816 interface. Data from the USART interface are forwarded via USB to the PC (both ways). A program called simLAB can handle such communication on the PC side and allows modification of APDU exchanged between a mobile phone (Mobile Equipment) and a SIM card. The SIM card should be connected using any external Smart Card Reader (should NOT be inserted into the SIMtrace slot). The simLAB application is responsible for routing the communication between the card reader and SIMtrace hardware (mobile phone).
    simlabTrace - forwarder
  • SIM reader
    Implements a CCID driver (USB Chip/Smart Card Interface Devices) to communicate with a SIM card inserted. It acts as a regular USB card reader.
    simlabTrace - reader

The project is a fork of Tom Schouten's (zwizwa) project (contains many bug fixes and improvements): https://github.com/zwizwa/at91work/tree/apdu_phone which in turn is based on OsmocomBB project:
git://git.gnumonks.org/at91work.git
git://git.osmocom.org/openpcd

Getting the hardware

Getting the firmware

Download pre-compiled firmware

Building the firmware (under Linux)

Each of mentioned modules (reader and forwarder) is placed in a separate directory and has its own Makefile.
The procedure of compiling and flashing firmware is the same for both modules and will be described based on the SIM forwarder part.
To get the simlabTrace repository:
git clone https://github.com/kamwar/simlabTrace.git

1. Getting GNU Toolchain for ARM
We need a GNU ARM toolchain to compile our firmware.
The toolchain can be build using the procedure described on the following page:
http://bb.osmocom.org/trac/wiki/GnuArmToolchain
You can also used some pre-compiled toolchains but not all of them may produce a working firmware.
The latest tested/working version of GCC is 4.8.2.

2. Compiling the firmware

$ cd simlabTrace/sim_forwarder
$ make

The output firmware will be placed in the 'bin' directory (as .bin and .elf file).

Flashing the firmware over USB

SIMtrace usually comes with the DFU bootloader (Device Firmware Upgrade) already installed. In case of problems with DFU on the device please use the SAM-BA bootloader as it is described on: http://bb.osmocom.org/trac/wiki/SIMtrace/Firmware

1. Install dfu-util - the host (computer) side of the USB DFU protocol.
$ sudo apt-get install dfu-util
You can also visit the http://dfu-util.sourceforge.net/ website for more details.

2. Enter DFU mode
Press the BOOTLOADER button while plugging in the USB to flash the device using DFU. The red LED should turn on.

3. Flash the device
Use the following command (from sim_forwarder dir):
$ sudo dfu-util -d 16c0:0762 -R -a0 -D bin/sim_forwarder-simtrace-at91sam7s128-flash_dfu.bin

No warranty

The program is provided "as is" without warranty of any kind.

Credits

Main contributors:

  • Kamil Wartanowicz
  • Szymon Mielczarek