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.

TMS320F28335: TMS320F28335 example project f28335_flash_kernel failed. Error code 24

Part Number: TMS320F28335
Other Parts Discussed in Thread: CONTROLSUITE

Dear Team,

Happy new year!

We'd been working on SCI boot on F28335 and use the f28335_flash_kernel as a reference. But we failed if we use the SCI bootloader to send f28335_flash_kernel.bin file. Details a below. Due we've been debugging for sometime and still exists, need your expertise to help resolve. Thanks!

(C:\ti\controlSUITE\device_support\f2833x\v142\DSP2833x_examples_ccsv5\f28335_flash_kernel)

1. We compiled the project and generate .bin file;

2. Without connect the debugger, we select SCI boot and use UART to send the bin firmware to F28335;

3. During f28335_flash_kernel execution, the Flash_Erase() in CopyData() function failed. Error code 0x18;

4. Please note, if we use CCS download the firmware through debugger and execution fine. Without powercycle, we enter SCI boot mode, it will work!

5. If we use C2PROG, we can download successful. Which proves our hardware is OK?

We've searched all e2e suggestions (as below) and tried, but issue still exists. 

--- Suggestions we got from e2e and deyisupport ---

When Flash API return status = 24, it means "STATUS_FAIL_PRECOMPACT"

STATUS_FAIL_PRECOMPACT:-

Erase operation failed because the pre- compaction portion failed. The pre-compaction is applied to all sectors on the device. The FLASH_ST structure will return a fail address corresponding to the first sector fails this step.

processors.wiki.ti.com/.../FAQs

There is no guarantee that we can recover the flash from this problem. But, you can try depletion recovery algorithm to see if it resolves the problem. But, if depletion recovery fails, you just have the only option of replacing the part.

 

建议尝试depletion recovery, 另外这上面提到的Wiki如下:

http://processors.wiki.ti.com/index.php/C2000_Flash_Common_Issues/FAQs#Depletion

--- Suggestions we got from e2e and deyisupport ---

  • One more comments is this procedure we've been verified on F28069 and successful. So we suppose our bin file is fine.
  • Louis,

    Have yo seen this AR? www.ti.com/lit/sprabv4

    I am a little confused. Is the problem you are seeing when executing the SCI bootloader or when executing the SCI flash kernel?

    Please load the flash kernel via the debugger and execute it with the debugger. Then send the flash application along via SCI and you can debug the kernel this way.

    Make sure your flash application is linked entirely to flash and that there is nothing being loaded to RAM.

    sal
  • Sal, 

    Thanks! 

    1. This problem is when executing the SCI flash kernel. (The example project). And the SCI flash kernel is loaded to F28335 through SCI bootloader.

    2. If we use load flash kernel through debugger and execute it with the debugger, there will be no issue.

    For "Make sure your flash application is linked entirely to flash and that there is nothing being loaded to RAM."

    Do you mean we can not execute the flash kennel application in RAM? Why?

  • Hi Louis,

    You must execute the flash kernel from RAM. You are doing this correctly.

    I mean make sure that the flash application you are loading via the flash kernel is entirely linked to flash. When the flash kernel is executing and loading and programming your application, make sure the application is linked entirely to flash.

    If you are seeing an error during Flash_Erase() and seeing code 0x18, make sure you are erasing sectors which are available on your part. Additionally, you can try to erase again and see if you get the same error.

    Vamsi, what does error 0x18 mean?

    sal
  • Louis,

    When Flash Erase function returns 0x18 (24) it generally suggests that the problem is in flash not SCI bootloader. As you suggested, it means

    STATUS_FAIL_PRECOMPACT:-

    Erase operation failed because the pre- compaction portion failed. The pre-compaction is applied to all sectors on the device. The FLASH_ST structure will return a fail address corresponding to the first sector fails this step.

    Do you see this problem on every device (or) on this particular device?

    Regards,
    Manoj
  • Hi Sal,

    Thanks for the quick feedback!!

    The issue appears at first step, when flash kernel is loaded to RAM and run, and then it stuck (We have not use it to update new firmware to flash yet). We're sure the flash API is in RAM.

    Could you help verify if same issue exists on your setup. As it's using the example project, It's easy to reproduce. Thanks for great support!

  • LLouis,

    Are you saying the example project available in controlsuite is failing? I just get a feeling that this could just device issue (compaction failure). Do you see this problem on many devices?

    Regards,
    Manoj
  • Manoj, Yes, the example project is failed. We've observe on many devices. Could you verify if it's same on your setup? Please not not use the Debugger only use the SCI. Thanks.

  • LLouis,

    Was the example project in controlSuite modified? When you load this example project, it get programmed to flash and run from flash. I have tried programming example project into flash using CCS / JTAG option and example project works just fine.

    How did you manage to program this example project to flash using SCI? There is no direct way to do this.

    Regards,
    Manoj

  • Hi Manoj,

    1. The example is not modified;

    2. As stated in above, you can't use debugger to program or connect with target;

    3. Select SCIA Boot, then using uart terminal to send bin file to the F28335. afterward, sent 41 AA 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00

    Could you check the procedure on your side? Appreciated!

  • LLouis,

    I don't have a ready made setup to test this one. I shall check with my team members to resurrect this setup and get back with you.

    Please expect 2 -3 business days for a response.

    Regards,
    Manoj
  • Hi Louis,

    Please add this to your flash kernel project properties... See the attached.

    Let me know if this solves your problem. It appeared to me that the kernel was not exiting properly and branching properly to the flash application which gets programmed by the kernel.

    Regards,

    sal

  • Issue still exists
  • Louis,

    Can you load the Kernel now with the above fix to RAM via CCS debugger and run that, please? While that is running execute the serial flash programmer with the code to load the kernel commented out. Can you see if the kernel is able to properly flash and branch to the application? Set a breakpoint at that the return from main and see if the code then branches to the entry address of the flash appliction, please.

    sal
  • Please use the attached file for the serial flash programmer.

    It appears there was another bug in the serial flash programmer which was not seen on other devices. It might not be a bug technically, but related to the synchronization between the f28335 and the PC which is not seen with other devices.

    sal

    f05_DownloadImage.cpp