Jump to content

amauri

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by amauri

  1. Hi, just to backup my suspicion on the spi driver: https://www.raspberrypi.org/forums/viewtopic.php?t=19489 The guys found and patched their spi module and the things really got better. I don't know if the sunxi arm spi driver has the same real time clock. Best regards Amauri
  2. Hi, I got it working, there was a problem in the CAN board. Now I can send and receive CAN messages. But there is still an issue: missing frames. The orangepi stack is not retrieving all the CAN messages and the missing rate is high. I wonder if the SPI kernel module is not working properly. Is there any other configuration that could be done? Best regards, Amauri
  3. This is also very strange, see the clock value: root@orangepizero:~# ip -details link show can0 3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10 link/can promiscuity 0 can state ERROR-ACTIVE restart-ms 1000 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 4000000 Can anyone also do this command just to check the clock value? Regards, Amauri
  4. Very strange here. root@orangepizero:~# cat /proc/net/can/stats 3 transmitted frames (TXF) 97889 received frames (RXF) 0 matched frames (RXMF) The kernel stack see some frames coming, but the candump can see them. Researching a bit more here.
  5. Hi johlin, can you confirm you see CAN messages using the board? The build above is working setting the can0, but when using candump (sudo apt-get install can-utils) to inspect the messages on a CAN BUS I get nothing. I can assert that there are CAN traffic using another board. I tried the INT PA02 and PA07 and nothing. On both cases the can0 interface is created but no traffic. Looking at the decompiled sun8i-h3-spi1-mcp2515.dtbo I see the entry below. The frequency is correct to 8MHz, but the reference to the clock seems strange (clocks = <0x2>;) The same for the irq, but it might be correct. /dts-v1/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target-path = "/aliases"; __overlay__ { spi1 = "/soc/spi@01c69000"; }; }; fragment@1 { target-path = "/clocks"; __overlay__ { #address-cells = <0x1>; #size-cells = <0x1>; can0_osc_fixed { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <0x7a1200>; linux,phandle = <0x2>; phandle = <0x2>; }; }; }; fragment@2 { target = <0xffffffff>; __overlay__ { can0_pin_irq@0 { allwinner,pins = "PA7"; allwinner,function = "irq"; allwinner,drive = <0x0>; allwinner,pull = <0x1>; linux,phandle = <0x1>; phandle = <0x1>; }; }; }; fragment@3 { target = <0xffffffff>; __overlay__ { status = "okay"; #address-cells = <0x1>; #size-cells = <0x0>; mcp2515@0 { reg = <0x0>; compatible = "microchip,mcp2515"; pinctrl-names = "default"; pinctrl-0 = <0x1>; spi-max-frequency = <0x989680>; interrupt-parent = <0xffffffff>; interrupts = <0x0 0x7 0x2>; clocks = <0x2>; status = "okay"; linux,phandle = <0x3>; phandle = <0x3>; }; }; }; __symbols__ { can0_osc_fixed = "/fragment@1/__overlay__/can0_osc_fixed"; can0_pin_irq = "/fragment@2/__overlay__/can0_pin_irq@0"; can0 = "/fragment@3/__overlay__/mcp2515@0"; }; __fixups__ { pio = "/fragment@2:target:0", "/fragment@3/__overlay__/mcp2515@0:interrupt-parent:0"; spi1 = "/fragment@3:target:0"; }; __local_fixups__ { fragment@3 { __overlay__ { mcp2515@0 { pinctrl-0 = <0x0>; clocks = <0x0>; }; }; }; }; };
  6. Hi Zador, very nice. Please inform what is the address of spi1 so I can try to port it orange pi zero. Regards, Amauri
  7. I'm using the same board as above, but I couldn't make it work. On raspberry pi I have the same board working. I need to do more configuration, but in overall without the overlay out of the box it is a pain. Specially with the amount of boards outside. Regards, Amauri
  8. Thanks, Just made some more readings about the dts in linux and found the dts for the orangepi boards in the igor's toolchain at sources/u-boot/v2017.01/arch/arm/dts I think I can try to make changes here and compile the kernel. Is it right? I could not find a documentation on how to implement the dtc overlay in the kernel. The boot.cmd has reference to the /boot/dts and /boot/overlay
  9. Thanks Zador, I'm a bit stuck here. The kernel compilation seems not to support overlays. I was looking at raspian for raspberry pi and they have the /boot/config.txt and the overlays at /boot/overlays. The overlay configuration defines the device can0 attached to the mcp251x driver. https://github.com/raspberrypi/linux/blob/rpi-4.4.y/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts The information on the mcp251x.c shows some configuration for compiling time, but does not specify how to create the device can0. The socketCan are used through the can devices. Any documentation on how to set the DT with or without overlay? I see in the armbian path userpatches/overlay directory. Is it here to put the overlay file? Regards, Amauri
  10. Hi all, I'm trying to put my orange pi zero to talk with a CAN BUS via mcp2515 chip. The chip is SPI controlled. The actual image does not have support for SocketCAN enabled, so I'm compiling the kernel with SocketCan following the kernel configuration shown here https://developer.ridgerun.com/wiki/index.php/How_to_configure_and_use_CAN_bus I'm using the cross-compiler tool from the armian website. After the image is burned to the sdcard and the orange pi zero is booted, I can see the image has can support enabled, but when I load the mcp251x driver it does nothing. I'm sure I'm missing some detail on spi side in order to have the mcp driver pointing to the proper spi. Any hints? Thanks in advance Amauri
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines