Hello,
Right now I am preparing an example code for PRU to do some POC. I am trying to put some buffer in shared mem, but when I load the code through CCS, it does not allow me to write anything into shared memory. So anyone please let me know how can I access the shared memory region to load the code?
My gel file is as below:
menuitem "PRU_CAPE"
/* AM335x specific mux bit defines */
#define AM572X_SLEWCTRL_FAST (0 << 19)
#define AM572X_SLEWCTRL_SLOW (1 << 19)
#define AM572X_INPUT_EN (1 << 18)
#define AM572X_PULL_UP (1 << 17)
/* bit 3: 0 - enable, 1 - disable for pull enable */
#define AM572X_PULL_DISA (1 << 16)
#define AM572X_PIN_OUTPUT (0)
#define AM572X_PIN_OUTPUT_PULLUP (AM335X_PULL_UP)
#define AM572X_PIN_INPUT (AM335X_INPUT_EN | AM335X_PULL_DISA)
#define AM572X_PIN_INPUT_PULLUP (AM335X_INPUT_EN | AM335X_PULL_UP)
#define AM572X_PIN_INPUT_PULLDOWN (AM335X_INPUT_EN)
hotmenu PRU_Cape_Init()
{
PRU_PINMUX_Config();
PRU_PRCM_Enable();
PRU_ICSS_Reset();
}
hotmenu PRU_PINMUX_Config()
{
GEL_TextOut("****** PRU Cape PINMUX is being configured ***** \n","Output",1,1,1);
//**********************************************************
// DAC
//**********************************************************
//Data Out gpio6_10 - Mode 13
*((unsigned int*) 0x4A003774) = AM572X_PIN_OUTPUT | 13;
//Clock out
*((unsigned int*) 0x4A003778) = AM572X_PIN_OUTPUT | 13;
//Sync
*((unsigned int*) 0x4A00377C) = AM572X_PIN_OUTPUT | AM572X_PULL_DISA | 13;
}
hotmenu PRU_ICSS_Reset()
{
GEL_TextOut("*\t***** Reseting the PRU-ICSS ******\n","Output",1,1,1);
// *((unsigned int*) 0x44E00C00 ) |= 0x2;
// *((unsigned int*) 0x44E00C00 ) &= 0xFFFFFFFD;
}
hotmenu PRU_PRCM_Enable()
{
GEL_TextOut("\t****** Enabling PRU-ICSS clock ****** \n","Output",1,1,1);
// *((unsigned int*) 0x44E000E8 ) |= 0x02; // enabling the pru-icss module taking it out of idle //Rakesh Commented
*((unsigned int*) 0x4A009718 ) |= 0x02; // enabling the pru-icss module taking it out of idle //Rakesh Added
*((unsigned int*) 0x4A009720 ) |= 0x02; // enabling the pru-icss module taking it out of idle //Rakesh Added
//CSS_Reset();
}