It sounds like the OP is trying to do low-level reads of the SJA100 chip from
userspace. I suggest to load the driver, 'lincan.ko' using the appropriate
module arguments, and then use the model illustrated in the lincan package
example code to read & write CANbus messages. I have used that method with a
TS-CAN1 on a TS-7350 board.
TS supplied quite detailed instructions on the procedure with the TS-CAN1
modules I purchased. I will summarize from memory here (corrections welcome).
1. Load the shell helper functions from a script called 'ts7000.subr' (on the
initrd filesystem): '. ts7000.subr'
2. Enable the PC-104 bus: 'pc104on'
3. Load the kernel module: 'insmod lincan <optional arguments>'
4. Build/run the readburst.c application in the utils directory on the
ocera/lincan driver package.
The readburst application demonstrates how to read from the CANbus interface
using the lincan driver.
--- rod.
--- In Joel Morgan <> wrote:
>
> On Dec 12, 2011 8:48 AM, "zhangjing80" <> wrote:
> >
> >
> >
> >
> >
> > --- In Joel Morgan <jrcowboy79@> wrote:
> > >
> > > Hi,
> > >
> > > On Dec 12, 2011 3:08 AM, "zhangjing80" <zhangjing80@> wrote:
> > > >
> > > >
> > > >
> > > > hi, guys
> > > > I have a TSCAN1 Board and have installed it on TS7300, I have also
> read
> > > some relative manuals. The received can message is decoded at
> > > SJA1000_base_addr. The tscan1.c calls a function which is defined like:
> > > > static u8 tscan1_read(const struct sja1000_priv *priv, int reg)
> > > > {
> > > > return inb((unsigned long)priv->reg_base + reg);
> > > > }
> > > > This function will return the can message. But I have some questions
> > > about the getting data from the SJA1000_base_addr. I wanna get the 8
> byte
> > > data and transfer them, so has anyone ever used the TSCAN1 board? Could
> you
> > > please give me some help?Thanks in advance
> > >
> > > Are you using the Ocera framework?
> > >
> > > What is your question?
> > >
> > > Regards,
> > > -joel
> > >
> >
> > Hi, joel
> > yes, I used the Ocera framework, I have sevaral questions about the usage
> of the TSCAN1. Have you ever used it?
>
> Yes
>
> Could you please give me some help?
> > 1. you know a standard can frame mainly contains 11 ID and 8 byte data,
> according to the TSCAN1_manual,the SJA1000 supports dual-identifier mode.
> But each can frame has only one ID. Where comes double identifier?
>
> Lincan (and the other ocera components) present APIs to the user. One of
> the structure members, canmsg_t.id is an unsigned long. This is all defined
> in the header canmsg.h
>
> > 2. I can set the register, and select the SJA1000_IO base address, where
> the can message decodes itself. I wanna get the 8 byte data of each can
> frame, how can I realize it?
>
> From userspace? The lincan module wont take too kindly to that ;)
> Use the API
>
> > 3. If I wanna transfer data of data[8], you know that I should write them
> to Txbuffer, but how ?
>
> See above.
>
> -joel
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|