-
Notifications
You must be signed in to change notification settings - Fork 4
Setting Up RaspberryPi and Linux Hosted CPC Development Environments
Instructions are provided here for setting up development areas on an Ubuntu Linux machine, to compile C code and assembler libraries for the CPC, and a RaspberryPi, to act as a co-processor.
Clone this GitHub area from https://github.com/revaldinho/cpc-cplink/wiki
git clone https://github.com/revaldinho/cpc-cplink.git
This will install all code into a cpc-cplink/ directory.
All the software examples are in cpc-cplink/sw/examples
On Ubuntu 18.04 - install build environment for C coding (all done from xterm console)
- Install Mono from https://www.mono-project.com/download/stable/#download-lin following their instructions
Ensure you "sudo apt install mono-complete"
- Go to https://lronaldo.github.io/cpctelera/files/readme-txt.html#Installing_CPCtelera to install CPCtelera which includes an environment to build with SDCC c compiler.
Install the following:
sudo apt-get install build-essential
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libboost-dev
sudo apt-get install libfreeimage-dev
sudo apt-get install git
- Clone the github repo for cpctelera
git clone https://github.com/lronaldo/cpctelera
cd cpctelera/
./setup.sh
Shut and open a new terminal to pickup changes.
- Test your installation by compiling the loopback example
cd cpclink/sw/examples/loopback/cpc_cpct/fifo
make
You have just built the cpc c program with assembly fifo routines.
The CPC binary is in obj/fifo.bin. A CDT (tape image) and DSK (disk image) file are created in the current directory. Transfer any of these to the CPC and unpack as required.
NB the obj/fifo.bin does not have an AMSDOS header. If using Duke's M4 card to upload/download files directy, then use his cpcxfer utility to add the necessary header:
xfer -u <ip-addr-of-your-M4-card> obj/fifo.bin dev/cpctel 2 0x4000 0x4000
On a raspberry pi (done using buster-lite on a pi4). I use mine headless with ssh enabled over wifi.
- Install the following:
sudo apt-get install git
sudo apt-get install wiringpi
- Again, clone the GitHub repository onto the Pi.
git clone https://github.com/revaldinho/cpc-cplink.git
cd cpclink/sw/examples/loopback/rpi_c
Type make to see the loopback c test program compile.
You should have loopback_wpi binary ready to run - run it at the command line and run fifo.bin on the CPC
RaspberryPi> ./loopback_wpi
AmstradCPC> RUN "FIFO.BIN
- Install the following:
sudo apt-get install python-dev
sudo apt-get install python3-dev
- To install the wiringPi library for the Python examples
sudo pip install wiringpi
sudo pip3 install wiringpi
- Run the example code.
cd cpclink/sw/examples/loopback/rpi_python
RaspberryPi> python loopback_wpi.py
AmstradCPC> RUN "FIFO.BIN
Thanks to Shifters74 for providing this HowTo.