Skip to content

Commit

Permalink
Create SD card test
Browse files Browse the repository at this point in the history
SD card test checks for the presence of a microSD card in the
slot, reads and reports the card properties and then proceeds
to check the contents of a test file `LOREM.IPS` in the root
directory of a FAT32-formatted card against its internal
reference.

See the source for directions on how to set up a microSD card
with a suitable file; set 'emitText' to true on the first run
and it will emit the sample text with instructions.

Support for Long FileNames.
  • Loading branch information
alees24 committed Dec 8, 2024
1 parent 262e2a9 commit 515e7c1
Show file tree
Hide file tree
Showing 5 changed files with 1,279 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sw/cheri/common/console.hh
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ using Log = reisfmt::Fmt<WriteUart>;
}
}
}

// Emit the UCS-2 long filename in a readable form; we cannot do this properly; we're just
// handling ASCII in practice.
[[maybe_unused]] static void write_str_ucs2(Log& log, const uint16_t* ucs, size_t ucs_max = ~0u) {
size_t idx = 0u;
char str[2];
str[1] = '\0';
while (idx < ucs_max && ucs[idx]) {
str[0] = (ucs[idx] >= 0x20u && ucs[idx] < 0x80u) ? ucs[idx] : '.';
log.print(str);
idx++;
}
}
Loading

0 comments on commit 515e7c1

Please sign in to comment.