Hello, we want to use CAN via Sensor Processing Engine. However, I am a starter of it. So I want to know some questions on SPE.
Until now, we have compiled the example in the document:
And now, we have some questions about that below, the question is bolded:
- First, we want to know how to use Cortex-R5.
In my opinion, I treat the Cortex-R5 as a MCU. Just like what we should do while using MCU. We compile the software on PC, whose output may be a “hex” file or “bin” file.
So the Cortex-R5 may should be used in the same way. We compile the program on PC via gcc-arm-toolchain. Get the “bin” file and flash it with:
sudo ./flash.sh -k spe-fw <T186 or T194 SoC based Jetson platforms> mmcblk0p1
And then the program is flashed into EEPROM. When we power the NX, the Cortex-R5 run the program in EEPROM.
We want to know whethe what I have mentioned above is the usage of Cortex-R5.
And Could you please give us an example of the flash comman line above? Our NX is AGX Xavier NX, jetpack 35.3.1
And the flash won’t change the Linux system right?
- Secondly, we want to know how CAN is used on SPE.
In the example given in the “app/can-app.c”, we just find two init function of TX and RX.
void can_app_init(void)
{
can_app_tx_task_init(CAN_TX_CONTROLLER);
can_app_rx_task_init(CAN_RX_CONTROLLER);
}
It just like the init function in MCU.
So can we understand it as the init function of two interrupt function?
And then, if we treat it as interrupt function or RTOS system. When we enter the “can_app_tx_task_init”, we found the “xTaskCreate”, which is a function of RTOS.
/* CAN TX task */
ret = xTaskCreate(can_xmit_test, 0, 512, ttcan, tskIDLE_PRIORITY,
&can_xmit_handle);
if (ret != pdPASS) {
printf("CAN%lu: xTaskCreate for transmit failed\r\n", ttcan->id);
goto can_deinit_err;
}
However, we don’t find the “can_xmit_test”, which should be a function ptr in that parameter. And it should also represent the task we want to set.
So in the example, the “can_xmit_test” is not given. When we want to set task of tx, we need to write a function code right? Just like this:
void can_xmit_test(void){
...
}
And in addition, can it be treated like an interrupt funciton, which means when CAN send something, the Cortex-R5 will run it.
- And finally, can Cortex-R5 communicate with Linux system? And how to make it?