39#include "ux_device_class_storage.h"
53static const UCHAR
s_fat_oem_name[8] = {
'R',
'A',
'8',
'D',
'2',
'F',
'W',
' '};
56static const UCHAR
s_fat_volume_label[11] = {
'R',
'A',
'8',
'D',
'2',
' ',
'O',
'S',
'P',
'I',
' '};
59static const UCHAR
s_fat_fs_type[8] = {
'F',
'A',
'T',
'1',
'6',
' ',
' ',
' '};
62static const UCHAR
s_fat_file_name[11] = {
'O',
'S',
'P',
'I',
' ',
' ',
' ',
' ',
'B',
'I',
'N'};
176 const uint32_t entry = first_entry + j;
180 }
else if (entry == 1U) {
183 value = (uint16_t)(entry + 1U);
213 if (root_sector != 0U) {
275 const uint32_t flash_addr =
304 for (
ULONG i = 0UL; i < number_blocks; i++) {
364 return (uint8_t)((uint8_t)
'0' + (uint8_t)nibble);
391 if (text[len] ==
'\0') {
435 out[0] = (uint8_t)
'0';
446 for (uint8_t i = 0U; i < count; i++) {
447 out[i] = scratch[count - 1U - i];
455 uint8_t width = digits;
459 for (uint8_t i = 0U; i < width; i++) {
@ k_scsi_ascq_none
ASCQ: none.
@ k_scsi_asc_write_protected
ASC: WRITE PROTECTED.
@ k_scsi_sense_illegal_request
Sense key: ILLEGAL REQUEST.
@ k_scsi_sense_data_protect
Sense key: DATA PROTECT.
@ k_scsi_asc_lba_out_of_range
ASC: LBA out of range.
static volatile uint32_t s_dbg_read_calls
Device-side media_read invocations.
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
@ k_dir_off_attr
MS FAT spec sec 6 "DIR_Attr".
unsigned int UINT
ThreadX-compatible unsigned int (host stub).
unsigned long ULONG
ThreadX-compatible unsigned long (host stub).
xSPI / Octo-SPI driver (flash read/program/erase + ID/status)
ra8_err_t ra8_xspi_flash_read(uint8_t instance, uint32_t flash_addr, uint8_t *buf, uint32_t len)
Read len bytes from external flash into buf.
@ k_selftest_hex_digit_split
Threshold between '0-9'/'A-F'.
@ k_selftest_dec_chars_u32
Max digits for a 32-bit count.
@ k_selftest_hex_chars_u32
32-bit value -> "ABCDEF01".
@ k_selftest_nibble_bits
Bits per hex nibble.
@ k_selftest_dec_radix
Base for decimal conversion.
@ k_selftest_nibble_mask
4-bit nibble mask.
static const UCHAR s_fat_oem_name[8]
Boot-sector OEM name (8 bytes, space padded).
static const UCHAR s_fat_fs_type[8]
Filesystem-type tag, 8 bytes space padded.
static const UCHAR s_fat_volume_label[11]
Volume label, 11 bytes space padded (also the root entry).
@ k_boot_sig_hi_off
Signature high-byte offset.
@ k_boot_jmp0
Short JMP opcode.
@ k_boot_num_heads
Geometry filler.
@ k_boot_sig_lo_off
Signature low-byte offset.
@ k_boot_sig_hi
Boot signature high byte.
@ k_boot_jmp1
JMP displacement.
@ k_boot_sig_lo
Boot signature low byte.
@ k_boot_media
Fixed-disk media byte.
@ k_boot_sec_per_trk
Geometry filler.
@ k_boot_ext_sig
Extended boot signature.
@ k_boot_drive_num
BIOS drive number.
@ k_boot_volume_id
Arbitrary volume serial.
static const UCHAR s_fat_file_name[11]
8.3 directory name of the exposed file: "MRAM.BIN".
@ k_word_shift
Bits per half-word.
@ k_fat_root_entries
Root directory entries.
@ k_fat_eoc
End-of-chain marker.
@ k_fat_data_lba
First data sector (cluster 2).
@ k_fat_root_lba
First root-directory sector.
@ k_fat_fat_sectors
FAT16 size for 4098 entries.
@ k_fat_fat_lba
First FAT sector.
@ k_fat_first_cluster
FAT data area starts at cluster 2.
@ k_fat_entry0
FAT[0]: media F8 + filler.
@ k_fat_reserved_sectors
Boot sector only.
@ k_fat_entries_per_sec
FAT16 entries per 512-byte sector.
@ k_fat_total_sectors
1 + 17 + 32 + 4096.
@ k_fat_num_fats
Single FAT copy.
@ k_dir_entry_bytes
Directory entry size.
@ k_bpb_off_spt
Sectors per track.
@ k_bpb_off_label
Volume label (11 bytes).
@ k_dir_attr_volume
Volume-label attribute.
@ k_bpb_off_media
Media descriptor.
@ k_bpb_off_bps
Bytes per sector.
@ k_dir_off_size
File size (32-bit LE).
@ k_bpb_off_jmp
Jump instruction.
@ k_bpb_off_heads
Head count.
@ k_bpb_off_oem
OEM name (8 bytes).
@ k_bpb_off_volid
Volume serial (4 bytes).
@ k_bpb_off_bootsig
Extended boot signature.
@ k_bpb_off_fatsz16
Sectors per FAT.
@ k_bpb_off_rsvd
Reserved sector count.
@ k_bpb_off_drvnum
Drive number.
@ k_bpb_off_fstype
Filesystem type (8 bytes).
@ k_bpb_off_rootent
Root entry count.
@ k_dir_name_bytes
8.3 name field length.
@ k_byte_shift
Bits per byte for LE packing.
@ k_dir_off_cluster_lo
First cluster (low word).
@ k_bpb_off_nfats
Number of FATs.
@ k_bpb_off_spc
Sectors per cluster.
@ k_bpb_off_totsec16
Total sectors (16-bit).
@ k_dir_attr_read_only
Read-only attribute.
@ k_selftest_block_size
SCSI logical block size (bytes).
@ k_selftest_print_cap
Bound for console-string scans.
Shared constants + step prototypes for the OSPI USB self-loop app.
@ k_fat_last_data_clus
Last cluster of MRAM.BIN.
@ k_ospi_pat_bias
Constant bias.
@ k_ospi_pat_mask
Byte mask.
@ k_ospi_pat_smul
Per-sector multiplier.
@ k_ospi_pat_imul
Per-byte multiplier.
@ k_ospi_bytes
1 MiB exposed window size.
@ k_ospi_test_offset
1 MiB into the chip (scratch).
@ k_ospi_instance
xSPI controller instance.