On our custom OMAP4430 board (based on the PandaBoard), we're using an OV5640 sensor.
To support it, we're using the last Ubuntu 12.04 with the ti-ubuntu-3.4.0-1490.11 Linux kernel. We have build the last gstreamer0.10-openmax_0.10.0.4+ti1.6.7.3-1_armhf.deb from the Git repository.
And thanks to our NDA, we've got a copy of the Ducati firmware source code OPBU_Ducati_GLP1.6.7.zip.
Our purpose is just to take photos with the OV5640. So, we modified the Ducati firmware for the Panda platform to support the OV5640 (which is already supported by the Blaze platform).
Thanks to the following command, we succeed to take a photo :
gst-launch omx_camera mode=3 device=0 num-buffers=1 focus=2 focus-mode=1 focusweight=1 iso-speed=200 qfactor=90 name=cam cam.imgsrc ! queue ! "image/jpeg, width=2592, height=1944" ! filesink location=/tmp/test.jpg
Unfortunately, if we try to take several photos, the Linux kernel crashes :
[ 1047.385528] omap-rproc omap-rproc.1: omap rproc ipu_c0 crashed [ 1047.391876] rproc remoteproc1: fatal error #1 detected in ipu_c0: error type device exception [ 1047.402130] rproc remoteproc1: trying to recover ipu_c0 [ 1050.714385] ------------[ cut here ]------------ [ 1050.719421] kernel BUG at /home/fcoiffier/jarodSW/jarod_builder/kernel-ubuntu/drivers/staging/omapdrm/omap_drv.c:935! [ 1050.730865] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 1050.737152] Modules linked in: omapdrm_pvr(O) omapdce(C) rpmsg_omx omaprpc(C) leds_gpio omap_remoteproc rpmsg_resmgr_common remoteproc omap_rpmsg_resmgr rpmsg_resmgr virtio_rpmsg_bus virtio virt io_ring [ 1050.756713] CPU: 0 Tainted: G C O (3.4.0-1490-omap4 #11eolane7) [ 1050.764251] PC is at omap_drm_file_priv+0x1c/0x30 [ 1050.769378] LR is at dce_release+0x24/0x12c [omapdce] [ 1050.774841] pc : [<c0431884>] lr : [<bf04b2d4>] psr: a00f0113 [ 1050.774871] sp : e99d5de0 ip : e99d5df0 fp : e99d5dec [ 1050.787231] r10: ebe2c3b8 r9 : ed167190 r8 : 00000000 [ 1050.792877] r7 : c096e988 r6 : bf04c240 r5 : eb9d3400 r4 : e996e0c0 [ 1050.799926] r3 : bf04c214 r2 : 00000000 r1 : fffffff4 r0 : e996e0c0 [ 1050.806976] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 1050.814666] Control: 10c5387d Table: a99d004a DAC: 00000015
The root cause of this crash is a RP_MBOX_CRASH message posted in the mailbox by the M3. This message was posted due to a Ducati exception :
[1][ 62.194] ##### PPM: Shot2Shot time = 486817
[1][ 62.194]
[1][ 62.195]
[0][ 62.291] [ERR=6369] src/msp_camera_api.c:[948]:VideoStopSensor_ : Preview is STOPPED.. going ahead gracefully!
[0][ 62.291]
[0][ 62.327] [ERR=6370] src/bte_drv.c:[452]:Successfully acquired BTE resource ctx 0
[0][ 62.327] [ERR=6371] src/omx_iss_cam_usecase_with_pipe_common.c:[3063]:I->L OK !!!!!
[0][ 62.327]
[0][ 62.329] [ERR=6372] src/omx_core.c:[261]:
[0][ 62.329] ====
[0][ 62.329] RPMSG Trace log Buffer A9 Address: 0x9fb00000
[0][ 62.329] ====
[1][ 62.331] [WAR=6373] bios6/src/timm_osal_task.c:[205]:Task PrvFill is in ready state, will wait for task to terminate before deleting
[1][ 62.332] [WAR=6374] bios6/src/timm_osal_task.c:[205]:Task PrvCsi is in ready state, will wait for task to terminate before deleting
[1][ 62.333] [WAR=6375] bios6/src/timm_osal_task.c:[205]:Task PrvIsp is in ready state, will wait for task to terminate before deleting
[1][ 62.334] [WAR=6376] bios6/src/timm_osal_task.c:[205]:Task PrvFaceDetect is in ready state, will wait for task to terminate before deleting
[1][ 62.335] [WAR=6377] bios6/src/timm_osal_task.c:[205]:Task Prv3A is in ready state, will wait for task to terminate before deleting
[1][ 62.336] [WAR=6378] bios6/src/timm_osal_task.c:[205]:Task PrvGBCE is in ready state, will wait for task to terminate before deleting
[1][ 62.337] [WAR=6379] bios6/src/timm_osal_task.c:[205]:Task PrvExtraData is in ready state, will wait for task to terminate before deleting
[1][ 62.338] [WAR=6380] bios6/src/timm_osal_task.c:[205]:Task PrvMTIS is in ready state, will wait for task to terminate before deleting
[1][ 62.339] [WAR=6381] bios6/src/timm_osal_task.c:[205]:Task PrvLDC is in ready state, will wait for task to terminate before deleting
[1][ 62.340] [WAR=6382] bios6/src/timm_osal_task.c:[205]:Task CapPreFlashGen is in ready state, will wait for task to terminate before deleting
[1][ 62.341] [WAR=6383] bios6/src/timm_osal_task.c:[205]:Task CapPreFlash is in ready state, will wait for task to terminate before deleting
[1][ 62.342] [WAR=6384] bios6/src/timm_osal_task.c:[205]:Task CapFlashGen is in ready state, will wait for task to terminate before deleting
[1][ 62.343] [WAR=6385] bios6/src/timm_osal_task.c:[205]:Task CapRawImg is in ready state, will wait for task to terminate before deleting
[1][ 62.344] [WAR=6386] bios6/src/timm_osal_task.c:[205]:Task CapStatistics is in ready state, will wait for task to terminate before deleting
[1][ 62.345] [WAR=6387] bios6/src/timm_osal_task.c:[205]:Task CapDarkFrmSubs is in ready state, will wait for task to terminate before deleting
[1][ 62.346] [WAR=6388] bios6/src/timm_osal_task.c:[205]:Task Cap3A is in ready state, will wait for task to terminate before deleting
[1][ 62.347] [WAR=6389] bios6/src/timm_osal_task.c:[205]:Task CapGBCE is in ready state, will wait for task to terminate before deleting
[1][ 62.348] [WAR=6390] bios6/src/timm_osal_task.c:[205]:Task CapLdcCA is in ready state, will wait for task to terminate before deleting
[1][ 62.349] [WAR=6392] bios6/src/timm_osal_task.c:[205]:Task CapGLBCE is in ready state, will wait for task to terminate before deleting
[1][ 62.350] [WAR=6393] bios6/src/timm_osal_task.c:[205]:Task CapRawToYUV is in ready state, will wait for task to terminate before deleting
[1][ 62.351] [WAR=6394] bios6/src/timm_osal_task.c:[205]:Task CapLDCNSF is in ready state, will wait for task to terminate before deleting
[1][ 62.352] [WAR=6395] bios6/src/timm_osal_task.c:[205]:Task CapRER is in ready state, will wait for task to terminate before deleting
[1][ 62.353] [WAR=6396] bios6/src/timm_osal_task.c:[205]:Task CapThumbRER is in ready state, will wait for task to terminate before deleting
[1][ 62.354] [WAR=6397] bios6/src/timm_osal_task.c:[205]:Task CapJPEGeThumb is in ready state, will wait for task to terminate before deleting
[1][ 62.355] [WAR=6398] bios6/src/timm_osal_task.c:[205]:Task CapJPEGE is in ready state, will wait for task to terminate before deleting
[1][ 62.356] [WAR=6399] bios6/src/timm_osal_task.c:[205]:Task CapExtraData is in ready state, will wait for task to terminate before deleting
[1][ 62.357] [WAR=6400] bios6/src/timm_osal_task.c:[205]:Task CapThumbLDC is in ready state, will wait for task to terminate before deleting
[1][ 62.358] [WAR=6401] bios6/src/timm_osal_task.c:[205]:Task CapPostLDC is in ready state, will wait for task to terminate before deleting
[1][ 62.359] [WAR=6402] bios6/src/timm_osal_task.c:[205]:Task CapREDetect is in ready state, will wait for task to terminate before deleting
[1][ 62.360] [WAR=6403] bios6/src/timm_osal_task.c:[205]:Task CapPostRER is in ready state, will wait for task to terminate before deleting
[1][ 62.361] [WAR=6404] bios6/src/timm_osal_task.c:[205]:Task SnapExtraData is in ready state, will wait for task to terminate before deleting
[1][ 62.362] [WAR=6405] bios6/src/timm_osal_task.c:[205]:Task CapPostview is in ready state, will wait for task to terminate before deleting
[1][ 62.363] [WAR=6407] bios6/src/timm_osal_task.c:[205]:Task CapGBCEWT is in ready state, will wait for task to terminate before deleting
[0][ 62.367] Exception occurred at (PC) = 85e322c0
[0][ 62.367] CPU context: thread
[0][ 62.367] BIOS Task name: SYS3A_CALC handle: 0x8602c680.
[0][ 62.367] BIOS Task stack base: 0x86024678.
[0][ 62.367] BIOS Task stack size: 0x8000.
[0][ 62.367] [t=0x00000001:843c5446] ti.sysbios.family.arm.m3.Hwi: ERROR: line 937: E_hardFault: FORCED
[0][ 62.367] ti.sysbios.family.arm.m3.Hwi: line 937: E_hardFault: FORCED
[0][ 62.367] [t=0x00000001:843f267e] ti.sysbios.family.arm.m3.Hwi: ERROR: line 1049: E_usageFault: INVSTATE: Invalid EPSR and instruction combination
[0][ 62.367] ti.sysbios.family.arm.m3.Hwi: line 1049: E_usageFault: INVSTATE: Invalid EPSR and instruction combination
[0][ 62.367] R0 = 0x85e321f8 R8 = 0x860f7878
[0][ 62.367] R1 = 0xffffffd8 R9 = 0x0021ad3c
[0][ 62.367] R2 = 0x0bc64428 R10 = 0x8000001a
[0][ 62.367] R3 = 0x85e322c0 R11 = 0x00000000
[0][ 62.367] R4 = 0x85e321f8 R12 = 0x860297c4
[0][ 62.367] R5 = 0x00000002 SP(R13) = 0x86029870
[0][ 62.367] R6 = 0x860d4a14 LR(R14) = 0x003907eb
[0][ 62.367] R7 = 0x861d1b60 PC(R15) = 0x85e322c0
[0][ 62.367] PSR = 0x30000000
[0][ 62.367] ICSR = 0x00435803
[0][ 62.367] MMFSR = 0x00
[0][ 62.367] BFSR = 0x00
[0][ 62.367] UFSR = 0x0002
[0][ 62.367] HFSR = 0x40000000
[0][ 62.367] DFSR = 0x00000000
[0][ 62.367] MMAR = 0xe000ed34
[0][ 62.367] BFAR = 0xe000ed38
[0][ 62.367] AFSR = 0x00000000
[0][ 62.367] Stack trace
[0][ 62.367] 00 [op f977f7fd] 003934e7 (ret from call to 003907d4)
[0][ 62.367] 01 [op fbdbf001] 003934fb (ret from call to 00394cb0)
[0][ 62.367] 02 [op fdddf000] 0039292f (ret from call to 003934e8)
[0][ 62.367] 03 [op ff09f063] 0032eb0b (ret from call to 0039291c)
[0][ 62.367] -- [op a1a36001] 00020101
[0][ 62.367] 04 [op fcbff0b3] 0027b113 (ret from call to 0032ea90)
[0][ 62.367] 05 [op f9c3f060] 0021acb5 (ret from call to 0027b03a)
[0][ 62.367] 06 [op fcd5f010] 00384387 (ret from call to 00394d30)
[0][ 62.367] 07 [op 47886840] 8602990c
[0][ 62.367] 08 [op fbc4f28a] 0009c691 (ret from call to 00326e18)
This exception occurs in the auto_white_balance_delete_stereo() calling awb_alg_dcc_tuning_dcc_bin_free() calling TIMM_OSAL_Free() : in fact, the function tries to free an invalid pointer.
But this code can work during the first 12 taken photos and can crash at the 13th. So, this problem can be due to a memory corruption or an erroneous code in awb_alg_dcc_tuning_dcc_bin_free() which tries to free a not initialized pointer.
But the source code in auto_white_balance_delete_stereo() and awb_alg_dcc_tuning_dcc_bin_free() isn't provided with Ducati source code : only the subs.aem3 library.
So, we have several questions :
- Is it a known problem for the Ducati development team ?
- Can it be due to a bad initialization of the OV5640 (in fact, there is no DCC for AWB algorithm with this OV5640 sensor) ?
- Is there a way to get an update Ducati source code or the source code of the subs.aem3 library ?
Regards,
Frédéric