Arduino adventures - old school idiocy

Post test messages here

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
larsimmisch
 
Posts: 2
Joined: Wed May 28, 2008 6:27 pm

Arduino adventures - old school idiocy

Post by larsimmisch »

I got a Boarduino, I soldered it, I left it on my bench.

Finally, I decided to test it. Not being fond if GUIs, I wanted to do it the old school way, through the commandline and proper Makefiles and such. It seemed easy and Debian has everything at an apt-get fingertip.

I didn't like the setup(), loop() thing of the sketches - what's wrong with straight C and main()? So I wrote a blink.cpp and adjusted the Makefile. make. Hmm, warnings, ignore them. make upload. No permissions. Hmm. sudo make upload.

Yikes! Invalid device signature.

And the LED does not blink, but is solid red. No idea what's wrong, so I googled for "Yikes! Invalid device signature.". The only halfways lucid post talked about problems with DTR and the FT232RL in older kernel versions. Better update the kernel. Ah, no. Still doesn't work.

So I decided to do it by the book and downloaded the entire Arduino environment to a consumer OS (X). Try the blink sketch. Downloads, blinks. Ah. The board does work, then. Install avrdude via Macports, replicate out what the IDE does, but still: Yikes!

Hmmm. Went to bed in frustration. On the next day, I found the SVN respository for Arduino, found the avrdude code and compared it to the stock version. Ah! The Arduino version has special code for reading the device signature!

Compiled that version on Linux: yep, correct signature. Distill a patch, send it upstream.

But blink.cpp still doesn't blink. But by then, sanity had returned. The board was working, the upload did succeed, so it must be the code. It took me two minutes to find I had forgotten to call init() in my straight C version. I added it, all was well.

(In hindsight, I really appreciate the work of the Arduino team. They've done an excellent job making microcontroller programming easy, without dumbing it down too much.)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

you can also just tell it to skip the sigcheck with -F :)

see: http://ladyada.net/library/arduino/bootloader.html

User avatar
larsimmisch
 
Posts: 2
Joined: Wed May 28, 2008 6:27 pm

Post by larsimmisch »

ladyada wrote:you can also just tell it to skip the sigcheck with -F :)

see: http://ladyada.net/library/arduino/bootloader.html
Yes, of course, and that is even the default in the Makefile. But see, the code didn't run (because I had forgotten to call init()), and I didn't know where to start searching and started searching in the wrong place. The idiocy in the title is entirely mine.

And on the upside, the signature issue is documented in the upstream avrdude patch manager.

Locked
Please be positive and constructive with your questions and comments.

Return to “Test Message Forum (closed)”