2013-09-11 07:00 PM
Finally got my ov2640 cameras and was chugging through the code. But then I started a debug session (after several other successful ones) and I get this error
''core is held in reset'' If I unplug the camera I can debug but that does me no good. If I start debugging without the camera then plug it in it will work for writing a few registers and then fail. Any ideas ? I'm using keil on a stm32f4 discoveryUpdate:It does not seem to get in this state if I do not call OV2640_JPEGConfig(JPEG_160x120);which does a lot of this type of stuff, seems to write a few i2c regs then stops responding.void OV2640_JPEGConfig(ImageFormat_TypeDef ImageFormat){ uint32_t i; OV2640_Reset(); Delay(200); /* Initialize OV2640 */ for(i=0; i<(sizeof(OV2640_JPEG_INIT)/2); i++) { OV2640_WriteReg(OV2640_JPEG_INIT[i][0], OV2640_JPEG_INIT[i][1]); } /* Set to output YUV422 */ for(i=0; i<(sizeof(OV2640_YUV422)/2); i++) { OV2640_WriteReg(OV2640_YUV422[i][0], OV2640_YUV422[i][1]); } #stm32f4discovery2013-09-12 01:11 PM
I still have no idea what causes this. I'm just writing to i2c registers in the camera and my debugging session crashes, followed by the inability to debug because
''core is held in reset''. I've had issues like this with other MCU normally I would restart them and it would go away. Its like the MCU is not responding to debugging so thats why your debugging crashes, so obviously its not ready to start another debug session. Its so weird though that it would happen when i'm writing i2c regs ? Do you think maybe the camera is pulling too much power when I enable and causes the cpu to throw a piston ? Thanks, hope I can figure this out jpg is going to be sweet !2013-09-13 03:41 AM
? Do you think maybe the camera is pulling too much power when I enable and causes the cpu to throw a piston ?
That was my first idea, some kind of brown-out. I once had such problems with a QVGA panel attached. Perhaps you can try to supply your hardware externally (not by USB).
2013-09-14 12:08 PM
I dont think its a power issue. I plugged in a computer ps with 5v to power everything and its exactly the same. I get to writing the reset register and I get stuck in
/* Test on I2C2 EV6 and clear it */
timeout = DCMI_TIMEOUT_MAX; /* Initialize timeout value */
while(!I2C_CheckEvent(I2C2, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED))
{
/* If the timeout delay is exeeded, exit with error code */
if ((timeout--) == 0) return 0xFF;
}
and I can see the timeout counting down. It almost seems like its coming from somewhere else like a interrupt causes some horrible issue, but if i dont go into the function that writes those registers it works fine ? But of course if i cant write the cameras registers I cant use it.
OV2640_WriteReg(OV2640_DSP_RA_DLMT, 0x01);
OV2640_WriteReg(OV2640_SENSOR_COM7, 0x80);
The first register just switches to page 1 the next should reset it, but Like I say above it never even gets past the check for transmitter mode ... ?
2013-09-14 02:10 PM
I think that maybe this is all caused because the camera port on my board is connecting a data line from the camera to the ''Reset'' pin which is connected to ''NRST'' so maybe when the camera does something it is asserting that pin and causing all these issues.
2013-09-14 02:21 PM
Yes, thats exactly what it was. Problem solved, thanks for reading.