aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-09-24cardem: ignore set ATRkevin/cardemKévin Redon1-1/+4
the PPS procedure with baud rate change has not been tested. by keeping the default ATR instead of applying the ATR sent by the host software, no other baud rate choice is offered. Change-Id: Ibf7c6b83d2cf68172c7aa25116d838e24a95d5fe
2019-09-24cardem: fix TPDU state checkKévin Redon1-1/+1
this change allows to initialize the TPDU state while in ISO_S_WAIT_TPDU, before actually entering ISO_S_TPDU Change-Id: I505d3add32a43de31499b800bc53442f99f65931
2019-07-18cardem: ensure VCC_PHONE is floatingKévin Redon2-1/+17
this change is mainly relevant for the SIMtrace board, but also affects the others. First we ensure VCC_PHONE is not forwarded to VCC_SIM because the card could affect the signal (card could draw too much current or feed back current in). next we disable VCC_SIM. the card slot does not need to be powered, and the FPF2019 leaks current back to VCC_PHONE, even with forwarding disabled (the reverse current protection only kicks in when VCC_PHONE is briefly shorted to ground, but still leaks 0.6V). enable the ADC channels normally used to measure VCC, even if not used. the dedicated ADC pins leak current when left unconfigured. enabling them puts them in high impedance. Change-Id: If1487c1c191838aaa08b654e49cd31c7180ffc19
2019-07-18cardem: use USART timeout for waiting timeKévin Redon9-118/+295
the reset/ATR handling has been heavily updated/fixed. instead of using the timer counter peripheral to handle the waiting time and corresponding timeout, the USART peripheral internal timeout mechanism is used. this is particularly important for the SIMtrace board since the clock signal is not connected to the timer counter. thus this change adds card emulation support for SIMtrace boards. Fi and Di have been properly rename to F and D since the "i" stands only for an "indicated" value, not the actual value. this does not change the USB protocol (the variable have just been renamed). additional variables store more information about the card capabilities NOTE: it has only be tested for the SIMtrace board Change-Id: Ibcb2c8cace9137695adf5fb3de43566f7cfb93b5
2019-06-13make: only compile source for corresponding appKévin Redon4-2/+13
since simtrace supports multiple application, but currently not at the same time, the feature support is not app specific Change-Id: I98ff92450cc2a247b294d2e15df171f3fe7c5156
2019-06-13cardem: currently simtrace does not support cardemKévin Redon1-1/+1
the SIMtrace board does not support the current card emulation application because this uses a timer counter to handle the timeouts, but on the SIMtrace board this is not connected to the CLK signal Change-Id: Idd09ea534179f0ede705573e1373dbd045c9828a
2019-05-15use simplest ATRKévin Redon1-2/+2
this is the shortest and simplest ATR possible according to the ISO 7816-3 spec. it does not offer any non-default parameters (F, D, WI, ...) Change-Id: I4ff41b5120bcadca652296f9d3691f7606be2bd2
2019-05-14minor: ignore usbstring binaryKévin Redon1-0/+1
Change-Id: I18fc3179f8b7f3f1272d26853007876156fc1e03
2019-05-14make sim switch board specificKévin Redon4-0/+161
the simtrace board uses a bus switch not used on qmod and owhw to switch the SIM between physical and virtual Change-Id: Ieaf2ed4761fc3e04f33f9aac5c04a768c9a6f71e
2019-05-14minor add commentsKévin Redon1-22/+27
this is just to better understand the flow Change-Id: I045286836176da729cc8c863866d6f6aa3836592
2019-05-14rename PIN_PHONE_IO to PIN_USIM1_IOKévin Redon1-2/+2
this matches the naming scheme used for USIM2 Change-Id: I486b14260faec897e8c8698c4b7987bf36492497
2019-05-14better detect VCC and nRST changesKévin Redon1-2/+2
monitoring the state changes of the VCC and nRST lines is required to correctly detect warm and cold reset Change-Id: I72099956332724f84226e1495fdc5a5b1a034695
2019-05-14add ISO 7816-3 library to remsim projectKévin Redon1-1/+1
Change-Id: I99f3fecbc00d2379c3a6dc457b047c6fee41c292
2019-05-14add library providing ISO 7816-3 utilitiesKévin Redon2-0/+221
this will become part of libosmocore since it it common to smart card related projects (such as osmo-ccid-firmware) Change-Id: I3d4c65d137fc4555fcb256443feadd1c695de73d
2019-05-14minor : fix typo in commentKévin Redon1-2/+2
Change-Id: Ie310143fe713a51fa1adf8bf7599374282341f2e
2019-02-07minor: improve debug outputKévin Redon1-2/+2
Change-Id: Ibfc22b95c0be3ac78bd50a40e31cc7d8546d81d9
2019-02-07remsim: use simplest ATRKévin Redon1-3/+1
this ATR does not encode any data and uses all defaults. the lower default speed is also better handled by the hardware. handling faster speeds is upcoming. Change-Id: I5a4f2f94bea1a15aedbef5a6f2f49344387dc11d
2019-02-07minor: move USB debug output from info to debug levelKévin Redon1-24/+24
else it's too nosy while debugging other components, not often used, and break the flow since it does not and a line. Change-Id: I8920ff7c33b4c9fb174bb31a29334a63fcbede43
2019-02-07minor: make debug output only verbose in info levelKévin Redon1-1/+5
the longer output is to fast and often incomplete. the shorter version is enough to view the progress when not debugging. Change-Id: I97bb84da68d1f3bc14fb7c05400edf1748f55460
2019-02-07minor: use same LED pattern for cardem as other opplicationsKévin Redon1-1/+2
Change-Id: I5608c3312b648c0d59f79338ef1f97b6fe08f5b9
2019-02-07minor: updated copyright yearsKévin Redon2-4/+6
Change-Id: I9254b1ddf6436b5a4964b9124a36ae17bfc22886
2019-02-07minor: fix spacingKévin Redon1-2/+2
Change-Id: I2f3127c7b276c9726fd0242e3e29be22f9d6255c
2018-10-25cardem: add more debug information for TPDU stateKévin Redon1-14/+79
this just adds the name of the TPDU state on top of the state number. the ISO state is cleaned up accordingly Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
2018-10-21remsim: fix TPDU response size transmissionKévin Redon1-1/+1
the TDPU response data size can be up to 256. this length cannot be stored in a uint8_t, which would cause the length to become 0, no data being send, and the reader reset the card because of misbehaviour of the card (i.e. no/malformed response leading to the timeout of the waiting time). Change-Id: Iae7671085aaa3115a02d82530dd7a0e7e2d4155e
2018-10-21remsim: update copyrightKévin Redon1-2/+4
Change-Id: Ibcf093877ee53f8446c97bfa50c8370ceda24c53
2018-10-21remsim: add already parsed USB path argument infoKévin Redon1-0/+1
Change-Id: I03de93ebb92b1d1b5004cbe865cdf1fa0b2b23ac
2018-10-13Fix compiler warning: no-return-in-nonvoid-function simtrace2_usb.cMartin Hauke1-0/+1
RPM post-build-checks found some issue and marks these as error: [ 61s] I: Program returns random data in a function [ 61s] E: simtrace2 no-return-in-nonvoid-function simtrace2_usb.c:88 Change-Id: Id16fb7fc4f13176b2b6443af02a5848d8fcfb069
2018-10-12libusb_util.c: Avoid gcc warning about strncpy()Harald Welte1-1/+1
What we're doing is actually legal: We copy the full size of the destination array, and then overwrite the last byte with NUL. However, gcc isn't smart enough to see that: libusb_util.c:162:5: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation] strncpy(out[out_idx].path, path, sizeof(out[out_idx].path)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Let's copy one byte less to make it happy. Change-Id: I30ddacdc73e5245c7c38b92d1e94e39b13fae7d3
2018-09-23debian/control: Add dependency to libpcsclite-devHarald Welte1-0/+1
The host utilities use libpcsclite, and the missing build dependency causes build failures in our nightly OBS builds since commit faf1e88e48c216456bdea6060a623b7c31f07c70 was merged: [ 131s] cc -o simtrace2-remsim simtrace2-remsim.o apdu_dispatch.o simtrace2-discovery.o libusb_util.o -Wl,-z,relro `pkg-config --libs libusb-1.0 libosmocore` -pthread `pkg-config --libs libosmosim libpcsclite` [ 131s] Package libpcsclite was not found in the pkg-config search path. [ 131s] Perhaps you should add the directory containing `libpcsclite.pc' [ 131s] to the PKG_CONFIG_PATH environment variable [ 131s] No package 'libpcsclite' found Change-Id: I29adfc629e5e4ffd0bf8b9035ef9138fe7693d96
2018-09-08owhw: set the right simtrace USB ID in usb2udpKévin Redon1-2/+2
Change-Id: I0b54c2eb98b3fad1e2afaf9b81fbe4518b01fbda
2018-09-06host: clean library dependenciesKévin Redon1-2/+2
remsim also needs libpcsclite `pkg-config --libs libosmocore` and -losmocore are duplicates `pkg-config --libs libosmosim` is equivalent to -losmosim pthread it needed (by most applications) for static compilation LDFLAGS+= allows static compilation when running LDFLAGS="-static" make Change-Id: Ic7bd6f2be074d6f652d4f84f4996c8588ea5f851
2018-09-06owhw: add missing function board_main_topKévin Redon1-0/+8
the board_main_top function was not defined, causing a hard fault when initializing the board Change-Id: Ib92003416648822c4115472992850c592bc4047a
2018-09-06owhw: add missing function board_exec_dbg_cmdKévin Redon1-0/+18
the board_exec_dbg_cmd function was not defined, causing a hard fault on user input Change-Id: I3ecc1f7bdb2484f5a67c36163d33ebc065e4e709
2018-09-06minor: update copyrightKévin Redon6-0/+8
Change-Id: Iafcd029be9b3f8cf2e90f08d5e9802912d6a59b1
2018-09-06minor: fix typo in commentKévin Redon1-2/+1
Change-Id: I3edb50abe93bc8574c9c1f25b34f75dab2e8f0ce
2018-09-06minor: add checks on configurations and functionsKévin Redon1-5/+17
these checks prevent out of bounds access and running unset function pointers. Change-Id: Ida889d40b898fc1ab8b885800431833570fdaafe
2018-09-04qmod: add LED user controlKévin Redon1-0/+21
this is used during board testing Change-Id: I4ccd787f6e307f523821725de158e3c6f1508ee2
2018-09-04EEPROM: fix Wformat compile warningKévin Redon1-2/+2
Change-Id: I86434a46a75f2acc30e20c33edab6dd3f87e052b
2018-09-03qmod: output EEPROM data only on debug level, and add completion outputKévin Redon1-3/+5
the EEPROM byte output was causing data loss on the serial output, resulting is automatic tests failing. instead an end text will be output to detect the end of the procedure. Change-Id: Ib8d3cbd01d0e34432d424355f4fafb24bc5273a1
2018-09-03DFU: fix Wformat compile warningKévin Redon1-1/+1
Change-Id: I8c422d8a709f8311c40d37e1f1f01dcd3a199b6f
2018-09-03stdio: fix detection of malformated format stringsKévin Redon1-8/+18
the error code returned by vsnprintf was ignored, resulting in printing the string from a previous print. Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
2018-08-28stdio: add void 'l' format string qualifierKévin Redon1-13/+16
Wformat requires uint32_t to be used in format string with the 'l' qualifier (l = long = at least 32 bits). this qualifier was not handled before. since on ARM 32-bit int == long we can simply ignore it (stdio already does not support 64-bit data). Change-Id: Ib506a66f68712c6b3eeb5129a39abf47ec86a2a7
2018-08-28UART: switch baud rate to 921600 bpsKévin Redon2-3/+8
the higher baud rate allows for more debugging (without dropping data) and is well supported by USB for UART adapters (this standard baud rate is 8 x 115200). the closest matching integer value is calculated for UART CR. no floating point calculation can be used since this would increase the size of the resulting binary by ~ 2kB (for the softfp). this is not possible for the DFU since it already is close to the maximum size of 16 kB. Change-Id: I82b74f697342d580ccb79ada4715f35f4e8cca86
2018-08-28set main clock for using UART at 921600 bpsKévin Redon5-25/+31
UART baud rate is main clock (MCK) divided by CR*16. The MCK values are chosen >= 48 MHz and <= 64 MHz to have a near integer value CR for a baud rate of 921600 bps. The end MCK frequency between simtrace and qmod differ slightly but are close to 58 MHz. Change-Id: Iaa4a97fc68494c93b9d128503515d88049de506c
2018-08-26tag debian release 0.5.10.5.1Harald Welte1-1/+7
Change-Id: Id6559b1019353815eea9f6653b6560e9a8aab23a
2018-08-26simtrace2-sniff: Fix build with released libosmocore versionsHarald Welte1-0/+13
There's still no released libosmocore defining the GSMTAP_TYPE_SIM sub-types (Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a dated Jul 26, 2018). Let's make sure users don't need an unreleased version of the library if it's only about a few #defines that we can just copy here for backwards compatibility. Change-Id: I2fd9e14873711d60f194bb404420bbfbb0a00f48
2018-08-26Revert "debian/control: Depend on libosmocore >= 0.12.1"Harald Welte1-1/+1
This reverts commit 77ff745ccad6b0dd58e4476c1b82de70f034f7af. libosmocore 0.12.1 is not recent enough, I misread the 'gitk' output. Change-Id: I87a8e5bbb4aea0c991abe5372f840d76f17378eb
2018-08-26debian/control: Depend on libosmocore >= 0.12.1Harald Welte1-1/+1
Only this version includes the GSMTAP_SIM_ATR and GSMTAP_SIM_APDU definitions. Change-Id: I988cad56aed755af416fc7f23822dcf0229dbb7d
2018-08-26v0.5 debian package release0.5Harald Welte1-3/+3
Change-Id: Iaf56c03f966a5dfc8b750d926f0429223aeec54e
2018-08-26Add Debian packaging rulesHarald Welte6-0/+42
Change-Id: Iece115e4dde87bff5dc36286668f50de0abdcb9e