How to integrated work SPE-fw and CUDA?

All kernel-build files are copyied in Linux_for_Tegra/kernel. Is it okey?

Jachen, I did dto update and flashing and found /sys/devices/aon_echo/data_channel but how to communicate each other?

Mr. jachen,
Could you answer above question?

Hello All,
Anyone know above question?

Hello, hamzaygrtc:
Good to know that you got /sys/devices/aon_echo/data_channel.
After that, you can echo/cat strings to/from that sysFS node, and that string will be transferred from CCPLEX (Linux) to SPE R5 (FreeRTOS).
You can check SPE FW source rt-aux-cpu-demo/app/ivc-echo-task.c for details.

br
Chenjian

Hello jachen,
I checked ivc-echo-task.c but which function will be used read and write for string I couldn’t understand. Not worked. Could you tell me a example read and write for both sides?

Hello,
in file rt-aux-cpu-demo/app/ivc-echo-task.c function ivc_echo_task_process_ivc_messages, there’s a loop to get messages. and ivc_echo_task_write_msg to send messages, from SPE side.

br
ChenJian

hello jachen,

I tried debug following code but not get in loop . program cutting. If I put my function above I can see debug output why this happening? tegra_uart_write_now(&UART_APP_PORT, tx_message4, tx_len4);

ret = xEventGroupWaitBits(state->wait_event,
					  EVENT_WAIT_ALL_BITS,
					  pdFALSE,
					  pdTRUE,
					  portMAX_DELAY); // not get in this below of this code
static portTASK_FUNCTION(ivc_echo_task, pvParameters)
{
	struct ivc_echo_task_state *state = pvParameters; 
	EventBits_t ret;
		
	for (;;) {
		ret = xEventGroupWaitBits(state->wait_event,
					  EVENT_WAIT_ALL_BITS,
					  pdFALSE,
					  pdTRUE,
					  portMAX_DELAY); // not get in this below of this code
       	char tx_message4[] = "m100\r\n";
	int tx_len4 = sizeof(tx_message4) - 1;
	 tegra_uart_write_now(&UART_APP_PORT, tx_message4, tx_len4);
		vTaskDelay(1000);			  
		
		if ((ret & EVENT_WAIT_ALL_BITS) == EVENT_WAIT_ALL_BITS) {
			xEventGroupClearBits(state->wait_event,
					     EVENT_WAIT_BIT);
			ivc_echo_task_process_ivc_messages(state);
		}
	}
}

Hello,
In Linux side, execute ‘echo xxx >…/…/data_channel’, and in SPE FW function ivc_echo_task_process_ivc_messages

dbgprintf("IVC read count: %d\r\n", count);

should be executed and then SPE FW will write back the message by ivc_echo_task_write_msg.

br
ChenJian

hi,
I got deleted this code.

ret = xEventGroupWaitBits(state->wait_event,
					  EVENT_WAIT_ALL_BITS,
					  pdFALSE,
					  pdTRUE,
					  portMAX_DELAY); // not get in this below of this code

run then got in ivc_echo_task_process_ivc_messages but nothing reading
with

cat data_channel

Hello,
my suggestion is to add some print code and understand the logic first. then you can try to make some changes.

br
Chenjian

You need not add ivc_echo_task_init. That will be called in main.c - late_init.

Do you mean that the ivc is enabled in default that we don’t need to change anything, just compile and flash to the SPE, then the SPE part works?

Hello, hao.ye:
It should be. That part of task has already been enabled in SPE FW for SDK 32.4.2
If that does not work as expected, you can start a new thread to discuss that.

br
ChenJian

Can you please show me an example of the code I should add to the spe sources to send/receive data from data_channel?
I can see the /sys/devices/aon_echo/data_channel in Linux.

Hello,
Please take a look at How to integrated work SPE-fw and CUDA? - #29 by jachen and other replies.
Some code clips are pasted and it may help.

br
ChenJian