previously the version string was in the iConfiguration field of a
dedicated USB configuration.
this configuration had no interface, but the USB specification
requires at least one interface.
an interface has been added to this configuration.
the version string is now in the iInterface field, and the
iConfiguration field contains "firmware version".
the USB specification does not require an end-point, and none are
present.
Change-Id: I99361e313979711f4f45ad424a52faa3ddd7c558
disabling the ERASE pin prevents accidental erase for the flash
memory while the board is powered on (e.g. in case the user
overcomes the weak 100 kOhm pull-down for more than 220 ms by
touching or shorting the pin).
the flash is still erasable using the ERASE pin during power up.
it is only disabled after boot completed.
Change-Id: Ic3332eb1d4247a07988b2fd841f40e79862d06a7
The most recent commits introduced 'C99' syntax by declaring variables
inside the 'for' statement itself, rather than before.
This resulted in compile failures in the Ubuntu 16.04 builds on
build.opensuse.org:
[ 105s] libcommon/source/usb.c: In function 'SIMtrace_USB_Initialize':
[ 105s] libcommon/source/usb.c:679:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(device_id_string) - 1; i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:679:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
[ 105s] libcommon/source/usb.c:686:15: error: redefinition of 'i'
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(git_version) - 1; i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:679:15: note: previous definition of 'i' was here
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(device_id_string) - 1; i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:686:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(git_version) - 1; i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:692:15: error: redefinition of 'i'
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(usb_strings) && i < ARRAY_SIZE(usb_strings_extended); i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:686:15: note: previous definition of 'i' was here
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(git_version) - 1; i++) {
[ 105s] ^
[ 105s] libcommon/source/usb.c:692:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[ 105s] for (uint8_t i = 0; i < ARRAY_SIZE(usb_strings) && i < ARRAY_SIZE(usb_strings_extended); i++) {
[ 105s] ^
[ 105s] Makefile:227: recipe for target 'obj/simtrace/flash_usb.o' faile
Change-Id: Ibdb837ac105664484b10873c2c0d9561051b1c2a
the device ID (unique to the micro-controller) is now displayed in
the USB iSerial descriptor.
the git version is now also displayed in iConfiguration in an
additional (empty) configuration descriptor.
this allows the user to quickly get the device hardware serial and
firmware version just by using lsusb (no need for a custom USB
software).
Change-Id: If9fadecc097ca3e006990160936bf11b22eae4e0
the jenkins script will now upload the versioned output to the
all directory, and a copy named "latest" in the latest directory.
Change-Id: I70114ef8414779e369da5cbf945854c9ace3464e
We recently introduced ALLOW_PEER_ERASE to control if the firmware
should contain code for the SAM3 to reset each other on QMOD.
Let's use the same define to also remove code for putting the USB
hub into reset as well as code for erasing + writing the hub EEPROM.
This is needed only during production, but it shouldn't be enabled
during normal operation of the product at the end user.
Change-Id: I1c8cca2f7f0f0070d7bf1ade676e035c45e4d5ab
adds command 'a' to allow setting/asserting the peer SAM3S ERASE
line on the next command.
this prevents against accidental erase since only the command 'y'
was required, without confirmation.
this could happen not only through accidental user input, but
noise on the serial line (noise would still cause other issues,
but at least now it will not "brick" the device).
now the sequence 'ay' is required, as any other command following
'a' would clear the permission again.
note: since ERASE is only setting a GPIO within this command
parsing function, not accidental function pointer problem calling
'board_exec_dbg_cmd' should cause accidental ERASE since it would
need to be called two times with the exact sequence
Change-Id: I06bfeaef09a397bd554bec84321e0dd64ccc3aac
The freq_ctr app is a small application that is implementing a
simplistic direct-mode frequency counter using the internal 32.768kHz
oscillator and two TC blocks. One of them is used to generate a 1Hz
signal, which is then subsequently used by the other TC to trigger
a counter read after exactly 1s.
This is in itself not something useful on a simtrace2 device. However,
it is a separate 'app' and I prefer to have the code here in master
over some obscure branch that's easy to forget about.
Change-Id: I2249bfb8dd6a88d85d406f3b33537377133d0939
This is a general purpose evaluation board, and it makes sense to
support it particularly for the DFU bootloader.
Change-Id: I85aea8f1441158f991493c5fc767fdcad405545e
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
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
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
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
The host utilities use libpcsclite, and the missing build dependency
causes build failures in our nightly OBS builds since commit
faf1e88e48 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
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
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
the error code returned by vsnprintf was ignored,
resulting in printing the string from a previous print.
Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
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
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
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
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
This reverts commit 77ff745cca.
libosmocore 0.12.1 is not recent enough, I misread the 'gitk' output.
Change-Id: I87a8e5bbb4aea0c991abe5372f840d76f17378eb
This fixes a bug, identified by the below compiler warning:
libboard/owhw/source/owhw.c: In function 'cardsim_gpio_init':
libboard/owhw/source/owhw.c:39:16: warning: passing argument 1 of 'PIO_Configure' from incompatible pointer type [-Wincompatible-pointer-types]
PIO_Configure(&pins_cardsim, ARRAY_SIZE(pins_cardsim));
^
In file included from ./atmel_softpack_libraries/libchip_sam3s/chip.h:45:0,
from libboard/owhw/source/owhw.c:20:
./atmel_softpack_libraries/libchip_sam3s/include/pio.h:189:16: note: expected 'const Pin * {aka const struct _Pin *}' but argument is of type 'const Pin (*)[2] {aka const struct _Pin (*)[2]}'
extern uint8_t PIO_Configure( const Pin *list, uint32_t size ) ;
^~~~~~~~~~~~~
Change-Id: I4c1de66c0b8475bb355b1d128f6ec88b2f2a7fcf
There have been tons of format-string related bugs in our code which
we never discovered due to disabling -Wformat. Let's fix that.
Change-Id: I5ec466361bcc526fac1f4897673264ee5af3458b
the upload failed because after the firmware were built (make),
they where removed (make clean).
now they are removed only after the upload.
Change-Id: Ie4421a6fa9207eb541107de9c14f265626f6be96