3.6 KiB
3.6 KiB
SD card example layout
Firmware expects a plain FAT volume handled by FatFs. In this project exFAT is disabled in ffconf.h, so the safe choice is FAT32 with a standard MBR partition.
Recommended card preparation:
- Format the card as
FAT32. - Copy the files from this directory to the root of the SD card, or keep the same relative folder structure.
- Make sure
profiles.csvis present at the root path expected by the firmware.
Expected file set:
profiles.csvprofiles/profile_1_saw.iniprofiles/profile_2_custom_wave.iniwaves/wave_custom.csv
profiles.csv format:
- One profile per line.
- Columns:
display_name, profile_ini_path, optional_waveform_csv_path - Empty lines are ignored.
- Lines starting with
#or;are ignored.
Example:
Factory Saw,profiles/profile_1_saw.ini,
Custom SRAM,profiles/profile_2_custom_wave.ini,waves/wave_custom.csv
Profile .ini format:
- One
key=valuepair per line. - Empty lines are ignored.
- Lines starting with
#or;are ignored. - Unknown keys are ignored.
- The whole file must be smaller than 4096 bytes; a larger profile fails to load instead of being truncated.
Additional profile-controlled devices:
AD9102waveform settings are stored through thewaveform_*keys.AD9833settings are stored throughad9833_enable,ad9833_triangle, andad9833_frequency_word.- STM32 internal DAC settings are stored through
stm32_dac_enableandstm32_dac_code. - TEC drive modulation is stored through
tec_modulation_enable,tec_modulation_laser,tec_modulation_frequency_hz, andtec_modulation_amplitude_code. DS1809is stored as an absolute target above the minimum tap usingds1809_applyandds1809_position_from_min.- Laser 2 current and STM32 DAC sweeps are stored through the
laser2_current_sweep_*andstm32_dac_sweep_*keys:_enable,_min_code,_max_code,_step_code,_step_period_us, and_pause_ms.
Notes:
ad9833_frequency_worduses the same raw 28-bit tuning word that the old serial command accepted.tec_modulation_laseris1or2; accepted TEC modulation frequency is50..2000 Hz, and peak amplitude is0..27900external TEC DAC codes (further limited by the headroom around the PID output).- A sweep steps from
_min_codeup to_max_code(inclusive) by_step_codeevery_step_period_us(at least10, rounded down to a multiple of 10 us), then holds_min_codefor_pause_msbefore repeating. - Sweep codes are raw DAC codes: the laser current DAC uses the same units as
laser2_current, the STM32 DAC0..4095. - The laser 2 current sweep only runs in
auto_run=trueprofiles, because it needs the laser to be driven. ds1809_position_from_minis clamped to the valid0..63range by the firmware.- When
ds1809_apply=true, the firmware first drives the potentiometer fully down and then steps it up to the requested absolute position.
Waveform file format:
- The firmware scans the file with
strtol(). - Any integer token found in the file becomes one AD9102 SRAM sample.
- Separators may be commas, spaces, tabs, or newlines.
- Do not put comments or stray digits into the waveform file, because any parsed integer will be treated as a sample.
Supported waveform_mode values:
sawgenerated_sramcustom_sram
Minimal boot behavior:
- On startup the firmware loads the first valid line from
profiles.csv. - It then loads the referenced profile
.ini. - If
boot_enabled=true, the profile is activated. - If
auto_run=true, the board immediately entersWORKmode.