Hi Mark, Thanks a lot for the response. I think the idea in this processor SDK Linux tutorial <https://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Overview/Processor_SDK_Linux_create_SD_card_script.html> is to create Linux SD card from the Processor SDK Linux package, which somewhat echoes with your suggestion. I guess what confuses me is that in README.txt of the example, it just says "build firmware & userspace code" in the directory, which I assume both are done in BBB. Firmware is straightforward to build, because there is PRU code generation tools - compiler <https://www.ti.com/tool/download/PRU-CGT-2-3>. I already used cross-compiler to build Userspace (ARM side) code. In the meantime, I just wonder if that can also be done in current BBB system. I will definitely study the document you suggest. Thanks!
In addition, the bigger problem is actually rpmsg_pru30 issue. That literally prevents me from running any rpmsg functions. As Dennis mentioned, this might be a device tree problem? I need to spend some time on this. Regards, Cheng 在2021年4月30日星期五 UTC-4 下午9:06:24<lazarman> 写道: > Cheng > > I'm actually using the SDK now so be careful about generic advise > the instructions are for Ubuntu not Debian > 'Since I had questions myself right now I realized this PRU code you have > just a small part of the SDK > My point was you never read the SDK quick start > Please do so here is the doc tarball > ' > 12. Documentation Tarball — Processor SDK RTOS Documentation > <http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/Documentation_Tarball.html> > > If you search the group on X15 and DSP Jeff Aused the SDK and ran the > binary on Debian(For the DSP with remore proc) > > So yes you can use Debian to load the PRU firmware you need a > corresponding ARM binary for that code. Jeff used the SDK to build that > > I dont know where you read to compile SDK examples on BBB its not > something I read > > So use Ubuntu box as instructions tell you too > > OR > > wait to see if Jeff Andlich can tell you if its feasable to attempt to > install the SDK on the board itself and compile the code that doesn't > sound right to me > > OR > > create an account on E2E ask the people who designed the SDK especially if > your confused > > I can answer CCS JTAG barebone ARM questiion about SDK not interested in > Linux > > Please read the tarball in the link > > Regard > ' > > > On Friday, April 30, 2021, 03:09:09 PM CDT, Cheng Chen <[email protected]> > wrote: > > > Hi all, > > I am practicing PRU skills through some TI examples. I am playing with > PRU_ADC_onChip > > <https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am335x/PRU_ADC_onChip?h=master>example > > and ran into a few questions. I wonder if you can help me with. > > The nice thing about this example is it has a README.txt with all the > procedures. The idea is to use rpmsg to communicate between arm and pru > module and read out ADC value. > I am using a Beaglebone Black wireless. > Here is the basic procedures. > > FILE STRUCTURE > PRU_ADC > | > |--pru_adc_firmware.c firmware loaded into PRU0 > | > |--pru_adc_userspace > |--pru_adc_userspace.c userspace code that interacts with PRU0 > > BUILD FIRMWARE & USERSPACE CODE > $ cd <PATH_TO_PRU_SW_SUPPORT_PACKAGE>/examples/am335x/PRU_ADC_onChip/ > $ make clean > $ make > $ cd pru_adc_userspace/ > $ make clean > $ make > > My BBB wireless can compile pru code successfully because I installed > PRU_CGT compiler. But it is unable to compile ARM code. I think that is > because ARM_CCT cross-compiler toochain environment is missing, in another > word, I need to install processor-sdk-am335x > > My first questions is can I install processor-sdk-am335x into Debian > system I currently have (Linux beaglebone 4.19.94-ti-r62 ) ? I am a little > confused about the relationship between this SDK and Debian system. Why is > the tutorial asking me to compile pru_adc_userspace.c in the Beaglebone. > I thought it is supposed to be executed in a cross-compilation environment. > > I ended up installing processor-sdk-am335x on my linux desktop and > compiled successfully. Then I copied the generated file back to BBB > wireless. But when I tried to run the program, it shows the following > error. > > Reading voltage at ADC Channel: 5 > /dev/rpmsg_pru30 could not be opened. > Trying to initialize PRU using sysfs interface. > ERROR: Could not open /dev/rpmsg_pru30 > > Attached is the excerpt where the problem happened. Could anyone help me > with some hints of what is going on here? Much appreciated. > > > struct shared_struct message; > > /* use character device /dev/rpmsg_pru30 */ > char outputFilename[] = "/dev/rpmsg_pru30"; > > /* test that /dev/rpmsg_pru30 exists */ > FILE *ofp; > uint16_t returnedVoltage; > ofp = fopen(outputFilename, "r"); > > if (ofp == NULL) { > > printf("/dev/rpmsg_pru30 could not be opened. \n"); > printf("Trying to initialize PRU using sysfs interface.\n"); > > FILE *sysfs_node; > char firmware[] = "/sys/class/remoteproc/remoteproc1/firmware"; > char firmwareName[] = "PRU_ADC_onChip.out"; > sysfs_node = fopen(firmware, "r+"); > if (sysfs_node == NULL) { > printf("cannot open firmware sysfs_node"); > return EXIT_FAILURE; > } > fwrite(&firmwareName, sizeof(uint8_t), sizeof(firmwareName), > sysfs_node); > fclose(sysfs_node); > > char pruState[] = "/sys/class/remoteproc/remoteproc1/state"; > char start[] = "start"; > sysfs_node = fopen(pruState, "r+"); > if (sysfs_node == NULL) { > printf("cannot open state sysfs_node"); > return EXIT_FAILURE; > } > fwrite(&start, sizeof(uint8_t), sizeof(start), sysfs_node); > fclose(sysfs_node); > > /* give RPMSG time to initialize */ > sleep(3); > > ofp = fopen(outputFilename, "r"); > > if (ofp == NULL) { > printf("ERROR: Could not open /dev/rpmsg_pru30\n"); > exit(EXIT_FAILURE); > } > } > > > > > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/1d43aa7b-0e94-4431-9e31-13545213940bn%40googlegroups.com > > <https://groups.google.com/d/msgid/beagleboard/1d43aa7b-0e94-4431-9e31-13545213940bn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f04a0c44-1816-4837-b4fa-9ea2ce3c69bfn%40googlegroups.com.
