waggle-sensor / wagman

The Waggle Manager (Wagman), a custom circuit board and control system for Wild Waggle Nodes
1 stars 3 forks source link

Wagman V3.1 : Bootloader Install and Firmware Upgrade Issues #15

Closed Rumpkie closed 7 years ago

Rumpkie commented 7 years ago

The latest run of wagman 3.1 boards and the older wagman 2s will not accept the latest version of the wagman software.

Symptoms: the following error is generated:

avrdude: Expected signature for ATmega32U4 is 1E 95 87 
Double check chip, or use -F to override this check.

The board will not accept the latest boot loader or any boot loader.

Rumpkie commented 7 years ago

I have been able to get the bootloader to program on the ATMEGA32u4 by reducing the programmer's baud rate by editing the makefile and changing the avrdude -B flag from 1 to 2. which drops the programming bit rate from 1Mhz to 500Khz.

While this did get passed the problem of burning the bootloader, it did not allow me to program the chips with the test software. The issue becomes the command

stty -F /dev/waggle_sysmon hupcl;

which normally puts the ATMEGA32u4 into receive program mode doesn't seem to work, or doesn't seem to completely work. and while sometimes the avrdude can read the existing board, it cannot seem to find the programmer or reports that the programmer has stopped responding when it goes to program it the script does try the programmer several times over the course of 8 seconds or so.

I was able to reproduce this problem the Argonne 02 and Argonne 03 programmers with both my personal MacBook and the Linux Lenovo currently at Surya.

I was not able to install the Arduino bootloader on any of the symptomatic v2 boards or the new v3.1 from the Aduino IDE.

Rumpkie commented 7 years ago

The initial thoughts of causality centered around a purchasing choice to move from the ATMEL part number ATMEGA32u4-MUR to ATMEGA32u4-MU, the thoughts there being that there was no difference in the chips. I have confirmed with both the supplier, DIGIKEY and the manufacture ATMEL that ATMEGA32u4-MUR to ATMEGA32u4-MU are the same chip and that one comes on a reel and the other a tray. This is further confirmed by the part number that is etched on both the ATMEGA32u4-MUR and ATMEGA32u4-MU that reads ATMEGA32u4-MU.

Rumpkie commented 7 years ago

Additional information: some of the older wagmans are programmable and when those chips are placed on the newer board they remain programmable so we have ruled out the prospect of it being something else on the board.

Rumpkie commented 7 years ago

The initial state of the Atmel chip may not have the fuses properly set, the following line added at commit 63ee45d7f2b9cbcbe55420d20b721080452c2d91

avrdude -C ./avrdude.conf -B 2 -p atmega32u4 -P usb -c avrispmkII -U efuse:w:0xcb:m -U hfuse:w:0xd8:m -U lfuse:w:0xff:m -v -U flash:w:Caterina.hex

sets the correct clock settings for the CPU