Setting up a SD card for TF4060 RaspberryPI

This is a writeup how to setup the raspberry pi for the TF4060 68060 Accelerator for Amiga 3000/4000

The pi on the TF4060 is FULLY optional and the card will work perfectly without it. it is (for the moment) only to flash the firmware. nothing needed for the card to run! no emulation, no nothing!
you CAN still program the cpld with a jtag on board and the fpga with the SPI connector on the board if you want to. this is not covered in this guide!

Where is the software for the TF4060? ehide.device and cpuspeed?
oh do not worry! it is in ROM. it will be there automatically! no software needed to be installed except the 68060 libs from mmulibs! TF4060 will autoboot directly from IDE etc!

I will also provide a already-done-image for more “nontech” people in another post. this is for later.
this post WILL change some times now when more info is coming up / guide being polished.
this requires SOME knowledge. but not much.

I will install a minimal Raspbian system here. you CAN do a full-GUI etc if you want to connect monitor/mouse/keyboard. it will be up to you. here I do a “headless” configuration that will not need any monitor or mouse/keyboard attached to the raspberry pi

Requirements:
an empty SD card atleast 4GB of size (insert it to your reader now)
a raspberry pi. (Raspberry PI Zero 2 W is what I use)

EXTREMLY IMPORTANT NOTE! if you of ANY reason attach a USB device to the pi that delivers power TO the PI like a USB cable from your computer) you MUST remove the “rpi power” jumper from the TF4060. located close to the pi header. if not the pi will try to power the amiga! this is NOT good!.

Do follow this guide and use links provided. as some files might be changed to fit this. as official fpga and cpld softwares used colliding gpio pins so some changes in sources have been done!

We will need raspian that can be found at: https://www.raspberrypi.com/software/operating-systems/

Downbload “Raspberry pi imager:” at: https://www.raspberrypi.com/software/

download it for your os and install and run:

Choose Device (Raspberry PI 2 Zero W)
Choose OS (Go down to “Raspberry PI os (other)” and click there

Select “Raspberry Pi OS Lite (64-bit)

Storage choose your SD card .
next

Click “Edit Settings”

set username and password. I have here “pi” and “raspberry” (no qoutationmakes)

also set your wifi SSID and password here.

Click “Services”

Make sure “Enable SSH” is ticked and “Use password authentication” and press SAVE

Select YES

You will be warned that your SD card will be erased. accept by clicking YES

Image will now be written to SD card

Meanwhile you need to add a header to your PI:

Like this, it is 26 pins (2×13) so it needs to be soldered on like this.
and assembled on the TF4060 like this:

Also note that the PIPWR jumper must be set or you will need to power your raspberry pi in another way.
(remember the warning! IF you attach anything to the pi that powers it this jumper MUST be removed)

Anyway when image is written to your SD card:

Remove the SD card, put it into the PI on the 4060.

power on your Amiga. and you will notice that the led flashes. this is the OS loading.

The first boot will take some extra time. if you connect a monitor to the pi you will notice it rebooting several times etc., this is normal.

you need to monitor your dhcp server in your network when it gives out an IP to “raspberrypi”

(name you chosen above) when this is done. First boot is done.

How to do this I sadly have to point to your manual for your router.

On my opnsense I found it here:

S

o my IP was 172.16.19.180 your WILL be different

so I check if it is online:

and yes it is as it responds to ping!

now we need to connect to it.. from linux/mac use a terminal and ssh pi@172.16.19.180 (change to your IP)
in Windows. Download Putty and connect to your IP. Login as pi

When asked about certificate. Answer yes

enter password. “raspberry”

For the moment you can ignore this. It is up to you to change this later it is not within this guide.
Yes. You should etc etc. but if this is in your own network. Not THAT much of a deal. If this is a matter for you sure handle it. Deal with it. 🙂

now lets update the OS and install software.

Write:

sudo apt update

this loads a list of all updates that can be done.

Write:

sudo apt upgrade

answer yes when prompted

all updates packages will now be upgraded to newest version

this will take some time

When this is done..

I usually reboot. Maybe not needed but after a update like this it feels better:

sudo reboot

and you will need to reconnect and login again. Boot will be quite quick.

Time to install the required software:

write:
(in windows you can paste in my just pressing right mousebutton in putty

(when asked. Answer yes unless told not to in instructions here)
(also remember linux does feel difference between lowercase and UPPERCASE filenames etc)

sudo apt -y install build-essential libusb-dev libftdi-dev libgpiod-dev
sudo apt -y install git cmake

mkdir tf4060
cd tf4060
git clone https://github.com/terriblefire/fomu-flash
git clone https://github.com/matrix-io/xc3sprog

(NO do NOT install xc3sprog via apt install, this will NOT work)
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
sudo ./reinstall

(ignore errormessage that might popup)
cd ..
cd xc3sprog
mkdir build
cd build
cmake ..
make

(ignore things that looks like warnings and errors. Weird code is weird code)

cd ..
cd ..
cd fomu-flash
sudo make
cd ..

(again ignore things that might look like warning/errors)

now we should have all software available..
so lets test this

write:
xc3sprog/build/xc3sprog -c matrix_creator

This lists the CPLD! Nice.

write:

fomu-flash/fomu-flash -r

This will reset the fpga, AND the Amiga. so your amiga should reboot!

you unpack the file with:

unzip

flash the cpld with:

xc3sprog/build/xc3sprog -c matrix_creator -p0 -v tf4060*.jed

SOMETIMES this will fail with something with “fuse” if so. Redo the command.

Flash the FPGA with:

fomu-flash/fomu-flash -u -w tf4060*.bin

and reset the amiga and boot with command as above:

fomu-flash/fomu-flash -r

extra: if you want to install (a very insecure 🙂 )
samba server so you can copy files from your windowsmachine directly to the pi:

write:

sudo apt install -y samba

lets do some config.
Write:
sudo nano /etc/samba/smb.conf
(NOPE! I am not a “vi” guy)
go to bottom of file with cursor/page down.

Add:

[tf4060]
comment = TF4060
path = /home/pi/tf4060
guest ok = yes
browseable = yes
writeable = yes
force user = pi
force group = pi

save with ctrl+x and answer y
sudo reboot

and if you from your windowsmachine look for the machine \ipaddress\
you will see a share “tf4060” here you can copy in files like the firmwarefile.

About

Categories: Uncategorized |

9 thoughts on “Setting up a SD card for TF4060 RaspberryPI

  1. Warning: raspios bookworm 2024-07-04 does NOT start the ssh daemon if you use default credentials pi/raspberry.
    Use another username or password for less trouble. 🙂

    1. Well I actually did one install now. working fine.
      but well I might recomend people using more “secret” credentials anyway 🙂 but I want this guide “easy”

  2. Can we program the TF4060 disconnected from the A4000 motherboard (the TF4060 connected to the Raspberry PI Zero 2 W and the PI powered by USB)?

    1. “I guess” if the pi is powered with enough power. however my question back would be: why?

      1. I understood your point, which reminded me that I forgot to mention one small detail in my question. Let me rephrase it

        Can we program the TF4060 disconnected from the A4000 motherboard (the TF4060 connected to the Raspberry PI Zero 2 W and the PI powered by USB) with the PIPWR jumper open?

        yes, I forgot to mention that the Raspberry Pi power would not be linked with the TF4060
        I do not know about CPLDs and FPGAs but some microprocessors can be programmed with only the power provided by the programmer. That was what I was asking.

  3. Hopefully I successfully flashed the new firmware on my TF4060
    followed your sequence but please explain why you want us to reset the FPGA in the end

    your sequence as above is:
    1- write: xc3sprog/build/xc3sprog -c matrix_creator (this lists the CPLD)
    2- write: fomu-flash/fomu-flash -r (This will reset/erase the FPGA, and the Amiga reboots)
    3- through Samba copy the firmware zip file and then through SSH session unpack/unzip the file or when on Windows unzip the firmware zip file directly to the TF4060 directory (easier this way)
    4- write: xc3sprog/build/xc3sprog -c matrix_creator -p0 -v ./tf4060r5_20611_2024_07_28_4252a06_alpha/tf4060r5_bus_top.jed (this will flash the CPLD)
    5- write: fomu-flash/fomu-flash -u -w ./tf4060r5_20611_2024_07_28_4252a06_alpha/tf4060r5_ram.bin (this will Flash the FPGA)
    6- the last command mentioned below I do not understand this because will reset/erase again the FPGA

    “and reset the amiga and boot with command as above:
    fomu-flash/fomu-flash -r”

    Is it correct or we should neglect the last command???

    1. Simple. as you should do this on a running system. that reset will also reset the amiga. meaning it will reset and boot using the new firmware

  4. Thanks for the awesome guide Chucky, just out of curiosity, is there any way to check the currently running firmware on a card from the Pi? Would just be nice to double check once we’ve written the new firmware.

    1. if you run the “cpuspeed” command from CLI you will see what firmware you got

Leave a Reply

Your email address will not be published. Required fields are marked *

[TOP]