M4 Board

From CPCWiki - THE Amstrad CPC encyclopedia!
Revision as of 07:03, 8 August 2016 by Gryzor (Talk | contribs) (Firmware: added changelog)

Jump to: navigation, search

The M4 Board is a 2016 expansion card which enables WIFI access to and from CPC, Romboard and using SD-Card as mass storage.

You can read more about it at http://www.spinpoint.org/cpc/m4info.txt.


Updating (or downgrading) a firmware is done by unpacking the update zip file to the root directory of the microSD card (from a PC). Then insert to the M4 and powercycle the CPC/M4 board, after about 20 seconds it should be updated. Verify with |version command. Latest firmware version can always be obtained via |upgrade command (no need to use PC, as long as CPC is setup to the internet).

Version Changes File
1.01 Initial Version M4FIRM_v101.zip
1.02 M4 rom defaults to Rom 6 M4FIRM_v102.zip
1.03 |CD command now accepts no paramters and will prompt with cursor,
so Basic 1.0 users can use SHIFT+CURSORKEYS+COPY.
1.04 Ability to replace lowerrom. M4FIRM_v104.zip
1.05 FTELL, FSIZE commands implemented and
new RSX commands |ROMUP, |ROMSET, |ROMUPD
1.06 Fix WEB UI instability issue.
Fix romupload for roms with or without AMSDOS header, and related bugs.
1.07 Fixes and buffering for cas_in_char,
fix |ROMUP to work from .dsk files, fix cat/dir loop,
fix httpget to work with IP addresses aswell as hostnames.
1.08 FIX IP addresses for httpget (again). Fix
|dir bug. Fix hardreset.
Added C_GETPATH command (requested).
Added ability to load your own build of M4ROM from root of microSD, should be named M4ROM.BIN

Various files

xfer (v1.0.1)  : Command-line tool that allow to send files and receive from a M4 Board. Possibility to add a AMSDOS header too.

M4 Board relay rom  : When moving M4rom out of position 1-7 / 1-16 it will no longer be initialized, therefore this rom should be placed at rom7 or lower. This is if you want to use 32 roms of XMEM and map M4 romboard after it. You should program the XMEM or other romboard with M4 bootrom in pos 1-7, it will look for M4 rom from 1-127 and initialize it + pass commands through to it

Technical information

Structure for romslots.bin & romconfig.bin under m4 directory are:
Contains 32x raw rom data (no headers). To locate a rom in the file, use:
offset = slot * &4000


int totalRoms; // 32 (early versions of the firmware had only 16)
int m4RomNum; // M4 rom to map rom number 0-255
int m4RomEnable; // M4 rom enabled
int romRangeStart; // start mapping roms from
int lowerEnable; // lower rom replacement enabled
int lowerSlot; // which slot maps lowerrom (0-31)
unsigned int reserved[2]; // set to zero for now

Then for each rom (repeated 32 times):
char updateflag; // 0 = no rom present (or disabled), 1 = rom present (enabled), 2 = New rom will be flashed into M4 internal flash, 3 = remove rom
char name[32]; // name of rom to be displayed in webinterface


Make your own M4 ROM or add additions to the existing, source code can be found here:
It's compiled (assembled) with sdasz80 (part of SDCC package).

Telnet client example, source code (requires beta 1.0.9+ firmware):

CPC xfer, pc commandline tool to transfer files back and forth to M4 board:
Source code here: https://github.com/M4Duke/cpcxfer

Command documention and other infos: