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.

TMS320F28374S: How to configuration the two CMD file of bootloader and application program

Part Number: TMS320F28374S

Hi Expert,

Customer meet a problem that

  • The system could not work normally, if re-power the board after bootloader process;
  • The system could work normally, if keep to run the board after bootloader process.

The background is customer divide the bootloader program and application program separately while means there're two different CMD files.

Finally, they found the RAM definition is different in two CMD file, one is for data memory, the other is for program memory, and solved this problem by synchronizing these two RAM as the same function.

Could you please help to answer customer's questions? Thanks!

  • how to configuration these two CMD file, if there's any attention need to take care?
  • for the production boards, how to fix the problem, write "0" to RAM, then boot the application code?

For the below files, the left is the issue CMD file, while the right is the correct file.

Best Regards

Rayna

  • Hi Rayna,

    If your final application running on the MCU is split into 2 CCS projects, you need to make sure that you are not using the same memory regions by the 2 projects as one might overwrite what the other has written. The best way is to divide the memory across these 2 projects and use only the allocated memory in the respective projects. Same is the case for Flash memory as well.

    Rayna Wang said:
    for the production boards, how to fix the problem, write "0" to RAM, then boot the application code?

    Can you please explain this question. The boot mode is usually selected using the boot select pins on the board

    Regards,

    Veena

  • Hi Veena,

    What I mean is that if bootloader program could not change in the production board, could use application program to erase RAM memory to solve this issue?

    Or is there any other effective method to solve the issue, in case the bootloader program could not be changed?

    Thanks!

    Beat Regards

    Rayna 

  • The auto init routine that comes from compiler will take care of initializing the RAM used by the program. both bootloader and application will have this routine linked.

    Do you want to initialize the whole RAM or only the locations used for variables ?

  • Hi Veena and Baskaran,

    These are not 2 application projects, but one is bootloader program used to boot the application program. Both the two program have their own CMD file, which defines the memory separately, so occurs the same RAM zone is defined as both page 0 and page1.

    For the production machine, the bootloader program was already downloaded into the device, customer wonder how to fix the issue, if initialize the RAM, whole or part could solve this issue?

    Thanks!

    Best Regards

    Rayna

    initialize 

  • Hi Rayna,

    As Baskaran mentioned in his post, the auto init routine in the application program initializes all the RAM memories which is used by the application code. If the same RAM location was used by the bootloader code, it will be overwritten.

    Note that the zero initialization of uninitialized variables is done only if you are using the EABI format. If using the COFF format, the uninitialized variables will retain the old values. If the variables are explicitly initialized, both EABI and COFF compiler will initialize them.

    Regards,

    Veena

  • Hi Veena,

    Thanks for your explanation.

    However, I still confused if the overwrite RAM method could solve the bootloader issue? Could you please kindly help to clarify it? Thanks!

    Best Regards

    Rayna

  • Hi Rayna,

    May be I did not understand the problem correctly. Let me know if my understanding is correct.

    The device has bootloader application pre-loaded and you are switching to the application code after bootloader. The application code is using some RAM locations. These will be initialized by the application's auto init routine.

    Can you explain a bit about the bootloader issue you are facing?

    Regards,

    Veena