15 Commits
Author SHA1 Message Date
Alexander Couzens f5eead56eb simtrace2-cardem-pcsc: use new API osmo_apdu_segment_in2() to fix GP GET DATA
The old osmo_apdu_segment_in() could not parse GP GET DATA correctly
and will fail when parsing a GP GET DATA case 2 with an Le != 0.

Related: SYS#8147
Change-Id: Id5642cb76da4fcbcdd318d41691415781bf0bc50
2026-08-20 16:51:09 +02:00
Alexander Couzens bed4704377 contrib/jenkins.sh: pin libosmocore to the last release
Ensure the libosmocore version doesn't move while building
firmwares which are published.
This improve reproducible builds.

Change-Id: I753d634674f76c50e1a9cf67e5adc43201d54f0c
2026-08-19 15:49:19 +00:00
Alexander Couzens 63a61bfdaf Add osmo_apdu_segment_in2() to ensure correct parsing of GP GET DATA
osmo_apdu_segment_in() doesn't have the context of the previous APDU,
for nearly all calls this is fine, except for GP GET DATA, which can be
a case 2 or case 4 APDU.
GP GET DATA defines the Le field as 0x00 which is used by osmo_apdu_segment_in
to detect if it is a case 2 or case 4.
However a card can respond with the SW 6cXX, which means the previous
command must be resend with a Le field XX, which got misinterpreted by
the osmo_apdu_segment_in() as a case 4 resulting in a timeout waiting for
more data.

Modem <-> Card
81cadf2000 ->
 <- 6c0b
81cadf200b ->
 -- Simtrace waits for more data because it wrongly decodes it as APDU case 4
    instead of case 2.

Related: SYS#8147
Change-Id: Ie238662e7e6a10dd4283ede0c8d8d73bc375c247
2026-08-18 15:31:43 +00:00
Alexander Couzens 9f85d1e15b cosmetic: fix typo in comment
Change-Id: I7df27ebf9137ca60d6d7cd45dcf1be2d766c4f44
2026-08-18 11:22:54 +00:00
Alexander Couzens f1deb81434 firmware: Drop CEMU_TX_DATA when emulated sim is in-active
When the emulated sim is in reset or without power, drop
CEMU_TX_DATA.

Change-Id: I796e548225a742cddfde12bd6a60e4d2e5c04c8f
2026-08-12 17:12:12 +02:00
Alexander Couzens 889b8d8927 cosmetic: fix typo in comment
Change-Id: I85939afd424c957ae872fa99f40b9cd528375537
2026-08-07 16:01:43 +02:00
Alexander Couzens 567c03c83f firmware: card_emu.h: declare usb_buf_upd_len_and_submit()
usb_buf_upd_len_and_submit() is already a non-static function and should be
accessible.

Change-Id: I734d4b2d782223dd2f735f140d8c9bc6fc00a086
2026-07-14 18:24:44 +02:00
Alexander Couzens 1b43e1db48 firmware: card_emu.h: add missing header stdbool.h.
Change-Id: I4ad6d5cf0b4477cbd5f761d70c4cd92fb3ca1fcd
2026-07-14 18:24:15 +02:00
Alexander Couzens 01f36081fc README.md: describe the debug uart
Change-Id: I4cf929fded962e7ffb4c01628279385b2af04157
2026-07-14 18:24:10 +02:00
Alexander Couzens 7949165a4a README.md: fix typo in firmware
Change-Id: I16721418fce55322c8730920ceaa4e65f91a8a7e
2026-07-11 20:06:22 +02:00
Alexander Couzens f9885fe019 simtrace2-cardem-pcsc: allow to set sim presence polarity
Add api call osmo_st2_cardem_request_config2(struct cardemu_usb_msg_config *)
which contains a full cardemu_usb_msg_config.

Related: SYS#6946
Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59
2024-06-23 18:47:42 +02:00
Alexander Couzens ec9b0b5254 firmware: allow to change the sim presence pin polarity
The sim presence pin allows the simtrace2 to inform the modem
about the presence of the simcard. On a generic simcard slot a
button is pressed by the simcard which generate a high or low voltage level.
Even though there are specifications of minipcie or ngff defining this signal, certain
modems behave different.
Certain modems require different signals from the specification.

Extend the usb protocol to set the behaviour at runtime.

Related: SYS#6946
Change-Id: I77118114ba873fdf0778137402888b40f2442456
2024-06-23 18:47:40 +02:00
Alexander Couzens 0cd501ef80 dissector: add support for sim polarity
Needs testing.

Related: SYS#6946
Change-Id: If3ae350d0f4d737bc9e80c4f5d73cc1a39d076af
2024-06-13 23:58:44 +02:00
Alexander Couzens d405133672 ngff_cardem: cosmetic: fix superflous space
Change-Id: Ib155d5778a0df7865958ab65fe2ce48b44f4326d
2024-05-22 15:09:23 +01:00
Alexander Couzens 2ceba0fdc4 firmware: usb: call USBD_HAL_DISCONNECT while usb init to recover from resets
The firmware doesn't recover from a OSMO_ASSERT() which direct reset the board.
After the reset the firmware will waits forever for the USBD state USBD_STATE_CONFIGURED.
By adding the explicit USBD_HAL_DISCONNECT the board always recovers.

Fixes: OS#5478
Related: SYS#5752
Change-Id: I600a26025166d20b6b27c191f24e4023efdaadf6
2022-03-09 07:21:01 +00:00