#avr Logs

Mar 20 2022

#avr Calendar

04:59 AM specing_ is now known as specing
05:09 AM WormFood: Yeah. I noticed the datasheet is rather convoluted for programming them.
05:14 AM con3_ is now known as con3
06:28 AM rue_mohr: I actually stayed up past tom sleeping
04:28 PM ville: so any ideas how to trouble shoot why my .hex file apparently has 0 bytes? http://coliru.stacked-crooked.com/a/9ae3b8bfda0ef17b
04:29 PM ville: the: "avrdude: writing flash (0 bytes):" part seems suspicious
04:31 PM ville: ls seems to thinks it's 13 bytes: -rw-r--r-- 1 ville ville 13 2022-03-20 23:10 xxx.hex
04:32 PM ville: no idea if that's even a reasonable number or if that's some sort of header + 0 bytes of payload
04:33 PM ville: the particular program is: http://coliru.stacked-crooked.com/a/210af4e134368997
04:34 PM Phantom: ville: .hex is text
04:35 PM Phantom: open and see what's in
04:35 PM Phantom: but probably a bad makefile
04:36 PM ville: the .hex file: http://coliru.stacked-crooked.com/a/45dc33a779757871
04:42 PM ville: even when i run: `avr-objcopy -j .text -j .data -O ihex build/avr-g++_release/xxx.elf build/avr-g++_release/xxx.hex` manually it's still producing the 13 byte .hex file
04:48 PM ville: the .elf file comes out at 1.3K so i suppose it contains something, hmm how can i see the disassembly for it...
04:54 PM ville: `avr-objdump --disassemble build/avr-g++_release/xxx.elf` produces no output...
04:58 PM ville: ok i wasn't passing -mmcu=atmega32 to the linker, so it helpfully just generated an empty executable...
05:34 PM Phantom: elf at 1.3k is empty
06:44 PM ville: anyone happen to have a known working c or c++ program that blinks the builtin led on an arduino micro?
06:49 PM qu1j0t3: ville: there isn't one online" or on that page you wre discussing?
06:49 PM Phantom: ville: again, get a proper makefile
06:53 PM qu1j0t3: ^^^
06:59 PM ville: qu1j0t3: haven't really been able to find one. all the ones i find are using the arduino ide
07:00 PM qu1j0t3: that can't be true. you were literally on a bare metal site.
07:00 PM qu1j0t3: i've found that stuff before.
07:01 PM qu1j0t3: in fact i might have published some, let me see...
07:01 PM ville: qu1j0t3: https://emil.fi/avr this one?
07:02 PM ville: qu1j0t3: it's not specific to arduino micro. so i have to know what to change the pins to. i am trying to eliminate any errors i may be introducing, such as getting the pin number wrong for the internal led
07:02 PM qu1j0t3: you can verify that from documentation...
07:02 PM ville: yes which i've done best to my ability. no blinking led
07:03 PM ville: so hence i wished to get a known working program
07:05 PM ville: https://docs.arduino.cc/static/777a1c066b7b2060eba932b9cc3eed5a/A000053-pinout.png would suggest it's PC7
07:05 PM qu1j0t3: ville: can you post a schematic and your code?
07:05 PM ville: 23:17:10 ville | the particular program is: http://coliru.stacked-crooked.com/a/210af4e134368997
07:06 PM qu1j0t3: and the schematic?
07:06 PM ville: schematic of what exactly?
07:06 PM ville: the pinout.png not enough?
07:06 PM qu1j0t3: i have the duemilanove schematic open as it happens already, the LED is PB5 here
07:08 PM qu1j0t3: there are also LEDs on rx and tx and power, but the only gpio one that i see is PB5
07:09 PM qu1j0t3: that is also true of Nano
07:09 PM qu1j0t3: of course none of this si relevant to bare metal setup
07:09 PM ville: the image i posted would suggest PC7?
07:12 PM qu1j0t3: i can only tell you what's on the official arduino schematics
07:13 PM ville: that is from the arduino site
07:13 PM qu1j0t3: ville: Micro is a _different model_
07:13 PM qu1j0t3: it's not PB5 on all arduinos
07:13 PM ville: that is for the micro
07:13 PM qu1j0t3: so clearly it changes per model.
07:14 PM qu1j0t3: which implies your program/headers needs to change per model.
07:15 PM ville: which is why i wished to know if someone had a known working program to share
07:16 PM qu1j0t3: for what hardware exactly?
07:16 PM qu1j0t3: that's really the only important question
07:17 PM ville: arduino micro
07:18 PM ville: which uses the atmega32u4 as the mcu
07:19 PM qu1j0t3: ok if it's official arduino hardware, there is a blink led sample built into the IDE?
07:20 PM qu1j0t3: you could test that, then if it works, RE how it works
07:20 PM ville: qu1j0t3: probably but i don't have the ide, and it would be using the arduino libraries
07:22 PM qu1j0t3: is it impossible to install it?
07:23 PM qu1j0t3: ville: It's not really important that it 'uses the arduino libs'
07:24 PM qu1j0t3: ville: because i'd do this: 1) test it works. 2) change to PORT write. & test that works.
07:25 PM ville: yes i can install it. i rather not, but may eventually give in
07:26 PM qu1j0t3: ville: if that works, you'r eback to 'my toolchain' issues which is very likely where the problem is (and not the _code_ per se)
07:27 PM ville: well i can upload a bootloader hex just fine and that works alright my setup
07:28 PM ville: so the next step would be to get hands on a known working program that does not use the arduino libraries
07:29 PM qu1j0t3: it's a possible next step
07:29 PM qu1j0t3: not the only one
07:29 PM qu1j0t3: one thing that assumes is that you are actually loading and running a program but you may not be