Part Number: BEAGL-BONE-AI-64
Tool/software:
Hi,
I am using "ti-cgt-c7000_5.0.0.LTS" compiler and working on establishing IPC communication between the Cortex-A72 and the C71x DSP on the BeagleBone AI-64, using using remoteproc and rpmsg.
My goal is to have the DSP C71x send a "hello world" message to the Cortex-A72 when it receives a "start" message from Cortex-A72. I developed the DSP code using functions defined in "ipc.h" from the Processor SDK RTOS (ti-processor-sdk-rtos-j721e-evm-11_00_00_06) and successfully built a .out file using the attached Makefile.
But when send the .out file to the Beaglebone ai 64 and try to deploy it on dsp, I get the following error:
debian@BeagleBone:~$ sudo scp dsp_rpmsg_hello.out /lib/firmware/
[sudo] password for debian:
debian@BeagleBone:~$ sudo echo stop > /sys/class/remoteproc/remoteproc14/state
debian@BeagleBone:~$ sudo echo dsp_rpmsg_hello.out > /sys/class/remoteproc/remoteproc14/firmware
debian@BeagleBone:~$ cat /sys/class/remoteproc/remoteproc14/firmware
dsp_rpmsg_hello.out
debian@BeagleBone:~$ sudo echo start > /sys/class/remoteproc/remoteproc14/state
echo: write error: Invalid argument
//this is "dsp_hello.c" file which when i make it using the makfile i get "dsp_rpmsg_hello.out"
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <c7x.h>
#include <ipc.h> //ipc.h :ti/drv/ipc/ipc.h
#include "ipc_rsctable.h"
#define BUF_SIZE 128
#define REMOTE_PROC_ID 0 // Linux on A72
#define LOCAL_SERVICE_NAME "dsp_service"
uint8_t recv_buf[BUF_SIZE];
uint8_t send_buf[BUF_SIZE];
int main(void)
{
RPMessage_Handle handle;
RPMessage_Params params;
uint32_t myEndPt;
uint32_t remoteEndPt;
uint32_t remoteProcId;
uint16_t recv_len;
int32_t status;
// Initialize IPC with default parameters
Ipc_init(NULL);
// Initialize RPMessage module
RPMessageParams_init(¶ms);
params.requestedEndpt = 0; // Let the driver assign an endpoint
params.numBufs = 16; // Adjust as needed
params.bufSize = BUF_SIZE; // Adjust as needed
// Create an RPMessage endpoint
handle = RPMessage_create(¶ms, &myEndPt);
if (handle == NULL) {
return -1;
}
// Announce our endpoint to A72
status = RPMessage_announce(REMOTE_PROC_ID, myEndPt, LOCAL_SERVICE_NAME);
if (status != IPC_SOK) {
return -1;
}
while (1) {
// Wait for message from A72
status = RPMessage_recv(handle, recv_buf, &recv_len, &remoteEndPt, &remoteProcId, (uint32_t)-1); //-1: time IPC_WAIT_FOREVER
if (status == IPC_SOK) {
if (strncmp((char *)recv_buf, "start", 5) == 0) {
strcpy((char *)send_buf, "Hello World from DSP!");
RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, send_buf, strlen((char *)send_buf) + 1);
}
} else {
break;
}
}
return 0;
}#Makefile
# Compilateur TI pour C71xx
CC = /opt/ti-cgt-c7000_5.0.0.LTS/bin/cl7x
#LD = lnk7x
CFLAGS = --c11 -mv7120 --opt_level=3 -g --define=SOC_J721E --define=CORE_DSP_C7_1 \
--include_path=./ \
--include_path=/opt/ti-cgt-c7000_5.0.0.LTS/include \
--include_path=/home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/drv/ipc \
--include_path=/home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/
LDFLAGS = -z --entry_point=main --heap_size=0x800 --stack_size=0x800
INCLUDES = -I/opt/ti-cgt-c7000_5.0.0.LTS/include/
LIB_DIR = /opt/ti-cgt-c7000_5.0.0.LTS/lib/
# Fichiers sources
SRCS = dsp_hello.c
OBJS = $(SRCS:.c=.obj)
OUT = dsp_rpmsg_hello.out
# Cible par défaut
all: $(OUT)
# Règle de compilation
%.obj: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Édition des liens
$(OUT): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/drv/ipc/lib/j721e/c7x_1/release/ipc.ae71 \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/csl/lib/j721e/c7x/release/ti.csl.init.ae71 \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/csl/lib/j721e/c7x/release/ti.csl.init.ae71 \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/osal/lib/nonos/j721e/c7x/release/ti.osal.ae71 \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/drv/sciclient/lib/j721e/c7x_1/release/sciclient.ae71 \
-l /home/chaima/ti/j7/ti-processor-sdk-rtos-j721e-evm-11_00_00_06/pdk_jacinto_11_00_00_21/packages/ti/board/lib/j721e_evm/c7x/release/ti.board.ae71 \
-l /opt/ti-cgt-c7000_5.0.0.LTS/lib/rts7120_le.lib
# Nettoyage
clean:
rm -f $(OBJS) $(OUT)
Could you please help me understand the cause of this error and how to resolve it? Any guidance or resources to help me achieve the intended goal would be greatly appreciated.
Best regards,
Chaima Ben Fredj
