How can I use PRU by CCS Compiler?

I 'm very confusing with many tutorial for PRU.
And Now I have CCS Compiler/Editor with PRU library.
I have example code/Project from PRU_Cape.
But I don’t know what should I do next step with all file in Released folder with my beaglebone?

And what should I do in beaglebone?
How can I make device tree source file?
How can I compile my C source code and flash to PRU’s program memory?

Does anyone recommend a tutorial to use PRU with CCS Compiler?

Thank You

Check out my post: PRU C Project - from device tree to program execution
It gives notes for all the above questions

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 1 นาฬิกา 9 นาที 51 วินาที UTC+7, Peter Gregory เขียนว่า:

Check out my post: PRU C Project - from device tree to program execution
It gives notes for all the above questions

Thank you
Your suggestion was helpful for me.
And now I have some problem with insert a device tree to slot file in /sys/devices/bone_capemgr.9 by “cat slots” command

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

it was not show after I insert “echo myoverlay > slots” and I recheck by “cat slots” command again it’s not show in list
And it’s show error like this

“-bash: echo: write error: File exists”

I think it tell me that has file in it already but it’s not show!!!

Try putting the device tree overlay file in
/sys/firmware
I made a mistake when I specified it go in /sys/kernel

I mean /lib/firmware

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 21 นาฬิกา 50 นาที 21 วินาที UTC+7, Peter Gregory เขียนว่า:

I mean /lib/firmware

In the /sys/devices/bone_capemgr.9, it’s must have more than 5 lists
I still cannot insert any devices tree into that by echo

And I think because it’s have no my device tree on bone_capemgr.9,
I have error by run ./pru_loader like this “prussdrv_open open failed” which according to your pru_loader.c code
it’s mean it cannot open “PRU_EVTOUT_0” which it’s in my device tree…

Maybe I cannot enable PRU by dtbo file right now?

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 23 นาฬิกา 46 นาที 18 วินาที UTC+7, tinnagit poojeerang เขียนว่า:

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 21 นาฬิกา 50 นาที 21 วินาที UTC+7, Peter Gregory เขียนว่า:

I mean /lib/firmware

In the /sys/devices/bone_capemgr.9, it’s must have more than 5 lists
I still cannot insert any devices tree into that by echo

And I think because it’s have no my device tree on bone_capemgr.9,
I have error by run ./pru_loader like this “prussdrv_open open failed” which according to your pru_loader.c code
it’s mean it cannot open “PRU_EVTOUT_0” which it’s in my device tree…

Maybe I cannot enable PRU by dtbo file right now?

But when I try to echo device tree to that list , It’s error by Files Exists but it’s not shown in lists…

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 23 นาฬิกา 57 นาที 21 วินาที UTC+7, tinnagit poojeerang เขียนว่า:

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 23 นาฬิกา 46 นาที 18 วินาที UTC+7, tinnagit poojeerang เขียนว่า:

เมื่อ วันจันทร์ที่ 8 ธันวาคม ค.ศ. 2014, 21 นาฬิกา 50 นาที 21 วินาที UTC+7, Peter Gregory เขียนว่า:

I mean /lib/firmware

In the /sys/devices/bone_capemgr.9, it’s must have more than 5 lists
I still cannot insert any devices tree into that by echo

And I think because it’s have no my device tree on bone_capemgr.9,
I have error by run ./pru_loader like this “prussdrv_open open failed” which according to your pru_loader.c code
it’s mean it cannot open “PRU_EVTOUT_0” which it’s in my device tree…

Maybe I cannot enable PRU by dtbo file right now?

But when I try to echo device tree to that list , It’s error by Files Exists but it’s not shown in lists…

Yeah It’s work already…
I try to change your dts file
in your dts file , you use P9.31 is output right?
I saw in table Pin map is used by SPI (http://elinux.org/Ti_AM33XX_PRUSSv2 )
and I change to use P9.27 on GPIO125 , Offset Reg = 9A4h
and change you c code to simple blink on P9.27
and then it’s work right now

Thank You

my C Code:

`

void main(){
volatile uint32_t gpio;

/* Clear SYSCFG[STANDBY_INIT] to enable OCP master port */
CT_CFG.SYSCFG_bit.STANDBY_INIT = 0;

/* Toggle GPO pins TODO: Figure out which to use */
gpio = 0x0020;

/* TODO: Create stop condition, else it will toggle indefinitely */
while(1){
__R30 ^= gpio;
__delay_cycles(100000000);
}

/* Halt the PRU core */
__halt();
}

`

my dts code :

`
/dts-v1/;
/plugin/;

/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”;

/* identification */
part-number = “MYOVERLAY”;
version = “00A0”;

/* state the resources this cape uses */
exclusive-use =
// PRU resources used
“pruss”,
“pru0”,
// PRU Input pins
“P8.16”,“pr1_pru0_pru_r31_14”, // PIN Name and the PRU port it maps to (see table above)
// PRU Output pins
“P9.27”,“pr1_pru0_pru_r30_5”;

// MUX Bit Maps:
`
// 0x40 = slow slew (0 = fast slew)
// 0x20 = input (0 = output)
// 0x10 = pullup, 0x08 = disabled (0 = pulldown)
// 0x01 to 0x07 = mode 1 to 7
fragment@8 {
target = <&am33xx_pinmux>;
overlay {

pruss_pins: pruss_pins {
pinctrl-single,pins = <
0x038 0x06 // P8_16, gpio1[14] mode 6, input pull-up
0x1A4 0x25 // P9_27, gpio3[19] mode 5, output, pull-down

;
};
};
};

fragment@10 {
target = <&pruss>;
overlay {
status = “okay”; // This enables the PRU
pinctrl-names = “default”;
pinctrl-0 = <&pruss_pins>; // This uses our custom mapping (see above definition)

// This is for documentation only. You can see the pin mappings by:
// sudo cat /sys/kernel/debug/gpio
any_name1 { // Grouping of pins under this name
pin-names = “Input pin description”; // one name per pin defined in gpios. Multiple entries are$
gpios = <&gpio4 14 1>; // &gpio? (One based: 1-4 instead of 0-3) bit(0-31) input(1)/output(0). $
};
any_name2 {
pin-names = “Output pin description”;
gpios = <&gpio2 19 0>;
};
};
};
};

Thank you for your all support