The tinySA ULTRA now enumerates as a composite device: the CDC serial
port plus a mass storage interface (Bulk-Only Transport, SCSI). The SD
card is only presented to the PC in USB DISK mode (STORAGE menu or shell
command 'usbdisk on|off'), which stops sweeping and screen updates so the
mass storage thread owns SPI1 and spi_buffer. Outside the mode the PC
sees an empty card reader, so the serial port never re-enumerates. The
mode ends on touch, jog button, eject from the PC, card removal or
'usbdisk off'.
- usb_msc.c/h: mass storage thread, BOT state machine, SCSI commands
- usbcfg.c: composite descriptors (IAD, bcdDevice 0x0201), bulk EP3,
requests hook, packet memory reuse on a repeated SET_CONFIGURATION and
data toggle reset on CLEAR_FEATURE (both specific to this ChibiOS fork)
- ui.c: USB DISK menu item and mode screen
- main.c: 'usbdisk' command; shell commands that could use SPI1 are
refused while the mode is active
F072 builds are unchanged. Tested on HW V0.5.4 with Windows 11: about
620 KB/s read and 370 KB/s write, data verified against FatFs reads.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- SD_SendCmd(): send STOP_TRANSMISSION without waiting for not busy and
skip its stuff byte, as in ChaN's reference driver. During a multiple
block read the card sends data, which can contain no 0xFF at all, so
CMD12 was not sent and the card kept streaming
- Wait up to 200 ms for the read data token, SDHC/SDXC read access time
can be up to 100 ms and 50 ms made reads fail
- disk_read(): convert the sector to a byte address only once for byte
addressed (<= 2 GB) cards
- disk_read()/disk_write(): reject a zero sector count
- disk_ioctl(): GET_SECTOR_COUNT available without FF_USE_MKFS
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- ChibiOS: send a zero length packet after any multiple of the bulk IN
packet size (backport from ChibiOS 21.11)
- halconf.h: name the serial buffer settings the way this ChibiOS fork
reads them (values equal to the defaults in use)
- shell_reset_console(): call the I-class queue functions locked
- VNAShell_executeLine(): enqueue the shell thread locked and only while
the command is still pending
- btn_wait_release(): wrap-safe repeat timing
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The zero-span time grid can be calculated before actual_sweep_time_us is updated, leaving the display aligned to the previous sweep duration.
Calculate grid geometry without mutating global state, recompute it after the measured sweep time is stored, and redraw only when the resulting tuple changes. Use 64-bit arithmetic through the final time-domain division so short sweeps retain exact pixel geometry.
The compact scientific formatter emits its leading digit by adding the
normalized integer mantissa to '0'. Its upper normalization loop stops at
exactly 10, however, so powers of ten use ':' (the character after '9') as
their leading digit. For example, -100.0 becomes -:.000000e+01.
Keep the normalized mantissa below 10. This preserves surrounding values
and renders exact powers with a valid leading digit and adjusted exponent.
The RTC backup checksum covers every byte except the checksum itself, including a reserved packed byte that was never assigned. Its stack value could therefore make otherwise valid state fail verification after reset.
Zero-initialize the complete backup image before assigning persisted fields so the checksum and reserved byte are deterministic.
It's now possible to save capture, traces, or both by clicking SD card icon
Disabling both options hides SD card icon
Config submenu was added to Storage menu, and all settings were moved there
Existing config remains valid, and default behavior with saving a capture is kept
When long sweep completes, a black line appeared at the bottom of the screen
Also, the same issue occurred even with progress bar turned off
This commit amends 3a006f5312, erikkaashoek/tinySA#145
* Hide progress bar in file browser
* Hide progress bar in form/fullscreen menu
* Do not clear progress bar when it was not drawn. This is the case with file browser when previous or next page button is held but not released