Project

General

Profile

Actions

Bug #6026

closed

simtrace2 cardem firmware stops card communication early

Added by dexter 12 months ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/09/2023
Due date:
% Done:

100%

Spec Reference:

Description

The latest (08052023) version of the simtrace cardem firmware seems to be broken. The card communication seems normal at first but then suddenly stops early.

Attached one finds two firmware images:
Latest firmware from 08.05.2023: simtrace-cardem-dfu-latest.bin (does not work)
Firmware image from last year: simtrace-cardem-dfu-0.8.1.33-9088.bin (works, even with current master host utils)

$ simtrace2-cardem-pcsc -V 1d50 -P 60e3 -C 1 -I 0 -H "2-1" -n 2
simtrace2-cardem-pcsc - Using PC/SC reader as SIM
(C) 2010-2022, Harald Welte <laforge@gnumonks.org>
(C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon <kredon@sysmocom.de>

DLINP NOTICE [0] <= osmo_st2_cardem_request_config(features=00000001)
DLINP NOTICE [0] <= osmo_st2_cardem_request_card_insert(inserted=1)
DLINP NOTICE [0] <= _modem_sim_select(remote_sim=1)
DLINP NOTICE [0] <= osmo_st2_cardem_request_set_atr(3b 9f 96 80 1f c7 80 31 a0 73 be 21 13 67 43 20 07 18 00 00 01 a5 )
DLINP NOTICE [0] <= _modem_reset(asserted=2, pulse_ms=300)
Entering main loop
DLGLOBAL NOTICE => IRQ STATUS: flags=0x13, fi=1, di=1, wi=10 wtime=9600 (RESET VCC CLK )
DLGLOBAL NOTICE => IRQ STATUS: flags=0x3, fi=1, di=1, wi=10 wtime=9600 (VCC CLK )
DLGLOBAL NOTICE Warm Resetting card in reader...
DLGLOBAL NOTICE => PTS req: ff 10 96 79 
DLGLOBAL INFO => DATA: flags=0x01 (HDR ), 00 a4 00 04 02 
 DLINP DEBUG [0] <= osmo_st2_cardem_request_pb_and_rx(pb=a4, le=2)
DLGLOBAL INFO => DATA: flags=0x02 (FINAL ), 3f 00 
 DLINP DEBUG [0] <= osmo_st2_cardem_request_sw_tx(sw=6156)
DLGLOBAL INFO => DATA: flags=0x01 (HDR ), 00 c0 00 00 56 
 DLINP DEBUG [0] <= osmo_st2_cardem_request_pb_and_tx(pb=c0, tx=62 54 82 02 78 21 83 02 3f 00 a5 19 80 01 71 83 02 7f ff cb 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 ca 01 82 8a 01 05 ab 1b 84 01 2e 90 00 84 01 88 a4 06 83 01 01 95 01 08 84 01 fc a4 06 83 01 0a 95 01 08 c6 0f 90 01 70 83 01 01 83 01 0a 83 01 0b 83 01 81 , len=86)
DLINP DEBUG [0] <= osmo_st2_cardem_request_sw_tx(sw=9000)
DLGLOBAL NOTICE => IRQ STATUS: flags=0x13, fi=9, di=6, wi=10 wtime=9600 (RESET VCC CLK )
DLGLOBAL NOTICE => IRQ STATUS: flags=0x12, fi=9, di=6, wi=10 wtime=9600 (RESET CLK )
DLGLOBAL NOTICE => IRQ STATUS: flags=0x10, fi=9, di=6, wi=10 wtime=9600 (RESET )

Files

Actions #1

Updated by mschramm 11 months ago

'latest' is 0.8.1.61-f52b .

Actions #2

Updated by dexter 11 months ago

I have now tried to narrow down the problem. Unfortunately the problem is somehow LLVM related. When I checkout the commit [1] where USE_CLANG was introduced the problem is still persistent. When I compile with GCC, then cardem works as expected, even with current master.

My best guess here is that the firmware crashes after the first transaction and that this is the reason why simtrace2-cardem-pcsc stops.

We now have two options here: We could add options to the makefiles that allow us to build cardem with GCC. This could be a quickfix to get working latest/nightly firmware binaries again. However, I assume that we have decided to use LLVM for a reason and that we should debug this properly.

I was using arm-none-eabi 7.3.1 and arm-llvm 14.0.0
[1] a65fb1e319ad71d576729019c0f25b087644d136 clang build support

Actions #3

Updated by laforge 11 months ago

I think the bootloader was the only part that really needed a llvm build. So let's build the apps with gcc?

Actions #4

Updated by mschramm 11 months ago

laforge wrote in #note-3:

I think the bootloader was the only part that really needed a llvm build.

Yes, it was #5260 .

Actions #5

Updated by Hoernchen 11 months ago

As of f52b8b1a2ec89af712eaedd7e25077f432236308:
works with Os:

PATH=$PATH:/work/octsim/osmo-ci/scripts:/work/octsim/arm-none-eabi/bin:~/embedded/LLVM-embedded-toolchain-for-Arm/install-13.0.0/LLVMEmbeddedToolchainForArm-13.0.0/bin  MAKE=make PARALLEL_MAKE=-j8 USE_CLANG=1 BOARD="simtrace" APP="cardem" OPTIMIZATION="-Os" make

broken with Oz, which is currently default:

OPTIMIZATION="-Oz" make

Probably timing related.

Actions #7

Updated by Hoernchen 11 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)