Part Number: AM5728
HI,
Purpose: Using C code programming AM5728 PRU driver DCAN.
IDE: CCS10.1.1.00004 .
Trouble: PRU cannot directly manipulate DCAN registers by mapping addresses (always return 0x00000000), GPIO(LED) levels have been manipulated in this way.
Is there any restriction that PRU cannot directly access the peripheral address of DCAN?
Here's how I did it: (DCAN1_CTL_REG always get 0x00000000)
#define HWREG(x) (*((volatile unsigned int *)(x)))
#define DCAN1_CTL 0x4AE3C000
#define DCAN1_CTL_INIT_ENTER_INIT_MODE_MASK 0x00000001
void function(void)
{
unsigned int DCAN1_CTL_REG = 0;
/* Get the DCAN register value */
DCAN1_CTL_REG = HWREG(DCAN1_CTL);
/* Set THE DCAN register */
HWREG(DCAN1_CTL) |= DCAN1_CTL_INIT_ENTER_INIT_MODE_MASK;
/* Waiting the DCAN1 enter the INIT mode */
do{
DCAN1_CTL_REG = HWREG(DCAN1_CTL);
}while(!(DCAN1_CTL_REG & DCAN1_CTL_INIT_ENTER_INIT_MODE_MASK));
}