Skip to content

toolbox: Skip DATA_OUT phase on zero-length SET_WORKING_DIR#361

Merged
erichelgeson merged 1 commit intomainfrom
eric/toolbox-setwd-zero-length
Apr 27, 2026
Merged

toolbox: Skip DATA_OUT phase on zero-length SET_WORKING_DIR#361
erichelgeson merged 1 commit intomainfrom
eric/toolbox-setwd-zero-length

Conversation

@erichelgeson
Copy link
Copy Markdown
Contributor

CDB[8]=0 on SET_WORKING_DIR now returns STATUS with no state change, matching the SCSI-2 convention already used by MODE SELECT a parameter list length of zero means no data shall be transferred and shall not be treated as an error.

Clients that want to reset the override must continue to send a 1-byte NUL path explicitly (CDB[8]=1, data=0x00). An all-NUL multi-byte payload (e.g. CDB[8]=4 with four NUL bytes) resets as well.

Thanks saybur!

CDB[8]=0 on SET_WORKING_DIR now returns STATUS with no state change,
matching the SCSI-2 convention already used by MODE SELECT a parameter
list length of zero means no data shall be transferred and shall not
be treated as an error.

Clients that want to reset the override must continue to send a 1-byte
NUL path explicitly (CDB[8]=1, data=0x00). An all-NUL multi-byte payload
(e.g. CDB[8]=4 with four NUL bytes) resets as well.

Thanks saybur!
@github-actions
Copy link
Copy Markdown

BlueSCSI Memory Report

Compared against release v2026.03.01

Memory Usage

Target FLASH RAM SCRATCH_X SCRATCH_Y
Pico_2_Audio_SPDIF 674.6 KB (+54.6 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.8 KB (+1.0 KB) [94%]
Pico_2_DaynaPORT 666.9 KB (+53.6 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.0 KB (+1.0 KB) [75%]
Pico_Audio_SPDIF 696.1 KB (+62.3 KB) [34%] 252.2 KB (+6.7 KB) [99%] 1.5 KB [38%] 768 B [19%]
Pico_DaynaPORT 687.9 KB (+61.7 KB) [34%] 245.9 KB (+15.6 KB) [96%] 1.5 KB [38%]
Ultra 683.9 KB (+58.9 KB) [33%] 511.7 KB [100%] 3.5 KB [88%] 3.0 KB (+1.0 KB) [75%]
Ultra_Wide 443.8 KB (+63.0 KB) [22%] 511.7 KB [100%] 2.0 KB [50%] 3.0 KB (+1.0 KB) [75%]

Symbol Region Changes

Pico_2_Audio_SPDIF: 3 symbols moved FLASH → RAM (+12 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
Pico_2_Audio_SPDIF: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Pico_2_DaynaPORT: 3 symbols moved FLASH → RAM (+12 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
Pico_2_DaynaPORT: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Pico_Audio_SPDIF: 13 symbols moved FLASH → RAM (+2.0 KB)
Symbol Size
mscd_xfer_cb 1.4 KB
mscd_control_xfer_cb 328 B
tud_descriptor_string_cb 116 B
mscd_open 104 B
mscd_reset 20 B
mscd_init 20 B
tud_descriptor_configuration_cb 8 B
operator delete(void*, unsigned int) 8 B
operator new[](unsigned int) 8 B
tud_descriptor_device_cb 8 B
operator delete[](void*) 8 B
exit 6 B
SdSpiCard::errorCode() const 4 B
Pico_Audio_SPDIF: 43 symbols moved RAM → FLASH (-5.3 KB RAM)
Symbol Size
amigaWifiCommand 1.2 KB
FatFile::rename(FatFile*, char const*) 332 B
FatPartition::init(FsBlockDeviceInterface*, unsigned char, unsigned long) 324 B
ExFatPartition::init(FsBlockDeviceInterface*, unsigned char, unsigned long) 252 B
ExFatFile::addDirCluster() 196 B
ExFatPartition::bitmapFind(unsigned long, unsigned long) 192 B
partitionTableGetVolumeStartSector(FsCache&, unsigned char) 192 B
ExFatPartition::bitmapModify(unsigned long, unsigned long, bool) 164 B
FatFile::makeUniqueSfn(FatLfn_t*) 144 B
ExFatFile::rename(ExFatFile*, char const*) 140 B
ExFatFile::preAllocate(unsigned long long) 136 B
ExFatPartition::freeClusterCount() 136 B
FatPartition::allocContiguous(unsigned long, unsigned long*) 136 B
FatPartition::freeClusterCount() 124 B
FatPartition::allocateCluster(unsigned long, unsigned long*) 124 B
FatFile::addDirCluster() 112 B
FatFile::fgets(char*, int, char const*) 106 B
FatFile::contiguousRange(unsigned long*, unsigned long*) 106 B
ExFatFile::fgets(char*, int, char const*) 104 B
FatPartition::fatPut(unsigned long, unsigned long) 104 B
FsBaseFile::copy(FsBaseFile const*) 102 B
ExFatPartition::fatPut(unsigned long, unsigned long) 80 B
ExFatPartition::freeChain(unsigned long) 78 B
ExFatFile::contiguousRange(unsigned long*, unsigned long*) 76 B
FatVolume::chdir(char const*) 72 B
FatFile::preAllocate(unsigned long) 72 B
ExFatVolume::chdir(char const*) 68 B
FatPartition::freeChain(unsigned long) 58 B
FatFile::getLfnChar(DirLfn_t const*, unsigned char) 52 B
ExFatFile::peek() 50 B
... and 13 more
Pico_DaynaPORT: 34 symbols moved FLASH → RAM (+7.2 KB)
Symbol Size
mscd_xfer_cb 1.4 KB
ExFatFile::write(void const*, unsigned int) 992 B
ExFatFile::read(void*, unsigned int) 672 B
FatFile::write(void const*, unsigned int) 524 B
FatFile::readPrivate(void*, unsigned int, DirFat_t**) 498 B
ExFatFile::seekSet(unsigned long long) 468 B
ExFatFile::buildSectorMap() 444 B
FatFile::buildSectorMap() 358 B
mscd_control_xfer_cb 328 B
FatFile::seekSet(unsigned long) 272 B
FatFile::readSectorsDirect(unsigned long, unsigned char*, unsigned long) 200 B
ExFatFile::readSectorsDirect(unsigned long, unsigned char*, unsigned long) 200 B
FatPartition::fatGet(unsigned long, unsigned long*) 154 B
tud_descriptor_string_cb 116 B
mscd_open 104 B
ExFatPartition::fatGet(unsigned long, unsigned long*) 96 B
FsCache::prepare(unsigned long, unsigned char) 84 B
ExFatPartition::dirSeek(DirPos_t*, unsigned long) 80 B
FsCache::sync() 74 B
ExFatPartition::dirCache(DirPos_t const*, unsigned char) 68 B
ExFatFile::dirCache(unsigned char, unsigned char) 60 B
FatFile::cacheDirEntry(unsigned char) 32 B
FatFile::readDirCache() 32 B
mscd_reset 20 B
mscd_init 20 B
FsBaseFile::operator=(FsBaseFile const&) 12 B
tud_descriptor_configuration_cb 8 B
operator delete(void*, unsigned int) 8 B
operator new[](unsigned int) 8 B
tud_descriptor_device_cb 8 B
... and 4 more
Pico_DaynaPORT: 3 symbols moved RAM → FLASH (-1.2 KB RAM)
Symbol Size
amigaWifiCommand 1.2 KB
StreamFile<FsBaseFile, unsigned long long>::peek() 34 B
StreamFile<FatFile, unsigned long>::peek() 10 B
Ultra: 4 symbols moved FLASH → RAM (+16 B)
Symbol Size
operator new(unsigned int) 4 B
operator delete[](void*) 4 B
operator new[](unsigned int) 4 B
operator delete(void*, unsigned int) 4 B
Ultra: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_lseek 16 B
_close 16 B
_fstat 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B
Ultra_Wide: 4 symbols moved FLASH → RAM (+16 B)
Symbol Size
operator delete(void*, unsigned int) 4 B
operator new[](unsigned int) 4 B
operator delete[](void*) 4 B
operator new(unsigned int) 4 B
Ultra_Wide: 9 symbols moved RAM → FLASH (-298 B RAM)
Symbol Size
tud_descriptor_device_cb 116 B
tud_descriptor_string_cb 96 B
_fstat 16 B
_lseek 16 B
_close 16 B
_isatty 16 B
tud_descriptor_configuration_cb 12 B
_read 6 B
_write 4 B

@erichelgeson erichelgeson merged commit 0644f3f into main Apr 27, 2026
1 check passed
@erichelgeson erichelgeson deleted the eric/toolbox-setwd-zero-length branch April 27, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant