Whci PRU-C-compiler is recommended?

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

Community/Open Source PRU-C-compiler is

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

OK, I’ll try GCC version! Just wanted to collect some information regarding both compilers in this thread…

OK, I'll try GCC version! Just wanted to collect some information regarding
both compilers in this thread...

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

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

- available at
http://software-dl.ti.com/codegen/non-esd/downloads/beta.htm
- 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?)

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.

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).

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

19 ноември 2014, сряда, 15:25:21 UTC+2, Karl Karpfen написа:

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?

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

21 ноември 2014, петък, 10:09:57 UTC+2, Karl Karpfen написа: