Am Di, 18.02.2014, 23:00 schrieb Wayne Ross: > On Monday, February 17, 2014 3:21 PM, Wolfgang Grandegger > <[email protected]> wrote: > > > >> Looks like memory mapped accesses are required. Please try the >> xeno_can_mem driver as show below: >> >> # modprobe xeno_can_mem mem=0xda0000,0xdb200 irq=12,15 ocr=0xda,0xda >> > > > Yes, indeed, that improves things! The driver indicates success in > loading. > > >> Not sure what the output configurations register is. The driver >> supports the module parameters "ocr=" to specify the output *control* >> register, which is most likely the same register. For further >> information, please search for "ocr" in: >> >> http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/can/sja1 >> 000/rtcan_mem.c >> >> >> Wolfgang. >> > > > Indeed, I see those are the same in the two drivers, as they both address > the 8th register in the SJA1000. > > > Next problem: "Network is down" when running Round Trip Time example > (rtcan_rtt).
Please use rtcansend and rtcanrecv for basic testing first. > Secondary problem: only 1 message can be sent with rtcansend. > > > > Details: > When I do: modprobe xeno_can_mem mem=0xdb000,0xdb200 irq=12,15 > ocr=0xda,0xda Then review: lsmod > Two new entries show up: > Module Size Used by > xeno_can_mem 1737 0 xeno_can_sja1000 6333 1 > xeno_can_mem > > > And dmesg shows new entries: > RTCAN SJA1000 driver initialized > rtcan: registered rtcan0 > rtcan: registered rtcan1 > > > Executing "./rtcan_rtt rtcan0 rtcan1" responds: > 1 3 > RX rxsock=896, ifr_name=rtcan1 > TX txsock=897, ifr_name=rtcan0 > Round-Trip-Time test rtcan0 -> rtcan1 with CAN ID 0x1 > Cycle time: 10000 us > All RTT timing figures are in us. > send failed: Network is down Messages RTTlast RTT_avg RTT_min RTT_max > Overruns > < and stalls here > > No new information is found in dmesg. > > > > Looking at the RT-Socket-CAN Utilities: > Run: ./rtcanconfig rtcan0 --baudrate=250000 start > and: ./rtcanconfig rtcan1 --baudrate=250000 start The above two commands are mandatory before you can send/recv messages. > dmesg shows new activity: rtcan0: real bitrate 250000, sampling point 87.5% > rtcan_sja_set_bit_time: btr0=0x1 btr1=0x1c > rtcan1: real bitrate 250000, sampling point 87.5% > rtcan_sja_set_bit_time: btr0=0x1 btr1=0x9c That's strange. "btr1" should here be "0x1c" as well. > > Then: ./rtcanrecv rtcan0 --verbose > interface rtcan0 s=0, ifr_name=rtcan0 > > <leave running in one SSH window, while in another:> > > > ./rtcansend rtcan1 --verbose --identifier=0x123 0xde 0xad > interface rtcan1 s=1, ifr_name=rtcan1 <0x123> [2] de ad > Cleaning up... > > > No data shows up on the rtcanrecv, though a separate device watching for > CAN activity showed the message! Further executions of rtcansend don't > show "Cleaning up..." automatically (like it is stalled) and ^C is > required to regain control. No further data is sent or seen on further > attempts of rtcansend. If I reboot cleanly and use rtcansend with > --loop=10 only 1 message will be sent. > > > I suspect I don't see "Network is down" because rtcansend uses Maybe that's just because the interface was not up. Anyway, it seems that no messages are going out to the network. > rt_dev_send() while rtcan_rtt uses send(). But in any case, I only the 1 > message on the physical CAN bus, the first time. > > cat /proc/rtcan/devices shows: Name___________ _Baudrate State___ > TX_Counter RX_Counter ____Errors > rtcan0 250000 active 0 0 0 > rtcan1 250000 active 1 0 0 A few questions: - What does "/proc/xenomai/irq" list after you have sent a message? - Is your CAN cable connected and terminated properly? - Could you connect an external CAN node/analyser to test message transmission from and to rtcan0? Wolfgang. _______________________________________________ Xenomai mailing list [email protected] http://www.xenomai.org/mailman/listinfo/xenomai
