Uwe Hermann [Tue, 5 Nov 2019 21:34:44 +0000 (22:34 +0100)]
spiflash: Add "EEPROM" to descriptions.
There are various different names that these types of memories are being
referred to in the wild: SPI flash, flash chip, flash, flash EEPROM,
SPI EEPROM, serial flash, serial memory, flash memory, and various others.
In order to make UI decoder selection more useful to the user, we add
the "EEPROM" string to some of the decoder metadata fields, so the
decoder will (for example) show up in PulseView's list of decoders when
the user types "eeprom" to narrow down the listed decoders.
Andrew Gregory [Wed, 5 Dec 2018 15:31:34 +0000 (23:31 +0800)]
modbus: Make C->S and S->C configurable, add framegap option.
Change client->server and server->client to be separately configurable,
allowing decoding at both the server (where client->server is RX and
server->client is TX) and client (where client->server is TX and
server->client is RX) ends of the link. It also allows monitoring of the
bus on a single channel (where client->server and server->client are both
RX (or TX)).
When I tried to decode a bus capture, I found that when the transmitter was
turned off it generated a false start bit, which in turn resulted in a false
trailing byte from the UART decoder. This narrowed the inter-frame gap to
the point where the Modbus decoder failed to recognise a new frame. The
result was only the first frame of the capture decoded - all the rest of the
frames failed to decode. I had to reduce the frame gap to allow subsequent
frames to decode, and so made it a configurable option that defaults to the
existing gap.
Lastly, I fixed a call to puti() that incorrectly included the annotation
prefix.
Stefan Brüns [Mon, 17 Jun 2019 18:01:58 +0000 (20:01 +0200)]
usb_request: Allow configuration of BULK IN transfer display
From a protocol level, a BULK IN transfer starts when the host starts
polling the respective endpoint. For analysis, it is sometimes useful
to show when the devices starts to answer the requests.
As both are useful for different use cases (the old, default one emphasizes
the host behavior, the new one shows the endpoint/device behavior), make
the display configurable.
Stefan Brüns [Mon, 17 Jun 2019 17:51:29 +0000 (19:51 +0200)]
usb_request: Fix some decoding errors
Append OUT data only if it has been ACKed. OUT transfers (BULK OUT or
CONTROL transfer DATA stage) are typically NACKed to create backpressure.
Always keep IN and OUT transfers separate. On the physical layer, the
endpoint number only uses 4 bits, and IN and OUT use separate tokens.
In case the transfer is an IN transfer, set the high bit as used in the
endpoint descriptors (i.e. 0x81 is IN enpoint 1, 0x01 is OUT endpoint 1).
Uwe Hermann [Wed, 24 Apr 2019 19:10:40 +0000 (21:10 +0200)]
spi: Add support for "transfer" annotations.
There is already an OUTPUT_PYTHON type named 'TRANSFER' that is being
transmitted to stacked decoders. Make the same information available
as annotations (additionally), which can be helpful in some situations.
Uwe Hermann [Mon, 15 Apr 2019 16:50:12 +0000 (18:50 +0200)]
sdcard_spi: Fix some abbreviations and names to match the spec.
The official abbreviation for CMD24 in the spec is "WRITE_BLOCK", as
opposed to "WRITE_MULTIPLE_BLOCK" for CMD25 (chapter 4.7.4,
"Detailed Command Description", table 4-24).
The byte preceeding e.g. the CMD24 block data is called "Start Block" token
(chapter 7.3.3.2, "Start Block Tokens and Stop Tran Token"). We don't
include the "token" itself for consistency, since the decoder doesn't do
that for any other tokens either.
Gerhard Sittig [Wed, 3 Apr 2019 17:10:46 +0000 (19:10 +0200)]
sdcard_spi: touch up CMD24 handling
Address some nits in the SDCard (SPI mode) protocol decoder. Rename
identifiers to eliminate comments. Determine the default block size at
the start of the write command instead of the iteration over payload
data bytes. Remove a print() statement which would break regression
tests. Allow re-use of the data handler for other commands, too. Use
lower case hex digits for consistency across the source file, and
slightly unobfuscate a bit pattern check while we are here. Improve
robustness of response handlers and how internal state gets advanced.
Replace constant lookups by direct method calls.
Pierre Poulain [Fri, 15 Mar 2019 17:37:24 +0000 (18:37 +0100)]
sdcard_spi: add support for CMD24 including payload data
The previous implementation advanced from the start of CMD24 to IDLE.
This commit introduces support for the data phase and data response of
CMD24. Which results in improved usability of the decoder output, and
reduced probability of false positives (don't detect "commands" in the
payload data).
This commit addresses the missing CMD24 handling part of bug #1365.
Uwe Hermann [Tue, 2 Apr 2019 19:35:32 +0000 (21:35 +0200)]
srd_inst_stack(): Warn upon potentially incorrect stacking.
Currently there must be at least one match of inputs/outputs for
decoders that are stacked. If not, we emit an informational warning
(but this is not a hard error for the time being).
Libor Gabaj [Wed, 23 Jan 2019 20:58:26 +0000 (21:58 +0100)]
DS1307: Bugs fixes.
- Square wave frequencies above 1 Hz are in Hz not in kHz.
- AM/PM flag is in the bit 5 of hours register not in bit 6.
- AM flag is valid at 0 value of AM/PM flag not at 1 value.
Gerhard Sittig [Sat, 24 Nov 2018 10:57:38 +0000 (11:57 +0100)]
uart: remove obsolete TODO (Python annotation for frame errors)
The "Frame error?" TODO comment on Python annotations has become
obsolete. Individual bit errors within the frame immediately get
communicated as they are detected (START, parity, STOP). The overall
frame's validity has become available with the FRAME annotation.
Internally keep track of the UART frame's validity. Emit a FRAME Python
annotation for aborted as well as for completed frames. This obsoletes a
TODO comment in the STOP bit code path.
This annotation also spans the complete frame's length, including start
and parity and stop bits, which the DATA annotation doesn't cover.
Stacked decoders can individually decide whether to strictly reference
the mere data bits section or the complete UART frame which happened to
communicate the data value.
Gerhard Sittig [Sun, 21 Oct 2018 15:14:59 +0000 (17:14 +0200)]
decoder: consider reset() a mandatory decoder method
In theory support for PD reset is optional, applications are not
required to make use of it. But it's essential to receive correct
decoding results when used with the popular Pulseview mainline
application.
So let's consider the absence of the reset() method fatal. All mainline
decoders have it. Out-of-tree decoders are easy to adjust, and very
probably should support reset() as well. Thus this change is considered
beneficial, and not harmful.
Jon Burgess [Sun, 14 Oct 2018 18:11:21 +0000 (19:11 +0100)]
Fix GVariant memory leaks in session test code
==187759== 88 (40 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 2,262 of 3,218
==187759== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==187759== by 0x563C435: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187759== by 0x5654056: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187759== by 0x5673630: g_variant_new_from_bytes (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187759== by 0x566C5E6: ??? (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187759== by 0x566C7D2: g_variant_new_uint64 (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187759== by 0x403D41: conf_check_fail.constprop.6 (session.c:152)
==187759== by 0x403E06: test_session_metadata_set_bogus (session.c:215)
==187759== by 0x53E51D5: srunner_run_tagged (in /usr/lib64/libcheck.so.0.0.0)
==187759== by 0x401237: main (main.c:51)
Jon Burgess [Sun, 14 Oct 2018 18:10:16 +0000 (19:10 +0100)]
Fix memory leak in decoder test code
==187724== 917 bytes in 1 blocks are definitely lost in loss record 3,046 of 3,207
==187724== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==187724== by 0x563C435: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187724== by 0x5655D82: g_strdup (in /usr/lib64/libglib-2.0.so.0.5600.3)
==187724== by 0x4E43937: py_str_as_str (util.c:371)
==187724== by 0x4E415E1: srd_decoder_doc_get (decoder.c:892)
==187724== by 0x40281D: test_doc_get (decoder.c:395)
==187724== by 0x53E51D5: srunner_run_tagged (in /usr/lib64/libcheck.so.0.0.0)
==187724== by 0x401237: main (main.c:51)
Jon Burgess [Sun, 14 Oct 2018 17:55:47 +0000 (18:55 +0100)]
Fix memory leak in print_searchpaths()
==175453== 522 bytes in 8 blocks are definitely lost in loss record 2,923 of 3,201
==175453== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
==175453== by 0x59E9BB5: PyObject_Malloc (in /usr/lib64/libpython3.6m.so.1.0)
==175453== by 0x5A35A76: PyBytes_FromStringAndSize (in /usr/lib64/libpython3.6m.so.1.0)
==175453== by 0x4E3FA6E: print_searchpaths (srd.c:173)
==175453== by 0x4E3FA6E: srd_init (srd.c:287)
==175453== by 0x4034BE: test_session_reset_nodata (session.c:238)
==175453== by 0x53E51D5: srunner_run_tagged (in /usr/lib64/libcheck.so.0.0.0)
==175453== by 0x401237: main (main.c:51)