This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-TDA4VM: Camera with the imx219

Part Number: SK-TDA4VM

Hi Team,

SDK: ti-processor-sdk-linux-j7-evm-08_06_01_02

Camera modules: imx219

When the board is connected with the imx219 camera, the log of booting the board is as follows: 

Fullscreen
1
2
[ 10.678229] cdns-csi2rx: probe of 4504000.csi-bridge failed with error -22
[ 10.741322] cdns-csi2rx: probe of 4514000.csi-bridge failed with error -22
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When enter /run/media/mmcblk0p1/uEnv.txt, making the modification: name_overlays=k3-j721e-sk-rpi-cam-imx219.dtbo

The log for restarting the board after modification is as follows: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[ 7.682820] imx219 8-0010: supply VANA not found, using dummy regulator
[ 7.694639] imx219 8-0010: supply VDIG not found, using dummy regulator
[ 7.727209] imx219 8-0010: supply VDDL not found, using dummy regulator
[ 7.759459] k3-dsp-rproc 4d80800000.dsp: assigned reserved memory node c66-dma-memory@a7000000
[ 7.759701] imx219 9-0010: supply VANA not found, using dummy regulator
[ 7.776665] k3-dsp-rproc 4d80800000.dsp: configured DSP for remoteproc mode
[ 7.777461] imx219 9-0010: supply VDIG not found, using dummy regulator
[ 7.792750] k3-dsp-rproc 4d80800000.dsp: local reset is deasserted for device
[ 7.793635] imx219 9-0010: supply VDDL not found, using dummy regulator
[ 7.811501] remoteproc remoteproc0: 4d80800000.dsp is available
[ 7.827184] imx219 9-0010: failed to read chip id 219
[ 7.838293] imx219: probe of 9-0010 failed with error -5
........
[ 9.522278] cdns-csi2rx 4504000.csi-bridge: Probed CSI2RX with 2/4 lanes, 4 streams, external D-PHY
[ 9.536147] remoteproc remoteproc19: b10c000.txpru is available
[ 9.548261] cdns-csi2rx 4514000.csi-bridge: Probed CSI2RX with 2/4 lanes, 4 streams, external D-PHY
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

There are two ways to set up the camera and take a picture in this case:

1)media-ctl and v4l2-ctl tool

media-ctl -p information:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@tda4vm-sk:/home# media-ctl -p -d /dev/media0
Media controller API version 5.10.162
Media device information
------------------------
driver j721e-csi2rx
model TI-CSI2RX
serial
bus info platform:4500000.ticsi2rx
hw revision 0x1
driver version 5.10.162
Device topology
- entity 1: 4500000.ticsi2rx (17 pads, 17 links, 1 route)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
routes:
0/0 -> 1/0 [ACTIVE]
pad0: Sink
[stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
<- "cdns_csi2rx.4504000.csi-bridge":1 [ENABLED,IMMUTABLE]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Taking pictures with v4l2-ctl does not return normally, the .raw file generated after exit is forced with Ctrl+c is empty. 

2) v4l2 API

The following simple photo programs is being used for test:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <sys/mman.h>
#include <string.h>
#define DEV "/dev/video2"
//#define WIDTH 640
//#define HEIGHT 480
#define BUF_NUM 4
#define BRIGHTNESS 10 //
#define CONTRAST 10 //
struct pic_data
{
unsigned char *tmpbuffer[BUF_NUM];
unsigned int tmpbytesused[BUF_NUM];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

DQBUF error:

Dqbuf is blocking when the device is turned on in blocking mode. An error is returned when the device is turned on in non-blocking mode. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@tda4vm-sk:/home# ./camera
Support format:
1.YUYV 4:2:2
2.UYVY 4:2:2
3.YVYU 4:2:2
4.VYUY 4:2:2
5.8-bit Bayer BGBG/GRGR
6.8-bit Bayer GBGB/RGRG
7.8-bit Bayer GRGR/BGBG
8.8-bit Bayer RGRG/GBGB
9.10-bit Bayer BGBG/GRGR
10.10-bit Bayer GBGB/RGRG
11.10-bit Bayer GRGR/BGBG
12.10-bit Bayer RGRG/GBGB
13.12-bit Bayer BGBG/GRGR
14.12-bit Bayer GBGB/RGRG
15.12-bit Bayer GRGR/BGBG
16.12-bit Bayer RGRG/GBGB
17.10-bit Bayer RGBG/GIrGIr
18.10-bit Bayer GRGB/IrGIrG
19.10-bit Bayer BGRG/GIrGIr
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The full log is as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
U-Boot SPL 2021.01-g62a9e51344 (May 02 2023 - 15:41:24 +0000)
Model: Texas Instruments J721E SK R5
Board: J721EX-EAIK rev B
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.3--v08.06.03 (Chill Capybar')
Trying to boot from MMC2
Starting ATF on ARM64 core...
NOTICE: BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE: BL31: Built : 15:40:55, May 2 2023
I/TC:
I/TC: OP-TEE version: 3.20.0 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Tue May 2 15:41:00 UTC 2023 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.3--v08.06.03 (Chill Capybar')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Fixing SA2UL firewall owner for GP device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The customer would like to know how to complete a photo test with the camera in correct way. Could you help give some suggestions? Thanks.

Best Regards,

Cherry