GadgetReboot / RotaryUSB

LS30 Rotary Joystick to USB Interface
5 stars 1 forks source link

Error when building #3

Open spotUP opened 7 months ago

spotUP commented 7 months ago

Hi there! I am trying to build this, but i get this error:

Arduino: 1.8.3 (Windows 10), Board: "ATtiny, ATtiny85, 1 MHz (internal)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\User\AppData\Local\Arduino15\packages -hardware C:\Users\User\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\User\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\User\Documents\Arduino\libraries -fqbn=attiny:avr:attiny:cpu=attiny85,clock=internal1 -ide-version=10803 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_997197 -warnings=none -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_821394 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\User\AppData\Local\Arduino15\packages -hardware C:\Users\User\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\User\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\User\Documents\Arduino\libraries -fqbn=attiny:avr:attiny:cpu=attiny85,clock=internal1 -ide-version=10803 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_997197 -warnings=none -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_821394 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino Using board 'attiny' from platform in folder: C:\Users\User\Documents\Arduino\hardware\attiny\avr Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr WARNING: Category '' in library EEPROM is not valid. Setting to 'Uncategorized' Detecting libraries used... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\Rotary_Joystick_USB_KB.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\Rotary_Joystick_USB_KB.ino.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\DigiUSB.cpp" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\oddebug.c" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\osccal.c" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\usbdrv.c" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\usbdrvasm.S" -o "nul" "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\Documents\Arduino\libraries\Bounce2\src\Bounce2.cpp" -o "nul" Generating function prototypes... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\Rotary_Joystick_USB_KB.ino.cpp" -o "C:\Users\User\AppData\Local\Temp\arduino_build_997197\preproc\ctags_target_for_gcc_minus_e.cpp" "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\User\AppData\Local\Temp\arduino_build_997197\preproc\ctags_target_for_gcc_minus_e.cpp" Compiling sketch... "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -x assembler-with-cpp -flto -MMD -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10803 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Users\User\Documents\Arduino\hardware\attiny\avr\variants\tiny8" "-IC:\Users\User\Documents\Arduino\libraries\Bounce2\src" "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\usbdrvasm.S" -o "C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\usbdrvasm.S.o" C:\Users\User\AppData\Local\Temp\arduino_build_997197\sketch\usbdrvasm.S:393:9: error: #error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!"

error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!"

     ^

Using library Bounce2 at version 2.71 in folder: C:\Users\User\Documents\Arduino\libraries\Bounce2 exit status 1 Error compiling for board ATtiny.

What to do? =)

GadgetReboot commented 7 months ago

Is the IDE 1.8.3 or 1.8.13? I'm on 1.8.13 (on a Mac).

The first thing I see is the chosen board type is ATTiny at 1 MHz, but as it says in the comments at the top of the sketch, it uses a Digistump board file with a board type "Digispark Default 16.5 MHz"

And if using a blank ATTiny85 that has never been configured for Digispark emulated USB, it must have a Micronucleus bootloader in it first because this is how Digispark boards arrive pre-configured. Here's a video I did on programming Micronucleus bootloaders https://www.youtube.com/watch?v=RlscDz5JCcI

Once the ATTiny85 has the micronucleus bootloader it should be able to operate as a Digispark USB device when the right board file is installed to support those modules. Here's the Digistump board file installation guide http://digistump.com/wiki/digispark/tutorials/connecting

spotUP commented 7 months ago

Oh...... this explains everything... I will have a look at lunch! THANK YOU!

On Sun, Dec 3, 2023 at 7:33 PM GadgetReboot @.***> wrote:

Is the IDE 1.8.3 or 1.8.13? I'm on 1.8.13 (on a Mac).

The first thing I see is the chosen board type is ATTiny at 1 MHz, but as it says in the comments at the top of the sketch, it uses a Digistump board file with a board type "Digispark Default 16.5 MHz"

And if using a blank ATTiny85 that has never been configured for Digispark emulated USB, it must have a Micronucleus bootloader in it first because this is how Digispark boards arrive pre-configured. Here's a video I did on programming Micronucleus bootloaders https://www.youtube.com/watch?v=RlscDz5JCcI

Once the ATTiny85 has the micronucleus bootloader it should be able to operate as a Digispark USB device when the right board file is installed to support those modules. Here's the Digistump board file installation guide http://digistump.com/wiki/digispark/tutorials/connecting

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/RotaryUSB/issues/3#issuecomment-1837562536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA5GVBRNSW3BKA4JG54AKDYHTAZNAVCNFSM6AAAAABAE6DCIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGU3DENJTGY . You are receiving this because you authored the thread.Message ID: @.***>

-- Johan Samuelsson Designer & Animator M: +46 (0)701-490684

IKACHAN AB Källdammsvägen 4, 423 36 Torslanda

spotUP commented 7 months ago

Getting closer i think. I use the same arduiono ide version as you. What setting am i doing wrong? It can’t find the board. The usb driver is installed.

IMG_6636

spotUP commented 7 months ago

Here's the build log

Arduino: 1.8.13 (Windows 10), Board: "Digispark, 16.5 MHz - For V-USB, Default (6650 bytes avail.), Upgrade (via USB)"

In file included from C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/DigiKeyboard.h:17:0,

             from C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:35:

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/keylayouts.h:5229:2: warning: #warning "Using default layout (LAYOUT_US_ENGLISH)" [-Wcpp]

warning "Using default layout (LAYOUT_US_ENGLISH)"

^~~

In file included from C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/DigiKeyboard.h:17:0,

             from C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:35:

C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino: In function 'void processJoystick()':

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/keylayouts.h:150:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]

define KEY_R ( 0x15 | 0xF000 ) // Keyboard r and R

                             ~~~~~~~^~~~~~~~~~

C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:139:32: note: in expansion of macro 'KEY_R'

 DigiKeyboard.sendKeyStroke(KEY_R, MOD_SHIFT_LEFT);

                            ^~~~~

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/keylayouts.h:101:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]

define MODIFIERKEY_LEFT_SHIFT ( 0x02 | 0xE000 )

                             ~~~~~~~^~~~~~~~~~

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/DigiKeyboard.h:57:29: note: in expansion of macro 'MODIFIERKEY_LEFT_SHIFT'

define MOD_SHIFT_LEFT MODIFIERKEY_LEFT_SHIFT

                         ^~~~~~~~~~~~~~~~~~~~~~

C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:139:39: note: in expansion of macro 'MOD_SHIFT_LEFT'

 DigiKeyboard.sendKeyStroke(KEY_R, MOD_SHIFT_LEFT);

                                   ^~~~~~~~~~~~~~

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/keylayouts.h:144:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]

define KEY_L ( 0x0F | 0xF000 ) // Keyboard l and L

                             ~~~~~~~^~~~~~~~~~

C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:148:32: note: in expansion of macro 'KEY_L'

 DigiKeyboard.sendKeyStroke(KEY_L, MOD_SHIFT_LEFT);

                            ^~~~~

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/keylayouts.h:101:40: warning: large integer implicitly truncated to unsigned type [-Woverflow]

define MODIFIERKEY_LEFT_SHIFT ( 0x02 | 0xE000 )

                             ~~~~~~~^~~~~~~~~~

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.7.5\libraries\DigisparkKeyboard/DigiKeyboard.h:57:29: note: in expansion of macro 'MODIFIERKEY_LEFT_SHIFT'

define MOD_SHIFT_LEFT MODIFIERKEY_LEFT_SHIFT

                         ^~~~~~~~~~~~~~~~~~~~~~

C:\Users\User\Desktop\avrfw\Rotary_Joystick_USB_KB\Rotary_Joystick_USB_KB.ino:148:39: note: in expansion of macro 'MOD_SHIFT_LEFT'

 DigiKeyboard.sendKeyStroke(KEY_L, MOD_SHIFT_LEFT);

                                   ^~~~~~~~~~~~~~

Sketch uses 3546 bytes (53%) of program storage space. Maximum is 6650 bytes.

Global variables use 164 bytes (32%) of dynamic memory, leaving 348 bytes for local variables. Maximum is 512 bytes.

Please plug in the device (will time out in 60 seconds) ...

Device search timed out!

An error occurred while uploading the sketch

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

GadgetReboot commented 7 months ago

I don't get the same warnings about keyboard macros but it seems to be related to the Digistump library itself so maybe something changed. I am using 1.6.7 version of board file, not sure if we can manually change the version but here's a link to that version. Maybe it can be manually unzipped and overwrite existing installed files if it is forcing a newer version only. https://github.com/digistump/DigistumpArduino/releases

Screen Shot 2023-12-04 at 11 41 31 AM

I also see different options to select which board I'm using, and I don't have some options you have in the menu.

Screen Shot 2023-12-04 at 11 34 37 AM

Other than the compile warnings it looks like it did compile but it timed out when programming because it was waiting for the USB connection to be plugged in and then auto-detect and program using the micronucleus bootloader.

Do you have the ATTiny85 set up with a usb cable that can plug into the computer? Once programming starts and it says plug in the device before a timeout in 60 seconds, that's when the usb cable should be plugged in and it will program it, assuming the micronucleus bootloader is in the ATTiny so it knows how to use USB.

spotUP commented 7 months ago

With 1.6.7 i get this:

fork/exec /Users/spot/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino5/bin/avr-g++: bad CPU type in executable Error compiling for board Digispark (Default - 16.5mhz).

spotUP commented 7 months ago

i switched to my mac, and tried, but now i get:

Please plug in the device (will time out in 60 seconds) ... Device search timed out! An error occurred while uploading the sketch

But... i am trying to write to the avr programmer, should i instead plugin your pcb with the chip on and write to that?

spotUP commented 7 months ago

same thing with your pcb.

spotUP commented 7 months ago

Checking your videos over and over here.. it seems like the last step is to plug the attiny into your rotary pcb and program. I must have done something wrong when i wrote the Micronucleus bootloader to the attinys. I have ordered 4 more to test with. If i fail, is there ant chanse i could buy two programmed attinys from you for player 1 and player 2? I have been banging my head against the wall with my rotary cab for a year now. Going insane here! :D

GadgetReboot commented 7 months ago

It's been a while since I did anything with setting up that chip but I notice there's a newer micronucleus file from when I made the video about programming it. I wonder if they changed something in the bootloader. The previous file that would have been current when I originally programmed it is here (t85_default.hex) https://github.com/micronucleus/micronucleus/blob/29317ea0c5b55b704a42ad318c52945cf3e2359e/firmware/releases/t85_default.hex It can be downloaded by clicking the "download raw file" icon Screen Shot 2023-12-04 at 5 07 07 PM

I don't remember how programming the bootloader works regarding setting the flags in the chip but I think it keeps the reset pin working as a reset function instead of GPIO so the bootloader can maybe be re-programmed with the older hex file rather than just getting one shot at it.

I assume those usb drivers are installed, libusb? It's hard to diagnose something with multiple possible reasons for it not responding. I wonder if there's an older version of the libusb drivers that would work better. It looks like I was doing all of this 4 or 5 years ago and I don't recall updating anything since then so that's the version of various files I would have used.

When the IDE is waiting 60 seconds for the board to be connected for programming, it's looking for the final operating circuit with the ATTiny 85 and its own usb connector, so not the Arduino programming board.

So then another possible problem could be if the physical board has some sort of electrical issue preventing the usb connection from working. If the board was hand soldered, the usb connector could have bad connections.

One thing that would help sort out if the computer/drivers are working with this type of virtual usb bootloader is to try a digispark board and see if that works properly ali express modules Unfortunately I don't sell any hardware and don't even have any more chips. I'm wondering if the programming process still works on my side or if something has been updated that broke my setup too. All I tried for now is just compiling the sketch to see if there were errors.

I can't remember if it matters if the board is unplugged or not when programming is started. maybe try programming the sketch with the circuit's usb cable plugged in before starting to program and see if it's different from waiting until the 60 second delay starts before plugging it in.

spotUP commented 7 months ago

Thanks for the long and thorough reply! I will try with new chips and report back. Hopefully they will arrive tomorrow.

On Mon, Dec 4, 2023 at 11:33 PM GadgetReboot @.***> wrote:

It's been a while since I did anything with setting up that chip but I notice there's a newer micronucleus file from when I made the video about programming it. I wonder if they changed something in the bootloader. The previous file that would have been current when I originally programmed it is here (t85_default.hex)

https://github.com/micronucleus/micronucleus/blob/29317ea0c5b55b704a42ad318c52945cf3e2359e/firmware/releases/t85_default.hex It can be downloaded by clicking the "download raw file" icon Screen.Shot.2023-12-04.at.5.07.07.PM.png (view on web) https://github.com/GadgetReboot/RotaryUSB/assets/34284866/e4b5b765-cbe9-49aa-bf68-3c9c0ae0c173

I don't remember how programming the bootloader works regarding setting the flags in the chip but I think it keeps the reset pin working as a reset function instead of GPIO so the bootloader can maybe be re-programmed with the older hex file rather than just getting one shot at it.

I assume those usb drivers are installed, libusb? It's hard to diagnose something with multiple possible reasons for it not responding. I wonder if there's an older version of the libusb drivers that would work better. It looks like I was doing all of this 4 or 5 years ago and I don't recall updating anything since then so that's the version of various files I would have used.

When the IDE is waiting 60 seconds for the board to be connected for programming, it's looking for the final operating circuit with the ATTiny 85 and its own usb connector, so not the Arduino programming board.

So then another possible problem could be if the physical board has some sort of electrical issue preventing the usb connection from working. If the board was hand soldered, the usb connector could have bad connections.

One thing that would help sort out if the computer/drivers are working with this type of virtual usb bootloader is to try a digispark board and see if that works properly ali express modules https://s.click.aliexpress.com/e/_DDctOet Unfortunately I don't sell any hardware and don't even have any more chips. I'm wondering if the programming process still works on my side or if something has been updated that broke my setup too. All I tried for now is just compiling the sketch to see if there were errors.

I can't remember if it matters if the board is unplugged or not when programming is started. maybe try programming the sketch with the circuit's usb cable plugged in before starting to program and see if it's different from waiting until the 60 second delay starts before plugging it in.

— Reply to this email directly, view it on GitHub https://github.com/GadgetReboot/RotaryUSB/issues/3#issuecomment-1839614783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA5GVAB2XB3IBP2B22MSNDYHZFSHAVCNFSM6AAAAABAE6DCIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZZGYYTINZYGM . You are receiving this because you authored the thread.Message ID: @.***>

-- Johan Samuelsson Designer & Animator M: +46 (0)701-490684

IKACHAN AB Källdammsvägen 4, 423 36 Torslanda

spotUP commented 6 months ago

OK, new chips arrived. I hooked up the AVR programmer to my pc and did this, does this look correct?

C:\Users\User\Desktop\avrfw>avrdude -C avrdude.conf -v -P usb -b 19200 -c USBTiny -p attiny85 -Uflash:w:t85_default.hex:i -U hfuse:w:0x5d:m

avrdude: Version 7.1 Copyright the AVRDUDE authors; see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

     System wide configuration file is C:\Users\User\Desktop\avrfw\avrdude.conf

     Using Port                    : usb
     Using Programmer              : USBTiny
     Overriding Baud Rate          : 19200

avrdude: usbdev_open(): found USBtinyISP, bus:device: bus-0:\?\usb#vid_1781&pid_0c9f#5&201b4142&0&4#{a5dcbf10-6530-11d2-901f-00c04fb951ed}--libusb0 AVR Part : ATtiny85 Chip Erase delay : 4500 us RESET disposition : possible i/o RETRY pulse : SCK Serial program mode : yes Parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 PollIndex : 3 PollValue : 0x53 Memory Detail :

                                       Block Poll               Page                       Polled
       Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom                 65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
       flash                  65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
       lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
       calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

     Programmer Type : USBtiny
     Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp

avrdude pgm_default() error: programmer operation not supported

avrdude: using SCK period of 10 usec avrdude: AVR device initialized and ready to accept instructions avrdude: device signature = 0x1e930b (probably t85) avrdude: Note: flash memory has been specified, an erase cycle will be performed. To disable this feature, specify the -D option. avrdude: erasing chip avrdude: using SCK period of 10 usec avrdude: reading input file t85_default.hex for flash with 1510 bytes in 1 section within [0x1a00, 0x1fe5] using 24 pages and 26 pad bytes avrdude: writing 1510 bytes flash ...

Writing | ################################################## | 100% 0.05 s

avrdude: 1510 bytes of flash written avrdude: verifying flash memory against t85_default.hex

Reading | ################################################## | 100% 0.01 s

avrdude: 1510 bytes of flash verified avrdude: reading input file 0x5d for hfuse with 1 byte in 1 section within [0, 0] avrdude: writing 1 byte hfuse ... avrdude: 1 byte of hfuse written avrdude: verifying hfuse memory against 0x5d avrdude: 1 byte of hfuse verified

avrdude done. Thank you.

C:\Users\User\Desktop\avrfw>

GadgetReboot commented 6 months ago

I don't remember all the avrdude parameters and how to modify them but my original command line was in the format of

AVRDude command line to program Micronucleus hex file using Arduino as ISP Change “/folderpath/” to the location of files and “COMPORTNAME” to your programmer’s COM port

/folderpath/avrdude -C /folderpath/avrdude.conf -v -P COMPORTNAME -b 19200 -c avrisp -p attiny85 -Uflash:w:/folderpath/t85_default.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m

So I have some extra fuse parameters specified and -c avrisp instead of usbtiny, not sure what really matters but the fuses may be the most important thing to get configured

spotUP commented 6 months ago

Right, i used the line from your youtube video, but maybe it wasn't the correct one then, i'll make a new try tomorrow, thanks a bunch!

spotUP commented 6 months ago

ok, i used a new chip with the line you posted above and got this result, i hope it looks correct.

C:\Users\User\Desktop\avrfw>avrdude -C avrdude.conf -v -P usb -b 19200 -c USBTiny -p attiny85 -Uflash:w:t85_default.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m

avrdude: Version 7.1 Copyright the AVRDUDE authors; see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

     System wide configuration file is C:\Users\User\Desktop\avrfw\avrdude.conf

     Using Port                    : usb
     Using Programmer              : USBTiny
     Overriding Baud Rate          : 19200

avrdude: usbdev_open(): found USBtinyISP, bus:device: bus-0:\?\usb#vid_1781&pid_0c9f#5&201b4142&0&4#{a5dcbf10-6530-11d2-901f-00c04fb951ed}--libusb0 AVR Part : ATtiny85 Chip Erase delay : 4500 us RESET disposition : possible i/o RETRY pulse : SCK Serial program mode : yes Parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 PollIndex : 3 PollValue : 0x53 Memory Detail :

                                       Block Poll               Page                       Polled
       Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom                 65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
       flash                  65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
       lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
       signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
       calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00

     Programmer Type : USBtiny
     Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp

avrdude pgm_default() error: programmer operation not supported

avrdude: using SCK period of 10 usec avrdude: AVR device initialized and ready to accept instructions avrdude: device signature = 0x1e930b (probably t85) avrdude: Note: flash memory has been specified, an erase cycle will be performed. To disable this feature, specify the -D option. avrdude: erasing chip avrdude: using SCK period of 10 usec avrdude: reading input file t85_default.hex for flash with 1510 bytes in 1 section within [0x1a00, 0x1fe5] using 24 pages and 26 pad bytes avrdude: writing 1510 bytes flash ...

Writing | ################################################## | 100% 0.05 s

avrdude: 1510 bytes of flash written avrdude: verifying flash memory against t85_default.hex

Reading | ################################################## | 100% 0.00 s

avrdude: 1510 bytes of flash verified avrdude: reading input file 0xe1 for lfuse with 1 byte in 1 section within [0, 0] avrdude: writing 1 byte lfuse ... avrdude: 1 byte of lfuse written avrdude: verifying lfuse memory against 0xe1 avrdude: 1 byte of lfuse verified avrdude: reading input file 0xdd for hfuse with 1 byte in 1 section within [0, 0] avrdude: writing 1 byte hfuse ... avrdude: 1 byte of hfuse written avrdude: verifying hfuse memory against 0xdd avrdude: 1 byte of hfuse verified avrdude: reading input file 0xfe for efuse with 1 byte in 1 section within [0, 0] avrdude: writing 1 byte efuse ... avrdude: 1 byte of efuse written avrdude: verifying efuse memory against 0xfe avrdude: 1 byte of efuse verified

avrdude done. Thank you.

spotUP commented 6 months ago

I got it to recognize the usb board on the pc now. But it got stuck erazing at 65% and now it seems like the 3rd chip is bricked. Do i need to connect that resistor etc even though i am using an avr programmer?

GadgetReboot commented 6 months ago

Which resistor? I don't remember the whole setup because it was years ago and I don't have parts to duplicate it now so the best I can say is whatever I did in the video is what worked for me.
At least you're making progress. If chips are getting bricked so they can't be re-programmed, you can always try to recover them with a high voltage (12 volt is what they consider high voltage) programmer, which can un-brick the chips if the fuses are not allowing programming.

https://youtu.be/Qw54GcPNIf8?si=83riHkd1g3LjOear

spotUP commented 6 months ago

i read in many places that a 1 uF capacitor is needed. Here for example: https://gist.github.com/amcolash/b930cb9d206b75ca5fd4ab974cb78a60

"- Attach cap from GND to RESET (Otherwise try GND <-> V+. I only needed this the 2nd time)"

spotUP commented 6 months ago

image This image shows it, but i realize that it's not the programmer i use.

spotUP commented 6 months ago

Answering myself here, this might be my problem, as i am using the front usb port... "Try a different USB port, I was having a similar problem but it appears the port I had been using was technically a hub not a root device and switching to a root port did the trick"

spotUP commented 6 months ago

Giving up on this one now, thanks for your help and time Gadget Reboot! Much appreciated!

GadgetReboot commented 6 months ago

The capacitor is recommended on the reset pin when using an Arduino as a programmer because when the IDE tries to start programming, that Arduino programmer board normally will go into reset and the IDE may try to program the programmer board instead of the final target board, so the capacitor keeps the Arduino from resetting and it can do its programming job. Sometimes it may work without it but it's not guaranteed. It's basically a hack because normally there's just one device plugged in and the IDE will try to program it, but this method has two devices plugged into each other and the middle programming board needs to stay active the whole time.