the mac is wonderful but it has some odd behaviour and therefore
the steps are going to be a bit complicated.
start the terminal application and change directory to the desktop cd Desktop/
run nano and set the file name nano pokitto.command
paste in this code:
echo "drag .bin file and press enter"
cp $BIN /Volumes/CRP\ DISABLD/firmware.bin
diskutil unmount /Volumes/CRP\ DISABLD
press control x to save then y and then enter
run this command to set the permissions of the file chmod +x pokitto.command
now you can plug in your device and press and hold reset and then tap flash on the back of the pokitto and CRP DISABLD will pop up on the desktop.
now if you have a pokitto program from mbed your ready to go
thats right you can program the pokitto with the raspberry pi, heres how.
change directory to the desktop cd Desktop
run nano and set the file name nano pokitto.sh
paste this code:
echo "copy .bin location and press enter"
dd bs=1024 conv=nocreat,notrunc if=$BIN of =/media/pi/CRP\ DISABLD/firmware.bin
umount /media/pi/CRP\ DISABLD
press ctrl xto save then yand then enter
run this command to set the permissions of the file chmod +x pokitto.sh
now you can plug in your device and press and hold reset and then tap flash on the back of the pokitto
you can now download your .bin from mbed web IDE and double click the pokitto.sh
a popup might show up and you can press Execute in Terminal
now you can copy the file location in the terminal and hit enter, this might take some time
wen this is done its safe to remove the pokitto for the pi
This should also work on desktop Linux systems. There are a couple of things that different distros do differently (which includes the RPi, as there are multiple distributions for it as well) to worry about:
“/bin/sh” isn’t standardize, and different distributions use different shells. I think the script is pure posix, so should work in all of them, but maybe not.
More importantly, automount behavior varies a lot between distros. Not only different locations, but whether or not it happens at all. If it’s a different location, you hopefully know where. If it’s not at all, I recommend adding something like:
Arrgh. One line, of course. Change the mount directory (/media/mwm/POKITTO) to your preference, and the uid and gid to yours. You’ll need to create the mount directory owned by you, and possibly enable user mounts. But you can then just do mount /media/mwm/POKITTO to mount it, and similar to unmount.