Hi, I've been working with Christian, and he's been very helpful. In
trying to get to the bottom of my problem I wrote a /proc/file
interface so I could read & write mcp251x registers from userspace.
I've discovered that I can only read/write resisters in one very
specific condition. I describe how to get there below:

1. load the module
2. run "ip link set can0 up" this creates a "RTNETLINK answers:
Invalid argument" error, however the driver is doing several things
here (attached as fcall_link-up_fail is the debug output including my
added debug stuff).
3. Now I can read/write registers. I don't even need to use my hacked
/proc/file to test this. This is the only time "ip link set can0 type
can bitrate 50000" shows a actual numbers on the CNF debug line
"mcp251x spi1.3: CNF: 0x09 0xbf 0x02".

The only way I've found to get back to this state is to unload &
reload the driver. I understand that you can only mess with some of
the mcp251x registers when CANCTRL is in configuration mode, but at
the very least on startup you shouldn't need the failed link up
command for it to work. And probably whenever the link is down in
should be configurable.

I'm going through all of this because I was have a baud problems on the bus.

thanks,
Paul
mcp251x spi1.3: : mcp251x_open
mcp251x spi1.3: before mcp251x_hw_wakeup
mcp251x spi1.3: : mcp251x_write_bits
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_write_bits
mcp251x spi1.3: : mcp251x_spi_transmcp251x_can_isr
mcp251x spi1.3: : mcp251x_irq_work_handler
mcp251x spi1.3: : mcp251x_read_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_write_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_read_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_write_bits
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_read_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: before mcp251x_hw_reset
mcp251x spi1.3: : mcp251x_hw_reset
mcp251x spi1.3: : mcp251x_write_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_read_reg
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: : mcp251x_write_bits
mcp251x spi1.3: : mcp251x_spi_trans
mcp251x spi1.3: before mcp251x_setup
mcp251x spi1.3: : mcp251x_setup
mcp251x spi1.3: bit-timing not yet defined
mcp251x spi1.3: unable to set initial baudrate!
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to