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.

CC2540: CC2540 program loss issue

Part Number: CC2540


Dear

Customer use our cc2540 in their product,about 1/200 product appear program loss issue lately,and it become nomal work after reload program,pls help provide some suggestions

  • Hi,

    Can you please provide some more details to try to help diagnose the issue: if you read out the flash of an affected board using a programming tool instead of just reloading it, do you see flash as being totally blank, or is it simply different than the expected memory? If it's different, can you provide info about what differences there are (e.g. blank sections, individual bad bytes, and are bits always going 1->0 on the failing units)?

    Do you have OAD functionality in your application?

    Do you use any locking/protection mechanism on the flash? 

    Regards,
    Katie

  • Hi,

    Thanks for your answer first.And the differences between normal and bad image file as follows:

    1.from 00001000 to 00015000 total 80KB image codes lost ,instead by FF.

    2.The right crc shadow 0x2012 ocupied by 0xFFFF,and the file name space has the same problem. 

    Please help us solve the issue.

    Best regards.

  • Hi,

    Thanks for providing the information. It looks like some sort of erasure has occurred (FF is the erased state for Flash). Since it is an erase in such a large block, can you comment on if there is any sort of field firmware upgrade functionality implemented in your application, or if your application does any in-system flash writes?

    Regards,
    Katie
  • Hi,

    We use Universal Boot Loader for SOC-8051 by USB-MSD updating image run code. The UBL receives image data and erases the flash.I doubt that the problem occured in writing data to the flash,but i do not know why this would happen. 

  • One thing that is not clear for me: When does this occur? Is it in production, is it after n days in the field?
  • Situation one is our customer using it good for the beginning ,but after several days later during using it on work,it suddenly did not work.I read out the contents from the flash and find out that the right crc shadow 0x2012 ocupied by 0xFFFF,and the file name space has the same problem.
    Situation two is the first time using the dongle it works fine,but serval days later inserting it in the usb interface for the second time,it does not work.I read out the contents from the flash and find out that from 00001000 to 00015000 total 80KB image codes lost ,instead by FF.
  • For me it looks like one or more flash pages have been erased. Does your program contain code that do a flash erase? If so, the question is why that piece of code runs.
  • No,I just use NV page by calling the api,but never do a flash erase.
  • The NVS driver could erase a page, do you have an example of the API calls you use?
  • The first time I use the read flash api as follows:

    The firsttime I use the write flash api as follows:

    Api function osal_snv_read() and osal_snv_write()you can find it in the stack BLE-CC254x-1.3.2.

  • TER

    Any suggestion for this issue?thanks
  • Hi user4206199,

    Does this happen on any computer, or a specific one?

    The USB-MSD bootloader can be configured to appear as a mass storage device for some seconds after boot, or if a GPIO is held high/low. Is this happening here?

    Is it possible that some program, or the operating system itself, tries to write to the drive when it appears as a mass storage device, and that this causes the erase?

    Best regards,
    Aslak
  • Hi Aslak N,

    This happens both on labtop and desktop.

    I configured 0 second delay as a mass storage device after boot.

    Which GPIO you mean is held high/low,and what affact if so?

  • Hi,

    I am curious to know what happens if you increase the delay. If you change it to 300ms, for example, do you still observe the issue?
  • I used to configure the delay to 1 second,and do a test pull in and out the USB interface with a dongle for 1000 times.The dongle worked fun.But It happened program loss when our costumers using it.

  • If it only happens on a few devices, I'm interested in knowing the details around the hardware design. Have you followed out HW reference design for USB dongle? (CC2540EMK-USB)
  • Our dongle  Circuit schematic diagram as follows.Are there any problems?

  • From what I can see the CFG-DISCS section (referring to Universal Boot Loader for SoC-8051 by USB-MSD Developer's Guide) can set a GPIO. What is this struct defined as in your case? If you have defined a GPIO that is floating this could lead to issues.

    I read through some of the thread again but have to verify a detail: Does the "flash pages get overwritten be 0xFF" only happen when the dongle is inserted or could it happen after it's been in use some time? Not familiar with this bootloader but it should only do a flash write the first time the dongle is in use?
  • Have you managed to solve this?
  • The GPIO set in the struct as follows:

    I never use the GPIO P1.2 after boot.

    As before I said,sometimes the problem happened when powered on,and sometimes it happened on working.tT

    To deal with this problem,I have changed the bootloader codes not using the GPIO.

    After some tests,the problem not happened again.