imx536 can debug problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx536 can debug problem

986 Views
caoping
Contributor II

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?

    

Tags (4)
0 Kudos
3 Replies

717 Views
caoping
Contributor II

and when i enable LOOP_BACK MODE the register is as follows:

regs->mcr=0x4de0020f

regs->ctrl=0x14b43012

regs->timer=0x717

regs->rxgmask=0x0

regs->rx14mask=0x0

regs->rx15mask=0x0

regs->ecr=0x0

regs->esr=0x80

regs->imask2=0x0

regs->imask1=0x0

regs->iflag2=0x0

regs->iflag1=0x0

and i can send MSG8,and recieve data from MSG0,but wehn i disable LOOP_BACK MODE.i still can't send any data out,and the flag bit can't be set in iflag1 registers

0 Kudos

717 Views
caoping
Contributor II

This problem has been settled down.when debug CAN,we need to use to board,one is sender,and the other is reciver,the register is as follows:

CCM_CSCMR2      = 62b32f0b

CCM_CCGR6      = ff0010d

CCM_CCGR6      = ff0010d

regs->mcr=0x6460020f

regs->ctrl=0x14b42012

regs->timer=0x310

regs->rxgmask=0x0

regs->rx14mask=0x0

regs->rx15mask=0x0

regs->ecr=0x0

regs->esr=0x80

regs->imask2=0x0

regs->imask1=0x0

regs->iflag2=0x0

regs->iflag1=0x0

and the driver is a character driver,some code refer to  flexcan.c code in the path:/linux/drivers/net/can/flexcan.c

0 Kudos

717 Views
caoping
Contributor II

it produce a sending error.

0 Kudos