Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
Help / Re: Compiler Optimizations
« Last post by stahta01 on Today at 11:32:15 pm »
Hi stahta01,
I have set the compiler optimizations to 1, 2, and 3, but this issue still occurs. There was another post about using the compiler optimizations to solve an issue that I saw.
I just tried the same code with MPLABX with the same results, and the same warning message, so it doesn't appear to be a CB issue. I am just reaching out for help from people with way more experience than me.
Regards,
mikejp56

See https://www.nongnu.org/avr-libc/user-manual/group__util__delay.html

Did you define F_CPU as required?
Edit: You did as "-DF_CPU=16000000UL"

And, you need to find an website that supports your AVR compiler; because some or most of your question is off topic (OT) for this website.

Edit: Did you rebuild the project trying at least 3 different optimizations? Edit3: I suggest "O1" "O2" and "Og".
If yes, what optimizations did you try?
Post at least one build log of those opt. builds?

Edit2: Try building the project without the debug mode (-g) being used. Sometimes debug mode make things easier and sometimes harder.

Tim S.
2
Help / Re: Compiler Optimizations
« Last post by Miguel Gimenez on Today at 11:20:36 pm »
Were optimizations enabled in the log you posted?
3
Help / Re: Compiler Optimizations
« Last post by mikejp56 on Today at 08:56:08 pm »
Hi stahta01,
I have set the compiler optimizations to 1, 2, and 3, but this issue still occurs. There was another post about using the compiler optimizations to solve an issue that I saw.
I just tried the same code with MPLABX with the same results, and the same warning message, so it doesn't appear to be a CB issue. I am just reaching out for help from people with way more experience than me.
Regards,
mikejp56
4
Help / Re: Compiler Optimizations
« Last post by stahta01 on Today at 08:46:25 pm »
https://www.avrfreaks.net/s/topic/a5C3l000000UUx7EAG/t132775

Over a decade old post; where user found problem in Code::Blocks global compiler settings.

Tim S.
5
Help / Re: Compiler Optimizations
« Last post by mikejp56 on Today at 08:27:22 pm »
Hi Miguel,
Here is the text of the build log. From what I have read it appears to have something to do with compiler optimizations.
Thanks for your time.

-------------- Build: Debug in Binary_Clock_Mods (compiler: GNU GCC Compiler for AVR)---------------

avr-gcc -Wall -mmcu=atmega328p -DF_CPU=16000000UL -g  -c main.c -o obj/Debug/main.o
avr-gcc  -o bin/Debug/Binary_Clock_Mods.elf obj/Debug/fuse.o obj/Debug/main.o  -mmcu=atmega328p -Wl,-Map=bin/Debug/Binary_Clock_Mods.map,--cref 
In file included from main.c:18:0:
/usr/lib/avr/include/util/delay.h:112:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed" [-Wcpp]
 # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
   ^
Output file is bin/Debug/Binary_Clock_Mods.elf with size 31.85 KB
Running project post-build steps
avr-objdump -h -S bin/Debug/Binary_Clock_Mods.elf > bin/Debug/Binary_Clock_Mods.lss
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex bin/Debug/Binary_Clock_Mods.elf bin/Debug/Binary_Clock_Mods.hex
avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex bin/Debug/Binary_Clock_Mods.elf bin/Debug/Binary_Clock_Mods.eep
avr-objcopy --no-change-warnings -j .lock --change-section-lma .lock=0 -O ihex bin/Debug/Binary_Clock_Mods.elf bin/Debug/Binary_Clock_Mods.lock
avr-objcopy --no-change-warnings -j .signature --change-section-lma .signature=0 -O ihex bin/Debug/Binary_Clock_Mods.elf bin/Debug/Binary_Clock_Mods.sig
avr-objcopy --no-change-warnings -j .fuse --change-section-lma .fuse=0 -O ihex bin/Debug/Binary_Clock_Mods.elf bin/Debug/Binary_Clock_Mods.fuse
srec_cat bin/Debug/Binary_Clock_Mods.fuse -Intel -crop 0x00 0x01 -offset  0x00 -O bin/Debug/Binary_Clock_Mods.lfs -Intel
srec_cat bin/Debug/Binary_Clock_Mods.fuse -Intel -crop 0x01 0x02 -offset -0x01 -O bin/Debug/Binary_Clock_Mods.hfs -Intel
/bin/sh: 1: srec_cat: not found
Process terminated with status 127 (0 minute(s), 0 second(s))
0 error(s), 1 warning(s) (0 minute(s), 0 second(s))
 

-------------- Build file: Debug in Binary_Clock_Mods (compiler: GNU GCC Compiler for AVR)---------------

Nothing to be done (all items are up-to-date).
6
Help / Re: Compiler Optimizations
« Last post by Miguel Gimenez on Today at 07:45:58 pm »
7
Help / Compiler Optimizations
« Last post by mikejp56 on Today at 06:34:52 pm »
Hi All,
I am using CB with Linux Mint 20. I get the following warning "/usr/lib/avr/include/util/delay.h:112:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed" [-Wcpp]
 # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
I have set the compiler optimizations for 1, 2, and 3, but I still get the same warning.
I am pretty new to CodeBlocks and AVR programming.
Please point me in the correct direction.
Thanks for reading.
Regards,
mikejp56
8
Good catch, the bots are getting smarter in hiding links.
9
Using Code::Blocks / Re: gdb of better compiler not working
« Last post by Miguel Gimenez on Today at 01:55:30 pm »
GNU has changed the output of the "info breakpoints" command in GDB 13. From Sourceware change log:
Quote
* "info breakpoints" now displays enabled breakpoint locations of
  disabled breakpoints as in the "y-" state.  For example:

   (gdb) info breakpoints
   Num     Type           Disp Enb Address            What
   1       breakpoint     keep n   <MULTIPLE>
   1.1                         y-  0x00000000000011b6 in ...
   1.2                         y-  0x00000000000011c2 in ...
   1.3                         n   0x00000000000011ce in ...

The Enb column previously showed 'y' or 'n', now it shows 'y-' or 'n'. This may be fooling the debugger plugin.
10
Using Code::Blocks / Re: gdb of better compiler not working
« Last post by Grit Clef on Today at 12:51:43 pm »
Then maybe Xaviou's build can be suitable?
Pages: [1] 2 3 4 5 6 ... 10