Lua Script Unable to Test CubeBlack

I’m currently working on a LUA script to act as a driver for a DFRobot Sen0629 sensor, meant to act as a 1D range finder. Right now I am trying to run the script on a CubeBlack, with plans to move this onto a custom fc based on an H743. I am currently running into an issue with SCR_HEAP_SIZE. If I increase memory any further, EKF3 does not have enough memory to run. I am also confused as to why the script needs so much memory, as it is only 2KB, but it still does not have enough memory at 51200. Attached below are my parameters, as well as my driver script.

C4001.lua (2.6 KB)
pixhawk382025.param (17.9 KB)

CubeBlack is an STM32F427; flash 2MB, RAM 256KB chip.

Ensure your autopilot has at least 2 MB of flash and 80 kB of memory.
Scripting is not available in F4-based autopilots.