Re: [Emc-users] Rpi4B_7i90

2021-03-09 Thread Gene Heskett
On Tuesday 09 March 2021 22:36:18 dave engvall wrote:

> Hi all,
> I'm trying to get an Rpi4b -> 7i90 going.
>
> Ralph Stirling made an interface board for the pi that allows one to
> flash the spi.
>
> The following is copy of the procedure:
>
>
> On Rpi:
>
> $ git clone git://git.code.sf.net/p/openocd/code openocd
> $ cd openocd
> $ ./bootstrap
> $ ./configure --enable-maintainer-mode --enable-bcm2835gpio
> --enable-sysfsgpio
> $ make -j4
> $ sudo make install
>
> Go into Raspbian Setup from the application menu, and turn off SPI
> device driver.  Openocd has a builtin driver.
>
> Use the openocd_rpi.sh script to load bitstreams via jtag
> into the FPGA itself. This is not permanent, so you need
> to follow this with mesaflash to put it in the EEPROM.
>
> $openocd_rpi.sh whatever_spi_bitstream.bit
>
> Now go back in to Raspbian Setup and turn on the SPI driver. You can
> now use mesaflash to flash the EEPROM.
>
> $ sudo mesaflash --device 7i90 --addr /dev/spidev0.0 --spi --write
> whatever_spi_bitstream.bit
>
> I don't recall whether SPI needs to be enabled or disabled
> after this for hostmot2 to run in linuxcnc, but it is easy
> enough to try each way.
>
> Ha! Not quite.
>
> Google gives hits but none of them go deep enough to fix my problems.
>
> Clearly this is set up for bcm2835 eg. Rpi3b however just editing the
> bcm numbers to Rpi4b 2711 doesn't work.
> Deeper changes are clearly needed.
> Can anyone supply the relevant files for bcm2711?
>
> Comments and guidance appreciated.
>
> Dave
>
> file: rpi_jtag.cfg
> interface bcm2835gpio
> bcm2835gpio_peripheral_base 0x3F00
>
> # Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
> # These depend on system clock, calibrated for stock 700MHz
> # bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
> bcm2835gpio_speed_coeffs 146203 36
>
> # Each of the JTAG lines need a gpio number set: tck tms tdi tdo
> ## Header pin numbers: 23 22 19 21
> #bcm2835gpio_jtag_nums 11 25 10 9
> # Header pin numbers: 11 13 15 29
> bcm2835gpio_jtag_nums 17 27 22 5

Never fooled with jtag, so I don't know.

But if you have a linux pc with a working epp parport, mesaflash can put 
the firmware into the fpga using the pc and a parport cable. The right 
firmware converts the parport 26 pin header on the 7i90 into an spi 
interface, so without a reset procedure described in the docs you will 
not be able read it back out on the pc.

Then you need to stop the raspbian spi driver forever, then make from a 
board link I've sent, the adapter that connects to the header on the pi, 
and gives you the 26 pin socket for a jumper cable that plugs into the 
header socket the adapter puts on the pi. Very short jumper, mine might 
be an inch long. That means the jumper isn't long enough to twist so the 
pi is mounted on tall standoffs, upside down, with an old video card fan 
under it, running on the 5 volts running the pi. your hal file should 
loadrt the rpspi.so driver.

Ping me again when you have done that. ISTR I had to add a 10 pf cap on 
one of the spi lines on thebottom of the pi3, if needed I can send a 
pix. But lets do this in sequence.
>
> file: openocd_rpi.sh
> #!/bin/bash
>
> openocd \
>      -f /usr/local/share/openocd/scripts/interface/rpi_jtag.cfg \
>      -f /usr/local/share/openocd/scripts/cpld/xilinx-xc6s.cfg \
>      -c "adapter driver rpi_jtag ; adapter speed 500; init; \
>      xc6s_program xc6s.tap; pld load 0 $1 ; exit"
>
> Stick that in a file, chmod +x it and see if it works!
>
>
>
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Rpi4B_7i90

2021-03-09 Thread Ralph Stirling
Dave, I see a discussion on openocd and rpi4 on
the raspberrypi forum:

https://www.raspberrypi.org/forums/viewtopic.php?t=252551

There seems to be a couple of different problems being
addressed, but some claims of success.  I'm sorry I can't
test any of the solutions with a 7i90, since I don't have
a working pi 4 available at present.

-- Ralph

From: dave engvall [dengv...@charter.net]
Sent: Tuesday, March 9, 2021 7:36 PM
To: Enhanced Machine Controller (EMC)
Subject: [Emc-users] Rpi4B_7i90

CAUTION: This email originated from outside the Walla Walla University email 
system.


Hi all,
I'm trying to get an Rpi4b -> 7i90 going.

Ralph Stirling made an interface board for the pi that allows one to
flash the spi.

The following is copy of the procedure:


On Rpi:

$ git clone git://git.code.sf.net/p/openocd/code openocd
$ cd openocd
$ ./bootstrap
$ ./configure --enable-maintainer-mode --enable-bcm2835gpio
--enable-sysfsgpio
$ make -j4
$ sudo make install

Go into Raspbian Setup from the application menu, and turn off SPI
device driver.  Openocd has a builtin driver.

Use the openocd_rpi.sh script to load bitstreams via jtag
into the FPGA itself. This is not permanent, so you need
to follow this with mesaflash to put it in the EEPROM.

$openocd_rpi.sh whatever_spi_bitstream.bit

Now go back in to Raspbian Setup and turn on the SPI driver. You can now
use mesaflash to flash the EEPROM.

$ sudo mesaflash --device 7i90 --addr /dev/spidev0.0 --spi --write
whatever_spi_bitstream.bit

I don't recall whether SPI needs to be enabled or disabled
after this for hostmot2 to run in linuxcnc, but it is easy
enough to try each way.

Ha! Not quite.

Google gives hits but none of them go deep enough to fix my problems.

Clearly this is set up for bcm2835 eg. Rpi3b however just editing the
bcm numbers to Rpi4b 2711 doesn't work.
Deeper changes are clearly needed.
Can anyone supply the relevant files for bcm2711?

Comments and guidance appreciated.

Dave

file: rpi_jtag.cfg
interface bcm2835gpio
bcm2835gpio_peripheral_base 0x3F00

# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 146203 36

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
## Header pin numbers: 23 22 19 21
#bcm2835gpio_jtag_nums 11 25 10 9
# Header pin numbers: 11 13 15 29
bcm2835gpio_jtag_nums 17 27 22 5



file: openocd_rpi.sh
#!/bin/bash

openocd \
 -f /usr/local/share/openocd/scripts/interface/rpi_jtag.cfg \
 -f /usr/local/share/openocd/scripts/cpld/xilinx-xc6s.cfg \
 -c "adapter driver rpi_jtag ; adapter speed 500; init; \
 xc6s_program xc6s.tap; pld load 0 $1 ; exit"

Stick that in a file, chmod +x it and see if it works!





___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C62710c35f3f3412340d108d8e375b8b8%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637509442052021737%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=%2BCLZqleht%2FYiG9uPXURHpTEDpZaRS0HqX1XO4742XN8%3Dreserved=0


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Rpi4B_7i90

2021-03-09 Thread dave engvall

Hi all,
I'm trying to get an Rpi4b -> 7i90 going.

Ralph Stirling made an interface board for the pi that allows one to 
flash the spi.


The following is copy of the procedure:


On Rpi:

$ git clone git://git.code.sf.net/p/openocd/code openocd
$ cd openocd
$ ./bootstrap
$ ./configure --enable-maintainer-mode --enable-bcm2835gpio 
--enable-sysfsgpio

$ make -j4
$ sudo make install

Go into Raspbian Setup from the application menu, and turn off SPI 
device driver.  Openocd has a builtin driver.


Use the openocd_rpi.sh script to load bitstreams via jtag
into the FPGA itself. This is not permanent, so you need
to follow this with mesaflash to put it in the EEPROM.

$openocd_rpi.sh whatever_spi_bitstream.bit

Now go back in to Raspbian Setup and turn on the SPI driver. You can now 
use mesaflash to flash the EEPROM.


$ sudo mesaflash --device 7i90 --addr /dev/spidev0.0 --spi --write 
whatever_spi_bitstream.bit


I don't recall whether SPI needs to be enabled or disabled
after this for hostmot2 to run in linuxcnc, but it is easy
enough to try each way.

Ha! Not quite.

Google gives hits but none of them go deep enough to fix my problems.

Clearly this is set up for bcm2835 eg. Rpi3b however just editing the 
bcm numbers to Rpi4b 2711 doesn't work.

Deeper changes are clearly needed.
Can anyone supply the relevant files for bcm2711?

Comments and guidance appreciated.

Dave

file: rpi_jtag.cfg
interface bcm2835gpio
bcm2835gpio_peripheral_base 0x3F00

# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 146203 36

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
## Header pin numbers: 23 22 19 21
#bcm2835gpio_jtag_nums 11 25 10 9
# Header pin numbers: 11 13 15 29
bcm2835gpio_jtag_nums 17 27 22 5



file: openocd_rpi.sh
#!/bin/bash

openocd \
    -f /usr/local/share/openocd/scripts/interface/rpi_jtag.cfg \
    -f /usr/local/share/openocd/scripts/cpld/xilinx-xc6s.cfg \
    -c "adapter driver rpi_jtag ; adapter speed 500; init; \
    xc6s_program xc6s.tap; pld load 0 $1 ; exit"

Stick that in a file, chmod +x it and see if it works!





___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users