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.

Flashing the CC2540

Other Parts Discussed in Thread: CC2540, CC2520

All,

So I have built my own CC2540 board based on the keyfob reference design. I then attempted to flash my code using the CC Debugger and the SmartRF Flash Programmer. The Flash Programmer recognized the chip and would write to it but always failed the verify part of the "Erase, program, and verify" function. I have a couple theories but I would appreciate feedback from others.

Theory 1: The MISO and MOSI pins are reversed.

Looking at the keyfob reference design the debug header pin 8 goes to P0_3/MISO and pin 10 goes to P0_2/MOSI. After reading the CC Debugger Guide SWRU197E (which does not have anything specifically on 2540 or 2541) and looking at figure 5 it appears that pin 8 should be MOSI and pin 10 should be MISO. Also, figure 7 shows the CC2520 and it has pin 8 as MOSI and pin 10 as MISO. Table 7-1 of the CC2540 user guide also shows this mapping. Perhaps by design it is suppose to be reversed as to communicate back and forth but that is why I am asking the community.

Theory 2: Lock Bits are set and are blocking the program

Not sure what software/firmware comes on a new CC2540 from TI but should it be capable of being flashed right out of the box? Section 3.4.1 of the CC2540 user guide mentions that the CHIP_ERASE command from the debugger is needed to clear the debug-lock bit and flash_pages lock bit. However, my IAR trial has expired and I don't want to spend $3k to by the license to erase and download code that is currently good enough for testing.

Theory 3: I am missing a solder connection

The QFN package is a royal pain in the @$$ to solder by hand.  There is a chance that I did not connect up every pin with adequate solder.  However there is enough solder in place that the flash programmer can recognize the chip and attempts to program it.  At some point I will hook up my oscilloscope to read the different lines.  If it can reconize the chip does that mean that the DC, DD, CSn, Reset, SCLK, MISO, and MOSI lines are functioning properly?

Please give me your thoughts. 

Thanks,

Tony

  • Hi,

    There was a report about labeling of ports on MiniDK (check out first post in this).

    2540 should give no trouble with lock bits - we've had BLE112s resoldered with 256K parts (stock modules bear CC2540F128), and had no problem with programming them.

    BR

    Oleg

  • Hi Tony,

    Theory 1: Although it is correct that the MISO/MOSI labels in the schematic for the CC2540Keyfob (rev A) are wrong, this is not related to the problems you are seeing, Only DC, DD and RESETn are needed to program the device.

    Theory 2: Is not the issue. The erase operation in the programmer will perform a mass erase, wiping out everything on the device, including any lock bits already set. And if you set up the programmer to turn on certain flash lock bits, this will not interfere with the verification step, as the latter is done before the lock bits are set.

    Theory 3: More likely a hardware issue. Make sure the chip is properly soldered/connected to the ground pad under the chip and that you have all the required decoupling capacitors etc. Also note that the chip detect function on the debugger is particularly robust, so it will be able to detect a device even though the connection is a bit flaky. When programming, you can try to reduce the debig interface speed by selecting Slow in the Interface drop down box next to the list of connected devices in SmartRF  Flash Programmer. Also perform a simple chip erase followed by a read back from the chip. If you don't get all 0xFF, you should recheck the hardware and the connection of the debugger.

    Hope this helps.