Kévin Redon
50d071fb0e
sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU)
...
Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a
2018-07-03 16:15:58 +02:00
Kévin Redon
36be182ea2
sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture
...
Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961
2018-07-03 16:10:04 +02:00
Kévin Redon
05cc8bd36a
sniffer: display F and D values frim PPS
...
Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0
2018-07-03 15:57:03 +02:00
Kévin Redon
f9f1261c18
sniffer USB: implement USB communication and send parsed messages
...
Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b
2018-07-01 18:33:28 +02:00
Kévin Redon
0c9079f1ae
USB: add central file to define USB IDs, classes, and endpoints
...
Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f
2018-07-01 18:33:28 +02:00
Kévin Redon
cb700ef087
reintroduce adc2uv used in boardver_adc.c and mode_cardemu.c
...
Change-Id: I52e3919adfd1d888eb130b5ec9298315c4e507c9
2018-07-01 18:33:28 +02:00
Kévin Redon
6123460055
sniff: add WT timeout detection using USART timeout (TC is not required)
...
Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c
2018-07-01 18:33:28 +02:00
Kévin Redon
15a3384e9a
sniff: add TPDU parsing (TPDUs become APDUs on the upper layer)
...
Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347
2018-07-01 18:33:28 +02:00
Kévin Redon
f40c10d2f2
sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed)
...
Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e
2018-07-01 18:33:28 +02:00
Kévin Redon
10553e7f0c
update_fidi: remove debug output since this function is called in time critical ISR
...
Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559
2018-07-01 18:33:28 +02:00
Kévin Redon
216a2149e1
sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update
2018-07-01 18:33:28 +02:00
Kévin Redon
ae1ce57d4c
ISO7816: change update_fidi to use provided USART, and disable write protection for USART register if required
2018-07-01 18:33:28 +02:00
Kévin Redon
915f1636b0
sniffer: add state definitions, improve IRQ handling, update pins configuration
2018-07-01 18:33:28 +02:00
Kévin Redon
7ddf46ce1c
sniff: use USART 0 instead of USART 1
...
Use USART 0 connected to the SIM card side to sniff the communication.
The card side can also measure ETU times.
Do proper pin initialization.
This code can already capture the ATR communication between phone and card.
2018-07-01 18:33:28 +02:00
Kévin Redon
aa70887ce0
sniff mode: handle USART 1 RX interrupt to show sniffer data
2018-07-01 18:33:28 +02:00
Kévin Redon
7bcbae3ad9
enable (empty) sniffer support for SIMtrace board
2018-07-01 18:33:28 +02:00
Harald Welte
9d90d284ed
Use system include <foo.h> notation for libosmocore headers
...
the curent local copies of libosmocore headers + source is a temporary
hack anyway. We should instead rely on a system-wide install of
libosmocore cross-compiled for arm-none-eabi. But leave that as a
second (later) step beyond this patch.
Change-Id: Ia63fd842d45a2b404233b4326050e7eda0604cf0
2018-06-29 22:26:57 +02:00
Kévin Redon
f5869d4a59
USB: implement USB reset by setting the on-board pull-up on D+ low
2018-06-29 20:07:31 +02:00
Kévin Redon
a93f7273b3
fix: remove duplicate volatile declaration
2018-05-21 17:17:20 +02:00
Harald Welte
af616ec4e2
CCID driver: Use USBD_GetDriver() instead of non-initialized state variable
2017-11-29 00:45:23 +01:00
Harald Welte
6051e126da
CCID: re-enable control request handler for CCID class requests
2017-11-29 00:26:34 +01:00
Harald Welte
75cf93e04d
rename ccid.c to mode_ccid.c to align with mode_cardemu.c
2017-11-28 23:00:40 +01:00
Harald Welte
0633b25974
iso7816_4: Re-trigger watchdog while waiting for character
2017-11-28 22:47:09 +01:00
Harald Welte
ed75c62acf
{ccid,sniffer}.c: Add comments on USB callbacks
2017-11-28 21:23:12 +01:00
Harald Welte
5c081911a9
remove dead code (source/phone.c), superseded by card_emu.c/mode_cardemu.c
2017-11-28 21:21:50 +01:00
Harald Welte
5e6e8dcbde
Make build of CCID code succeed again on BOARD=simtrace
2017-11-28 20:58:06 +01:00
Harald Welte
ba2ad563cc
fix build of APP=cardem on BOARD=simtrace
2017-11-28 19:49:41 +01:00
Harald Welte
fc87c24326
mode_cardem: Build on platforms without WWAN_PERST suppotrt
2017-11-28 19:17:27 +01:00
Harald Welte
f231541601
Fix typos in usb.c, llist_irqsafe.h and dfu.h
2017-11-28 19:16:57 +01:00
Harald Welte
119624f46f
WIP: use local_irq_{save,restore}()
2017-11-04 12:28:30 +01:00
Harald Welte
7b36306113
[firmware] WIP: make talloc irq-safe
2017-11-04 12:17:09 +01:00
Harald Welte
965d5c918a
[firmware] cardemu: Skip CARD_INSERT if board doesn't support it
2017-11-03 20:48:11 +01:00
Harald Welte
c47fc5febf
set local slot LED according to remote/local state.
...
The LED is illuminated as long as the slot is in local (physical SIM
card) mode.
2017-05-20 14:46:57 +01:00
Harald Welte
3b646955b9
Fix swapped manufacturer/product strings
...
the */usb_strings.txt files always assumed that the first line is the
manufacturer string, followed by the product string in the second line.
However, the enum strDescNum had it the other way around. Let's fix it
by adjusting the enum to reality.
Fixes: SYS#3591
2017-05-14 23:15:11 +02:00
Harald Welte
23c00b6ad3
cardemu: Fix interpretation of MSGC_MODEM messages
...
msg->l2h should always point at the first byte of the header after the
generic simtrace header. For some reason this doesn't work if used
globally, but it is required for the MSGC_MODEM messages to be
interpreted correctly.
2017-05-11 01:11:43 +02:00
Harald Welte
b91f6ad848
firmware: fix various compiler warnings
2017-05-10 23:20:50 +02:00
Harald Welte
5c583d3535
Generalize SIM switching code and allow local/remote switching via USB
2017-05-09 13:24:28 +02:00
Harald Welte
2e9254ac3f
cardem: Implement WWAN Modem reset via USB
...
Using the SIMTRACE_MSGT_DT_MODEM_RESET message
2017-05-09 13:24:28 +02:00
Harald Welte
25a9a80ff5
Convert to new generalized SIMTRACE2 USB protocol
...
The current protocol was card-emulation specific. The new protocol is
generic/flexible enough to accommodate both tracing and card emulation,
as well as modem control and other future extensions.
2017-05-09 13:24:23 +02:00
Harald Welte
8e7fca3255
migrate from req_ctx to msgb
...
We now generalize the USB communiction and abandon the 'req_ctx'
structure inherited from openpcd. Instead we use the libosmocore 'msgb'
structure to handle incoming and outgoing USB tranfers. We also use
linuxlist-based msgb-queues for each endpoint.
2017-05-07 23:09:56 +02:00
Harald Welte
6d1128e9d1
QMOD: Add code to determine SIM Card presence
2017-05-05 23:17:27 +02:00
Harald Welte
054216d94d
usb: Use different SubClass values for card-emulation and sniffer
...
This way, host code can dynamically detect which interface supports
which functionality.
The related #defines should be moved to a header file that's shared with
the host application code.
2017-03-06 10:07:17 +01:00
Harald Welte
eab7e456fe
USB: Don't specify Class/Subclass 0xff at device level
...
Actually, at device level we want to specify 0, so we can select
individual Class/Subclass values at Interface values.
Table 9-8 of the USB2 Specification is quite clear about this.
2017-03-06 10:04:56 +01:00
Harald Welte
495a67da7d
usb: consistently use named structure initializers
2017-03-06 09:55:37 +01:00
Harald Welte
2bff7cd9c2
tc_etu: Don't confiugre unused TIOA pin of TC0 + TC2
...
When initializing the TC blocks, let's only configure the GPIO pins TCLK
and TIOB, and not the unused TIOA pin. That pin is actually used for
(separate) different functions in both qmod and owhw.
2017-03-05 22:15:54 +01:00
Harald Welte
c6e482d581
qmod eeprom/i2c: Re-start watchdog while slow bit-banging
2017-03-05 16:24:29 +01:00
Harald Welte
2363fa0327
Generate USB Strings from apps/*/usb_strings.txt files at compile time
...
This way we can skip the manually-crafted USB string definitions in the
dfu_desc.c and usb.c files.
2017-03-05 10:16:25 +01:00
Harald Welte
ee9ebb30da
stdio: Increase max string size to 512 and don't endless-loop!!
2017-03-02 16:52:08 +01:00
Harald Welte
0395bd15b3
move PLLB (for USB) initialization to board_lowlevel.c
...
This way it is present both inside the DFU loader and in the main app.
2017-02-28 01:28:56 +01:00
Harald Welte
c430ac1f2a
have local stdio.h file to avoid newlib issues
...
... we should move to -nostdinc at some point :/
2017-02-28 01:25:12 +01:00