Programming the ARCH GPRS V2 with mbed

The ARCH GPRS V2 can be programmed using the mbed platform. I actually had a bit of trouble programming it so I’ll share my process here.

I first attempted to get the hello world (the “mbed_blinky”) project programmed using Ubuntu. Connecting the ARCH GPRS V2 with my laptop over USB for the first time, a drive appeared containing an html file taking you to the product page on mbed. This must be a result of the firmware that is shipped on the device, because once I started playing with the firmware this drive did not appear again.

I added the ARCH GPRS V2 platform and mbed_blinky project to my online mbed IDE, following the instructions on the Seeed Wiki:

Now connect your Arch board to your PC and long press the reset button. A removable USB drive named CRP DISABLD should automatically appear on your PC. Go to the CRP DISABLD drive, delete the existing firmware file that you see in the folder and copy the downloaded binary file to CRP DISABLD. Quick press the reset button to run the new binary.

 

I did this and… nothing happened. The firmware the device was shipped with did some blinking when plugged in (I can’t remember the exact details now, and there doesn’t seem to be a factory reset so I can’t confirm what behaviour is noticeable out of the box), but now a few LEDs were dimly lit and that’s it. I retried my process a few times with no luck.

So I rebooted my computer to go into Windows 8 and signed into my mbed account, compiled the code and downloaded it. Noticeably, the ARCH GPRS V2 didn’t appear as a drive when it was in normal mode (my previous attempts must have wiped the firmware it was shipped with that make it appear as a mass storage device in normal mode), but when I did the long press, CRP DISABLED appeared. This time, I simply deleted firmware.bin and copied and pasted the compiled binary I downloaded from mbed. Upon reset, hey presto it worked as advertised. To spice things up a little bit, I copied the slightly more complicated blinking example from the Seeed Wiki and again found it worked as intended.

I switched back to Ubuntu and re-read the instructions. I noticed there is a discrepancy between these instructions on mbed:

dd if={program.bin} of={firmware.bin}

and these instructions on the Seeed Wiki:

dd if={new_firmware.bin} of={mnt_dir}/firmware.bin conv=notrunc

It seems that the “no trunc” flag is vital in this situation. Not being a Linux guru, I had a Google and it seems that this is used “to prevent truncation when writing into a file.” I’m not entirely sure why this is needed, but I know for sure that the drive that appears when you put the board in USB ISP mode is not a conventional drive.

I also noticed on the Seeed Wiki that it says to set your mbed compiler to the Seeeduino-Arch platform. I think this is a typo, and potentially is a result of copying and pasting from a Wiki for an earlier platform. On the mbed page for the Arch GPRS V2 it says to use the Arch GPRS V2 platform; indeed, this is where the link resides for you to add this platform to your compiler. However, I compiled mbed_blinky on this platform and it ran just fine, so at the very least some pins are compatible, but I won’t be experimenting to see if more complex projects work.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s