Hi everyone,

I try to write a program for the pru on the beagle bone green. For this I 
got two programs
1. Running on default Debian system, which loads the program into the pru
2. Program, which should run on the pru.

To achieve this I downloaded the example "hello world" 
<http://mythopoeic.org/bbb-pru-minimal/>, of which the compiled version is 
running well.
I want to write the program of the pru in C. So I transfered the assembler 
code into the C-Language, which is looking like this:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <stdint.h>
#include <pru_cfg.h>

#define PRU0_R31_VEC_VALID (1<<5)
#define SIGNUM 3 // corresponds to PRU_EVTOUT_0

#define DELAY_SECONDS 5 // adjust this to experiment
#define CLOCK 200000000 // PRU is always clocked at 200MHz
#define CLOCKS_PER_LOOP 2 // loop contains two instructions, one clock each
#define DELAYCOUNT DELAY_SECONDS * CLOCK / CLOCKS_PER_LOOP

volatile register uint32_t __R31;

void main(void) {
    volatile uint32_t time = DELAYCOUNT;
            while(time != 0) {
                time--;
            }
    __R31 |= PRU0_R31_VEC_VALID | SIGNUM;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The compiled program has a size of: 25652 Bytes, which is 25,6 kB, which is 
a way too large for the PRU, with only 8 KB InstructionRAM.
If I compile an empty program, looking like this:

void main(void) {}
The program has a size of 23388 Bytes, which is still too large.
I also tried to run the first LAB of TI from this website: 
http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs#LAB_1:_Toggle_LED_with_PRU_GPO
I can't get the program to run, because I get errors of the loader program, 
running on linux and the pru program is still to large.
The Compiler is configured like in the lab.
The output of the compiling process:

**** Build of configuration Debug for project toggle_led ****

/home/fabian/ti/ccsv6/utils/bin/gmake -k all 
Building file: ../main.cpp
Invoking: PRU Compiler
"/home/fabian/ti/ccsv6/tools/compiler/ti-cgt-pru_2.1.2/bin/clpru" -v3 -O0 
--include_path="/home/fabian/ti/processor-sdk-am335x/example-applications/pru-icss-4.0.2/include/am335x"
 
--include_path="/home/fabian/ti/ccsv6/tools/compiler/ti-cgt-pru_2.1.2/include" 
-g --define=am3359 --define=pru0 --diag_wrap=off --diag_warning=225 
--display_error_number --endian=little --hardware_mac=on 
--preproc_with_compile --preproc_dependency="main.d"  "../main.cpp"
Finished building: ../main.cpp
 
Building target: toggle_led.out
Invoking: PRU Linker
"/home/fabian/ti/ccsv6/tools/compiler/ti-cgt-pru_2.1.2/bin/clpru" -v3 -O0 
-g --define=am3359 --define=pru0 --diag_wrap=off --diag_warning=225 
--display_error_number --endian=little --hardware_mac=on -z 
-m"toggle_led.map" --stack_size=0x100 --heap_size=0x100 
-i"/home/fabian/ti/ccsv6/tools/compiler/ti-cgt-pru_2.1.2/lib" 
-i"/home/fabian/ti/ccsv6/tools/compiler/ti-cgt-pru_2.1.2/include" 
--reread_libs --diag_wrap=off --display_error_number --warn_sections 
--xml_link_info="toggle_led_linkInfo.xml" --rom_model -o "toggle_led.out" 
"./main.obj" "../AM335x_PRU.cmd"  -llibc.a 
<Linking>
Finished building target: toggle_led.out
 

**** Build Finished ****

What am I doing wrong?
How can I get the program running on the PRU? 
Do the programs have the size like mine too (about 20 - 30 kB)?

I would apprechiate any help.

-- 
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 beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/ef8eb3e3-bbd1-46aa-b903-6d7073f9ca33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to