Author Topic: ATMEGA 644P AVR Programming Help Needed  (Read 3609 times)

0 Members and 1 Guest are viewing this topic.

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
ATMEGA 644P AVR Programming Help Needed
« on: June 01, 2024, 12:32:37 am »
I am trying to install a boot loader on an ATMEGA644P and I'm afraid I'm totally way in over my head. This is for a desktop synthesizer, and unfortunately the instructions provided are fairly cryptic to me, including what app I'm supposed to use exactly or how to go about it. I got me an AVRISP mkII programmer connected to my computer, and I was wondering if someone might be able to give me an idea of how to go about what these instructions instruct me to do?

https://pichenettes.github.io/mutable-instruments-diy-archive/shruthi/firmware/

I appreciate all the help any of you can provide.

Many thanks!

 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #1 on: June 01, 2024, 05:41:56 am »
There are many examples on how to do this in the Arduino world.



Search on google with "arduino upload bootloader avrisp" and you will find lots of information.

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #2 on: June 01, 2024, 04:52:08 pm »
Thank you, I have (I only post for help after I feel I've exhausted my Google/YouTube options). I'm not finding anything specific to the ATMEGA 644 which I think is what has me a bit confused. Part of the problem is that the Arduino IDE app doesn't appear to be connecting to the ATMEGA, and it doesn't appear to have an option for the 644 which I suspect might be part of the issue.

A lot of the YouTube tutorials assume a pre-existing familiarity with the tools which I don't have quite yet.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #3 on: June 01, 2024, 06:02:13 pm »
The magic word you're looking for is "Sanguino" which returns a number of boards developed 12 years ago based on the 40 pin 644.

I run a fairly old 1.6.8 version of Arduino IDE and had to install this for the IDE to recognize the board type. 

I never managed to install a bootloader; really didn't put in much effort.  But you should be able to upload sketches using the AVRISP mkII by changing the Tools->Programmer menu item and using Sketch->Upload Using Programmer menu item after connecting the programmer to the SCK,MISO,MOSI,Reset,Vcc,GND pins of the 644.  If the 644 is on a breadboard, install a crystal (with 20pF caps) and 10K reset pin pullup resistor.    644 pinout here.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #4 on: June 01, 2024, 06:36:48 pm »
There is also avrdude that can be used from command line to upload the code to the micro. The connections of the AVRISP to the ATMEGA 644P remain the same like pqass wrote. With avrdude you should be able to load the bootloader you revered to into the micro and from then on use the programming route the bootloader is made for.

Lots of info to be found on avrdude.

It is also used by the Arduino platform under the hood.

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #5 on: June 02, 2024, 04:48:38 am »
Thank you. Yes I'm trying to program the boot loader from the command line Terminal in MacOS and running into some problems that make me wonder if perhaps I have some incompatibility issues with the new MacOS ARM architecture. Basically it appears as if some files are not being compiled correctly and it's causing the entire boot loader writing operation to fail.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #6 on: June 02, 2024, 05:54:32 am »
I'm not familiar with MacOS, but if it is behaving similar to Linux it might be that the AVRISP is not allowed access from user level. Under Linux it is necessary to setup udev rules to get user access to the device.

For more insight from our end you could post the error messages you get.

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #7 on: June 02, 2024, 07:08:51 pm »
Thank you. I'm following the instructions from this link about Building the firmware to the letter:

https://pichenettes.github.io/mutable-instruments-diy-archive/shruthi/firmware/


For one, git submodule update doesn't work for me. I tried this on two separate machines and in both cases GitHub is simply not responding. No biggie as I can clone manually -- done!

Here is the error that is being reported in Terminal:

kays@Kayss-iMac-Pro shruthi-1 % make build_all
avrlib/makefile.mk:199: build/shruthi1/depends.mk: No such file or directory
shruthi/makefile:29: build/shruthi1/depends.mk: No such file or directory
/usr/local/CrossPack-AVR-20131216/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/adc.cc -MF build/shruthi1/adc.d -MT build/shruthi1/adc.o
make: /usr/local/CrossPack-AVR-20131216/bin/avr-g++: Bad CPU type in executable
make: *** [build/shruthi1/adc.d] Error 1


At the top of the error list, it appears that it can't find depends.mk and those files are simply not on GitHub and definitely not present in that folder. Not sure how they are generated in the first place.

Lastly, the BadCPU type error, I'm not quite sure how to solve.

I'm going to try it in Windows 11 next to see, although I'm bracing for impact on that platform since I have even less of an idea of what I'm doing on that operating system.

 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #8 on: June 02, 2024, 07:24:43 pm »
I think you are using an old version of the compiler and maybe you will have more success on windows or find an update for what you use on the Mac.

I myself work on Linux but not so much with AVR mcu's. More ARM based so different toolkit. Have used an AVR compiler on it though and not encountered this type of error. Google indicates it most likely being a MAC issue.

Check this link for more info: https://github.com/qmk/qmk_firmware/issues/14929

It looks like CrossPack-AVR is no longer supported.


Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #9 on: June 02, 2024, 10:10:32 pm »
I managed to compile the project on Linux using my (old) Arduino-1.6.8 installation avr tools.  Then also with the latest 2.3.2 installation.

First download the project as a zip from the github page. Click the green "<> Code" button then "Download ZIP" item.

ALSO visit the "avrlib @ af7266e" and "tools @ 1c8c71c" folders too and download their zip files as those are links to other projects and won't be in the first zip file.

Once you've downloaded all three zip files, expand them, then replace the empty "avrlib" and "tools" folders with the content of the second and third zip files, respectively.

Download and install the Arduino IDE from here.  I was going to suggest the last version of the 1.x.x series but it doesn't look like they produced one for MacOS ARM.  So I downloaded the latest 2.3.2 (for Linux) to see where they hid the bin/avr-* tools.  Naturally, since it's a major release, they completely change the directory structure.

Once the Arduino IDE is downloaded and/or installed, run the "arduino-ide" executable itself first as that downloads the avr tools and a bunch of other stuff.  Once that's done, select an initial board from menu Tools -> Board  ...  "Arduino UNO".   Also check both boxes in File -> Preferences for "Show verbose output during ... compile, upload".  This will show you all command lines executed (with paths).  Compile the default empty sketch via Sketch -> Verify/Compile menu to confirm that everything is working/no errors.

Now change directory into your "shruthi-1-master/avrlib" subdirectory. 
Edit the makefile.mk, find the "TOOLS_PATH" and "AVRDUDE" lines, comment-out and replace with your own (confirm the new path to bin/avr-* execs as seen in the initial Arduino sketch compile above):

#AVRLIB_TOOLS_PATH ?= /usr/local/CrossPack-AVR/bin/
AVRLIB_TOOLS_PATH ?= ~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/


Since bin/avrdude exec has been moved away from the bin/avr-* stuff, skip down to ...

#AVRDUDE        = $(AVRLIB_TOOLS_PATH)avrdude
AVRDUDE        = ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude


Save, exit.
Now change directory back into your "shruthi-1-master/" subdirectory and type:  make
The "build/shruthi1/shruthi1.hex" file should be produced.   See below.

Code: [Select]
[xx@fedora shruthi-1-master]$ make
mkdir -p build/shruthi1/
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/adc.cc -MF build/shruthi1/adc.d -MT build/shruthi1/adc.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/random.cc -MF build/shruthi1/random.d -MT build/shruthi1/random.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/serial.cc -MF build/shruthi1/serial.d -MT build/shruthi1/serial.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/string.cc -MF build/shruthi1/string.d -MT build/shruthi1/string.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/time.cc -MF build/shruthi1/time.d -MT build/shruthi1/time.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/i2c/i2c.cc -MF build/shruthi1/i2c.d -MT build/shruthi1/i2c.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/devices/wii_nunchuk.cc -MF build/shruthi1/wii_nunchuk.d -MT build/shruthi1/wii_nunchuk.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/audio_out.cc -MF build/shruthi1/audio_out.d -MT build/shruthi1/audio_out.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/clock.cc -MF build/shruthi1/clock.d -MT build/shruthi1/clock.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/display.cc -MF build/shruthi1/display.d -MT build/shruthi1/display.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/editor.cc -MF build/shruthi1/editor.d -MT build/shruthi1/editor.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/midi_dispatcher.cc -MF build/shruthi1/midi_dispatcher.d -MT build/shruthi1/midi_dispatcher.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/note_stack.cc -MF build/shruthi1/note_stack.d -MT build/shruthi1/note_stack.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/oscillator.cc -MF build/shruthi1/oscillator.d -MT build/shruthi1/oscillator.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/parameter.cc -MF build/shruthi1/parameter.d -MT build/shruthi1/parameter.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/part.cc -MF build/shruthi1/part.d -MT build/shruthi1/part.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/patch.cc -MF build/shruthi1/patch.d -MT build/shruthi1/patch.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/resources.cc -MF build/shruthi1/resources.d -MT build/shruthi1/resources.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/sequencer_settings.cc -MF build/shruthi1/sequencer_settings.d -MT build/shruthi1/sequencer_settings.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/shruthi.cc -MF build/shruthi1/shruthi.d -MT build/shruthi1/shruthi.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/storage.cc -MF build/shruthi1/storage.d -MT build/shruthi1/storage.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/system_settings.cc -MF build/shruthi1/system_settings.d -MT build/shruthi1/system_settings.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/ui.cc -MF build/shruthi1/ui.d -MT build/shruthi1/ui.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice_allocator.cc -MF build/shruthi1/voice_allocator.d -MT build/shruthi1/voice_allocator.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice.cc -MF build/shruthi1/voice.d -MT build/shruthi1/voice.o
cat build/shruthi1/adc.d build/shruthi1/random.d build/shruthi1/serial.d build/shruthi1/string.d build/shruthi1/time.d build/shruthi1/i2c.d build/shruthi1/wii_nunchuk.d build/shruthi1/audio_out.d build/shruthi1/clock.d build/shruthi1/display.d build/shruthi1/editor.d build/shruthi1/midi_dispatcher.d build/shruthi1/note_stack.d build/shruthi1/oscillator.d build/shruthi1/parameter.d build/shruthi1/part.d build/shruthi1/patch.d build/shruthi1/resources.d build/shruthi1/sequencer_settings.d build/shruthi1/shruthi.d build/shruthi1/storage.d build/shruthi1/system_settings.d build/shruthi1/ui.d build/shruthi1/voice_allocator.d build/shruthi1/voice.d > build/shruthi1/depends.mk
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/adc.cc -o build/shruthi1/adc.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/random.cc -o build/shruthi1/random.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/serial.cc -o build/shruthi1/serial.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/string.cc -o build/shruthi1/string.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/time.cc -o build/shruthi1/time.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/i2c/i2c.cc -o build/shruthi1/i2c.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/devices/wii_nunchuk.cc -o build/shruthi1/wii_nunchuk.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/audio_out.cc -o build/shruthi1/audio_out.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/clock.cc -o build/shruthi1/clock.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/display.cc -o build/shruthi1/display.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/editor.cc -o build/shruthi1/editor.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/midi_dispatcher.cc -o build/shruthi1/midi_dispatcher.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/note_stack.cc -o build/shruthi1/note_stack.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/oscillator.cc -o build/shruthi1/oscillator.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/parameter.cc -o build/shruthi1/parameter.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/part.cc -o build/shruthi1/part.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/patch.cc -o build/shruthi1/patch.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/resources.cc -o build/shruthi1/resources.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/sequencer_settings.cc -o build/shruthi1/sequencer_settings.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/shruthi.cc -o build/shruthi1/shruthi.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/storage.cc -o build/shruthi1/storage.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/system_settings.cc -o build/shruthi1/system_settings.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/ui.cc -o build/shruthi1/ui.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice_allocator.cc -o build/shruthi1/voice_allocator.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice.cc -o build/shruthi1/voice.o
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -mmcu=atmega644p -lm -Os -Wl,--gc-sections -o build/shruthi1/shruthi1.elf build/shruthi1/adc.o build/shruthi1/random.o build/shruthi1/serial.o build/shruthi1/string.o build/shruthi1/time.o build/shruthi1/i2c.o build/shruthi1/wii_nunchuk.o build/shruthi1/audio_out.o build/shruthi1/clock.o build/shruthi1/display.o build/shruthi1/editor.o build/shruthi1/midi_dispatcher.o build/shruthi1/note_stack.o build/shruthi1/oscillator.o build/shruthi1/parameter.o build/shruthi1/part.o build/shruthi1/patch.o build/shruthi1/resources.o build/shruthi1/sequencer_settings.o build/shruthi1/shruthi.o build/shruthi1/storage.o build/shruthi1/system_settings.o build/shruthi1/ui.o build/shruthi1/voice_allocator.o build/shruthi1/voice.o  -lc
~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom build/shruthi1/shruthi1.elf build/shruthi1/shruthi1.hex


[xx@fedora shruthi-1-master]$ ls -lt build/shruthi1/
total 2972
-rw-r--r--. 1 xx xx 174360 Jun  2 17:48 shruthi1.hex
-rwxr-xr-x. 1 xx xx 792944 Jun  2 17:48 shruthi1.elf
-rw-r--r--. 1 xx xx 178620 Jun  2 17:48 voice.o
-rw-r--r--. 1 xx xx  10616 Jun  2 17:48 voice_allocator.o
-rw-r--r--. 1 xx xx 238716 Jun  2 17:48 ui.o
...

« Last Edit: June 02, 2024, 10:27:36 pm by pqass »
 
The following users thanked this post: pcprogrammer

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #10 on: June 03, 2024, 12:18:03 am »
THANK YOU!!!  This was incredibly helpful. I narrowed down what I was missing in the fact that I had not specified the AVRDUDE location in the variable, once I did that I was also able to compile both the bootloader and the firmware.

Now I'm running into another issue, when I try to install the bootloader into the AtMega644p, I get the following error:

kays@Kayss-MacBook-Air shruthi-1 % make bake_all
make -f bootloader/makefile fuses
~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -V -p m644p -c avrispmkII -P usb -B 10 -e -u \
         -U efuse:w:0xfd:m \
         -U hfuse:w:0xd6:m \
         -U lfuse:w:0xff:m \
         -U lock:w:0x2f:m
avrdude: can't open config file "/Users/jenkins/jenkins/workspace/avrdude-staging/label/mac-mini/objdir/etc/avrdude.conf": No such file or directory
avrdude: error reading system wide configuration file "/Users/jenkins/jenkins/workspace/avrdude-staging/label/mac-mini/objdir/etc/avrdude.conf"
make[1]: *** [fuses] Error 1
make: *** [bake_all] Error 2


It would appear as if the AVRDUDE config file is being pointed to the wrong directory. The problem is that I'm not sure how to go about changing the location of the config file that AVRDUDE is looking for. I tried looking in various files in the Shruthi folder, and the makefile.mk but there appears to be no reference to that variable.

Any idea how I could go about changing that variable?

Many thanks again, I feel as if I'm making some real progress finally!
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #11 on: June 03, 2024, 12:46:11 am »
That could be a default path.  None of the project makefiles try to specify any avrdude.conf file.

Try editing the avrlib/makefile.mk, looking for "AVRDUDE_COM_OPTS", commenting it out, then adding the following:

#AVRDUDE_COM_OPTS = -V -p $(DMCU)
AVRDUDE_COM_OPTS = -V -p $(DMCU)  -C ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf
« Last Edit: June 03, 2024, 12:49:51 am by pqass »
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #12 on: June 03, 2024, 01:10:40 am »
Thank you again, very spot on. That seems to have done the trick (I think)!

I believe I was able to successfully write to the Atmega644p...but now the synth doesn't appear to be doing anything (the screen is completely blank).

One of the things I had noticed was this mention:

"Make sure your avr-gcc is as close as possible to 4.3.3 since the most recent versions of gcc are performing optimizations differently and can cause the firmware to grow out of the size constraints."

How can I check to see what version of the GCC I am utilizing? And if so, how do I change it since the Arduino IDE installs them for me?

Many thanks!
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #13 on: June 03, 2024, 03:05:38 am »
I believe I was able to successfully write to the Atmega644p...but now the synth doesn't appear to be doing anything (the screen is completely blank).

One of the things I had noticed was this mention:

"Make sure your avr-gcc is as close as possible to 4.3.3 since the most recent versions of gcc are performing optimizations differently and can cause the firmware to grow out of the size constraints."

How can I check to see what version of the GCC I am utilizing? And if so, how do I change it since the Arduino IDE installs them for me?

Many thanks!

~/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -v

The above returns "gcc version 7.3.0 (GCC)" for me which matches the dir path.
But given how old the project is, avr-gcc has progressed.  You can't change what the Arduino IDE installs as that's what they'll support.  You'd have to dig-up some old avr binaries somewhere or compile your own from old sources.

For some unknown reason, the bootloader/bootloader.cc didn't compile for me so I compiled it manually using:

Code: [Select]
avr-g++ -MM -mmcu=atmega644p -I. -Os -w -Wall -DF_CPU=20000000 ...snip...  bootloader/bootloader.cc -MF build/shruthi1/bootloader.d -MT build/shruthi1/bootloader.o
avr-g++ -c -mmcu=atmega644p -I. -Os -w -Wall -DF_CPU=20000000 ...snip... bootloader/bootloader.cc -o build/shruthi1/bootloader.o
avr-gcc -mmcu=atmega644p -lm -Os -Wl,--gc-sections -o build/shruthi1/bootloader.elf build/shruthi1/bootloader.o
avr-objcopy -O ihex build/shruthi1/bootloader.elf build/shruthi1/bootloader.hex

Then looking at both hex files produced:

Code: [Select]
[xx@fedora shruthi-1-master]$ tail  build/shruthi1/shruthi1.hex
:10F19C002F42B442783FF63F0000354135410D3BDC
:10F1AC00163E000077417741E03E303E0000DE41E4
:10F1BC00DE41AD3EF13D000061436143783FE645E1
:10F1CC004B4646444644AC3AA43AFD3C8244B442D5
:10F1DC00E940F940E6400505135B135A12591158E2
:10F1EC0010570F560E550D540C5312590B520A5101
:10F1FC000950084F074E064D1259054C054C054C4D
:10F20C00044B034A02491259C348C347C2468246BB
:06F21C0083063F053D05DD
:00000001FF
[xx@fedora shruthi-1-master]$ tail  build/shruthi1/bootloader.hex
:10038000920090E080E0DF91CF9108952F923F920C
:100390004F925F926F927F928F929F92AF92BF9295
:1003A000CF92DF92EF92FF920F931F93CF93DF9341
:1003B000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBE9E
:1003C000CDBF09942A88398848885F846E847D84EB
:1003D0008C849B84AA84B984C884DF80EE80FD80ED
:1003E0000C811B81AA81B981CE0FD11D0FB6F89463
:0E03F000DEBF0FBECDBFED010895F894FFCF24
:0C03FE00F00021020002F0002077000255
:00000001FF

You'll see the last byte of the app is at 0xF21C + 0x6 bytes or 0xF222.  This is under 64k; the limit for the atmega644 by 0x0DDE or 3550 bytes.  This is good.

However, WRT the 2nd hex, the bootloader, i probably compiled it wrong since addressing starts at 0x0000 to 0x03F0+0xE bytes. Although it's under 1024 bytes or 512 words as specified by BOOTSZ=11 of HFUSE=D6 (see bootloader/makefile), I was expecting it to start at 0xFC00 like my optiboot_atmega644_8m.hex bootloader (which I happened to finally upload to my 644 earlier today).  Also on the 2nd-last line it's re-writing the previous line from 0x03FE+0xC bytes which puts it over the 1024 byte block.  I'm not sure what's happening here.

Can you upload your bootloader.hex or it may be called muboot.hex.

I'm just trying to confirm that there is enough space for the bootloader at the end of the address space.



EDIT:  Nevermind, I figured out how to compile the bootloader via its makefile:
Code: [Select]
[xx@fedora shruthi-1-master]$ make -f bootloader/makefile

The hex looks better too.  It does start at location 0xFC00 as expected and it does not exceed the 1024 byte block (0xFFDE + 0xC = 0xFFEA).   FYI: Intel HEX format description here.
Code: [Select]
[xx@fedora shruthi-1-master]$ tail build/muboot/muboot.hex
:10FF70004F925F926F927F928F929F92AF92BF92B9
:10FF8000CF92DF92EF92FF920F931F93CF93DF9365
:10FF9000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBEC2
:10FFA000CDBF09942A88398848885F846E847D840F
:10FFB0008C849B84AA84B984C884DF80EE80FD8011
:10FFC0000C811B81AA81B981CE0FD11D0FB6F89487
:0EFFD000DEBF0FBECDBFED010895F894FFCF48
:0CFFDE00F00021020002F0002077000279
:040000030000FC00FD
:00000001FF

In conclusion,
the app code doesn't overlap the bootloader.  And the bootloader appears to be in the correct spot (within its 1024 byte block).
It must be some other reason the device isn't booting.
« Last Edit: June 03, 2024, 05:50:04 am by pqass »
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #14 on: June 03, 2024, 06:00:20 am »
Sure thing, here are the two .hex files that the compiler produced for me.


How would I know if there is something wrong with the ATmega644p? If I had damaged it somehow, would it have given me an error during the writing process?
« Last Edit: June 03, 2024, 06:09:40 am by Midphase »
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #15 on: June 03, 2024, 06:36:11 am »
Your files start and end on the same addresses just like my files.
There is no overlap so that rules out the issue with later avr-gcc versions growing the code beyond the limits.

The way I usually test is to install the Arduino blink example on a breadboarded chip with LED.
But that's probably a pain for you to do that.

Maybe you didn't see an error during the upload step?
Add the "-v" at the end of the avrlib/makefile.mk "AVRDUDE_COM_OPTS" and try to upload again:

AVRDUDE_COM_OPTS = -V -p $(DMCU)  -C ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v
 

Offline electronix27

  • Contributor
  • Posts: 14
  • Country: us
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #16 on: June 03, 2024, 10:59:43 am »
Hi
Maybe you have already figured out your situation.  I have been using a Mac to compile and flash numerous Atmel chips through the years with all the tool chain directly installed to the machine, using terminal.  I've never used the Arduino IDE.  My last project I used a Atmega 324PA and it's from the same family of chips as yours, just less flash memory and EEprom.  I have older machines that I use CrossPack-AVR installer on, but it contains 32 bit tools which apple stopped supporting since Catalina.  I've never used an M series Mac, only intel.  The last time I had to install all the tools manually using the brew command.  You also need Apple command line tools to use make file in terminal, which either you already do or compiling through Arduino set up already makes that possible.

Looking at your configuration settings (fuses), some things don't look right.  For instance lfuse = FF, which means no clock source is defined.  Take a look at this fuse calculator -- https://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega644p.

You could also try flashing the chip directly with avrdude, for you be something like

avrdude -c avrisp mkII -p atmega644 -U flash:w:[your hex].hex

you would need to have the .hex in the directory your terminal is linked to.
« Last Edit: June 03, 2024, 11:09:03 am by electronix27 »
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #17 on: June 03, 2024, 05:23:44 pm »
The way I usually test is to install the Arduino blink example on a breadboarded chip with LED.
But that's probably a pain for you to do that.

Maybe you didn't see an error during the upload step?
Add the "-v" at the end of the avrlib/makefile.mk "AVRDUDE_COM_OPTS" and try to upload again:

Thank you. I can probably set up the blink test as well since I have the breadboard and components. In this case I'm a bit worried about all of the many variables involved in this particular project (i.e. both assembling a new PCB with various components, as well as learning to program this microcontroller, and hope everything is 100% ok).

I'll give it another shot today from scratch and see. I also do have another "virgin" ATMega644p that I could also use.
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #18 on: June 03, 2024, 05:27:42 pm »
You could also try flashing the chip directly with avrdude, for you be something like

avrdude -c avrisp mkII -p atmega644 -U flash:w:[your hex].hex

you would need to have the .hex in the directory your terminal is linked to.

Thank you. Alternatively I also have a Windows machine that I can use for this. As a matter of fact I have this AVRDUDE GUI app that I downloaded which seems to make uploading the files a bit more straightforward.

One of the things I don't really understand is the Fuses and their function. I'm used to the term as it applies to electronics, so I worry that I'm going to burn something out if they're set up incorrectly. In this case, I have to assume that the guy who designed this device knew what he was doing as far as the fuse settings, but I am not 100% sure.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #19 on: June 03, 2024, 06:11:03 pm »
The "fuse" settings in an ATMEGA644P are there to allow several options like protection against read back of the FLASH to safeguard your intellectual property. They are similar to EEPROM bits and can be reset for as far as I know.

Most of the time there is no need to touch the "fuses", but to learn about them the best source is the datasheet or the reference manual for the MCU in question. https://ww1.microchip.com/downloads/en/DeviceDoc/doc2593.pdf

An exception is the clock source. See page 28.

On page 273 there is something about the bootloader and a related fuse.

Chapter 25.2 has information about the fuses. (Page 285+)

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #20 on: June 03, 2024, 06:41:37 pm »
Before you pull the chip from the PCB, maybe you can just try reading the fuses.  FYI: schematics here.
Connect your AVRISP mkII 6 pin ISP header to the shruthi PCB, power up and execute the following:

Code: [Select]
~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude -C ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf -v -p atmega644p -c stk500v2 -P usb
It should either return info or an error.



Why "-c stk500v2" and "-p atmega644p"?   
A:You can specify "-c ?" or "-p ?" and avrdude will return a list. 
When I selected "AVRISP mkII" in Tools->Programmer IDE menu, that's what it put on the command line when I exec'd Sketch->Upload Using Programmer.
« Last Edit: June 03, 2024, 07:46:42 pm by pqass »
 
The following users thanked this post: Midphase

Offline electronix27

  • Contributor
  • Posts: 14
  • Country: us
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #21 on: June 03, 2024, 07:07:21 pm »


The schematic shows a 20 Mhz crystal on xtal 1 (pin 13) & xtal 2 (pin 12).  low fuse of FF would not read this properly.
« Last Edit: June 03, 2024, 07:14:29 pm by electronix27 »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3325
  • Country: gb
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #22 on: June 03, 2024, 07:16:08 pm »
One thing I haven't seen anyone mention; since you are programming the bootloader and application in two separate operations you will need to perform a flash erase only for the first programming operation and not the second.  If you are using AVRDude, the -e option enables flash+EEPROM erase.

The other option is to combine the hex files so you only perform a single programming operation.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #23 on: June 03, 2024, 07:19:36 pm »
One of the things I don't really understand is the Fuses and their function. I'm used to the term as it applies to electronics, so I worry that I'm going to burn something out if they're set up incorrectly. In this case, I have to assume that the guy who designed this device knew what he was doing as far as the fuse settings, but I am not 100% sure.

See this fuse calculator configured with the settings for your application (according to avrlib/makefile).

The danger bits are the HFUSE:SPIEN (must always be checked) otherwise you lose the ability to upload code via SPI pins.  And you'll need what's called a "high voltage programmer" to recover.

The whole LOCKBIT column could screw you out of being able to update the flash. It's used when installing the bootloader code and when you install your final app code version so that it's protected from recovery. 

I've always left this to the Arduino IDE to install a bootloader; never fiddled with it directly.  But after I installed the bootloader yesterday via IDE, I noticed that it executed avrdude twice.
First with: "-e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m",      <== erase, unlock bootloader and my choice of fuses.
Then a second time with: "-Uflash:w:<path>/optiboot_atmega644_8m.hex:i -Ulock:w:0x0F:m"  <== update bootloader code and lock-down.

Notice how the lower lock nibble is always F.  I think it would be best to never change that.

I tried reading about "24. Boot Loader Support ... Self-Programming" and "25. Memory Programming".  My brain hurt.
« Last Edit: June 03, 2024, 08:14:14 pm by pqass »
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #24 on: June 03, 2024, 07:30:35 pm »


The schematic shows a 20 Mhz crystal on xtal 1 (pin 13) & xtal 2 (pin 12).  low fuse of FF would not read this properly.

This is incorrect. LFUSE=FF means:
no clock out on the CLKO pin 2 (used to distribute clock or monitor freq. to adjust an internal tweak register),
no internal clock divide by 8,
external xtal oscillator 8MHz or greater, slowest startup delay.


BTW @electronix27, thanks for the link to your fuse calculator. It's better than the one I was using.
« Last Edit: June 03, 2024, 08:21:55 pm by pqass »
 

Offline electronix27

  • Contributor
  • Posts: 14
  • Country: us
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #25 on: June 03, 2024, 07:52:42 pm »
Quote
This is incorrect. LFUSE=FF means:
no clock out on the CLKO pin 2 (used to distribute clock or monitor freq. to adjust an internal tweak register),
no internal clock divide by 8,
external xtal oscillator 8MHz or greater, slowest startup delay.

Right on.  Guess I should have looked at my own fuse calculator more closely.
 
The following users thanked this post: pqass

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #26 on: June 03, 2024, 09:21:52 pm »
Before you pull the chip from the PCB, maybe you can just try reading the fuses.
Connect your AVRISP mkII 6 pin ISP header to the shruthi PCB, power up and execute the following:
It should either return info or an error.

Here's what it came back with when the Atmega is plugged into my ZIP socket adapter directly connected to the AVRISP mkII:

kays@Kayss-MacBook-Air ~ % ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -p m644p -c avrispmkII -P usb

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/kays/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/kays/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C990079
         AVR Part                      : ATmega644P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.24
         Vtarget         : 3.4 V
         SCK period      : 1.00 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e960a (probably m644p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D6, L:FF)

avrdude done.  Thank you.


However if I try to access the AtMega through the circuitboard pins, I get the following error at the end of the report:

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.



Should I be trying to erase the entire Atmega and try again from scratch? Should I be adding the -e command somewhere in the Makefile.mk document?
« Last Edit: June 03, 2024, 09:34:30 pm by Midphase »
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #27 on: June 03, 2024, 09:35:29 pm »
That's great!   You can communicate with it and the chip isn't dead.

Be sure to add the "-v" (verbose) switch to the end of the avrlib/makefile.mk "AVRDUDE_COM_OPTS" line.

Then you can (from the project root directory):
  make clean
  make bake_all

Report back what it says.


Hang on... 
"ZIP socket adapter directly connected to the AVRISP mkII"?     Do you mean ZIF (zero insertion force)? 
I thought the AVRISP mkII only has a 6 pin ribbon cable.

"if I try to access the AtMega through the circuitboard pins..." 
Was the board powered on?   Was ribbon cable in the correct orientation?
« Last Edit: June 03, 2024, 09:42:13 pm by pqass »
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #28 on: June 03, 2024, 10:32:58 pm »
Thank you for bearing with me on this one. I feel like I'm so in-over-my-head with this stuff and your help has been invaluable.

First of all, I picked up this programmer/ZIF socket combo which seemed like a sensible option for this (and EEPROM programming which I would like to do down the line):

https://www.amazon.com/dp/B08WL96RD4?psc=1&ref=ppx_yo2ov_dt_b_product_details

The PCB for the Shruthi synth has a 6-pin header. I tested for continuity on all the pins and I believe that I have everything set up in the correct orientation. I tried the operation both with just the USB of the programmer powering the Shruthi, as well as the Shruthi's own power supply turned on as well and in ether cases it doesn't seem to make much of a difference.

My best results so far appear to be by using the ZIP socket with the ATMega plugged directly into it (once again I tested the continuity between the pins and it seems like I have it inserted correctly.

Now, I am not 100% sure if the information is actually getting written to the ATMega, but here is the result of the latest attempt:

kays@Kayss-MacBook-Air shruthi-1 % make clean
cat build/shruthi1/adc.d build/shruthi1/random.d build/shruthi1/serial.d build/shruthi1/string.d build/shruthi1/time.d build/shruthi1/i2c.d build/shruthi1/wii_nunchuk.d build/shruthi1/audio_out.d build/shruthi1/clock.d build/shruthi1/display.d build/shruthi1/editor.d build/shruthi1/midi_dispatcher.d build/shruthi1/note_stack.d build/shruthi1/oscillator.d build/shruthi1/parameter.d build/shruthi1/part.d build/shruthi1/patch.d build/shruthi1/resources.d build/shruthi1/sequencer_settings.d build/shruthi1/shruthi.d build/shruthi1/storage.d build/shruthi1/system_settings.d build/shruthi1/ui.d build/shruthi1/voice.d build/shruthi1/voice_allocator.d > build/shruthi1/depends.mk
rm -f build/shruthi1/adc.o build/shruthi1/random.o build/shruthi1/serial.o build/shruthi1/string.o build/shruthi1/time.o build/shruthi1/i2c.o build/shruthi1/wii_nunchuk.o build/shruthi1/audio_out.o build/shruthi1/clock.o build/shruthi1/display.o build/shruthi1/editor.o build/shruthi1/midi_dispatcher.o build/shruthi1/note_stack.o build/shruthi1/oscillator.o build/shruthi1/parameter.o build/shruthi1/part.o build/shruthi1/patch.o build/shruthi1/resources.o build/shruthi1/sequencer_settings.o build/shruthi1/shruthi.o build/shruthi1/storage.o build/shruthi1/system_settings.o build/shruthi1/ui.o build/shruthi1/voice.o build/shruthi1/voice_allocator.o build/shruthi1/shruthi1.* build/shruthi1/depends.mk build/shruthi1/adc.d build/shruthi1/random.d build/shruthi1/serial.d build/shruthi1/string.d build/shruthi1/time.d build/shruthi1/i2c.d build/shruthi1/wii_nunchuk.d build/shruthi1/audio_out.d build/shruthi1/clock.d build/shruthi1/display.d build/shruthi1/editor.d build/shruthi1/midi_dispatcher.d build/shruthi1/note_stack.d build/shruthi1/oscillator.d build/shruthi1/parameter.d build/shruthi1/part.d build/shruthi1/patch.d build/shruthi1/resources.d build/shruthi1/sequencer_settings.d build/shruthi1/shruthi.d build/shruthi1/storage.d build/shruthi1/system_settings.d build/shruthi1/ui.d build/shruthi1/voice.d build/shruthi1/voice_allocator.d
kays@Kayss-MacBook-Air shruthi-1 % make bake_all
avrlib/makefile.mk:199: build/shruthi1/depends.mk: No such file or directory
shruthi/makefile:29: build/shruthi1/depends.mk: No such file or directory
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/adc.cc -MF build/shruthi1/adc.d -MT build/shruthi1/adc.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/random.cc -MF build/shruthi1/random.d -MT build/shruthi1/random.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/serial.cc -MF build/shruthi1/serial.d -MT build/shruthi1/serial.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/string.cc -MF build/shruthi1/string.d -MT build/shruthi1/string.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/time.cc -MF build/shruthi1/time.d -MT build/shruthi1/time.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/i2c/i2c.cc -MF build/shruthi1/i2c.d -MT build/shruthi1/i2c.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/devices/wii_nunchuk.cc -MF build/shruthi1/wii_nunchuk.d -MT build/shruthi1/wii_nunchuk.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/audio_out.cc -MF build/shruthi1/audio_out.d -MT build/shruthi1/audio_out.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/clock.cc -MF build/shruthi1/clock.d -MT build/shruthi1/clock.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/display.cc -MF build/shruthi1/display.d -MT build/shruthi1/display.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/editor.cc -MF build/shruthi1/editor.d -MT build/shruthi1/editor.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/midi_dispatcher.cc -MF build/shruthi1/midi_dispatcher.d -MT build/shruthi1/midi_dispatcher.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/note_stack.cc -MF build/shruthi1/note_stack.d -MT build/shruthi1/note_stack.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/oscillator.cc -MF build/shruthi1/oscillator.d -MT build/shruthi1/oscillator.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/parameter.cc -MF build/shruthi1/parameter.d -MT build/shruthi1/parameter.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/part.cc -MF build/shruthi1/part.d -MT build/shruthi1/part.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/patch.cc -MF build/shruthi1/patch.d -MT build/shruthi1/patch.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/resources.cc -MF build/shruthi1/resources.d -MT build/shruthi1/resources.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/sequencer_settings.cc -MF build/shruthi1/sequencer_settings.d -MT build/shruthi1/sequencer_settings.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/shruthi.cc -MF build/shruthi1/shruthi.d -MT build/shruthi1/shruthi.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/storage.cc -MF build/shruthi1/storage.d -MT build/shruthi1/storage.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/system_settings.cc -MF build/shruthi1/system_settings.d -MT build/shruthi1/system_settings.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/ui.cc -MF build/shruthi1/ui.d -MT build/shruthi1/ui.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice.cc -MF build/shruthi1/voice.d -MT build/shruthi1/voice.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -MM -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice_allocator.cc -MF build/shruthi1/voice_allocator.d -MT build/shruthi1/voice_allocator.o
cat build/shruthi1/adc.d build/shruthi1/random.d build/shruthi1/serial.d build/shruthi1/string.d build/shruthi1/time.d build/shruthi1/i2c.d build/shruthi1/wii_nunchuk.d build/shruthi1/audio_out.d build/shruthi1/clock.d build/shruthi1/display.d build/shruthi1/editor.d build/shruthi1/midi_dispatcher.d build/shruthi1/note_stack.d build/shruthi1/oscillator.d build/shruthi1/parameter.d build/shruthi1/part.d build/shruthi1/patch.d build/shruthi1/resources.d build/shruthi1/sequencer_settings.d build/shruthi1/shruthi.d build/shruthi1/storage.d build/shruthi1/system_settings.d build/shruthi1/ui.d build/shruthi1/voice.d build/shruthi1/voice_allocator.d > build/shruthi1/depends.mk
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/adc.cc -o build/shruthi1/adc.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/random.cc -o build/shruthi1/random.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/serial.cc -o build/shruthi1/serial.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/string.cc -o build/shruthi1/string.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/time.cc -o build/shruthi1/time.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/i2c/i2c.cc -o build/shruthi1/i2c.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions avrlib/devices/wii_nunchuk.cc -o build/shruthi1/wii_nunchuk.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/audio_out.cc -o build/shruthi1/audio_out.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/clock.cc -o build/shruthi1/clock.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/display.cc -o build/shruthi1/display.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/editor.cc -o build/shruthi1/editor.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/midi_dispatcher.cc -o build/shruthi1/midi_dispatcher.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/note_stack.cc -o build/shruthi1/note_stack.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/oscillator.cc -o build/shruthi1/oscillator.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/parameter.cc -o build/shruthi1/parameter.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/part.cc -o build/shruthi1/part.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/patch.cc -o build/shruthi1/patch.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/resources.cc -o build/shruthi1/resources.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/sequencer_settings.cc -o build/shruthi1/sequencer_settings.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/shruthi.cc -o build/shruthi1/shruthi.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/storage.cc -o build/shruthi1/storage.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/system_settings.cc -o build/shruthi1/system_settings.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/ui.cc -o build/shruthi1/ui.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice.cc -o build/shruthi1/voice.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -mmcu=atmega644p -I. -g -Os -w -Wall -DF_CPU=20000000 -D__PROG_TYPES_COMPAT__ -fdata-sections -ffunction-sections -fshort-enums -fno-move-loop-invariants -DDISABLE_DEFAULT_UART_RX_ISR  -DATMEGA644P -DSERIAL_RX_0 -mcall-prologues -fno-exceptions shruthi/voice_allocator.cc -o build/shruthi1/voice_allocator.o
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -mmcu=atmega644p -lm -Os -Wl,--gc-sections -o build/shruthi1/shruthi1.elf build/shruthi1/adc.o build/shruthi1/random.o build/shruthi1/serial.o build/shruthi1/string.o build/shruthi1/time.o build/shruthi1/i2c.o build/shruthi1/wii_nunchuk.o build/shruthi1/audio_out.o build/shruthi1/clock.o build/shruthi1/display.o build/shruthi1/editor.o build/shruthi1/midi_dispatcher.o build/shruthi1/note_stack.o build/shruthi1/oscillator.o build/shruthi1/parameter.o build/shruthi1/part.o build/shruthi1/patch.o build/shruthi1/resources.o build/shruthi1/sequencer_settings.o build/shruthi1/shruthi.o build/shruthi1/storage.o build/shruthi1/system_settings.o build/shruthi1/ui.o build/shruthi1/voice.o build/shruthi1/voice_allocator.o  -lc
~/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom build/shruthi1/shruthi1.elf build/shruthi1/shruthi1.hex
make -f bootloader/makefile fuses
~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -V -p m644p -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -c avrispmkII -P usb -B 10 -e -u \
         -U efuse:w:0xfd:m \
         -U hfuse:w:0xd6:m \
         -U lfuse:w:0xff:m \
         -U lock:w:0x2f:m

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/kays/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/kays/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
         Setting bit clk period        : 10.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C990079
         AVR Part                      : ATmega644P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.24
         Vtarget         : 3.3 V
         SCK period      : 10.37 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e960a (probably m644p)
avrdude: erasing chip
avrdude: reading input file "0xfd"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: reading input file "0xd6"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: reading input file "0x2f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written

avrdude done.  Thank you.

~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -B 1 -V -p m644p -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -c avrispmkII -P usb \
         -U eeprom:w:shruthi/data/factory_data/internal_eeprom.hex:i \
         -U flash:w:build/shruthi1/shruthi1.hex:i -U flash:w:build/muboot/muboot.hex:i \
         -U lock:w:0x2f:m

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/kays/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/kays/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
         Setting bit clk period        : 1.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C990079
         AVR Part                      : ATmega644P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.24
         Vtarget         : 3.3 V
         SCK period      : 1.00 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e960a (probably m644p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD
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: reading input file "shruthi/data/factory_data/internal_eeprom.hex"
avrdude: writing eeprom (2048 bytes):

Writing | ################################################## | 100% 0.99s

avrdude: 2048 bytes of eeprom written
avrdude: reading input file "build/shruthi1/shruthi1.hex"
avrdude: writing flash (61986 bytes):

Writing | ################################################## | 100% 4.44s

avrdude: 61986 bytes of flash written
avrdude: reading input file "build/muboot/muboot.hex"
avrdude: writing flash (65516 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 65516 bytes of flash written
avrdude: reading input file "0x2f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D6, L:FF)

avrdude done.  Thank you.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #29 on: June 03, 2024, 10:46:47 pm »
It definitely worked!    Written all the way into the chip.

If you install the chip in the Shruthi PCB and it still doesn't boot (LEDs off or no LCD messages) then you'll have to debug the PCB itself.
ie. checking all power rails are correct and available at all IC pins, if the clock is working, etc.


BTW: neat ZIF PCB. Complete with xtal and LED.
 
The following users thanked this post: Midphase

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #30 on: June 03, 2024, 11:04:23 pm »
Just confirming...

The Shruthi PCB calls for 9VAC input
This is important as it is used to make +5V, +3.3V, +8V, and -8V.
 
The following users thanked this post: Midphase

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #31 on: June 03, 2024, 11:13:07 pm »
Just out of curiosity, how can you tell that the data is written into the 644p? I'm still a bit confused as to what I'm looking at.

I'm going to give it another try and see if I can get the Shruthi to fire up. I built the board very carefully and looking at all the traces and components, everything looks pretty damn good on this end.

I'll start testing around for voltages and other things.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #32 on: June 03, 2024, 11:34:14 pm »
Just out of curiosity, how can you tell that the data is written into the 644p? I'm still a bit confused as to what I'm looking at.

I'm going to give it another try and see if I can get the Shruthi to fire up. I built the board very carefully and looking at all the traces and components, everything looks pretty damn good on this end.

I'll start testing around for voltages and other things.

The fact that everything shows "avrdude: x bytes of y written". 
The chip signature and expected fuse values are returned. 
All commands appear to execute with no sudden stop on an error. 

The AC input is needed to generate both positive and negative rails.
If you've connected a 9VDC source then it's possible for the board to generate -8V but 0V for the other positive rails (depending on the barrel plug polarity; negative center pin).
 
The following users thanked this post: Midphase

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #33 on: June 03, 2024, 11:42:37 pm »
The way the Shruthi works from what I can tell is that the main board hosts all of the CPU/processing and knobs/buttons for the unit, while the so called "filter" board also hosts the power supply. The two boards are hooked together through an 8-pin header.

The documentation says "Connect a DC supply (unregulated, any voltage between 7.5V and 9V, center pin positive) and check the voltages at the following points of the PCB:"

Right now I have a 9V adapter sending out the correct voltages through the voltage regulators and down the pipe to the main board when connected.

However, there is something happening somewhere on the main control board because as I said, I was having a hell of a time trying to get this to work through the 2X3 connection, which leads me to believe that something isn't happy on the board itself (while connecting through the ZIF socket works as expected).

I'm going to investigate further....but I get the feeling that this project might be a tad too ambitious for my taste.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #34 on: June 04, 2024, 05:30:59 am »
It might be that when in the board IC2 the 74LS165N is causing problems. When you use your zif socket to program the MCU there is nothing else connected to the SPI pins so the programmer will be able to control the pins as intended. On the board there are other connections to the SPI pins that might give trouble.

Another issue can be with the supply voltage when also connecting the 5V on the six pin AVRISP connector and trying to power the whole board from it. The voltage might drop due to to much current drawn.

Like qpass wrote with avrdude showing everything written and reading the fuse bytes back correctly the MCU seems to be correctly programmed, and when not working the problem will be on the main board when it does not work as expected.

It could be the crystal that is defective and the MCU is not running due to this. Checking this without an oscilloscope or frequency counter is hardly possible.

Offline electronix27

  • Contributor
  • Posts: 14
  • Country: us
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #35 on: June 04, 2024, 10:22:51 am »
By chance, with 644 back on PCB and powered, have you tried adjusting VR R21 connected to VO pin 3 of LCD.  With too high a positive bias you won’t see anything on screen.
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #36 on: June 04, 2024, 04:40:11 pm »
It could be the crystal that is defective and the MCU is not running due to this. Checking this without an oscilloscope or frequency counter is hardly possible.

Interesting. I poked around with an oscilloscope yesterday and I'm not getting particularly great readings off of the 644p. I am expecting a lot of activity off the various pins and I'm not really seeing particularly strong signals.

The crystal clock is also giving me somewhat oddball readings, but it might be that my oscilloscope isn't picking up 20mhz very well (although it should be able to).

I'll continue to poke around the board. Soldering-wise and traces-wise I don't see any red flags so far. The 644 is getting the correct voltage and the ground is properly connected.
 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #37 on: June 04, 2024, 04:44:31 pm »
By chance, with 644 back on PCB and powered, have you tried adjusting VR R21 connected to VO pin 3 of LCD.  With too high a positive bias you won’t see anything on screen.

Do you mean R1? Let me ask you this, the board calls for a 5K VR there, but all I had was a 10K which is what I ended up using, you don't think that would cause the LCD not to display anything? When I turn the knob it seems to affect the contrast properly, but the range is a bit more limited than I suspect it would have been on a 5K VR.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #38 on: June 04, 2024, 05:15:08 pm »
I'm certain that I've linked to the wrong schematic in my earlier messages.

Starting from your initial post link, I now see there are multiple CPU and addon boards.  On the manual page, it says: "The Shruthi comes either in the classic version with only 4 knobs below the screen; or the XT version which provides hands-on controls on all synthesis parameters."

Can you provide a link to the correct schematic(s), please.  Just so it's clear we know what board you're working on.


 
The following users thanked this post: Midphase

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #39 on: June 04, 2024, 05:22:29 pm »
It could be the crystal that is defective and the MCU is not running due to this. Checking this without an oscilloscope or frequency counter is hardly possible.

Interesting. I poked around with an oscilloscope yesterday and I'm not getting particularly great readings off of the 644p. I am expecting a lot of activity off the various pins and I'm not really seeing particularly strong signals.

The crystal clock is also giving me somewhat oddball readings, but it might be that my oscilloscope isn't picking up 20mhz very well (although it should be able to).

I'll continue to poke around the board. Soldering-wise and traces-wise I don't see any red flags so far. The 644 is getting the correct voltage and the ground is properly connected.

On the crystal (XTAL) pins on the MCU you should see small signals with the 20MHz frequency clearly there. On your programmers zif socket board there are also crystals, so you can compare with that. Frequency might be lower, but it should give you an idea of what the signals look like.


By chance, with 644 back on PCB and powered, have you tried adjusting VR R21 connected to VO pin 3 of LCD.  With too high a positive bias you won’t see anything on screen.

Do you mean R1? Let me ask you this, the board calls for a 5K VR there, but all I had was a 10K which is what I ended up using, you don't think that would cause the LCD not to display anything? When I turn the knob it seems to affect the contrast properly, but the range is a bit more limited than I suspect it would have been on a 5K VR.

It does not matter that much if it is 10K or 5K Ohm. The potentiometer is set as a voltage divider. At one end of the scale the display gets 5V and at the other it gets 0V. Depends on how much current flows into the contrast pin of the display, but don't think that it is that much you would see any difference between the two pots.

Edit: Take some pictures of your board(s) and post them here. They might say more then a 1000 words. :)
« Last Edit: June 04, 2024, 05:24:46 pm by pcprogrammer »
 
The following users thanked this post: Midphase

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #40 on: June 04, 2024, 05:45:17 pm »
Sorry about that. I’m working with the XT version. I’ll post actual photos in just a bit, but in the meantime here’s the actual board I’m working on: 

https://pichenettes.github.io/mutable-instruments-diy-archive/shruthi/digital_xt/

Here is a link to the schematics, although they’re not as informative as I would prefer:

https://pichenettes.github.io/mutable-instruments-diy-archive/static/schematics/Shruthi-Digital-XT-v03.pdf

Many thanks.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #41 on: June 04, 2024, 07:35:37 pm »
I'd pull all the ICs out of their sockets. Power the board and check if +5V makes it to the 644 and other ICs, LCD power pins.

Assuming all other non-socket'd parts are installed, I'd put back only the 644 and 74HC595.  Then connect your AVRISPmkII via ISP header, power the shruthi PCB and try to read the fuse info like you did in your reply#26.

Code: [Select]
% ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -p m644p -c avrispmkII -P usb
After power-up, you may get a reaction out of the LCD. Try turning the R1 pot until you see a cursor (dot matrix) or words.

It looks like IO_MISO from IC2 (74HC165 pin 9) would interfere with the ISP header or 644 MISO pin. 
74HC165 pin 9 is always driving IO_MISO (vs go high impedance when not enabled) so two outputs would be fighting each other.
 
The following users thanked this post: Midphase

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #42 on: June 04, 2024, 09:30:35 pm »
I'll run the test you suggested next.

I checked the VCC for the 644p and it appears to be getting a correct voltage of about 4.96V

Here's what is currently happening -- I'm powering on the unit and the screen is just blank. As I test XTAL 1 and 2 on the 644, it appears to elicit a response, and with enough fidgeting on those two pins, I get some activity on the LED display (although the unit does appear to be frozen).

Here is a pic of what it looks like after I probe pins 12 and 13 on the 644 for a bit.

 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #43 on: June 04, 2024, 10:20:52 pm »
I'd pull all the ICs out of their sockets. Power the board and check if +5V makes it to the 644 and other ICs, LCD power pins.

Assuming all other non-socket'd parts are installed, I'd put back only the 644 and 74HC595.  Then connect your AVRISPmkII via ISP header, power the shruthi PCB and try to read the fuse info like you did in your reply#26.

Ok...so voltages to all the sockets seem to be fine.

When I follow your instructions, and run the command line I get the following:

kays@Kayss-MacBook-Air ~ % ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -p m644p -c avrispmkII -P usb

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/kays/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/kays/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C990079
         AVR Part                      : ATmega644P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.24
         Vtarget         : 3.5 V
         SCK period      : 1.00 us

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.



For whatever reason, the connection appears to be failing when the 644 is installed into the socket...although in this case I'm going directly to the 644 pins themselves so I don't think it's a socket failure issue. Here's my setup (I know...not pretty):





 

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #44 on: June 04, 2024, 10:26:38 pm »
P.S.

When I take the 644 out of the socket and into the ZIP adapter, everything seems to be working correctly:

kays@Kayss-MacBook-Air ~ % ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -p m644p -c avrispmkII -P usb

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/kays/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/kays/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C990079
         AVR Part                      : ATmega644P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.24
         Vtarget         : 3.4 V
         SCK period      : 1.00 us

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e960a (probably m644p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D6, L:FF)

avrdude done.  Thank you.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #45 on: June 04, 2024, 11:04:49 pm »
I'll run the test you suggested next.

I checked the VCC for the 644p and it appears to be getting a correct voltage of about 4.96V

Here's what is currently happening -- I'm powering on the unit and the screen is just blank. As I test XTAL 1 and 2 on the 644, it appears to elicit a response, and with enough fidgeting on those two pins, I get some activity on the LED display (although the unit does appear to be frozen).

Here is a pic of what it looks like after I probe pins 12 and 13 on the 644 for a bit.


Nice board.  So the programming was successful as you're getting something intelligent on the LCD, eventually.

Look into re-soldering the xtal connections (or its 20pF caps).
Sounds like a bad xtal given it runs for a while then freezes.
Sometimes I've had to tap them to get them started. 


Quote
For whatever reason, the connection appears to be failing when the 644 is installed into the socket...although in this case I'm going directly to the 644 pins themselves so I don't think it's a socket failure issue. Here's my setup (I know...not pretty):

But IC2 (HC165) must be pulled off the board to use the AVRISPmkII because it'll interfere with the MISO ISP connector line.


Also,
I'm not sure it's a requirement to have a reliable clock while using the AVRISPmkII.  It probably is.
« Last Edit: June 04, 2024, 11:16:38 pm by pqass »
 
The following users thanked this post: pcprogrammer, Midphase

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #46 on: June 05, 2024, 12:06:00 am »
Ok, I seem to be making some good progress. I reseated all the IC's, and reflowed any solder point that looked a bit suspicious. I also replaced the 20mhz crystal with a spare I had...just in case.

So now the board powers up and the display shows what I think it's supposed to be showing which is a big step forward. However several of the parameters are flickering like crazy, as if the board is trying to rapidly switch values on a specific parameter. It might be a button shorting out, or something else perhaps? I do have a spare 644p as well that I can try to program to see if for some reason there might be a problem with the Atmega itself.

I should also mention that I didn't realize until after ordering the parts that the encoder that it wants needs to be one with a switch (I got me an encoder without a push down switch function), so I don't know if that might be the cause of the weird behavior since nothing is actually soldered in place of where the switch pins on the encoder would normally be soldered to.

I made a short video of the flickering characters that I'm seeing, it doesn't happen in all of the menus, but something is definitely not quite right:  https://youtu.be/hsg6ySoRIZo
« Last Edit: June 05, 2024, 12:35:36 am by Midphase »
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #47 on: June 05, 2024, 12:39:42 am »
I think the flickering means it's being constantly updated.  It may be that some LCDs don't erase before write whereas others do. That is, it may not be noticeable on other makes of LCDs.

The encoder push switch is likely a select/enter key. Until you get the correct part, you can temporarily put a momentary (NO) push button at the end of wires bringing it out from behind the board.  The ENC_SW pin on the 644 probably enables an internal pullup so it's not flapping in the breeze.

I'd cleanup the board with IPA too.
 
The following users thanked this post: Midphase

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #48 on: June 05, 2024, 05:56:28 am »
Quote
For whatever reason, the connection appears to be failing when the 644 is installed into the socket...although in this case I'm going directly to the 644 pins themselves so I don't think it's a socket failure issue. Here's my setup (I know...not pretty):

But IC2 (HC165) must be pulled off the board to use the AVRISPmkII because it'll interfere with the MISO ISP connector line.

Had not checked the datasheet of the HC165 before, but it definitely will cause problems. Pin 9 is a push pull output and will keep MISO in a defined state. The programmer will have a hard time pushing on it's own value and fail in programming the 644P.

Kind of a bad design.

Also,
I'm not sure it's a requirement to have a reliable clock while using the AVRISPmkII.  It probably is.

Yes it is, but it can be the internal clock when the fuses are set as such.



@Midphase
Well done.

I suspect the crystal had either poor connections or was defective. One hint for future projects, with a crystal like this and top side traces running underneath it is based to use a shim underneath the crystal. Can be a thin piece of plastic or a specially made one for the purpose, like these: https://www.amazon.ca/100PCS-Crystal-Oscillator-Gasket-Insulating/dp/B07Y7SZFBB

This prevents it from making shorts when the solder mask gets damaged.

Offline MidphaseTopic starter

  • Contributor
  • Posts: 35
  • Country: us
    • KaysLABS
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #49 on: June 05, 2024, 06:32:46 am »
I suspect the crystal had either poor connections or was defective. One hint for future projects, with a crystal like this and top side traces running underneath it is based to use a shim underneath the crystal.

Good idea, thank you. I actually saw a piece of rubber gasket underneath an oscillator once and was wondering what it was used for. I can see that  the crystal oscillator body, being made of metal, could potentially cause conductivity. Incidentally, when I re-installed the other crystal oscillator I kept the body further away from the PCB which I think reduced the possibility of it making contact with the top side traces.

I'm still not convinced that the LED display flickering is only due to a poor implementation of the write/erase cycle. For one, the functionality of the synth device appears to be affected by it -- but I still need to investigate further before coming to a full determination. One of the things that I want to do is to check all of the switches that I installed on the board as it's possible that one of them could be shorting out, causing both the weird flickering as well as the inconsistent functionality.

Whew....and I thought repairing old synths was difficult! ;-)
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4325
  • Country: nl
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #50 on: June 05, 2024, 08:18:26 am »
Whew....and I thought repairing old synths was difficult! ;-)

Wait until you decide to look into the software to see if the flickering is indeed due to poor programming.  :-DD

Offline VinzC

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: be
  • See you later, oscillator.
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #51 on: August 30, 2024, 05:33:20 pm »
I am trying to install a boot loader on an ATMEGA644P and I'm afraid I'm totally way in over my head. This is for a desktop synthesizer, and unfortunately the instructions provided are fairly cryptic to me, including what app I'm supposed to use exactly or how to go about it. I got me an AVRISP mkII programmer connected to my computer, and I was wondering if someone might be able to give me an idea of how to go about what these instructions instruct me to do?

https://pichenettes.github.io/mutable-instruments-diy-archive/shruthi/firmware/

I appreciate all the help any of you can provide.

Many thanks!

I am coming in late to the show and haven't read 100% of the convo and it is still not quite clear to me why you want to burn a bootloader to the ATmega644. In general a bootloader is used to flash a microcontroller in-place, i.e. using a serial communication channel *while the microcontroller resides on its PCB*. From what I understood you had to extract the MCU from its socket and burn the bootloader using an external programming gear (e.g. AVRISPmkII and a 6-pin header), is that correct?

If that's true and unless I missed something, then you do not need a bootloader to program your microcontroller. I have read on https://github.com/Lauszus/Sanguino
Quote
Since the ATmega1284 is not supported by Avrdude.
That information is outdated and incorrect. Recent versions of avrdude *do* support that microcontroller (along with the 644, which the same unit with smaller memory footprints).

Consequently the operations you had to run through to burn the bootloader are the same whether you want to flash a bootloader or flash a program. So it is possible you don't need a bootloader at all. In fact it is not necessary if you can program it on a dedicated socket or via the 6-pin header, in which case the protocol used is "serial downloading", as per the datasheet, see page 299: https://ww1.microchip.com/downloads/en/DeviceDoc/doc2593.pdf.

I don't know if that helps as I am not 100% sure about how you flashed your microcontroller. Anyway congrats for getting through :-+

EDIT: By the way you can have avrdude list all supported microcontroller units:
Code: [Select]
avrdude -p '?'On my machine the list is pretty impressive (~350 items). The only thing you might need to change to add a new microcontroller is avrdude.conf as that file holds the description for all supported units.
« Last Edit: August 30, 2024, 05:42:58 pm by VinzC »
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 912
  • Country: ca
Re: ATMEGA 644P AVR Programming Help Needed
« Reply #52 on: August 30, 2024, 09:59:21 pm »
Quote
I am coming in late to the show and haven't read 100% of the convo and it is still not quite clear to me why you want to burn a bootloader to the ATmega644. In general a bootloader is used to flash a microcontroller in-place, i.e. using a serial communication channel *while the microcontroller resides on its PCB*. From what I understood you had to extract the MCU from its socket and burn the bootloader using an external programming gear (e.g. AVRISPmkII and a 6-pin header), is that correct?

Why he wanted to burn a bootloader was never disclosed.  But usually, why is so the same rx/tx serial pins (which are available externally) can do double-duty of app stuff normally + mimic a programmer on boot-up.

However, it was discovered that although there was an ICSP header on his board, he couldn't use it because of a design flaw (MISO was always being driven by a non-tristate pin from a '165).  Hence the need to extract the MCU to burn the bootloader using a different board + AVRISPmkII programmer.

Quote
If that's true and unless I missed something, then you do not need a bootloader to program your microcontroller.

No, it wouldn't be needed as the ICSP header is on the board but it wasn't functional and you'd have to open the product to get to it anyway.
 
The following users thanked this post: VinzC


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf