Failing to link PRU code using CCS

I found some example PRU projects looking around on the forums, and so I’m trying to get their code to compile. Within CCS, I finally got it to show no errors. And with a good bit of work, I got the compile pass through clpru to succeed. However it’s failing on the linker pass. It’s saying it can’t find symbols:

  • pru_rpmsg_channel
  • pru_rpmsg_init
  • pru_rpmsg_receive
  • pru_rpmsg_send

They are declared within pru_rpmsg.h that is being included in c-file as a system file (using <>, not “”). I’d already worked through issues in CCS to get the compiler to find libc.a so I was aware that there were other *.h files in ~/ti/ccs1210/ccs/tools/compiler/ti-cgt-pru_2.3.3/ directory. So I looked there and found, the implementation file pru_rpmsg.c. However this directory is part of the CCS installation, not part of my source workspace directory. So I would assume/hope it is already compiled into a lib somewhere.

And indeed, I do see some lib files along with libc.a that I suspect MIGHT be what I’m looking for named:

  • rtspruv1_be.lib
  • rtspruv1_le.lib
  • rtspruv2_be.lib
  • rtspruv2_le.lib
  • rtspruv3_be.lib
  • rtspruv3_le.lib

I tried manually declaring one or two them to the linker, but that didn’t seem to help.

I also found where these files are in a CCS dropdown as “Runtime Support Library” files:

Manually delcaring nor picking them from this list seemed to make any difference. It doesn’t help that I don’t know what the difference between these 6 files is. The names are not intuitive to me.

In curiosity to just try something, I copied the pru_rpmsg.c local to the project’s main C-file (in this case it’s named pru.c) and tried another build. As expected, the linker no longer complained about those functions not being declared since there’s now a declaration. But it found different functions that are now not declared. So, what did I do? I copied all that source to my working example directory just to see what would happen. LOTS of errors and warnings of various types. So at this point, I think I’m going down a tangent rabbit hole.

So all that said, can anybody clarify what lib I’m supposed to include to get the pru_rpmsg stuff linked into this project?

Well I would say that be & le in the file names refer to big endian and little endian. In your screenshot you are compiling for little endian, but linking a big endian library. I assume the v1,v2,v3 might be referring to 3 different versions of the library. Other than that I have no idea sorry.

Thanks for the response. That certainly makes sense about the be and le. And I’ll update that in my project. However that wasn’t the fix.

I went back to the source code that I found the implementations in and decided to just try to make it and see what it makes. Turns out, it doesn’t make any of those be/le libs. It makes a lib called rpmsg_lib.lib which was not associated to my project whatsoever. Now knowing that this is what that source wants to make, I found that file premade in a different directory, associated it, and voila, I now have a compiling and linking example of PRU code in CCS.

For me, the original file was amongst the TI SDK install, not in CCS or CCS’s included PRU compiler/linker code. Here’s the relative path as it exists on my machine:

Not at all intuitive, but hopefully this helps someone else having a similar issue in the future.

The good news is making the lib was somewhat trivial. I was not able to build it as a normal user NOR was I able to do it using sudo commands. I had to promote my shell to super-user by running:
$ sudo bash --login

Then I was able to export the environment variable PRU_CGT needed by the makefile, which needs to be set to the path of your PRU compiler’s ./root, NOT the ./root/bin as the example in the makefile suggests when this variable is not configured.

When I attempted to do this with sudo, the makefile no longer saw my exported PRU_CGT variable. I even tried sudo export … but that’s evidently not allowed and gave me an error. I’m not one of those that gets nervous about being root, so I just made myself root, and solved the problem that way. I know I always get scolded by the hard-core Linux gurus out there for doing stuff like this, but I also want to get things done. There were probably other things I could’ve done to build without being root, but it wasn’t worth the time looking into it especially once I built with root, got the info I needed, and incorporated that into my project.

I am very surprised you needed root to build. That should not be the case, unless root owns the install. I will try to build the same example.later today.

I vaguely remember the installation of the TI SDK required sudo permissions to complete the install. I don’t recall why, but I suspect its so it could put symlinks in /usr/bin or something like that. But it’s also possible there’s a bug in their installer that continues to use that root permission when placing files that shouldn’t be extracted as root. Again, I could probably go figure it out or forcibly set all files in the SDK to a non-root user. But it just wasn’t a priority in the moment.

My hope is if anybody else has this issue in the future, the answer will just be a forum-search or maybe a google-search away.

Apologies for going OT on this. I cannot even get ccs to function properly.

Had problems getting it installed on Deb 11 so placed it in a fresh Ubuntu 22.04 VM and it installed/ launched.

Tried to click on the tutorials / videos / help and that is dead, any suggestions? This is on the “getting started” page

I tried installing on Ubuntu 22.04 and couldn’t get it to install. In fact the installer explicitly told me that CCS was only supported up to Ubuntu 18.04??? At the time (late last year), I downloaded the latest CCS installer available. And the CCS system requirements documentation clearly shows that Ubuntu 18.04, 20.04, and 22.04 are supported.

I happened to have an 18.04 VM and installed it on there, and it seemed to install and run just fine. Now that it is installed, I have no clue if Ubuntu could be upgraded to 20.04->22.04 and have CCS still work. I’ve had bad experiences with softwares upgrading with Ubuntu smoothly (mostly dependency libraries that are no longer supported or don’t have a clear upgrade path). It’s been hit-n-miss whether I was able to stay with the upgrade or if I had to revert. So now that I have a working setup, I just don’t have a lot of motivation to try…at least until some feature I need is only available on a newer version and gives me an incentive to try.

But point is my suggestion would be try installing Ubuntu 18.04 and then try to install CCS. I don’t know enough about exactly what changed between those Ubuntu versions to know why this would matter.

The page that comes up when the libraries are missing has a link to some more help files with the apt string and it did mention 22.04 LTS. I will install 18 and try that.

Its odd because eclipse installed and opened in Deb 11. Found out not to start that installer with sudo. Just install under the user account.

Wonder if it is worth the hassle getting up to speed on eclipse. Is it me or is that IDE overly complex relative to the end point.

Back in the old days my favorite was Borland Builder C++, I wish they would still be around and make something that supports Linux and aarch64/armhf. It was simple, you could have an actual demo model with a running database up and running very quickly. Now days, it takes a week or two just to read the help files…

I was an Eclipse user for quite a few years before I ever had any exposure to CCS. And during that time, I learned a lot about Eclipse’ peculiarities and eventually made peace with them because they were better than any of the IDEs offered by our vendors. So moving to CCS was an easy progression because I knew what was supposed to be available, where to look for it, and how to navigate the IDE. TI’s overlay of Eclipse is relatively minimal. The biggest value-add that CCS gives is that it builds into the software native knowledge of TI’s product line. Point being a lot of the complexity in CCS is inherited from Eclipse. And while I’ve come to be OK working with Eclipse, I have to say there are some issues that have been there for years that I’m disappointed haven’t been fixed yet. For example, lets say I want to include an H file but it isn’t found on any of the include paths CCS/Eclipse knows about, instead of just giving me an error, why not let me navigate to where on my system it is, and then let the IDE incorporate that new include automatically? But no, it doesn’t do that. You just have to know where and how to get include paths added, and it is a rather buried location you REALLY have to search for to find (or google search for help on).

It’s these quality-of-life improvements that really make products like JetBrain’s IntelliJ IDEa (for Java) so much better and worth the price if you use them everyday. I think JetBrain’s C/C++ IDE is called CLion, however I have to admit I’ve never used it. But based on my experience with IntelliJ, I would expect it to be a notable improvement over Eclipse CDT.

The modern day version of the ease-of-use development environments is Visual Studio for .NET. Back about 10 years ago, I went from knowing NOTHING about C# development to having a working program doing 80% of what I needed in about 4 days. Over the next 2 weeks of using that tool, I continued to add little niceties to it here and there that made it a completely usable tool for the testing I was doing at the time. I know there are plenty of companies that have enterprise .NET development, and one thing I could say is I did not get a feel for how to write .NET programs in a way that would scale well. I’m SURE it exists, I just didn’t need to stick with it long enough to learn .NET to that depth. But if I just need to throw something together quickly, I would go back to .NET no question.

Now since then, other technologies have matured, JavaScript, Python, Ruby, just to name a few. And while Python was an option back then, I’d had VisualBasic experience from college and just defaulted to .NET thinking maybe C# would be similar, and as it turns out, it was VERY similar. In fact, almost all the documentation I found for C# also applied verbatim to VisualBasic.NET. The only obvious differences I could see between the two were syntactic like using semicolons to end a line or using BEGIN and END instead open and close curly-braces. But if you were familiar and really like the old Borland Turbo C++/Pascal/Basic/Delphi development software, I think you’ll find VisualStudio’s C# familiar, not difficult to migrate to at all with major improvements.

Just to give you an example, I remember dropping a serial port in Borland C++ and having to manually configure what COM port options to display in the drop-down. In .NET, you can get the serial Port object to populate the dropdown with the COM ports currently available on the PC so you don’t have to fill a combobox up with COM1-thru-COM20 of which the PC won’t have most of.

1 Like

I did the demo a couple of weeks ago, it was a joke. They have this arcane password ritual that started the whole process off on the wrong foot. Then it did install, it was running like cold molasses even on a 12 core box. So that one is off the table.

Been running geany with some scripts and that is working fine. Just needed to get an interactive debug session up and a little bit more structure. Last time I did any assembly was using masm on DOS. Don’t recall what other tools were involved but I was working on drivers for cards on the ISA bus. With assembly it helps to have a “live” look at what is going on. Down the road those PRU’s look interesting and I am trying to get things lined up before hand.
We started a project with the Pico as the key deterministic element in the system then decided to have it all on one board, better idea??? maybe, maybe not.

Hmm. I use JetBrains IntelliJ IDEA Ultimate, PyCharm, CLion, DataGrip, GoLand, and WebStorm on my Lenovo ThinkPad X13s (Qualcomm Snapdragon 8cx Gen 3) with very acceptable performance. I’ve even built Yocto on it using WSL2 (Ubuntu) although it took 5 hours. My 16-c/32-t build server does it in an hour.

CLion requires ~3GB of available memory on the target in order to facilitate using the remote client, which is why CLion will not work wth the BBAI-64 and why I use VS Code to access the BBAI-64.

Also my build server runs Ubuntu 22.04.1 LTS and I was able to successfully install the Linux based tools after a warning that v18.04 was used to build the tools.

Wonder what was up with mine. The one I was on is 32gb and swappiness is set to 10. I might give it another try and see what happens.