Good morning,
Working with the simtrace2 code cross compiled for an a53 processor and am
running into a few issues. This email summarizes the issues and am wondering if
anybody has either resolved these or has any suggestions. The issues are
* Cross compiling errors with the simtrace2 host tools
* simtrace2-tool run time logging errors
Issue #1 simtrace2-cardem-pcsc.c app
Simtrace2 requires libosmocore. When trying to build the simtrace2 host tools
neither tagged versions of libosmcore 1.5.1 or 1.5.2 will compile correctly.
The only way to get the simtrace2 host tools to compile is to use commit
cfea39ba. Otherwise the following syntax errors occur in the
simtrace2-cardem-pcsc.c app. Is there some magic required to have the simtrace2
host tools compile with a tagged version of libosmocore?
CC simtrace2-cardem-pcsc.o
simtrace2-cardem-pcsc.c: In function ‘update_flags’:
simtrace2-cardem-pcsc.c:94:4: warning: implicit declaration of function
‘osim_card_reset’; did you mean ‘osim_card_open’?
[-Wimplicit-function-declaration]
94 | osim_card_reset(card, cold_reset);
| ^~~~~~~~~~~~~~~
| osim_card_open
simtrace2-cardem-pcsc.c: In function ‘main’:
simtrace2-cardem-pcsc.c:441:23: error: ‘OSIM_MAX_ATR_LEN’ undeclared (first use
in this function); did you mean ‘USB_MAX_PATH_LEN’?
441 | uint8_t override_atr[OSIM_MAX_ATR_LEN];
| ^~~~~~~~~~~~~~~~
| USB_MAX_PATH_LEN
simtrace2-cardem-pcsc.c:441:23: note: each undeclared identifier is reported
only once for each function it appears in
simtrace2-cardem-pcsc.c:611:45: error: ‘struct osim_card_hdl’ has no member
named ‘atr’
611 | osmo_st2_cardem_request_set_atr(ci, card->atr, card->atr_len);
| ^~
simtrace2-cardem-pcsc.c:611:56: error: ‘struct osim_card_hdl’ has no member
named ‘atr_len’
611 | osmo_st2_cardem_request_set_atr(ci, card->atr, card->atr_len);
| ^~
simtrace2-cardem-pcsc.c:441:10: warning: unused variable ‘override_atr’
[-Wunused-variable]
441 | uint8_t override_atr[OSIM_MAX_ATR_LEN];
| ^~~~~~~~~~~~
make: *** [Makefile:465: simtrace2-cardem-pcsc.o] Error 1
Issue #2 simtrace2-tool
Simtrace2-tool has an assertion error in the osmo logging system, perhaps this
is related to the question above about using tagged versions of libosmocore.
When trying to use the built version of simtrace2-tool the following stack
track occurs:
$ simtrace2-tool -V 1d50 -P 60e3 -C 2 -I 0 -S 0 -A 10 modem sim-switch local
(C) 2019 Harald Welte <[email protected]<mailto:[email protected]>>
Setting SIM=LOCAL; Modem reset recommended
ERROR: osmo_log_info == NULL! You must call log_init() before using logging in
log_check_level()!<webextlink://You%20must%20call%20log_init()%20before%20using%20logging%20in%20log_check_level()!>
Assert failed osmo_log_info ../../git/src/logging.c:299
backtrace() returned 8 addresses
/usr/lib/libosmocore.so.17(osmo_panic+0xd8) [0xffffbc03abb8]
/usr/lib/libosmocore.so.17(log_parse_level+0) [0xffffbc037c00]
/usr/lib/libosmocore.so.17(log_check_level+0x30) [0xffffbc039120]
/usr/lib/libosmo-simtrace2.so.0(+0x1c50) [0xffffbc077c50]
simtrace2-tool(+0x13fc) [0xaaaac79f13fc]
/lib/libc.so.6(__libc_start_main+0xe8) [0xffffbbea7878]
simtrace2-tool(+0x15b8) [0xaaaac79f15b8]
Aborted
Adding the osmo logging initialization (listed below) does not, at first
glance, appear to help
static struct log_info log_info = {};
rc = osmo_libusb_init(NULL);
if (rc < 0) {
fprintf(stderr, "libusb initialization failed\n");
return rc;
}
Thank you,