rosserial/cmake flashing fails with atmega168
Hi, I'm once again working on getting rosserial to work with a atmega168 based motor controller. With the arduino IDE, I can flash the rosserial "hello world" example just fine, but with the cmake-based system, the "make upload" command always aborts at the verification step at about 6 to 20% with "stk500_recv(): programmer is not responding".
I changed node_handle.h like so:
template<class Hardware,
int MAX_SUBSCRIBERS=5,
int MAX_PUBLISHERS=5,
int INPUT_SIZE=128,
int OUTPUT_SIZE=128>
class NodeHandle_
to make the code fit into the limited memory of the atmega168 (It would be good if this could be set without editing in the rosserial_client package btw :) /edit: Just noticed one can actually do this by using ros::NodeHandle_<ArduinoHardware,5,5,128,128>
instead of ros:NodeHandle
)
What I get when flashing is:
make upload
[ 76%] Built target diecimila_CORE
[100%] Built target chatter
Scanning dependencies of target chatter-upload
avrdude: successfully opened stk500v1 device -- please use -c stk500v1
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
a vrdude: erasing chip
avrdude: reading input file "chatter.hex"
avrdude: writing flash (9774 bytes):
Writing | ################################################## | 100% 7.60s
avrdude: 9774 bytes of flash written
avrdude: verifying flash memory against chatter.hex:
avrdude: load data flash data from input file chatter.hex:
avrdude: input file chatter.hex contains 9774 bytes
avrdude: reading on-chip flash data:
Reading | ########## | 19% 1.35savrdude: stk500_recv(): programmer is not responding
make[3]: *** [CMakeFiles/chatter-upload] Error 1
make[2]: *** [CMakeFiles/chatter-upload.dir/all] Error 2
make[1]: *** [CMakeFiles/upload.dir/rule] Error 2
make: *** [upload] Error 2
Is there a quick way to disable the verification step? Seeing how it works with the arduino IDE upload, I suspect that the verification step fails because of timing issues or so and not because flashing went bad.
Update:
After updating to most recent mercurial version and setting <ArduinoHardware,4,4,128,128>
for nh
, I can get the Atmega168 to publish on the chatter topic (Flashing still seems to fail sometimes though). However, if I add a subscriber, I can still flash the system, but rosserial fails to connect every time. If I upload the code using the arduino IDE, it works. Interestingly, the Arduino IDE reports a sketch size of
Binary sketch size: 9282 bytes (of a 14336 byte maximum)
while 'make upload' of the cmake based script tells me
avrdude: writing flash (11220 bytes):
for the exact same code
Comments

