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.

CCS/TMS320F28035: 2803x_flash_kernel modified for CAN

Part Number: TMS320F28035


Tool/software: Code Composer Studio

I have successfully modified the 2803x_flash_kernel for CAN (100 kbps).  I am able to load this kernel into RAM via the CAN Boot Mode.  Then I am able to write my application to flash from this kernel via CAN.  This all works fine, HOWEVER, there is one issue that I don't quite understand.

If I send CAN messages to the flash kernel at a rate of 10 ms, the write to flash does not complete successfully.  It writes much of the data correctly at first, but then it starts to fail as the process proceeds leaving some of the application flash space as 0xFFFF.  I'm writing about 2200 memory locations.

If I send CAN messages to the flash kernel at a rate of 100 ms, the entire application gets written to flash successfully.

Why can the flash kernel not handle receiving CAN messages at a rate of 10 ms?  Where is the bottleneck?

I've attached my modified flash kernel.

1884.f2803x_flash_kernel.zip

  • Adam,

    Flash Program time to program 2200 memory locations is the bottleneck. I don't think your application is waiting for the flash programming operation to complete before processing next batch of 2200 memory locations. At every 10ms, your hex code which you are trying to program into flash will be stored in the buffer. But, if the previous flash program operating isn't complete. Your buffer will get corrupted and next flash programming cycle starts before completing the previous one.

    Table 5-14. Flash Parameters at 60-MHz SYSCLKOUT, shows that typical flash program time of 16 bit word takes 50us. With 2200 memory location is expected to take approximately around 100ms. So, If you either have to reduce buffer size and decide to update CAN messages at 100ms. If I were you, since only typical flash programming time is mentioned I would add some buffer time if a flash memory locations take more time than 50us.

    Regards,
    Manoj
  • Ah yes, that makes sense. It takes 20 ms to write a buffer of 400 locations. And before it's even done (10 ms later), I've already sent the next piece of data. I need to send my CAN messages no faster than 20 ms, and probably at least 50% slower than that.

    Am I understand correctly?

  • Adam,

    You have understood it correctly with one little correction. But, I want to highlight you that it could also take more than 20ms to program 400 locations. Remember, we don't have MAX numbers for flash program time. So, I would recommend you to add some buffer time.

    In short, faster your CAN rate, lesser the buffer size should be.

    Regards,
    Manoj