#avr Logs

Nov 08 2021

#avr Calendar

07:36 AM specing_ is now known as specing
08:26 AM lionkor: Hello! I have a curious issue - I am using avr gcc to compile my program, and *adding a function* breaks it. Here it works: https://paste.debian.net/1218671/ and here it doesn't: https://paste.debian.net/1218672/ - I tried playing with the optimization levels. Without optimizations it works sometimes, but I need them for the delay functions, and that's just not a good workaround. Any ideas?
08:32 AM lionkor: Im compiling like this: https://paste.debian.net/1218673/
08:37 AM twnqx: and what error do you get?
08:38 AM twnqx: wait, you mean it compiles, but sometimes it runs and sometimes it doesn't?
08:39 AM lionkor: Oh sorry - the LED blinks in the first one, but not in the second. When I use different optimization levels, and add or remove statements from/to the function, it sometimes works and sometimes doesn't.
08:39 AM lionkor: Always compiles without complaints
08:40 AM qu1j0t3: the linker is putting the new function first in the ELF. idk if that is related.
08:40 AM qu1j0t3: are you maybe missing an ld option or two
08:44 AM qu1j0t3: alternatively, you can do the link step with avr-gcc
08:45 AM qu1j0t3: i'm reading comments online that the link step should also be architecture aware
08:45 AM josuah: is it possible that a size limit was exceeded?
08:45 AM qu1j0t3: josuah: looking at the program -- i do not think so :)
08:45 AM twnqx: good point qu1j0t3, i'd say the linking breaks it
08:45 AM twnqx: that also will miss all initializers
08:46 AM twnqx: all the crt and so on
08:47 AM qu1j0t3: yeah, i suspect that linking with avr-gcc will fix this
08:47 AM qu1j0t3: passing the same options, like this random Makefile https://gist.github.com/mcous/5920089
08:58 AM josuah: I just had that bug due to a static array miscalculation, hence my bias
08:58 AM josuah: screens take-up a lot of RAM, at least one bit per pixel, it quickly fills up
08:59 AM josuah: so I understand why these ugly character-based LCD screens are built
08:59 AM josuah: not only because it is easier to program
08:59 AM josuah: but because it takes up basically no RAM at all on either the LCD or the MCU
07:37 PM specing_ is now known as specing
10:25 PM rue_mohr: ... and some applications only need text
10:26 PM rue_mohr: the world doesn't need the line of thinking that everything should operate from a 4Ghz processor with 64G of ram
10:26 PM rue_mohr: lots of things can be done with a 555 just fine