Is there a way to debug the firmware?

Yes see my reply here: Debugging OpenMV4 firmware - #9 by iabdalkader