Skip to content

Code stops working after few seconds on Maix M1 Dock #37

Description

@narduzzi

Hello,

I am tying to run the hello_world.py scripts but it crashes after a few seconds of running.

# Hello World Example
#
# Welcome to the CanMV IDE! Click on the green run arrow button below to run the script!

import sensor, image, time, lcd

lcd.init()                          # Init lcd display
lcd.clear(lcd.RED)                  # Clear lcd screen.

# sensor.reset(dual_buff=True) # improve fps
sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
#sensor.skip_frames(time = 2000)     # Wait for settings take effect.
#clock = time.clock()                # Create a clock object to track the FPS.

while(True):
   #clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    lcd.display(img)                # Display image on lcd.
    #print(clock.fps())              # Note: CanMV Cam runs about half as fast when connected
                                    # to the IDE. The FPS should increase once disconnected.

To Reproduce
Steps to reproduce the behavior:

  1. Build firmware from kpu/featwith nncase 1.8.0 support for Maix M1 Dock (using project canmv_dock).
  2. Flash Micropython v1.0.5-5-ge1b2766-dirty on 2023-05-24; CanMV_Board with kendryte-k210
  3. Connect to IDE
  4. Run hello_world.pyscript. Output is:
init i2c:2 freq:100000
[CANMV]: find ov2640
[CANMV]: find ov sensor
...crash

What could be the source of the problem?
Not sure of it, but it seems related to the data transfer in the IDE.
The code following code works:

import sensor, image, time, lcd

lcd.init()                          # Init lcd display
lcd.clear(lcd.RED)                  # Clear lcd screen.
sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
time.sleep(2)

while(True):
    print(0)
    time.sleep(0.2) # removing this line makes the code crash.

Configuration

  • IDE version: 2.9.2
  • Firmware version: v1.0.5-5-ge1b2766-dirty
  • Board: Sipeed Maix Dock M1
  • OS: MacOS Ventura

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions