A lightweight bootloader/firmware flasher for M5Cardputer ADV with disk partition management and a UNIX-like file manager.
boot screen
partition info
running flash binary.bin
editor
fetch
overall
git clone https://github.com/wisnc/crub
cd crub
pio run -e bootloader
pio run -e m5cardputer
Since this is a merged firmware, you need to use esptool.
python -m esptool --chip esp32s3 --port <COM PORT> --baud 1500000 --before default_reset --after hard_reset write_flash -z 0x0 .pio\build\bootloader\bootloader.bin 0x8000 .pio\build\m5cardputer\partitions.bin 0x10000 .pio\build\m5cardputer\firmware.binmake sure to replace <COM PORT> with your cardputer serial port.
flash binaries from SD with
flash /path/to/binary.bin
then launch it with
launch
aliases can be externally edited (or with the built in editor) and is located as a text file in root directory in
/.crub_aliases
create aliases for flashing and launch: e.g. shortcut flash and launch bruce as "br"
alias br "flash /binaries/bruce.bin && launch"
view binary partition scheme
pt info /path/to/binary.bin
run scripts from SD
run /path/to/script.sh
scripts are just text files with one command per line. lines starting with # are comments. you can use echo, sleep, and any other crub command inside them. output redirection works with > and >>
echo hello > /notes/test.txt
echo second line >> /notes/test.txt
ls /binaries > /logs/filelist.txt
boot scripts run automatically if /.crub_boot exists on the SD card
write launch -f to /.crub_boot and crub will skip the boot screen and launch installed firmware instantly on power on. remove the SD card to enter crub normally
echo launch -f > /.crub_boot
you can also quickly do calculations. start the expression with '='. for example
>=5*3
15
>=2.5*(3+1)
10
>=100/3
33.3333
>=17%5
2
>=(2+3)*(7-1)
30
commands can be viewed with help
display can also be controlled with bright <0-255>, Fn + _ and Fn + = for dimmer and brighter display. also Btn0 toggles display to save battery
edit (filename) to enter nano-like editor
Fn + , . / ; for left down right up
Fn + backspace for exit/save. moves to status line and prompts directory to save and filename. enter to save Fn + backspace to discard
Fn + C copy line
Fn + V paste line
Fn + X cut line
Opt + . move to end of the file
Opt + ; move to top of the file
- added
bright <0-255>command for display brightness control - added
sdcommand to reinitialize SD card and reload aliases without rebooting - added
launch -fflag for instant launch with no delay
- added file utilities:
head,find,tree,wc,hex - added system commands:
uptime,free,i2cscan,md5,beep - added scripting:
run,echo,sleep,#comments - added
/.crub_bootboot script. runs on every boot if it exists on SD
- added basic calculator feature
- fixed an issue: aliases only having 16 entries as limit. now it is practically infinite
- added Cardputer v1.1 support. thanks u/First-Preference5831
- added fetch
- fixed an issue where larger binaries are unflashable. new functionality to view binary partition scheme
bininfo /path/to/binary.bin
- fixed an issue where having a LoRa Cap (or any Cap on that matter) interferes with reading the SD on boot
- updated UI
- added a nano-like text editor
- probably final update as no other features are planned
- nvs gets overwritten every time a firmware is being flashed. this was on 1.7 when i added functionality to name what firmware is inside ota_0 by writing it in nvs. it is also where the aliases are saved. fixed it by moving those to SD (firmware name and alias). because who would use this firmware flasher and file manager without an SD right?
- Public release
- GitHub repository created