Skip to content

Giga R1: GC2145 Issues #81

@mjs513

Description

@mjs513

While playing with the cameras went back to the giga to test the GC2145 and found 1 minor issue and 1 major one.

Minor issue.
Need to add {0} at end of static const struct video_format_cap fmts[] list:

static const struct video_format_cap fmts[] = {
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_QVGA_W, RESOLUTION_QVGA_H, VIDEO_PIX_FMT_RGB565),
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_VGA_W, RESOLUTION_VGA_H, VIDEO_PIX_FMT_RGB565),
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_UXGA_W, RESOLUTION_UXGA_H, VIDEO_PIX_FMT_RGB565),
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_QVGA_W, RESOLUTION_QVGA_H, VIDEO_PIX_FMT_YUYV),
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_VGA_W, RESOLUTION_VGA_H, VIDEO_PIX_FMT_YUYV),
	GC2145_VIDEO_FORMAT_CAP(RESOLUTION_UXGA_W, RESOLUTION_UXGA_H, VIDEO_PIX_FMT_YUYV),
  {0}
};

other wise if you try and do something like:

	printf("\n- Capabilities:\n");
	while (caps.format_caps[i].pixelformat) {
		const struct video_format_cap *fcap = &caps.format_caps[i];
		/* fourcc to string */
		printf("  %c%c%c%c width [%u; %u; %u] height [%u; %u; %u]\n",
		       (char)fcap->pixelformat, (char)(fcap->pixelformat >> 8),
		       (char)(fcap->pixelformat >> 16), (char)(fcap->pixelformat >> 24),
		       fcap->width_min, fcap->width_max, fcap->width_step, fcap->height_min,
		       fcap->height_max, fcap->height_step);
		i++;
	}

the resulting output list is corrupted, i.e.

uart:~$ Video device: dcmi@48020000
- Capabilities:
  RGBP width [[00:00:00.657,000] <inf> usb_cdc_acm: Device suspended
uart:~$ ; 0] height [240; 240; 0]
  RGBP width [640; 640; 0] height [480; 480; 0]
  RGBP width [1600; 1600; 0] height [1200; 1200; 0]
  YUYV width [320; 320; 0] height [240; 240; 0]
  YUYV width [640; 640; 0] height [480; 480; 0]
  YUYV width [1600; 1600; 0] height [1200; 1200; 0]
   width [1; 134640648; 47265] height [220; 1; 2053]
   width [134603900; 1073872896; 587] height [134603012; 0; 1]
   width [65537; 0; 929] height [0; 0; 2053]
   width [1; 134615628; 384] height [11; 3853; 0]
  ▒ width [384; 4269; 384] height [384; 3885; 0]
  M width [384; 3949; 384] height [384; 3437; 0]
  ▒ width [384; 4237; 384] height [384; 4301; 0]
  ▒ width [384; 134640886; 29991] height [134640900; 134640920; 2054]
  3 width [134602428; 134602428; 57484] height [134602652; 134602660; 2053]
  ▒ width [134640976; 327681; 30038] height [134627103; 458754; 2054]
  width [134619260; 589840; 30052] height [134640987; 524320; 2054]
  @
 width [134641007; 393344; 0] height [0; 0; 0]

- Current Video format: RGBP 320x240
- Supported frame intervals for the default format:

after the fix:

 Video device: dcmi@48020000
- Capabilities:
  RGBP width [[00:00:00.657,000] <inf> usb_cdc_acm: Device suspended
uart:~$ ; 0] height [240; 240; 0]
  RGBP width [640; 640; 0] height [480; 480; 0]
  RGBP width [1600; 1600; 0] height [1200; 1200; 0]
  YUYV width [320; 320; 0] height [240; 240; 0]
  YUYV width [640; 640; 0] height [480; 480; 0]
  YUYV width [1600; 1600; 0] height [1200; 1200; 0]

- Current Video format: RGBP 320x240
- Supported frame intervals for the default format:

MAJOR ISSUE:
after rebuilding I am not seeing any images on in the visualizer just an empyt window. In Serial1.

 Video device: dcmi@48020000
- Capabilities:
  RGBP width [[00:00:00.657,000] <inf> usb_cdc_acm: Device suspended
uart:~$ ; 0] height [240; 240; 0]
  RGBP width [640; 640; 0] height [480; 480; 0]
  RGBP width [1600; 1600; 0] height [1200; 1200; 0]
  YUYV width [320; 320; 0] height [240; 240; 0]
  YUYV width [640; 640; 0] height [480; 480; 0]
  YUYV width [1600; 1600; 0] height [1200; 1200; 0]

- Current Video format: RGBP 320x240
- Supported frame intervals for the default format:

[00:00:00.909,000] <inf> usb_cdc_acm: Device configured
[00:00:03.366,000] <wrn> video_stm32_dcmi: HAL_DCMI_ErrorCallback

once I get the <wrn> video_stm32_dcmi: HAL_DCMI_ErrorCallback data will not come out of the buffer and no images will get produced. This is with the stancard raw byte sketch

#include "camera.h"

Camera cam;

void fatal_error(const char *msg) {
  Serial.println(msg);
  pinMode(LED_BUILTIN, OUTPUT);
  while (1) {
      digitalWrite(LED_BUILTIN, HIGH);
      delay(100);
      digitalWrite(LED_BUILTIN, LOW);
      delay(100);
  }
}

void setup(void) {
  Serial.begin(115200);    
  if (!cam.begin(320, 240, CAMERA_RGB565)) {
    fatal_error("Camera begin failed");
  }
  cam.setVerticalFlip(false);
  cam.setHorizontalMirror(false);

  Serial.println("Camera Started....");
}

void loop() {
  FrameBuffer fb;
  if (cam.grabFrame(fb)) {
    if (Serial.read() == 1) {
      Serial.write(fb.getBuffer(), fb.getBufferSize());
    }
    cam.releaseFrame(fb);
  }
}

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