From: Stanislau Arkhipenka <dise.logo-JGs/UdohzUI@public.gmane.org>
To: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: SPI-CAN mcp2515
Date: Thu, 17 Dec 2015 23:26:00 +0300 [thread overview]
Message-ID: <1450383960.2007.3.camel@mail.ru> (raw)
Dear Colleagues, Hello.
Currently i'm working on building fully functional real size humanoid
robot.
One of major points of my work is connecting peripheral devices through
CAN bus to cubieboard.
During this activities i have read tonnes of manuals, related to Device
Tree Source, but still have alot of problems with connecting mcp2515 to
Cubieboard (v1).
Would you be so kind to help my in this field? I'm trying to configure
it more that month and have no success.
My changes in DTS file sun4i-a10-cubieboard.dts represented in following
diff:
54a55,59
> can0_oscillator = <&can0_osc>,"oscillator-frequency";
> can0_speed = <&can0>,"spi-max-frequency:0";
> can0_interrupt =
<&can0_pins>,"allwinner,pins:PB11",<&can0>,"interrupts:0";
>
>
77a83,90
>
> /* ************************************************** */
> clocks {
> can0_osc: can0_osc {
> compatible = "fixed-clock";
> #clock-cells = <0>;
> clock-frequency = <16000000>;
> };
78a92
> /* ************************************************* */
179a194,199
> /* ****************************************************** */
> can0_pins: can0_pins {
> allwinner,pins = "PI10", "PI11", "PI12", "PI13"; /* SPI0 */
> allwinner,function = "spi0"; /* input */
> };
> /* ****************************************************** */
220a241
> /* ***************************************** */
226c247,258
< };
---
> can0: mcp2515@0 {
> reg= <0>;
> compatible = "microchip,mcp2515";
> pinctrl-names = "default";
> pinctrl-0 = <&can0_pins>;
> spi-max-frequency = <10000000>;
> interrupt-parent = <&pio>;
> interrupts = <25 0x2>;
> clocks = <&can0_osc>;
> };
> };
> /* **************************************** */
Original file can be found here
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
my CAN controller
http://www.amazon.com/gp/product/B0152VCIA6?psc=1&redirect=true&ref_=ox_sc_act_title_1&smid=A1792RTTLO6S27
During compile i've used following settings:
Linux Kernel Configuration
Device Drivers
SPI support
Utilites for Bitbanging SPI masters
GPIO-based bitbanging SPI Master
Allwinner A10
Allwinner A31
Networking support
CAN bus subsystem support
CAN device drivers
Virtual Local CAN Interface (vcan)
Platform CAN drivers with Netlink support
CAN bit-timing calculation
#?? Enable LED triggers for Netlink based drivers
TI High End CAN controller (HECC)
Allwinner A10 CAN controller
CAN SPI Interface
Microchip MCP251x SPI CAN controller
During startup dmesg shows following:
[ 5.178360] CAN device driver interface
[ 5.201827] pinconfig core: failed to register map default (1): no
configs given
[ 5.364882] mcp251x spi32766.0: CANCTRL 0x87
[ 5.365508] mcp251x spi32766.0 can0: set_features() failed (-1);
wanted 0x0000000000004008, left 0x0000000000004808
[ 7.047499] mcp251x spi32766.0: failed to acquire irq 0
# ip -s -d link show can0
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group
default qlen 10
link/can promiscuity 0
can <TRIPLE-SAMPLING> state STOPPED restart-ms 0
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Your help will be really helpful.
Thank you in advance, SA
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2015-12-17 20:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 20:26 Stanislau Arkhipenka [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-12-17 20:51 SPI-CAN mcp2515 Stanislau Arkhipenka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450383960.2007.3.camel@mail.ru \
--to=dise.logo-jgs/udohzui@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).