cao ping

imx536 can debug problem

Discussion created by cao ping on Aug 2, 2013
Latest reply on Aug 5, 2013 by cao ping
Branched to a new discussion

hi everyone!

    now i am debugging the the flexcan driver under Linux,i want to write a character driver for flexcan,the register setting is as follows:

 

printf can module clock set:

     CCM_CCSR   = 0x0; LP_APM=0;

     CCM_CSCMR2 = 0x62b32f0b; CAN_CLKSEL:derive clock from ipg_clk_root(default)

     CCM_CCGR6 = 0x0ff00d0d;

 

printf can1 register :

     regs->mcr=0x6de0020f

     regs->ctrl=0x14b42012

     regs->timer=0x313

     regs->rxgmask=0x0

     regs->rx14mask=0x0

     regs->rx15mask=0x0

     regs->ecr=0x0

     regs->esr=0x 80

     regs->imask2=0x0

     regs->imask1=0x0

     regs->iflag2=0x0

     regs->iflag1=0x0

 

but when i write the data to MSG[8]

     can_id = 0xc0000;

     can_ctrl=0xc040000;

     data0=0x123;

     data1=0x124;

 

printf  the state register is :

     regs->ecr=0x68;

     regs->esr=0x28446;

     regs->iflag2=0x0;

     regs->iflag1=0x0;

    

     Does anyone who meet this problem?

    

 

 

 

Outcomes