Hi guys,
I ordered the 7i74 and wanna try the channel 7 of the 7i74 for half-duplex rs485. I made a simple bitfile for 7i76E+7i74 with UART 1x on channel 7 of the 7i74. It tweaked the InstStride1: integer := 16; of the TopEthernet16HostMot2.vhd aswell, So I had to put all the smart serial away, right?
Mesaflash --readhmid looks ok to me:
readhmid output below
pi@raspberrypi:~ $ mesaflash --device 7i76e --addr 10.10.10.10 --readhmid
Configuration Name: HOSTMOT2
General configuration information:
BoardName : MESA7I76
FPGA Size: 16 KGates
FPGA Pins: 256
Number of IO Ports: 3
Width of one I/O port: 17
Clock Low frequency: 100.0000 MHz
Clock High frequency: 200.0000 MHz
IDROM Type: 3
Instance Stride 0: 4
Instance Stride 1: 16
Register Stride 0: 256
Register Stride 1: 256
Modules in configuration:
Module: DPLL
There are 1 of DPLL in configuration
Version: 0
Registers: 7
BaseAddress: 7000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: WatchDog
There are 1 of WatchDog in configuration
Version: 0
Registers: 3
BaseAddress: 0C00
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: IOPort
There are 3 of IOPort in configuration
Version: 0
Registers: 5
BaseAddress: 1000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: StepGen
There are 5 of StepGen in configuration
Version: 2
Registers: 10
BaseAddress: 2000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: QCount
There are 1 of QCount in configuration
Version: 2
Registers: 5
BaseAddress: 3000
ClockFrequency: 100.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Configuration pin-out:
IO Connections for on-card
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir
TB2 4,5 0 IOPort StepGen 0 Dir/Table2 (Out)
TB2 2,3 1 IOPort StepGen 0 Step/Table1 (Out)
TB2 10,11 2 IOPort StepGen 1 Dir/Table2 (Out)
TB2 8,9 3 IOPort StepGen 1 Step/Table1 (Out)
TB2 16,17 4 IOPort StepGen 2 Dir/Table2 (Out)
TB2 14,15 5 IOPort StepGen 2 Step/Table1 (Out)
TB2 22,23 6 IOPort StepGen 3 Dir/Table2 (Out)
TB2 20,21 7 IOPort StepGen 3 Step/Table1 (Out)
TB3 4,5 8 IOPort StepGen 4 Dir/Table2 (Out)
TB3 2,3 9 IOPort StepGen 4 Step/Table1 (Out)
Internal 10 IOPort None
Internal 11 IOPort None
TB3 18,19 12 IOPort None
TB3 16,17 13 IOPort None
TB3 13,14 14 IOPort QCount 0 Quad-IDX (In)
TB3 10,11 15 IOPort QCount 0 Quad-B (In)
TB3 7,8 16 IOPort QCount 0 Quad-A (In)
IO Connections for P1
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir
1 17 IOPort None
14 18 IOPort None
2 19 IOPort None
15 20 IOPort None
3 21 IOPort None
16 22 IOPort None
4 23 IOPort None
17 24 IOPort None
5 25 IOPort None
6 26 IOPort None
7 27 IOPort None
8 28 IOPort UARTRX 0 RXData (In)
9 29 IOPort None
10 30 IOPort None
11 31 IOPort None
12 32 IOPort UARTTX 0 TXData (Out)
13 33 IOPort None
IO Connections for P2
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir
1 34 IOPort None
14 35 IOPort None
2 36 IOPort None
15 37 IOPort None
3 38 IOPort None
16 39 IOPort None
4 40 IOPort None
17 41 IOPort None
5 42 IOPort None
6 43 IOPort None
7 44 IOPort None
8 45 IOPort None
9 46 IOPort None
10 47 IOPort None
11 48 IOPort None
12 49 IOPort None
13 50 IOPort None
readhmid output above
Then, I gladly took the mesa_uart.comp Andy provided and compiled:
pi@raspberrypi:~ $ halcompile mesa_uart.comp
pi@raspberrypi:~ $ halcompile --compile mesa_uart.c
and moved the mesa_uart.so to linuxcnc-master/rtlib/
Then, I wanted to loadrt the mesa_uart component, these are the contents of my hal file:
halfile content below
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth config="num_stepgens=0" board_ip=10.10.10.10
loadrt mesa_uart names="hm2_7i76e.0.uart.0"
addf hm2_7i76e.0.read servo-thread
addf hm2_7i76e.0.write servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
halfile content above
During linuxcnc startup I get this output:
startup output below
LINUXCNC - 2.9.0~pre0
Machine configuration directory is '/home/pi/linuxcnc/configs/dcell-test'
Machine configuration file is 'dcell-test.ini'
Starting LinuxCNC...
Found file(REL): ./dcell-test.hal
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: INFO: Hardware address (MAC): 00:60:1b:10:45:15
hm2_eth: discovered 7I76E-16
hm2/hm2_7i76e.0: Low Level init 0.15
hm2/hm2_7i76e.0: 51 I/O Pins used:
hm2/hm2_7i76e.0: IO Pin 000 (P1-01): IOPort
hm2/hm2_7i76e.0: IO Pin 001 (P1-14): IOPort
hm2/hm2_7i76e.0: IO Pin 002 (P1-02): IOPort
hm2/hm2_7i76e.0: IO Pin 003 (P1-15): IOPort
hm2/hm2_7i76e.0: IO Pin 004 (P1-03): IOPort
hm2/hm2_7i76e.0: IO Pin 005 (P1-16): IOPort
hm2/hm2_7i76e.0: IO Pin 006 (P1-04): IOPort
hm2/hm2_7i76e.0: IO Pin 007 (P1-17): IOPort
hm2/hm2_7i76e.0: IO Pin 008 (P1-05): IOPort
hm2/hm2_7i76e.0: IO Pin 009 (P1-06): IOPort
hm2/hm2_7i76e.0: IO Pin 010 (P1-07): IOPort
hm2/hm2_7i76e.0: IO Pin 011 (P1-08): IOPort
hm2/hm2_7i76e.0: IO Pin 012 (P1-09): IOPort
hm2/hm2_7i76e.0: IO Pin 013 (P1-10): IOPort
hm2/hm2_7i76e.0: IO Pin 014 (P1-11): Encoder #0, pin Index (Input)
hm2/hm2_7i76e.0: IO Pin 015 (P1-12): Encoder #0, pin B (Input)
hm2/hm2_7i76e.0: IO Pin 016 (P1-13): Encoder #0, pin A (Input)
hm2/hm2_7i76e.0: IO Pin 017 (P2-01): IOPort
hm2/hm2_7i76e.0: IO Pin 018 (P2-14): IOPort
hm2/hm2_7i76e.0: IO Pin 019 (P2-02): IOPort
hm2/hm2_7i76e.0: IO Pin 020 (P2-15): IOPort
hm2/hm2_7i76e.0: IO Pin 021 (P2-03): IOPort
hm2/hm2_7i76e.0: IO Pin 022 (P2-16): IOPort
hm2/hm2_7i76e.0: IO Pin 023 (P2-04): IOPort
hm2/hm2_7i76e.0: IO Pin 024 (P2-17): IOPort
hm2/hm2_7i76e.0: IO Pin 025 (P2-05): IOPort
hm2/hm2_7i76e.0: IO Pin 026 (P2-06): IOPort
hm2/hm2_7i76e.0: IO Pin 027 (P2-07): IOPort
hm2/hm2_7i76e.0: IO Pin 028 (P2-08): IOPort
hm2/hm2_7i76e.0: IO Pin 029 (P2-09): IOPort
hm2/hm2_7i76e.0: IO Pin 030 (P2-10): IOPort
hm2/hm2_7i76e.0: IO Pin 031 (P2-11): IOPort
hm2/hm2_7i76e.0: IO Pin 032 (P2-12): IOPort
hm2/hm2_7i76e.0: IO Pin 033 (P2-13): IOPort
hm2/hm2_7i76e.0: IO Pin 034 (P3-01): IOPort
hm2/hm2_7i76e.0: IO Pin 035 (P3-14): IOPort
hm2/hm2_7i76e.0: IO Pin 036 (P3-02): IOPort
hm2/hm2_7i76e.0: IO Pin 037 (P3-15): IOPort
hm2/hm2_7i76e.0: IO Pin 038 (P3-03): IOPort
hm2/hm2_7i76e.0: IO Pin 039 (P3-16): IOPort
hm2/hm2_7i76e.0: IO Pin 040 (P3-04): IOPort
hm2/hm2_7i76e.0: IO Pin 041 (P3-17): IOPort
hm2/hm2_7i76e.0: IO Pin 042 (P3-05): IOPort
hm2/hm2_7i76e.0: IO Pin 043 (P3-06): IOPort
hm2/hm2_7i76e.0: IO Pin 044 (P3-07): IOPort
hm2/hm2_7i76e.0: IO Pin 045 (P3-08): IOPort
hm2/hm2_7i76e.0: IO Pin 046 (P3-09): IOPort
hm2/hm2_7i76e.0: IO Pin 047 (P3-10): IOPort
hm2/hm2_7i76e.0: IO Pin 048 (P3-11): IOPort
hm2/hm2_7i76e.0: IO Pin 049 (P3-12): IOPort
hm2/hm2_7i76e.0: IO Pin 050 (P3-13): IOPort
hm2/hm2_7i76e.0: registered
hm2: Can not find UART instance hm2_7i76e.0.uart.0.
Found file(REL): ./custom.hal
hm2: Can not find UART instance hm2_7i76e.0.uart.0.
startup output above
The linuxcnc starts and when I open halmeter, the hm2_7i76e.0.uart.0 pins (tx-bytes, tx-data[0..15], etc.) show up, which I do not understand.
Am I loadrt-ing the uart component wrong? Or do you have any suggestions why the uart instance cannot be found?
Thank you guys.