Amstrad CPC M4 Board Extended User Manual
Amstrad CPC M4 Board Extended User Manual
x
Firmware v2.0.8
M4 Interface Card for Amstrad CPC / CPC Plus
Extended User Manual
31-10-2024
Created by Duke, the developer of M4 board and firmware, text version of general information
Additional chapters and PDF version of the Manual by Csaba Toth
INTRODUCTION
The M4 Board is an expansion card, which enables WIFI access for the Amstrad CPC computer and
(bi-directional internet access). It provides a Romboard, a realtime clock and an SD-Card slot for mass
storage. You can load Basic files (BAS), disk images (DSK), cartridge images (CPR) and load ROM files
(BIN, ROM) to 31 slots.
INTRODUCTION OF BUTTONS
Right upper button << Card Reset >> (hot restart) - when using, the machine remains the last used
directory, mapped disk, etc.
Note, that in CTR mode (when a cartridge file is used), this button will NOT restart the machine, only
the cartridge app/game will be restarted.
Right bottom button: << CPC Reset >> (cold restart) - it will restart the machine. Afterall, the
machine does not remain the last used directory or mapping, the current directory will be the root
directory.
If you wish to use the card on its web interface, romboard, realtime clock or download stuff from the
internet, then you have to setup the network connection.
FILE SYSTEM
The microSD card is addressable with drive letter C:
The microSD card should be formatted to FAT16 or FAT32 partition - FAT32 is preferred to use. The file
system supports up to 2048 files per folder.
File names will be listed in 8.3 format for native compatibility.
Directories will be listed with their full name if less than 17 characters. If the directory name length is
longer, then short directory names will be used.
When listing a directory/catalog, directories will have a > character in front of the directory name.
FILE LISTING
Use |ls command to list the files of a directory by using long file names. It is only limited by the
current screen mode (using one column listing for ls command, while the ordinary cat command uses
two column listing). Use this command instead |dir to get the long file names and use them directly.
You can pause the directory listing by pushing once the << Escape >> key, and pushing space for
continuing the listing. You can interrupt the listing by pushing the << Escape >> key twice.
You can also use << Cursor >> and << Copy >> keys for quick file name entering - it has no problems
with special and symbol characters.
If you set a jumper to EXT pins, then it will use the CPC's power supply. If you set the jumper to USB
pins, then it will getting power via the USB socket.
Notice: If you’re using MX4 motherboard with plugged in M4 board, then you must use an external
power supply, either directly to the M4 or the MX4.
STATUS LEDs
- ON LED: indicates with blue led if the board is getting power source.
- DD LED: Disc Drive - it will be flashing by green when reading from / writing to the SD card.
FIRST STEPS
When starting the M4 Board in our Amstrad CPC, make a folder called „M4” to the microSD card,
which are automatically created these three files in the root of the card:
- romconfig.bin
- romslots.bin
- config.txt
Later you can modify the configuration files if you need it.
Then take out the microSD and edit the file(s) on a PC. Check chapter M4reconf for more.
ssid=wifi_SSID_name
pw=wifi_password
name=CPC
dhcp=1
dns1=8.8.8.8
dns2=8.8.4.4
tz=1 ntp=ntp.inet.tele.dk
Important!
After reset / hot start the computer, the mounted floppy will be still active and mounted, therefore
you can list it again with cat command, execute again, etc.
If you want to change the disk, first you have to step out from the directory:
|cd,”..” - step up to the parent directory
or
|cd,”/” - step to the root directory
Use the |DSKX command to extract files on the CPC. All files off all images should be extracted to the
same given path.
cat or |ls (long file names) - it will list the current directory’s content
|CTRUP,”name.cpr” - it will upload the cartridge file to the M4 board’s flash memory. DO NOT USE
Space character after the file name!
cat or |ls (long file names) - it will list the current directory’s content
cat or |ls (long file names) - it will list the current directory’s content
|CTRUP,”name.cpr” - it will upload the cartridge file to the M4 board’s flash memory. DO NOT USE
Space character after the file name!
|cd,”name.cpr” - enter CPR cartridge file
cat or |ls (long file names) - it will list the current CPR cartridge file’s content
Important!
After reset / restart / turn-on/off the computer, the uploaded cartridge content will remain until you
don’t upload another CRT image to the M4 board.
This is useful for making custom settings, like setting of screen mode, colors, mapping a drive or
enter into directory or executing a software, etc.
Here you can use any basic commands in this file that you want. It’s a Basic file only that will be
automatically launched. See the Amtrad User manual for basic commands.
Example:
Enter commands in each numbered line e.g as
10 mode 2
20 ink 1,26
30 cd,”DSK”
40 |ls
Then you have to save the file with the command: save"autoexec.bas
Notice: This should be done on the CPC itself, not in notepad on PC, unless you manually add the
correct fileheader.
Features
● Directory browsing using keyboard and/or joystick with support for up to 64k entries per
directory.
● Application launching with support for CPC BASIC files, Binary files or SNA snapshots.
● Text file viewing. Automatic for ASCII files or manual for any other type.
● File searching
● DSK to Disc transfering
● This application is distributed as a ROM, which means it needs to be installed in either a
software ROM slot in the M4 itself or a ROM Box attached to your system.
To run the application type the following command at the BASIC prompt: |M4FE
M4 explorer
https://web.archive.org/web/20181113190515/http://amstrad.esy.es/menu/m4explorer.zip
YANCC (Yet Another Norton Commander)
YANCC is a file manager and can be loaded and started from rom binary mapping.
https://www.octoate.de/tag/yancc/
Afterwards when the updated YANCC-CP.ROM file made, upload it the created ROM files to the
required ROM slots on the M4 board and upload the rom binaries to the M4 board’s rom slots.
|romup, "yancccc-cp.rom", 3 (or whatever ROM slot)
|romup,"launch.rom", 10 (or whatever ROM slot)
https://www.cpcwiki.eu/forum/applications/yet-another-norton-commander-clone/
https://www.cpcwiki.eu/index.php/M4reconf
Copy whatever romslots.bin and romconfig.bin you want to use to the /M4 directory as well.
For Basic 1.0 (464 CPC computers) to change the current directory to a subdirectory called "DISCS".
Type: A$="DISCS":|cd,@A$
Or make it much more easier to navigate for basic 1.1 users a prompt was build into |cd command.
You can press |cd and <ENTER> then you type or use cursor copy for the proper name.
With the M4 board you can replace the lower rom, so you can use Basic 1.1 on CPC464 too.
There is a small program for CPC464 to do this for you, you can download it from the CPC if you have
setup the WiFi:
a$="spinpoint.org/cpc/ROMUP464.BIN"
|httpget,@a$
RUN"ROMUP464
It will also set M4 rom slot to 7, which is best for compatibility with games. You can change it from
the web interface again.
Note, that DSK files are read only. You can use DSK files as a folder, ie.
|cd,"robocop.dsk" - it will take you inside the DSK file as it was a folder.
|cd,".. and afterall it will take you back, out of the directory to the main directory
Note, that it's also possible to use command |CD and go into a converted CPR cartridge image
(CPC+/GX4000 compatible cartridge files) similar to when using DSK images.
CTR - Execute a cartridge file (CPR), which was flashed to the M4 board. Available for CPC PLUS only!
|CTR
CTRUP - Upload a cartridge image file to the M4 flash. Format can be either plain binary dump or
.CPR format. Available for CPC PLUS only!
|CTRUP,"cartimg.cpr"
COPYF - Copy file, src file, dest file. Paths can be used too. (for microSD only)
|COPYF
FCP - Copy files between the microSD card and floppy drive(s).
Important! You can also address microSD card with drive letter C:
There is one wild card option, "*" to copy all files from a disc or directory.
|FCP,"A:*","C:" – it will copy all files on disc A: to the current directory of the SD card (C:).
Just like with CPC discs, you can also use it to rename a file or move a file / folder from a directory to
an another directory / path.
|ren,"robocop.dsk","robot.dsk" renames the file from the current directory to a newer file name.
|ren,"games/robocop.dsk","robocop.dsk" moves the file from the games directory to another path.
|DISC
SD - Switch to M4 (microSD) - it is useful e.g. after you used the tape, etc.
|SD
|SNA,"FRANKIE.SNA"
DIR - Display directory, similar to cpc discs, you can add wildcards to it, unlike the cat command.
|dir,"games/discs/b?t*.dsk"
LS - Display directories as long file names. Max. length depends on the screen mode. Same
parameters as |dir can be used.
|ls,"games/discs/b?t*.dsk"
|TAPE
TIME - Displays current time if the NTP time server was configured properly and the card has internet
access.
|TIME
|NETSTAT
HTTPGET - Download a file from the internet to the current directory. Parameters are url:port/name.
If no port is specified then port 80 will be used automatically.
|httpget,"spinpoint.org:80/battro.dsk"
HTTPMEM - Downloads a file from the internet to the memory. Max file size at once is 0x4000 bytes.
However an offset can be specified, so more can be read in chunks.
|HTTPMEM,"spinpoint.org/cpc/FIST.BIN",&C000,&4000
M4ROMOFF - Disable M4 rom until the next power cycle. Use this if you want to access the real
floppy drive or start a CPC+ cartridge.
|M4ROMOFF
ROMSOFF - Without parameters, all roms of the M4 board are disabled until the CPC is rebooted or
the M4 << Reset >> button was pressed.
Optional parameters are "except rom number", "reset" (0 = do not reset, 1 = do reset). By using
these it's possible to disable all roms except one.
|ROMSOFF,6,1 – this will disable all other roms than rom 6 and reset the CPC.
VERSION - Displays current firmware version of the Cortex M4 microcontroller and the ESP WiFi
(ESP8266 module).
|VERSION - There are two firmware entries, the general version (M4FIRM.BIN for the MCU) and the
ESP version (ESPFIRM.BIN for WiFi module).
There are two firmware files for the M4 board simultaneously, the M4FIRM.BIN file for the MCU and
the ESPFIRM.BIN file for the WiFi module
To perform the firmware update, both files should be updated at the same time. Unpack and copy
the files on a PC to the root of the SD card and insert the SD card to the M4 board.
|UPGRADE - Upgrade process will start and the board will display again once finished.
Afterwards you need to restart the M4 board by the << Reset >> switch or turning power off/on the
CPC.
Notice that ROMUP only works with files present on the microSD card, not from floppy disc.
ROMUPD - Will apply rom modifications (new roms will be flashed into M4 flash, without reboot
need)
|ROMUPD
GETPATH - Getting and showing the current / selected path.
Files are using file extensions, so when filtering files via wildcards, you typically use the *.* format.
Directories do not have extensions, so you only need to use * for directories.
ROMS
By default M4 Board rom is mapped as ROM 6, this is for highest compatibility with
games/demos/applications.
Note, that if your CPC supports overriding ROM 7, you should change it in the web interface, as it
provides better compatibility.
If your CPC6128 does not support overriding ROM 7, a modified lowerrom was made to give virtually
the same compatibility as using physical rom 7.
It's possible to map it as another ROM or disable it using the web interface.
Not all CPC6128's will allow to "override" rom7, and the board will keep resetting the CPC if that is
the case. Fix this if the WiFi is not configured on the board.
Configuration of rom slots/files:
|MKDIR,”M4”
|cd,”m4”
ssid=dd-wrt
pw=hackaway
name=CPC664
dhcp=0
ip=10.0.0.37
nm=255.255.255.0
gw=10.0.0.1
dns1=8.8.8.8
dns2=8.8.4.4
tz=1
ntp=ntp.inet.tele.dk
You need to change SSID and password to match your Router/AP. And use IP numbers that fit your
network.
Type the IP address you gave the board into your browser, in URL format as http://ipnumber. Then
the web interface will show up.
Set the Rom number to ie. 6. Then push to Go to "Control" and press M4 reset.
You can also use the how-to for make this: http://cpcwiki.eu/index.php/M4_Board#Various_files
Rom slot 0: This is reserved by BASIC ROM internally in the CPC, it can be replaced with
the romboard, but it must be an another BASIC rom!
Rom slots 1-7: Free to use
Rom slots 7-31: These slots are NOT initialized by the standard system. Use a modified
lowerrom (FW316) or booster rom (uploading in a slot below 8 ) to initialize
these roms at startup.
It is highly recommended that you insert the M4 rom in slot 7, this will give you best possible
compatibility with games.
CPC664/CPC464+/CPC6128+:
Rom slot 0: This is reserved by BASIC ROM internally in the CPC, it can be replaced with
the romboard, but it must be an another BASIC rom!
Rom slot 7: Reserved by AMSDOS disc rom internally in the CPC, it can be overwritten with
ie. ParaDOS or other disc rom, if access to disc drive is still wanted.
Rom slots 16-31: These slots are NOT initialized by the standard system. Use a modified
lowerrom (FW316) or booster rom (uploading in a slot below 8 ) to initialize
these roms at startup.
It is possible to set M4 rom to the slot 7 for the best compatibility, however you will lose
simultaneous disc drive and SD card access. If you wish to keep both M4 and floppy disc drive too,
then set M4 rom for the slot 6.
CPC6128:
Rom slot 0: This is reserved by BASIC ROM internally in the CPC, it can be replaced with
the romboard, but it must be an another BASIC rom!
Rom slot 7: Reserved by AMSDOS disc rom internally in the CPC, it CANNOT be overwritten
on most of CPC6128 systems, with the exception of MC20C (iirc) motherboard.
DO NOT use this slot!
Rom slots 16-31: These slots are NOT initialized by the standard system. Use a modified
lowerrom (FW316) or booster rom (uploading in a slot below 15) to initialize
these roms at startup.
Lowerrom
If the "Lower-rom enabled", you must upload a lower rom binary to the corresponding slot or the
machine will reset/freeze.
It is recommended to use ie. slot 31 for lowerrom replacement, because if you want to disable it, the
slot will not be initialized during the ordinary system configuration (and lowerrom should not be
initialized like a normal rom = freeze).
If you are using a CPC6128 model and having problems with game compatibility it is recommended
to use the modified lowerrom for the M4 board and put the M4 rom in the slot 6. Get thee modified
lowerrom here: http://www.cpcwiki.eu/index.php/M4_Board
For other machines, simply set M4 rom to slot nr. 7. Otherwise, if you want to use floppy disc drive
type |M4ROMOFF
Both basic and lowerrom must be replaced or it these will not work. Download ie. the roms for the
CPC6128 from here: http://www.cpcwiki.eu/index.php/ROM_List
Upload OS rom to e.g. slot nr. 31 and tick "Enable lower-rom" and set it to slot 31.
With the CPC and the M4 Board turned on, the front-end of the expansion can be accessed, which
will allow to configure or control a few features. To access it, enter the following URL in the browser:
On the screen you can upload files from the PC to the microSD card through the File menu or reset
the CPC machine from the Control menu or make changes to the configuration from the Settings
menu.
On the same screen, Rom Slots are listed from 0 to 31. In slot nr. 0 you have to configure the Basic
v1.1 rom, in slot nr. 8 the AMSDOS 0.5 and for the slot nr. 31 the lower rom modified (by Duke) of the
6128 machine.
There are a multitude of possible ROM configuration combinations. Click to the << Roms >> button
and configure it.
You have to address the URLs, where the card should download the roms from - some examples are
presented here:
Slot 0: http://www.cpcwiki.eu/imgs/ae/BASIC1.1_%286128_Spanish%29.ROM
Slot 8: http://www.cpcwiki.eu/imgs/7/7d/AMSDOS_0.5.zip
To upload the roms one by one, you have to click to the << Uploads >> button that appears next to
the slot.
Add a Slot name, then Browse the rom file and click to the << Upload >> button.
USING A MODIFIED ROM
Modified lower ROM for CPC6128
It is useful for users who cannot override AmsDOS (ROM slot 7) with the M4 ROM, using this patched
lower ROM, M4 ROM must be in ROM slot 6. It will be initialized instead of rom slot 7 and provide
better compatibility with games and higher high memory area (himem). It's recommended to upload
the original AMSDOS (or Parados) rom binary to the rom slot 6, then it will be available when typing
|M4ROMOFF.
Download the desired autoinstaller (file: M4LOW-EN.BIN) and place it on your microSD card and
then simply execute it to install and enable the modified lowerrom into rom slot 31.
RUN"M4LOW-EN.BIN
FutureOS ROM
16 KB XROM for FutureOS with full support for the M4 SD card.
https://www.cpcwiki.eu/index.php/FutureOS
FIRMWARE UPGRADE
Updating (or downgrading) a firmware is done by unpacking the update zip file to the root directory
of the microSD card (from a PC).
The latest firmware version can always be obtained via |upgrade command (no need to use PC, as
long as CPC is setup to the internet).
NETWORK CONNECTION
If you wish to use the web interface, romboard, realtime clock or download stuff from the internet.
Example of network connection and usage, using DHCP and a WiFi SSID:
This is enough to set up the internet connection. You can alter the rest of the settings from the web
interface of the M4 Board.
First type: |netstat to see if you are connected, or there's is an error. If connected, it will display your
IP address.
You can type this into your web browser or the netbios name directly, and access the rest of the
configuration from there under settings.
When using netbios name, make sure you type it like this:
It might take a bit the first time as your computer will have to associate the netbios name to the IP.
After the initial setup this is all saved to the microSD card in the /m4 folder in the config.txt file.
At the next power cycle these settings will be read and the CPC will automatically connect to the
internet.
Using a static IP address is recommended, this will make the board connect almost instantly.
Parameters
dhcp 0=disable DHCP and use static ip settings, 1=use DHCP (static IP settings are ignored)
dns1 dns server, you can use ie. 8.8.8.8 (google dns)
dns2 dns server backup, you can use ie. 8.8.4.4 (google dns)
Note, that if your parameters are longer than 255 chars (cpc basic line limit), then you can issue the
command twice.
The XFER CPC M4 tool
Command-line tool that allow to send files and receive from an M4 Board. Possibility to add an
AMSDOS header too.
https://www.cpcwiki.eu/index.php/CPC_M4_xfer_tool
Upload file, opt 0: no header add, 1: add ascii header, 2: add binary
xfer -u ipaddr file path opt
header (specify start and exec addr. in hex)
xfer -d ipaddr file path opt Download file, opt 0: leave header, 1: remove header
E.g. if your M4 has IP address 192.168.1.11, the following code will run zynaps from given directory.
xfer -s 192.168.1.11
In a development environment the idea is you ie. do the following to your makefile:
xfer -u 192.168.1.11 mycode.bin / 0 (to upload the file after compilation, additional files could be
uploaded too)
xfer -x 192.168.1.11 /mycode.bin (to execute it)
TELNET clients
Download the Telnet client directly to your CPC via:
|httpget,"spinpoint.org/telnet.bin"
HACK mode
Using the Hack menu with the left << HACK >> button.
It requires to solder two wires to the M4 board PCB (to the WiFi module).
Install only at your OWN risk. You can just launch hack menu from the Web UI.
TROUBLESHOOTING
● If somehow the card does not starting or something goes wrong after making configuration
changes. Take the microSD card into a PC and delete the files in /m4 directory, take the power
of the board, re-insert microSD and set it up again.
● Similar to this if you misconfigured the ROM slots or the execution of the rom binary is not
proper, and the machine is freezing when you start it. Then just remove the SD card and
delete the /M4 directory on it and insert the card again to the M4 board. Then after
restarting the machine, the board will regenerate the standard configuration files and will be
running again properly.
● Dirty edge connectors: If any odd issues, like resets, freeze, graphic glitces etc. make sure your
edge connector is cleaned. It can be root of many problems, if it's not properly cleaned.
APPENDIX
All further information of development, assembler programming, registers see the current m4info.txt
file of the board.
https://www.spinpoint.org/cpc/m4info.txt