This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Device suffers from reproducible resets once optimisation is turned on

I've recently begun work on maintaining and adding functionality to an existing product using the Chipcon CC1010.

<snip>

Parents
  • I'm using numerous function pointers elsewhere for time management and these work fine with optimisation - but their use is quite controlled. I'd removed all the function pointers from around the suspect code but it's possible they're being used elsewhere (in the same file). Doesn't the compiler normally complain about reentrant functions in these scenarios? An example of poor compiler understanding was that the previous code was calling functions like memset and memcpy from within interrupts!! :)

    Thanks for the tip on that one. I'll keep looking for further use of the function pointers.

    I have found that I can individually optimise files in the project so I've set everything to 9 except the screwy file. It freed up 10k so this will keep us going until we have time to sort it out. Any further suggestions would be appreciated though. :)

    Cheers
    Darcy

Reply
  • I'm using numerous function pointers elsewhere for time management and these work fine with optimisation - but their use is quite controlled. I'd removed all the function pointers from around the suspect code but it's possible they're being used elsewhere (in the same file). Doesn't the compiler normally complain about reentrant functions in these scenarios? An example of poor compiler understanding was that the previous code was calling functions like memset and memcpy from within interrupts!! :)

    Thanks for the tip on that one. I'll keep looking for further use of the function pointers.

    I have found that I can individually optimise files in the project so I've set everything to 9 except the screwy file. It freed up 10k so this will keep us going until we have time to sort it out. Any further suggestions would be appreciated though. :)

    Cheers
    Darcy

Children
  • "Doesn't the compiler normally complain about reentrant functions in these scenarios?"

    Not necessarily.

    The problem is that the compiler (and Linker)can't necessarily tell at build time that you have potentially reentrant calls via pointers.
    That's why you have to understand the issues first, and write the code accordingly.