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

Strangest problem.....HELP!!!!!

I am using a uVision 3 to write a firmware program for a TI chipcon CC1110 chip.
Lately I am having VERY strange troubles with the compiler...
I write a code. And it works great. Then I add a line of code. Any line which has no logic meaning like int k=0; (This isn't a specific example..this happens with ANY line of code,anywhere in the program). Then I burn the program to the chip and suddenly it doesnt work although no logical change ha been made.
Then I write k=0;k=0;k=0;k=0; a few times (don't remember the number of times you need).Then I burn the code again and it works perfect!
I add another k=0; ... it stops working....add some other lines...works fine. IM GOING CRAZY this makes no sense at all!! it seems that the number of code lines needs to be aligned to a certain size.This should not happen.This is not a memory issue for sure since I still have 16K of memory left.

Is this a known keil compiler bug??What should I do??

  • Stack overflow?

    RAM overflow?

    Uninitialized pointer?

    Incorrect ISR?

    Use of function pointers?

    Incorrect cast of a pointer?

    Difference between memory size you think the chip has, and what the real chip has?

    Difference between memory sizes of the chip, and memory sizes specified in the project?

    Use of extended features of the chip for code banking, extra index etc?

    Time-critical code that gets affected by extra nop statements?

    What have _you_ done to try to figure out why it happens, or to try to step through the code and see where everything goes wrong?

    Have you tried to turn off a number of interrupt sources and checked if that makes a difference?

    By the way: HELP in a subject line is seldom a good choice. Everyone who ask questions wants help so did you add the "HELP" word for extra VIP treatment? Many responders intentionally ignore HELP threads.

  • Thank you very much for your ideas and advice
    No need for VIP treatment, just trying to solve my problems...

    What I have tried to do so far...(I'm very new to this stuff,this is the first firmware I'm writing ever)

    1)First..I checked the code itself to be sure that Im not adding something that ruins the logic. Its not a logic problem for certain.

    2) There is no use of function pointers in the program
    There are no uninitialized pointers.
    3)I tried to figure out the Memory Map files and what they mean to see if there is an overflow (not so successfully to be honest...)
    When I compile the program it shows how much space it uses and its far from the limits of the chip.I dont think its a memory problem since I add lines of code and it stops working. Then I add some more line of code (more memory usage) and it works fine.
    As far as I know the chip has 32K of flash memory a 4K SRAM.

  • does you processor reset upon the failure? does it happen when you run your program on the simulator?

  • could you post a quick description of your program? what is it designed to do and how it achieves that?

  • These kinds of problems (the water flows uphill problem) are almost never a problem with the tools. Instead, they are usually a problem with the process or getting the code into the part.

    Here is something I would try.

    1. Take a working program.
    2. Re-build the project without making any code changes.
    3. Burn it into the part.
    4. Check to see if it runs.
    5. Repeat steps 2-4 and see if the program ever fails. If it does, then you have a process problem.

    Jon

  • For anyone who encounters such a strange bug: The problem was a hardware bug in cc1110 noted in the ERRATA notes which caused the chip never to exit power mode 2 once entering it. The way to overcome it is noted in the documents of TI.