[avr-libc-dev] broken code generation

2019-01-29 Thread avr-libc-devel
Hello friends. A long time ago, more than 10 years ago, I used avr-gcc + avr-binutils + avr-libc on Linux. Today I had to compile a test project with a modern installation of avr-gcc, avr-binutils, avr-libc. And I noticed a strange assembler code in the listing: there is no initialization of th

Re: [avr-libc-dev] broken code generation

2019-01-29 Thread avr-libc-devel
Seems like a strange compiler build. In my opinion, the problem at the link stage: the object file after compilation looks OK Command line to compile the project: $ avr-gcc -iquote . -Os -pipe -mmcu=attiny2313 -mint8 -g -c -o blink.o blink.c While I would not recommend using -mint8 (it has b

Re: [avr-libc-dev] broken code generation

2019-01-29 Thread avr-libc-devel
Seems like a strange compiler build. If this can be useful, I will provide an user account in Debian 9.7, where I try to compile the project — you can try your thoughts on this installation, if you wish. ___ AVR-libc-dev mailing list AVR-libc-dev@non

Re: [avr-libc-dev] broken code generation

2019-01-29 Thread avr-libc-devel
Your linker call is missing the -mmcu option. That's why no startup code has been scheduled to link against. OMG, thank you, it works :) ___ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev

[avr-libc-dev] const struct in program memory

2019-06-16 Thread avr-libc-devel
Hello friends. Tell me, please, can I use constant structures located in the program memory, as usual, which are located in the RAM? I tried to use the structure with the PROGMEM modifier, the program is compiled, but it seems to work incorrectly. Thank you. __

Re: [avr-libc-dev] const struct in program memory

2019-06-17 Thread avr-libc-devel
You certainly can use PROGMEM (or the newer __flash) on structs in program memory.  But you need to use the right methods to access the data.  Can you post a short sample code that you tried but which did not work? typedef struct { uint16_t int_part; uint8_t frac_part;

Re: [avr-libc-dev] const struct in program memory

2019-06-18 Thread avr-libc-devel
I recommend never using the "packed" attribute.  It rarely helps (and Thanks, I will consider it. In general, I know this, I'm just experimenting :) PROGMEM tells the compiler to put the data (bw_tab here) in flash memory.  On the AVR, flash is accessed with different instructions from ram (a