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: C2000 bootloader

Part Number: TMS320F28335


Hello,

I assume that  i placed my code in C2000 FLASH AB sector, and copy  it  to CD sector by writing bootloader, How can I start directly from the CD sector when AB has problems? and can it be done?

Thanks

  • As shown in Table 6-22. Addresses of Flash Sectors in F28335, F28333, F28235 in page 162 of SPRS439N, the Boot-to-Flash Entry Point is fixed to 0x33 FFF6 - 0x33 FFF7 in sector A. This cannot be changed. When boot-to-flash option is chosen, this is the address the boot-ROM code would jump to.

     

  • I developed a bootloader program, In the program, I can determine whether the user program(use flash secotr A and B) is normal or not ,And backup user programs(use flash secotr D and E) to prevent program escalation failures.

    When the program upgrade fails I know a way to copy flash secotr D and E to the flash secotr A and B District a district reduction program ,But i  don't want to use 

    I want to know if there is a way to change the offset address of the program's contents when the backup program is implemented, and the program starts directly from the backup programs(use flash secotr D and E) ?

  • I don’t understand what you mean by "secotr A and B District a district reduction program". As explained in the previous post, boot-to-flash entry point is fixed in the boot-ROM and cannot be changed.

  • I know that boot-to-flash entry point is fixed .When DSP starts, The program will boot from the address 0x33 FFF6 - 0x33 FFF7 to my bootloader program.flash secotr A and B stored in the user program,flash secotr D and E stored in the user back-up program(copy from flash secotr A and B).
    I want to know if there is a way to change the offset address of the program's contents when the backup program is implemented, and the program starts directly from the backup programs(use flash secotr D and E) ?
  • I regret I don't understand the question. Perhaps if you could re-state your question with physical addresses (as an example), I may be able to help better. Are the contents in sectors A & B and C & D identical? And you want to execute from C & D and not A & B?
  • I think I may have an understanding of what you are asking. You have a custom bootloader in flash which which is executed upon reset. Your application is compiled and linked to execute in the memory locations encompassed by flash sectors A & B. At some point in time, you indicate to your bootloader that you have a new application to load. Prior to loading the new application to the flash, the bootloader copies the application from flash sectors A & B to flash sectors D & E as a backup in case the new application fails. In the case of a failure, you would like to have your bootloader branch directly to to your backup application, located at flash sectors C & D and execute in place at this offset in memory. You wish to do this, rather than copy the backup application back to the original flash sector A & B locations. You are concerned about the fact that your application was compiled and linked to execute from flash sectors A & B and you are asking if you need to do anything to have it execute instead from flash sectors C & D.

    Is this a valid summary of what you are asking? I'm afraid I'm rather new to the C28x and haven't looked deeply into the C28x instruction set yet (on my list...) to say if the compiler/linker creates position independent code. I don't believe there is a CPU register that can be set to provide an offset to execute position dependent code at some new location. As far as I've seen, but I may be incorrect, the C28x does not have a memory management unit that will allow you to map sections of memory to a new address.
  • I am aware of a feature where code could be loaded in one part of the memory and run from another (See page 32 of SPRU513N). If Tom's understanding of your problem is correct, c28x does not support such remapping of memory.
  • Yes, that's what I want to ask,But it wasn't what I wanted to achieve.I want to know, for example flash sectors A & B 0x3F66F0- 0x3F66F1 data is 0x007F and 0x7100,Convert program code to "LB 0x3F7100",What I want to know is whether you can change some of the program's jump addresses back to flash sectors D & E in this way, so that you can start directly from flash sectors D & E ?
  • Perhaps you could have two versions of your code. One linked for sectors A & B, another linked for sectors D & E and flash both of them. Normally, control would branch to sectors A & B. If your code detects a problem, it could branch to the start address in D & E.