Openmv RT1062 Hangs Frequently, only when Connected to IDE

The IDE is causing the OpenMV RT1062 to hang frequently, and at various points during execution, including early when Importing .py modules from SD card. No error messages appear, execution just stops. When the RT1062 is disconnected from the IDE and the same code is run, execution does not hang.

When the IDE and RT1062 hang early during imports, there is ample memory available to import the modules.

One example is:

import Comm
Mem free: 8460912 allocated: 51600
Addl Mem Used = 9392
import System
Mem free: 8450288 allocated: 62224
Addl Mem Used = 10704
import Camera
Mem free: 8440304 allocated: 72208
Addl Mem Used = 4208
import DisplayTFT (hang’s here)

Do you have a minimal test script that can generate the issue?

While trying to reproduce the issue with a minimal test scrip I came across this issue with the serial terminal in the IDE losing data when it comes out fast. Could the hangup be related to this?

import sensor
import time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time=2000)

clock = time.clock()

while True:
    clock.tick()
    img = sensor.snapshot()
    print(clock.fps())

    for i in range (0, 100):
        print(i, " ", end="")
    print()

This is a known issue which I have a PR out to fix: misc: Update get_state() to work with a variable packet size. by kwagyeman · Pull Request #2493 · openmv/openmv

The IDE will be updated to support this once it’s merged.

However, you can by pass this issue in the IDE by clicking on the FPS label and turning off combined polling:

The CPU usage on the processor will modestly increase but it shouldn’t drop text anymore.