Whci PRU-C-compiler is recommended?

326 views
Skip to first unread message

Karl Karpfen

unread,
Nov 4, 2014, 7:11:23 AM11/4/14
to beagl...@googlegroups.com
Hi,

it seems there are two C-compilers available that are able to generate PRU-code. One from TI and one introduced here in this board. But...which one is recommended to be used? That's what I found out so far, may be somebody can add some missing information to make it easier to choose one:

TI's PRU-C-compiler is

- BETA
- can be used to create ARM-objects (which can be linked to a bare metal application and loaded to PRU on start-up automatically?)

Community/Open Source PRU-C-compiler is

- BETA
- GCC-based and therefore more stable

din...@gmail.com

unread,
Nov 4, 2014, 11:47:27 AM11/4/14
to beagl...@googlegroups.com
Hi Karl,

The PRU GAS and LD ports should be in a good shape. But the PRU GCC port has not yet reached beta. Judge for yourself:
  • PRU GCC has not been "battle tested" on a big project.
  • Only two small examples are currently used to "sanity check" the pru gcc releases.
  • PRU GCC has no known bugs.
If you can take a little risk and don't mind checking the compiler-generated assembler, then go ahead and try PRU GCC.

If you want an "ASAP, no hassles" C compiler for PRU, TI's one would be a more suitable choice right now.

Regards,
Dimitar

Karl Karpfen

unread,
Nov 4, 2014, 11:57:16 AM11/4/14
to beagl...@googlegroups.com
OK, I'll try GCC version! Just wanted to collect some information regarding both compilers in this thread...

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/rwNrqudk0Ug/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Kridner

unread,
Nov 6, 2014, 12:40:08 PM11/6/14
to beagl...@googlegroups.com
The latest version of the C compiler is no longer in beta. Even
better, it is a freely redistributable binary. While not as good as
redistributable source like the GCC, at least we can easily get it to
everyone;

http://software-dl.ti.com/codegen/non-esd/downloads/download.htm#PRU

I updated the wiki page and http://beagleboard.org/pru. I expect this
to be included in upcoming Debian releases, if not the GCC as well.

>>>
>>> Community/Open Source PRU-C-compiler is
>>>
>>> - avaialble at https://github.com/dinuxbg/gnupru
>>> - BETA
>>> - GCC-based and therefore more stable
>>>
>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/beagleboard/rwNrqudk0Ug/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> beagleboard...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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

Karl Karpfen

unread,
Nov 19, 2014, 8:25:21 AM11/19/14
to beagl...@googlegroups.com
Meanwhile I'm more than happy with TI's C-compiler. Especially the disassembler is very useful in case one has to count instructions to get the exact number of clock cycles a code-sequence requires (needed in some realtime applications).

din...@gmail.com

unread,
Nov 20, 2014, 2:24:49 PM11/20/14
to beagl...@googlegroups.com
Just to let you know that the PRU GCC toolchain also has a disassembler:
   pru-objdump -d myprog.elf
For more information do "man objdump"

Regards,
Dimitar

Karl Karpfen

unread,
Nov 21, 2014, 3:09:57 AM11/21/14
to beagl...@googlegroups.com
That's cool! Is there also a tool to extract text and data binaries out of an ELF file to load it into PRUs instruction and data RAM separately?

din...@gmail.com

unread,
Nov 22, 2014, 4:17:15 AM11/22/14
to beagl...@googlegroups.com
The standard objcopy should be able to extract and convert:
  pru-objcopy -j .data myprog.elf -O binary DMEM.bin
  pru-objcopy -j .text myprog.elf -O binary IMEM.bin

Alternatively, you can parse the ELF file yourself, as does the example loader:  https://github.com/dinuxbg/gnupru/blob/master/example/host/pload.c#L109

Regards,
Dimitar
Reply all
Reply to author
Forward
0 new messages