Whole bunch of beginner's m3pi+mbed questions

25 Feb 2012

Hi guys, I've been lurking for a few days now since I got my lovely m3pi+mbed+wifly and have a whole load of questions. I've had a look at the various guides I can get my hands on but still have a whole ton of confusion. I program C for a living and so I'm good to go with the development.

1. I assume that the m3pi can be programmed with the AVR programming cable directly OR via the mbed/expansion board. I assume that as I have the mbed and expansion board, I will not be using an AVR programmer and programming the m3pi directly, and that there is no benefit to doing the same?

If I reprogram the m3pi directly, will the mbed not work with it until it gets programmed back in 'slave serial' mode?

2. To program the mbed, I'm going to this site, clicking compiler, building my code in that, compiling, downloading the .bin to the mass storage device that the mbed presents to windows, then pressing the on button on the m3pi. I can then press the button on the mbed to restart the program. Is this the correct process? It's very tiresome to do this to test each revision to some code. Is there a better way to test/debug ?

3. For getting 'output' whilst debugging, I'm having data written to the LCD. Is there a better/more convenient way of debugging?

4. When writing some samples, I just end up with a 'bad cmd' printed on the LCD. Fortunately my sample code was only about 15 lines long so I figured out what it was complaining about. On a larger program, how am I supposed to debug this?

5. I have the wifly. I have inserted it in the appropriate slot and I see it alternating between red and green - is it ready to be programmed or do I need to solder/connect it to the mbed as per this link - http://mbed.org/cookbook/wifly ? I'm not sure whether the expansion board has handled this for me. My assumption is that it is ready to go as-is but I'm not having any luck working with it. The code sample from the link doesn't work. No output, no error, no nothing.. (back to my question about debugging)

6. Can I only ever put the one .bin file on the mass storage device (mbed)?

7. The m3pi seems to have a 'demo' program on it. If I hit the reset button on the m3pi it defaults back to this demo program. Is this correct/expected behavior? Should I/could I remove/replace this 'demo' program? I assume this is nothing to do with the mbed and resides directly on the m3pi ?

Please feel free to answer none/some/any/all of the above :D

Thanks guys!

Adam

25 Feb 2012

You can use terminal program to reset and print debug messages, crtl+b reset's mbed when connected to mbed by terminal.

http://mbed.org/handbook/Terminals

http://mbed.org/handbook/Debugging

http://mbed.org/users/ihunter/programs/debug/lg887u

07 Jan 2013

I am having the same problem as number 5

I am using the WiFlyInterface http://mbed.org/users/samux/code/Wifly_HelloWorld/

I have used the terminal to do some debugging.

wifly.connect() returns 0, suggesting it connects but wifly.getIPAddress() is empty.

Might it be because might router uses WPA-2Personal?

Greg