bug in compiler made code

can you help.

im a pasionate programmer and never leave bugs in my code but i have a problem.

i have my uvision project and it works great. i download it to my dev board and it works great. i put it into another board but it sometimes doesnt work. the board works great and the hw guy says i have a bug in my code. i put code into another board. the only thing i can think is the compiler added a bug to my code.

anyone else seen this?

Parents
  • I'm not sure what "passionate" actually means as an attribute of a programmer?

    The key attributes required of a good programmer are Attention to detail, Meticulous thoroughness, etc..

    "never leave bugs in my code"

    Well, I don't suppose that anyone deliberately leaves bugs in their code - but that doesn't mean that it never happens!

    How can you be so certain that you have no bugs in your code?
    I'm not aware of any method or scheme that can 100% guarantee that there are absolutely no bugs whatsoever in the code - so what's your secret??

    "i have a problem"

    Must be a bug, then - surely?!

    "i have my uvision project and it works great"

    What, exactly, do you mean by "works great" here?

    Have you exhaustively tested it - especially against all error cases and "corner" conditions?

    "i download it to my dev board and it works great"

    Again, have you exhaustively tested it - especially against all error cases and "corner" conditions?

    Running it on just one Dev Board does not constitute exhaustive testing!

    "into another board but it sometimes doesnt work"

    In what ways(s), exactly, does it "not work"?
    What testing and debugging have you done to determine what is going wrong?
    What have you done to try to determine the difference(s) between the times that it works, and the times that it doesn't?

    "the board works great"

    Again, what does that actually mean?

    "hw guy says i have a bug in my code"

    That doesn't seem an unreasonable thing to say - but what testing and debugging has he done to demonstrate that it's not a hardware bug?

    What have you done to prove him wrong?

    "i put code into another board"

    And what happened?

    This doesn't sound very "passionate" - it sounds like you're just randomly putting your code into different boards and hoping that it'll run!

    "the only thing i can think is the compiler added a bug"

    That is highly unlikely!
    Why do you think it is so much more likely than a bug in your code, and/or a bug in the hardware?

    "anyone else seen this?"

    Yes -it is a very common experience of all embedded developers!

    Since it "works" (sic) on the Dev Kit, but not on the first board, you could start by looking at what, exactly, is different between those two boards...

    It could be something like a timing difference - so that your code only just works on the Dev Kit, and only just fails on the other board...

    Or uninitialised variables

    Or...

Reply
  • I'm not sure what "passionate" actually means as an attribute of a programmer?

    The key attributes required of a good programmer are Attention to detail, Meticulous thoroughness, etc..

    "never leave bugs in my code"

    Well, I don't suppose that anyone deliberately leaves bugs in their code - but that doesn't mean that it never happens!

    How can you be so certain that you have no bugs in your code?
    I'm not aware of any method or scheme that can 100% guarantee that there are absolutely no bugs whatsoever in the code - so what's your secret??

    "i have a problem"

    Must be a bug, then - surely?!

    "i have my uvision project and it works great"

    What, exactly, do you mean by "works great" here?

    Have you exhaustively tested it - especially against all error cases and "corner" conditions?

    "i download it to my dev board and it works great"

    Again, have you exhaustively tested it - especially against all error cases and "corner" conditions?

    Running it on just one Dev Board does not constitute exhaustive testing!

    "into another board but it sometimes doesnt work"

    In what ways(s), exactly, does it "not work"?
    What testing and debugging have you done to determine what is going wrong?
    What have you done to try to determine the difference(s) between the times that it works, and the times that it doesn't?

    "the board works great"

    Again, what does that actually mean?

    "hw guy says i have a bug in my code"

    That doesn't seem an unreasonable thing to say - but what testing and debugging has he done to demonstrate that it's not a hardware bug?

    What have you done to prove him wrong?

    "i put code into another board"

    And what happened?

    This doesn't sound very "passionate" - it sounds like you're just randomly putting your code into different boards and hoping that it'll run!

    "the only thing i can think is the compiler added a bug"

    That is highly unlikely!
    Why do you think it is so much more likely than a bug in your code, and/or a bug in the hardware?

    "anyone else seen this?"

    Yes -it is a very common experience of all embedded developers!

    Since it "works" (sic) on the Dev Kit, but not on the first board, you could start by looking at what, exactly, is different between those two boards...

    It could be something like a timing difference - so that your code only just works on the Dev Kit, and only just fails on the other board...

    Or uninitialised variables

    Or...

Children
More questions in this forum