Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hi,
I'm trying to run and load PRU from arm cortex A8, but when my code want to execute the PRUICCS_create() funciton it ends up with an error
CortxA8: Unhandled ADP_Stopped exception 0x20023
And goes to do_AngelSWI()
Did anyone had a similar porblem to mine? This is my code:
/*
* ======== main.c ========
*/
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/runtime/Error.h>
#include <stdio.h>
#include <ti/drv/pruss/pruicss.h>
#include <ti/drv/pruss/soc/pruicss_v1.h>
#include <ti/board/board.h>
/*
* ======== taskFxn ========
*/
PRUICSS_Handle handle = NULL;
uint32_t instance = PRUICCSS_INSTANCE_ONE;
extern char binBuff[8192];
Void taskInitPRUFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");
PRUICSS_Config *pruss_config;
PRUICSS_socGetInitCfg(&pruss_config);
/* Creates handle for PRUICSS instance */
handle = PRUICSS_create(pruss_config, instance);
//PRUICSS_HwAttrs const *hwAttrs = handle->hwAttrs;
//PRUICSS_pinMuxConfig(handle, 0x0); /* PRUSS pinmuxing */
PRUICSS_pruDisable(handle, PRUICCSS_PRU0);
PRUICSS_pruDisable(handle, PRUICCSS_PRU1);
UART_printf("\n\rPRU beggin to load app!\n");
PRUICSS_setPRUBuffer(handle, PRUICCSS_PRU0, binBuff, (11*10));
PRUICSS_setPRUBuffer(handle, PRUICCSS_PRU1, binBuff, (11*10));
PRUICSS_enableOCPMasterAccess(handle);
PRUICSS_pruExecProgram(handle, PRUICCSS_PRU0);
PRUICSS_pruExecProgram(handle, PRUICCSS_PRU1);
//PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA;
//PRUICSS_pruIntcInit(handle, &pruss_intc_initdata);
PRUICSS_pruEnable(handle, PRUICCSS_PRU0);
PRUICSS_pruEnable(handle, PRUICCSS_PRU1);
UART_printf("\n\rPRU Load!\n");
Task_sleep(10);
System_printf("exit taskFxn()\n");
}
/*
* ======== main ========
*/
Int main()
{
/*
* use ROV->SysMin to view the characters in the circular buffer
*/
System_printf("enter main()\n");
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_ICSS_PINMUX;
Board_init(boardCfg);
BIOS_start(); /* does not return */
return(0);
}
And this is how I enable the pru in GEL file:
#define PRCM_BASE_ADDR (0x44E00000)
#define CM_PER_PRU_ICSS_CLKCTRL (PRCM_BASE_ADDR + 0x0E8)
#define CM_DPLL (0x44E00500)
#define CLKSEL_PRU_ICSS_OCP_CLK (CM_DPLL + 0x030)
WR_MEM_32(CM_PER_PRU_ICSS_CLKCTRL, 0x2);
WR_MEM_32(CLKSEL_PRU_ICSS_OCP_CLK, 0x1);
GEL_TextOut("PRU_ICSS enabled.\n");
