Programming failure, ubuntu 23.10 & Arduino Robot Control board

I recently decided to try programming an early Arduino Robot. I'm setup on Ubuntu 23.10. I seem to have programmed an alternative sketch into the robot when I was using it in the past.
I am trying to reprogram the original Hello_User sketch back into it. I am getting the following error:

I have tried this with and without pressing the reset after the sketch recompile, always the same result.

I have also tried to reprogram the bootloader in case there was a problem with it. I am using a USBAsp programmer. I get the following error:

avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Failed chip erase: uploading error: exit status 1

I haven't had a lot of experience using the Arduino IDE, so I'm kind of at a loss for where to look next.

Thanks in advance for any help anyone can give me.
Regards,
Greg

Is the board recognised by Ubuntu? lsusb and dmesg are your friends.

Which board is in your robot? 'butterfly_recv' indicates that it has a 32U4 (or so) microcontroller.

If your board indeed has a 32U4, what happens when you double tap the reset button; any change in the board recognition by the OS? If your board has the L-LED, it should fade in/out for approximately 8 seconds.

Ok, I should have included these links: Introduction to the Arduino Robot, Getting Started

The Arduino Robot has 2 boards about 18cm in diameter and both of them have an AVR 32U4.

My computer recognizes the robot:
Bus 003 Device 028: ID 2341:8038 Arduino SA Robot Control Board (CDC ACM, HID)
and I can select it in the Arduino IDE (Arduino Robot Control @ /dev/ttyACM0)

There is no 'L' led on the boards and I get no response from the existing onboard leds when the reset button is pressed. I have tried pressing the reset button during the programming process to no avail.

I do have one question on the reset button operation, for a double press, how long should I wait between presses? Should it be as fast as I can press them, or should I wait some time between presses?

That one :wink:

Board just resets, no change in the linux usb recognition or ttyACMx port.

Run dmesg -w; the command will not close. Next perform an upload; you should be able to see the difference.

[17845.507065] usb 1-5.4.2: new full-speed USB device number 20 using ehci-pci
[17845.591065] usb 1-5.4.2: New USB device found, idVendor=2341, idProduct=8036
[17845.591072] usb 1-5.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[17845.591076] usb 1-5.4.2: Product: Arduino Leonardo
[17845.591080] usb 1-5.4.2: Manufacturer: Arduino LLC
[17845.591751] cdc_acm 1-5.4.2:1.0: ttyACM1: USB ACM device

When upload starts

[17941.230504] usb 1-5.4.2: USB disconnect, device number 20
[17941.659106] usb 1-5.4.2: new full-speed USB device number 21 using ehci-pci
[17941.739031] usb 1-5.4.2: New USB device found, idVendor=2341, idProduct=0036
[17941.739038] usb 1-5.4.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[17941.739042] usb 1-5.4.2: Product: Arduino Leonardo
[17941.739046] usb 1-5.4.2: Manufacturer: Arduino LLC
[17941.739665] cdc_acm 1-5.4.2:1.0: ttyACM1: USB ACM device

Note the change in idProduct.

This happens at the very beginning and then no other changes as the programming connection tries continue:

[259211.210539] usb 3-2: USB disconnect, device number 34
[259211.690517] usb 3-2: new full-speed USB device number 35 using xhci_hcd
[259211.844991] usb 3-2: New USB device found, idVendor=2341, idProduct=8038, bcdDevice= 1.00
[259211.844998] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[259211.845000] usb 3-2: Product: USB IO Board
[259211.845002] usb 3-2: Manufacturer: Arduino LLC
[259211.847692] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[259211.849420] input: Arduino LLC USB IO Board Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:2341:8038.001C/input/input79
[259211.849640] input: Arduino LLC USB IO Board Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:2341:8038.001C/input/input80
[259211.906813] hid-generic 0003:2341:8038.001C: input,hidraw2: USB HID v1.01 Mouse [Arduino LLC USB IO Board ] on usb-0000:00:14.0-2/input2

Greg

The last sketch that you did upload seems to have been something with keyboard and mouse.

Is the output that you provided after a double tap reset or after an upload attempt; I made a mistake in my previous reply; I stated "When upload starts" which should have been "After a double tap reset".

If that is after a double tap reset, it looks like your board has lost the bootloader; the reason why I say that is that after the USB disconnect in your output, the board immediately gives the same idProduct as before that.

If your output is after / during an upload attempt, try the double tap reset and post the results.

I've checked the AVR board package and the idProduct should change to 0038 after a reset.

PS
I seem to have to register for the designspark link that you provided to view all information; I'm not prepared to do that.

The output that I posted was from a program upload cycle. Here's the output from a double tap of the reset button:

[318036.631896] usb 3-2: USB disconnect, device number 35
[318037.542558] usb 3-2: new full-speed USB device number 36 using xhci_hcd
[318037.692143] usb 3-2: New USB device found, idVendor=2341, idProduct=0038, bcdDevice= 0.01
[318037.692160] usb 3-2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[318037.692166] usb 3-2: Product: Arduino Robot Co
[318037.692171] usb 3-2: Manufacturer: Arduino LLC
[318037.694871] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

[318045.307824] usb 3-2: USB disconnect, device number 36
[318045.618829] usb 3-2: new full-speed USB device number 37 using xhci_hcd
[318045.773397] usb 3-2: New USB device found, idVendor=2341, idProduct=8038, bcdDevice= 1.00
[318045.773403] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[318045.773405] usb 3-2: Product: USB IO Board
[318045.773407] usb 3-2: Manufacturer: Arduino LLC
[318045.775869] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[318045.777041] input: Arduino LLC USB IO Board Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:2341:8038.001D/input/input81
[318045.777194] input: Arduino LLC USB IO Board Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:2341:8038.001D/input/input82
[318045.835074] hid-generic 0003:2341:8038.001D: input,hidraw2: USB HID v1.01 Mouse [Arduino LLC USB IO Board ] on usb-0000:00:14.0-2/input2

First, I have no idea why the board is identifying as a mouse and keyboard, I'm still looking for the original copy of the script that I had uploaded, but I'm sure that it was one of the examples from Arduino. It displays a compass and shows the heading and tries to drive the robot at 0 degrees. Oh, well, maybe I'll figure it out in time.

Other than that , you gave me the insight that I needed. I tried uploading again and then waiting until I got the compile results and then doing a double tap with these results:

Sketch uses 20930 bytes (72%) of program storage space. Maximum is 28672 bytes.
Global variables use 1772 bytes (69%) of dynamic memory, leaving 788 bytes for local variables. Maximum is 2560 bytes.
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
Device code: 0x44

Now I've got the Robot initial sketch running. Thanks for all of your help.

Greg

Sorry for the mistake.

Because you loaded a sketch that used the keyboard and the mouse? I assume that after the successful upload it now no longer identifies itself as such. I did load a keyboard sketch on my Leonardo and after that I got a keyboard as well

[17392.837069] usb 1-5.4.2: new full-speed USB device number 11 using ehci-pci
[17392.919594] usb 1-5.4.2: New USB device found, idVendor=2341, idProduct=8036
[17392.919600] usb 1-5.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[17392.919604] usb 1-5.4.2: Product: Arduino Leonardo
[17392.919608] usb 1-5.4.2: Manufacturer: Arduino LLC
[17392.919612] usb 1-5.4.2: SerialNumber: HIDPC
[17392.920390] cdc_acm 1-5.4.2:1.0: ttyACM1: USB ACM device
[17392.924571] input: Arduino LLC Arduino Leonardo as /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.4/1-5.4.2/1-5.4.2:1.2/0003:2341:8036.0005/input/input20
[17392.976725] hid-generic 0003:2341:8036.0005: input,hidraw1: USB HID v1.01 Keyboard [Arduino LLC Arduino Leonardo] on usb-0000:00:1d.7-5.4.2/input2

Great. You can use the checkbox button under the most useful post to mark the topic as "solved" so people who encounter the same problem know that there is a solution.

Pleasure.

I understand that the sketch that I loaded enabled the keyboard and mouse identification, what I don't understand is why. I guess I will have to look into how the USB support is enabled.
The sketch that I loaded was controlling the robot to seek a specific direction as determined by the on board compass. there should have been no reason for the keyboard and mouse support to have been enabled. I thought that the sketch was one of the Arduino supplied examples.

Whatever, now that I have figured the magic incantations to get a sketch programmed on the robot, I can start looking into more of its operation and the intricacies of the USB configuration and operation.

Thanks again,
Greg

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.