RPMsg example question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RPMsg example question

291 Views
dougbaker
Contributor III

I am using a IMX8 with a A53 and a M7.  The M7 code is built with VSCode and MCUXpresso environment.  The M7 runs Free RTOS and I have the M7 running example projects.  I have the example “multicoe_examples/rpmsg-lite-str-echo-rtos-remote”  running but I have some questions about it.

On a fresh boot, it generally works when I can sent messages from the A53 to the M7.  If I restart jut the M7 CPU, the messages do not The messages only work after a full reset including the A53.  When rebooting justthe m7 core, the M7 fails on the following call: rpmsg_lite_is_link_up(my_rpmsg);

 

Is there a example or recommended way to implement 2 endpoints between the A53 and the M7?  How should two endpoints between the two cores be implemented?

 

Am I asking this question in the right forum?

Thanks,

Doug

0 Kudos
Reply
5 Replies

213 Views
dougbaker
Contributor III

echo start > /sys/class/remoteproc/remoteproc0/state^C

0 Kudos
Reply

214 Views
dougbaker
Contributor III
echo start > /sys/class/remoteproc/remoteproc0/state
0 Kudos
Reply

224 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dougbaker 

How did you load the M7? Using Linux remoteproc sysfs or U-Boot commands? 

Best Regards,
Zhiming

0 Kudos
Reply

179 Views
dougbaker
Contributor III
Using Linux remoteproc.
0 Kudos
Reply

178 Views
dougbaker
Contributor III
In order to better isolate the messaging problems I am seeing, I went back to the original example code, confirmed that it worked correctly, and then began making small modifications. After those minor changes, I started seeing the same type of failures again.

The modification I made was:

#define USE_MEMORY_TEST (0)
#if USE_MEMORY_TEST
#define DUMMYBUF_SIZE 1024 // failed = 1024
static char dummy_buf[DUMMYBUF_SIZE];
#endif


I put this at the top of the void app_task(void *param)

#if USE_MEMORY_TEST
dummy_buf[DUMMYBUF_SIZE-1] = 1;
PRINTF("\r\nAdded DummyBuf size = %d...%d\r\n",
DUMMYBUF_SIZE, dummy_buf[DUMMYBUF_SIZE-1]);
#endif

After adding this code, I started seeing problems when stopping and restarting the M7 application.

With the code above enabled, messaging works correctly after a full reboot/power-up. However, if I stop and then restart the M7 application, the messaging fails and does not recover unless I perform a full system reset/reboot (either with the hardware reset switch or using shutdown -r now).

To stop/start the M7 CPU, I am using:
• echo stop > /sys/class/remoteproc/remoteproc0/state
• echo start > /sys/class/remoteproc/remoteproc0/state

Doug
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2377616%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERPMsg%20example%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377616%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20a%20IMX8%20with%20a%20A53%20and%20a%20M7.%26nbsp%3B%20The%20M7%20code%20is%20built%20with%20VSCode%20and%20MCUXpresso%20environment.%26nbsp%3B%20The%20M7%20runs%20Free%20RTOS%20and%20I%20have%20the%20M7%20running%20example%20projects.%26nbsp%3B%20I%20have%20the%20example%20%E2%80%9Cmulticoe_examples%2Frpmsg-lite-str-echo-rtos-remote%E2%80%9D%26nbsp%3B%20running%20but%20I%20have%20some%20questions%20about%20it.%3C%2FP%3E%3CP%3EOn%20a%20fresh%20boot%2C%20it%20generally%20works%20when%20I%20can%20sent%20messages%20from%20the%20A53%20to%20the%20M7.%26nbsp%3B%20If%20I%20restart%20jut%20the%20M7%20CPU%2C%20the%20messages%20do%20not%20The%20messages%20only%20work%20after%20a%20full%20reset%20including%20the%20A53.%26nbsp%3B%20When%20rebooting%20justthe%20m7%20core%2C%20the%20M7%20fails%20on%20the%20following%20call%3A%20%3CSTRONG%3Erpmsg_lite_is_link_up%3C%2FSTRONG%3E(my_rpmsg)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIs%20there%20a%20example%20or%20recommended%20way%20to%20implement%202%20endpoints%20between%20the%20A53%20and%20the%20M7%3F%26nbsp%3B%20How%20should%20two%20endpoints%20between%20the%20two%20cores%20be%20implemented%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAm%20I%20asking%20this%20question%20in%20the%20right%20forum%3F%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EDoug%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2378359%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20RPMsg%20example%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378359%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eecho%20start%20%26gt%3B%20%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc0%2Fstate%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2378364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20RPMsg%20example%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2378364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eecho%20start%20%26gt%3B%20%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc0%2Fstate%5EC%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2377995%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20RPMsg%20example%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2377995%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F136710%22%20target%3D%22_blank%22%3E%40dougbaker%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20did%20you%20load%20the%20M7%3F%20Using%20Linux%20remoteproc%20sysfs%20or%20U-Boot%20commands%3F%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379164%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20RPMsg%20example%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379164%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIn%20order%20to%20better%20isolate%20the%20messaging%20problems%20I%20am%20seeing%2C%20I%20went%20back%20to%20the%20original%20example%20code%2C%20confirmed%20that%20it%20worked%20correctly%2C%20and%20then%20began%20making%20small%20modifications.%20After%20those%20minor%20changes%2C%20I%20started%20seeing%20the%20same%20type%20of%20failures%20again.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20modification%20I%20made%20was%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20USE_MEMORY_TEST%20(0)%3CBR%20%2F%3E%23if%20USE_MEMORY_TEST%3CBR%20%2F%3E%23define%20DUMMYBUF_SIZE%201024%20%2F%2F%20failed%20%3D%201024%3CBR%20%2F%3Estatic%20char%20dummy_buf%5BDUMMYBUF_SIZE%5D%3B%3CBR%20%2F%3E%23endif%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20put%20this%20at%20the%20top%20of%20the%20void%20app_task(void%20*param)%3CBR%20%2F%3E%3CBR%20%2F%3E%23if%20USE_MEMORY_TEST%3CBR%20%2F%3Edummy_buf%5BDUMMYBUF_SIZE-1%5D%20%3D%201%3B%3CBR%20%2F%3EPRINTF(%22%5Cr%5CnAdded%20DummyBuf%20size%20%3D%20%25d...%25d%5Cr%5Cn%22%2C%3CBR%20%2F%3EDUMMYBUF_SIZE%2C%20dummy_buf%5BDUMMYBUF_SIZE-1%5D)%3B%3CBR%20%2F%3E%23endif%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20adding%20this%20code%2C%20I%20started%20seeing%20problems%20when%20stopping%20and%20restarting%20the%20M7%20application.%3CBR%20%2F%3E%3CBR%20%2F%3EWith%20the%20code%20above%20enabled%2C%20messaging%20works%20correctly%20after%20a%20full%20reboot%2Fpower-up.%20However%2C%20if%20I%20stop%20and%20then%20restart%20the%20M7%20application%2C%20the%20messaging%20fails%20and%20does%20not%20recover%20unless%20I%20perform%20a%20full%20system%20reset%2Freboot%20(either%20with%20the%20hardware%20reset%20switch%20or%20using%20shutdown%20-r%20now).%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20stop%2Fstart%20the%20M7%20CPU%2C%20I%20am%20using%3A%3CBR%20%2F%3E%E2%80%A2%20echo%20stop%20%26gt%3B%20%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc0%2Fstate%3CBR%20%2F%3E%E2%80%A2%20echo%20start%20%26gt%3B%20%2Fsys%2Fclass%2Fremoteproc%2Fremoteproc0%2Fstate%3CBR%20%2F%3E%3CBR%20%2F%3EDoug%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E