#avr Logs

Dec 23 2018

#avr Calendar

04:21 PM Evidlo: I'm trying to build this LCD library with avr-gcc, but I'm getting compilation errors: https://github.com/cpldcpu/uTFT-ST7735
04:25 PM Evidlo: https://termbin.com/7n3s
04:25 PM Evidlo: am I using gcc right here?
04:25 PM Evidlo: I don't understand why I'm getting 'undefined reference to main', because there is no main in that .c file
04:35 PM Igloo: Evidlo: If you try to link an executable, then the linker will want to be able to find main
04:36 PM Evidlo: don't I need to have uTFT_ST7753.o built first?
04:36 PM Igloo: Try avr-gcc -Wall -Os -mmcu=attiny85 -o foo.o -c uTFT_ST7735.c
04:36 PM Igloo: (note the "-c")
04:37 PM Evidlo: does it matter that there is an #ifdef SPI_SOFTWARE in uTFT_ST7735.c?
04:37 PM Evidlo: ok, I have the object file now
04:47 PM Evidlo: Igloo, shouldn't `avr-gcc -Wall -Os -mmcu=attiny85 -o main.o main.c uTFT_ST7735.c` compile and link main.c and the LCD library into main.o?
04:58 PM Igloo: Yes - but that's an executable file, not an object file
05:11 PM Evidlo: Igloo, so how do I get an object that I can use with `avr-objcopy -j .text -j .data -O ihex main.o main.hex` ?
05:18 PM Igloo: Evidlo: That should work
05:18 PM Evidlo: I just get a .hex that has about 10 bytes in it
05:21 PM Evidlo: Igloo, are you sure `avr-gcc -Wall -Os -mmcu=attiny85 -o main.o main.c uTFT_ST7735.c` is correct? I'm still getting 'undefined reference' errors
05:23 PM Evidlo: there's an ifdef in uTFT_ST7735.c and these functions are inside it
05:24 PM Igloo: Hmm, this might be dseigned for a different compiler. I've just downloaded it, and avr-gcc doesn't understand the asm syntax as far as I can see
05:24 PM Igloo: -DF_CPU=1000000UL -std=c99 gets closer, FWIW
05:25 PM Evidlo: I removed the SPI_SOFTWARE ifdef and deleted the 'inline' prefix for those functions and it builds
05:26 PM Igloo: Re the ifdefs, note that the .h files #defines SPI_SOFTWARE
11:24 PM day__ is now known as day