This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Put code permanently into micro controller

Other Parts Discussed in Thread: CC2541

Hello,

I bought a cc2541 KeyFob development kit and wrote a simple program which sends data to my iPad via BLE. Until now I have always downloaded the code through the debugger by clicking on the "Download and Debug" button on the IAR IDE. The problem now is that I can't turn off the micro controller sine it resets the flash memory and requires me to re-download the code. My question now is, how can I download code into the micro controller so that I am able to turn the micro controller on and off while keeping that program in memory? 

Kind Regards,

Francesco

  • Hi,

    When you download code from IAR, it's programming it to flash memory. This memory is non-volatile, thus it will be retained when you power off the CC2541. What is resetting the flash memory? If I pull the battery from the KeyFob, it resumes / reboots as soon as I re-insert the battery.

    Best wishes
  • Hi JXS,

    Thank you for the quick answer. I don't understand what I am doing wrong then...Whenever I pull the battery from the KeyFob and re-insert it, the device runs the code the code it had when it came out of the box. Whenever I click on the download and debug button on IAR, it is definitely putting the code into volatile memory.

    Any idea of what I am doing wrong?

  • Hi,

    Can you try using SmartRF Flash Programmer to erase the board. You should then see that nothing runs after power cycling. Then use IAR to program the part. Also, you can use SmartRF Flash Programmer to program the hex files directly. Let's try this experiment.

    Best wishes