Rebuild succeeded vs Errors in Error list

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

some time I have important bug. When I finished rebuild my project I have got info:

Build succeeded.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

but, when I open Error list window, there are some errors. I have not problem with improving my code, but project with build errors can not be "Rebuild ... succeeded"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are they actual errors? Or just warnings? Do you mind copy-pasting the errors here so we can have a better idea?

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Errors and warnings.
for example, I have made wrong code. Error in source code does not matter, I can find it and improve. But after every build I have to see in error list. Info in output window is not true.

Output is:
Build succeeded.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Error list:
Error 2 expected 'unsigned char' but argument is of type 'unsigned char *' C:\Documents and Settings\Peter\Dokumenty\AVRStudio\Terminal-SAX\Terminal-SAX\Terminal-SAX.c 77 6 Terminal-SAX

Warning 1 passing argument 1 of 'dogSPIout' makes integer from pointer without a cast C:\Documents and Settings\Peter\Dokumenty\AVRStudio\Terminal-SAX\Terminal-SAX\Terminal-SAX.c 195 5 Terminal-SAX

Output files *.HEX, *.ELF, ... are generated, but - of course program is not working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you attach a small project that demonstrates the issue?

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is *.zip file, with example of my source code and others projects files.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I cannot reproduce your problem. I use your project, I rebuild everything and I get no errors or warnings at all.
I use AVR Studio 5 (Version: 5.0.1163)

But I have some questions:
-Why do you use asm("NOP") for delay; Is that one cycle delay so important?
-Why do you have Optimization set to -O0? Is there a specific reason? (answering myself: "Possibly so that many things will not be removed by the optimizer?")
-Why do you use your own delay routines and not the optimized ones from avrlibc?

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Why do you use asm("NOP") for delay; Is that one cycle delay so important?

Surely it's to prevent the optimiser discarding the entire loop?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

Why do you use asm("NOP") for delay; Is that one cycle delay so important?

Surely it's to prevent the optimiser discarding the entire loop?

I was not referring to the NOPs inside the delay loops, but to the ones placed in the other parts of the code. Maybe I didn't phrase it correctly and passed the wrong tone, but I wrote those questions to actually ask the OP if there is a reason he did things that way, not to imply he did wrong.

But I notice that this project uses a graphic display, which is something I have never used so far. So, I don't think I can be of much help on troubleshooting this one.

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aah, revelation. LX_User, yes, I managed to reproduce your problem, working on it now.

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, if this works and does the job you want:

//read from Flash
temp = pgm_read_byte((unsigned char*)(pk[screen] + vCoord * 102 + hCoord));

//send temp to SPI - display temp.
dogSPIout(temp,1);

And this doesn't work:

dogSPIout(((unsigned char*)(pk[screen] + vCoord * 102 + hCoord)),1);

Why not do

dogSPIout(pgm_read_byte((unsigned char*)(pk[screen] + vCoord * 102 + hCoord)),1);

(note the "pgm_read_byte" inserted)
It compiles with no warnings or errors.

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Avrfreaks and Friends,
there is not problem in my code. It is only example - with errors. Problem is that, when I try build wrong code, it is finished with "Successful message", but in "Error list" are some errors. I expect that code with errors can not be build successfully. And exactly, code with errors is not good - it is really not working. When I try make another bugs in this code, build is unsuccessful.
It is mean: Do not repair my code. There is bug with using pgm_read_byte function. My question is about AVR Studio 5.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup, that's a bug in AVR Studio, but it's not what you think. The text from the compiler is

.././Terminal-DOG.c:163:5: warning: passing argument 1 of 'dogSPIout' makes integer from pointer without a cast
.././Terminal-DOG.c:53:6: note: expected 'unsigned char' but argument is of type 'unsigned char *'

AVR Studio is mistakenly showing the "note" as an error, and that's the bug, it should have showed up as a warning as well.

The code you wrote is only worth a warning, according to the compiler, which is why it went ahead and generated code.

Regards

Senthil

 

blog | website

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Senthil,

O.K. - now it is clear. Warnings + Notes, no errors. I am afraid that AVR Studio does not stop building on some kinds of errors.

Thanks again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I am afraid that AVR Studio does not stop building on some kinds of errors.

If you check the "Inhibit all warnings" option in AVRStudio5 and compile your code then the error(of course just warning) will not be listed in the error windows. This shows that AVR Studio is just mistaking considering the note as error.

-Krishna Balan S

-------------------------------------------------------------------------

"Heroes are ordinary people with extraordinary commitment"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The real bug is that your compiler is making some messed up hex file successfully. Change your toolchain, I use winAvr-20090313. I have noticed these issues before with the default toolchain and I do not believe they have been fixed.

see this thread for more info on my issue:
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=106682

see this for how to change the toolchain in avrStudio5:
http://avrstudio5.wordpress.com/2011/03/02/how-to-change-the-gcc-toolchain-used/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I use winAvr-20090313

I know WinAVR20100110 is getting a bit long in the tooth but why would you go even further back in time?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just issues, i have not had any w. 20090313, i remember having some with 20100110, but i didnt bother figuring what was going on. If its not broken, why change?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

if its not broken, why change?

modern device support and fixes you may not be aware of, also code generator is likely more efficient.