CSI Cameras with SPE

I am attempting to use the SPE while using a CSI camera.

I am currently using e-Con e-CAM121 CUOAGX camera on my Jetson Orin Dev Kit 64GB (JetPack 5.1.2). I followed the steps mentioned here to compile and flash a slightly modified version of the ivc-echo-task.c. This modified code simply prints a predefined message as you can see in the code snippet below:

static int ivc_echo_task_write_msg(void *data, int length)
{
	int ret;
	char *tx_msg;
	bool non_contig_available;

	const char* msg = "Hello from IVC echo task";

	if (!ivc_state) {
		error_hook("ivc_echo_task not init");
		return -1;
	}

	if (length > ivc_state->id->ivc_ch->frame_size) {
		error_hook("length larger than frame buffer size");
		return -1;
	}

	rtosSemaphoreAcquire(ivc_state->ivc_sem, rtosMAX_DELAY);

	ret = tegra_ivc_tx_get_contiguous_write_space(
		ivc_state->id->ivc_ch, &tx_msg, &non_contig_available);
	if (ret < 1) {
		error_hook("tegra_ivc_tx_get_contiguous_write_space() failed");
		goto exit;
	}

	// memcpy(tx_msg, data, length);
	memcpy(tx_msg, msg, strlen(msg));

	ret = tegra_ivc_tx_send_buffers(ivc_state->id->ivc_ch, 1);
	if (ret) {
		error_hook("tegra_ivc_tx_send_buffers() failed");
	}

exit:
	rtosSemaphoreRelease(ivc_state->ivc_sem);
	return ret;
}

This modified ivc-echo-task works as expected (prints “Hello from IVC echo task”). Following this, I install the necessary drivers specific to the CSI camera (provided by the camera manufacturer). After doing this, the CSI camera works fine (I can see the camera stream on a GUI). However, when I attempt to run the modified ivc-echo-task again, it fails stating that the data_channel does not exist:

image

My questions are:
1. Is this behavior expected? I don’t think the SPE code is too complex so why is this happening?
2. Is the SPE involved in interfacing with a CSI camera in any way? My understanding is there are some SPE-SPI pins on the CSI header. Is this correct? Does libargus utilize the SPE in any way for camera data streaming or camera control?

Would appreciate any leads.
@jachen

Hi,

For the camera basic functionality first needs to check the device and driver configuration.
You can reference to below program guide for the detailed information of device tree and driver implementation.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#sensor-software-driver-programming

Please refer to Applications Using V4L2 IOCTL Directly by using V4L2 IOCTL to verify basic camera functionality.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#to-run-a-v4l2-ctl-test

Once confirm the configure and still failed below link help to get log and some information and some tips for debug.
https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages

Thanks!

1 Like

Hello, dungrup:
I don’t know what’s your goal to connect the SPE with CSI camera. Maybe you can describe the use case, and we can discuss it more.

For your questions.

  1. have you ever checked whether the node ‘data_channel’ exists in your device? If not, please take a look at spe-freertos-bsp/rt-aux-cpu-demo-fsp/doc/ivc.md. Kernel DTB has to be updated.
  2. You code only tests data channel between CCPLEX and SPE, and it has nothing to do with SPI. By default, SPE firmware does not involve in anything related to CSI. I don’t know your goal, and no more comments though.

br
Chenjian

Hi Chenjian,

Thank you for the prompt reply. My objective is not to interface with the CSI camera with the SPE directly. I want to use the CSI camera even when there is a custom application running on the Cortex R5. This was an observation when trying to do the same.

  1. yes, it does exist when I followed the steps in ivc.md and I tested the functionality
    image
    Please note that this is BEFORE I install the CSI camera drivers.
  2. Yes my code does not deal with SPI in anyway. But, thank you for confirming that the SPE firmware is not related to CSI.

I hope the issue is clear now though. AFTER installing the eCon camera drivers I observed this “no such file/directory” for data_channel.

Have you ever checked the kernel DTB loaded 'AFTER installing the eCon camera drivers '?
You can just dump the kernel DTB in run time, and confirm whether the change for data_channel still exists.

br
Chenjian

Good point Chenjian.

It looks like when installing the camera drivers it somehow modifies the /boot/dtb/kernel_tegra234-p3701-0000-p3737-0000.dtb

This modified dtb has the aon_echo channel “disabled”.

What would be good fix such that the data_channel is enabled while still supporting the CSI camera?

after_econ_dtb.txt (592.8 KB)
before_econ.txt (553.0 KB)

You can just update the DTB to enable data_channel.

br
Chenjian

Worked. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.