blob: dcbafb29ac2a57f69d575f1f709deab3f5ca8018 [file] [log] [blame]
Kévin Redon0828b912018-05-21 19:35:56 +02001This is the source code for SIMtrace 2 firmwares.
Harald Welted8a003d2017-02-27 20:31:09 +01002
Kévin Redon0828b912018-05-21 19:35:56 +02003= Hardware
Harald Welted8a003d2017-02-27 20:31:09 +01004
Kévin Redon0828b912018-05-21 19:35:56 +02005== Micro-Controller
Harald Welted8a003d2017-02-27 20:31:09 +01006
Kévin Redon0828b912018-05-21 19:35:56 +02007The firmware is for Microchip (formerly Atmel) ATSAM3S4B micro-controllers (MCU).
8Product page: https://www.microchip.com/wwwproducts/en/ATSAM3S4B
9Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6500-32-bit-Cortex-M3-Microcontroller-SAM3S4-SAM3S2-SAM3S1_Datasheet.pdf
10
11Note: The SAM3S is now not recommended for new designs.
12It can be replaced by the pin-compatible SAM4S.
13The MCU can be specified using the environment variable `CHIP` (set to `sam3s4` per default) for future MCU support.
14
15== Boards
16
17The SIMtrace 2 firmware supports multiple boards.
18A board defines a given circuit board.
19While compiling the firmware, set the target board using the `BOARD` environment variable (set to `qmod` per default).
20The supported boards correspond to sub-folders under `libboard`.
Harald Welted8a003d2017-02-27 20:31:09 +010021
22Current boards supported are:
Harald Welted8a003d2017-02-27 20:31:09 +010023
Kévin Redon0828b912018-05-21 19:35:56 +020024* `simtrace`: The good old Osmocom SIMtrace PCB with SAM3 instead of SAM7, open hardware.
25* `qmod`: A sysmocom-proprietary quad mPCIe carrier board, publicly available
26* `owhw`: An undisclosed sysmocom-internal board, not publicly available
Harald Welted8a003d2017-02-27 20:31:09 +010027
Kévin Redon0828b912018-05-21 19:35:56 +020028= Firmware
Harald Welted8a003d2017-02-27 20:31:09 +010029
Kévin Redon0828b912018-05-21 19:35:56 +020030== Library
Harald Welted8a003d2017-02-27 20:31:09 +010031
Kévin Redon0828b912018-05-21 19:35:56 +020032The firmware uses the manufacturer provided Software Package (SoftPack) micro-controller library.
33The original library is available at https://www.microchip.com/design-centers/32-bit/softpacks/legacy-softpacks .
34Version 2.1 from 2001 is used: http://ww1.microchip.com/downloads/en/DeviceDoc/SAM3S_softpack_2.1_for_CodeSourcery_2010q1.zip
35The SIMtrace 2 project uses the `libboard_sam3s-ek`, `libchip_sam3s`, and `usb` sub-libraries, saved in `atmel_softpack_libraries` (with local modifications).
36
37Note: SoftPack is the legacy micro-controller library.
38This library is now replaced by the Advanced Software Framework (ASF): https://www.microchip.com/avr-support/advanced-software-framework-(asf) .
39The SAM3S ASF documentation is available at http://asf.atmel.com/docs/latest/sam3s/html/index.html .
40
41== Applications
42
43An application is a specific piece of software with given functionality.
44While compiling the firmware, set the target application using the `APP` environment variable (set to `dfu` per default).
45The supported applications correspond to sub-folder under `apps`.
46
47Current applications supported are:
48
49* `dfu`: The USB DFU bootloader to flash further main appliction firmwares.
50* `ccid`: To use SIMtrace 2 as USB CCID smartcard reader.
51* `cardem`: To provide remote SIM operation capabilities.
52* `trace`: To monitor the communication between a SIM card and a phone (corresponds to the functionality provide by the first SIMtrace)
53* `triple_play`: To support the three previous functionalities, using USB configurations.
54
55== Memories
56
57Firmwares can be run from several memory locations:
58
Harald Welted8a003d2017-02-27 20:31:09 +010059* flash: Run natively from start of flash memory
Kévin Redon0828b912018-05-21 19:35:56 +020060* dfu: Run after a DFU bootloader from an offset after the first 16k of flash (the first 16k are reserved for the bootloader)
Harald Welted8a003d2017-02-27 20:31:09 +010061* ram: Run from within the RAM of the chip, downloaded via JTAG/SWD
62
Harald Welted8a003d2017-02-27 20:31:09 +010063== Building
64
Kévin Redon0828b912018-05-21 19:35:56 +020065A given firmware build is made for a specific combination of an application `APP` running in a certain memory `MEM` on a given board `BOARD`.
66When building using `make`, set the target application using the `APP` environment variable and target board using the `BOARD` environment variable, e.g.:
Harald Welte601e0d32017-03-08 15:33:33 +010067
Harald Welte601e0d32017-03-08 15:33:33 +010068* make APP=cardem BOARD=qmod
69* make APP=dfu BOARD=qmod
70
Kévin Redon0828b912018-05-21 19:35:56 +020071The Makefile will create output files in the format: `bin/$(BOARD)-$(APP)-$(MEM).{elf,bin}`
72
Harald Welte601e0d32017-03-08 15:33:33 +010073The level of debug messages can be altered at compile time:
74```
75$ make TRACE_LEVEL=4
76```
77Accepted values: 0 (NO_TRACE) to 5 (DEBUG)
78
Kévin Redon0828b912018-05-21 19:35:56 +020079= Flashing
Harald Welte601e0d32017-03-08 15:33:33 +010080
Kévin Redon0828b912018-05-21 19:35:56 +020081To flash a firmware image follow the instructions provided in the [wiki](https://projects.osmocom.org/projects/simtrace2/wiki/).