I've been playing with the Blackice I and Mx with a view to following the retro trail blazed by Lawrie (Apple) and hoglet (BBC B) and getting my workflow sorted out. My main environment has been Ubuntu 18.04.3 LTS on VirtualBox (Windows10) and I decided to move to nextpnr rather than arachne-pnr which meant re-working the Makefile in the Blackice Mx trail example.
I built nextpnr after building icestorm, yosys and arachne-pnr as described at https://github.com/YosysHQ/nextpnr for the full ice40 family though excluding the gui option, so my build sequence was;
cmake -DARCH=ice40 -DBUILD_GUI=OFF .
sudo make install
One problem I had was that nextpnr couldn't find the Python libs as I was using miniconda, so I had to first export the library in my ~/.bashrc file;
I then modified the makefile in the Blackice Mx trail example folder;
# chip.bin: chip.v trail.v trail.pcf
# yosys -q -p "synth_ice40 -blif chip.blif" chip.v trail.v
# arachne-pnr -d 8k -P tq144:4k -p trail.pcf chip.blif -o chip.txt
# icepack chip.txt chip.bin
chip.bin: chip.v trail.v trail.pcf
yosys -p 'synth_ice40 -top chip -json chip.json' chip.v trail.v
nextpnr-ice40 --hx8k --package tq144:4k --json chip.json --pcf trail.pcf --asc chip.asc
icepack chip.asc chip.bin
stty -F /dev/ttyACM0 raw
cat chip.bin >/dev/ttyACM0
$(RM) -f chip.blif chip.txt chip.asc chip.ex chip.bin
Apart from file name changes the key element is to ensure you have specified the correct platform (in this case "--package tq144:4k"). Without it you may find the pcf references pins that are not supported on the default platform adopted by nextpnr and the process fails.
With these changes the trail example was processed, uploaded and ran fine on the Mx.
Edit: the --package parameter values are documented on the IceStorm site at http://www.clifford.at/icestorm/ in the supported parts table but I couldn't find a reference or similar list on the nextpnr site.
Edit 2: deleted the bit about package parameter not in the arachne-pnr invocation when it clearly is (-P parameter).