Part Number: TDA4VM
Other Parts Discussed in Thread: SYSBIOS
Hello!
Situation:
- I have the Yocto Linux running on the A72 and I have a custom application running there.
- The DSPs are currently running bare-metal (both C66 and C71)
- I compile SYSBIOS and XDCTools stuff but I do not start the OS at the moment
What I want to do:
I want to send a notification from the DSPs to the application on the A72.
The notification does not need to contain data, I just must differentiate from which DSP the notification was sent.
What I have now on the C71 DSP:
#define IPC_RPMESSAGE_OBJ_SIZE 256U
#define RPMSG_DATA_SIZE (256U * 512U + IPC_RPMESSAGE_OBJ_SIZE)
uint8_t gCntrlBuf[RPMSG_DATA_SIZE] __attribute__((section("ipc_data_buffer"), aligned(8)));
uint8_t gRspBuf[RPMSG_DATA_SIZE] __attribute__((section("ipc_data_buffer"), aligned(8)));
static uint8_t ipcCntrlTskStack[64 * 1024] __attribute__((section(".bss:taskStackSection")))
__attribute__((aligned(8192)));
uint32_t fileio_rpmsg_endpt = 0;
RPMessage_Handle fileio_rpmsg_handle;
uint32_t fileio_rpmsg_remote_endpt = 0;
void initRpmsg()
{
RPMessage_Params cntrlParam;
RPMessage_Params params;
int32_t ret = 0;
RPMessageParams_init(&cntrlParam);
cntrlParam.buf = &gCntrlBuf[0];
cntrlParam.bufSize = RPMSG_DATA_SIZE;
cntrlParam.stackBuffer = &ipcCntrlTskStack[0];
cntrlParam.stackSize = sizeof(ipcCntrlTskStack);
ret = RPMessage_init(&cntrlParam);
RPMessageParams_init(¶ms);
params.requestedEndpt = 13;
params.buf = &gRspBuf[0];
params.bufSize = RPMSG_DATA_SIZE;
fileio_rpmsg_handle = RPMessage_create(¶ms, &fileio_rpmsg_endpt);
}
void sendMsg()
{
int32_t ret = 0;
char buf[10];
std::sprintf(buf, "ping");
ret = RPMessage_send(fileio_rpmsg_handle, IPC_MPU1_0, 13U, IPC_C7X_1, buf, std::strlen(buf));
}
What I have on the A72 app:
#define IPC_RPMESSAGE_OBJ_SIZE 256U
#define RPMSG_DATA_SIZE (256U * 512U + IPC_RPMESSAGE_OBJ_SIZE)
uint8_t buf[RPMSG_DATA_SIZE] __attribute__((section("ipc_data_buffer"), aligned(8)));
pthread_t task;
int unblockfd;
void* appIpcRpmsgRxTaskMain(void* arg)
{
(void)arg;
std::printf("appIpcRpmsgRxTaskMain\n");
std::fflush(stdout);
return nullptr;
}
int32_t appIpcCreateRpmsgRxTask()
{
pthread_attr_t thread_attr;
int32_t status = 0;
unblockfd = eventfd(0, 0);
if (unblockfd < 0)
{
status = -1;
printf("IPC: ERROR: Unable to create unblock event !!!\n");
}
if (status == 0)
{
status |= pthread_attr_init(&thread_attr);
if (status != 0)
{
printf("IPC: ERROR: Unable to set thread attr !!!\n");
}
if (status == 0)
{
status |= pthread_create(&task, &thread_attr, appIpcRpmsgRxTaskMain, nullptr);
}
pthread_attr_destroy(&thread_attr);
}
if (status != 0)
{
printf("IPC: ERROR: Unable to create RX thread !!!\n");
}
return status;
}
int main(int argc, char* argv[])
{
rpmsg_char_init(nullptr);
rpmsg_char_dev_t* rcdev;
char eptdev_name[32] = {0};
sprintf(eptdev_name, "rpmsg-char-%d-%d", DSP_C71_0, getpid());
rcdev = rpmsg_char_open(DSP_C71_0, NULL, 13, eptdev_name, 0);
appIpcCreateRpmsgRxTask();
}
Now I get the following error message on A72:
_rpmsg_char_find_rproc: 64800000.dsp is either not probed or not a remoteproc!
What am I doing wrong?
Sadly the documentation is not really good, although there are a lot of examples it's all full of OpenVx stuff and complicated.
Best regards
Jan Hieber