Run Lua Scripts on FCs with 1MB internal flash and onboard external flash

Is there any way to run lua scripts on flight controllers like Matek F405-MINI or other FCs having MCUs like STM32F405 or STM32F407 with 1MB internal flash if i have an external flash available onboard ?

I want to know what configurations or changes i should try to make in hwdef.dat file of FCs with MCUs having 1MB internal flash to enable just lua scripting feature if i have an onboard external flash available ?

The simplest change is to get a 2MB board. The more complicated change is to remove so many features from APM_Config.h file so that the lua scripting can fit in. It will not be easy, and might even not be possible.

External flash? What would this be?

Something like separate winbond or micron flash

i want to do similar thing…i want to set a mission which should be stored on my external flash.My FC is same with internal 1MB flash and connected with an external SPI Flash(Winbond-W25Q256JV) with no SD card on board.The size of the mission is large enough.I have to use external flash.