For not lot od FCs has 16Mb or more data flash chips.
Is there any way to use it as LUA script storage?
Just read the Wiki.
Lua scripts
Hi, I’ve already read about this. It also says that it’s impossible to run scripts integrated into the firmware without an SD card slot on the flight controller. Or did I misunderstand something?
Here does it says that ?
And how did that work out?
You can run Lua scripts on flight controllers without an SD card slot. It just takes some hardware-specific additions to the hardware definition files (emulated SD card slot) and a custom compiled firmware. I’ve been using Lua scripts on a Kakute H7 Mini for almost two years now and never had a problem.
@martinwilco hej. I do have exact same board
Can you please share your changes?
Thanks!
@mobius
Add the following to the hardware definition files:
hwdef.dat:
# SPI3 for emulated SD card
PA15 SDCARD_CS CS
PC10 SPI3_SCK SPI3
PC11 SPI3_MISO SPI3
PC12 SPI3_MOSI SPI3
# added emulated SD card as spi device
SPIDEV sdcard SPI3 DEVID1 SDCARD_CS MODE0 400*KHZ 25*MHZ
# enabled filesystem and directories, mandatory to enable scripting
define HAL_OS_FATFS_IO 1
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
hwdef-bl.dat:
# Add CS pins to ensure they are high in bootloader
PA15 SDCARD_CS CS
defaults.parm:
SCR_ENABLE 1
You can either place your Lua scripts directly into KakuteH7Mini/scripts
or /ROMFS_custom/scripts
. That way they will be included in the compiled firmware.
If needed, you can compare your changes with my ArduPilot fork:
ardupilot/libraries/AP_HAL_ChibiOS/hwdef/KakuteH7Mini_custom at Copter-KakuteH7Mini_custom · martinwilco/ardupilot
Tell me if it works:)