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.

TMS320F280049: Zero Boot Mode Select

Part Number: TMS320F280049


I am trying to get a F280049C microcontroller to boot to Flash without pullups on GPIO's 24 and 32 (Zero Boot Mode) but running into an error.

I found a post trying to accomplish the same task from January here: https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/655051?CCS-TMS320F280049M-TMS320F280049-How-to-set-Zero-Boot-Mode-Select-Pins-

I implemented the changes suggested to the .asm and .link.cmd files however CCS throws an error regarding the length of OTP_Boot being of length 0x1.  I changed it to length 0x3 and CCS successfully built the project.  I later found another post from August that made the same change to the length (http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/715617).

After I checked all my changes to the .asm and .link.cmd files, I am getting an error thrown when I go into Debug mode.  The code runs but only during a Debug session so it appears that the OTP isn't being set to automatically boot from Flash.  I turned on verbose mode for more information and I get the following output:

...

C28xx_CPU1: Writing buffered data @ Address 0x0007801C of Length 0x00000004

C28xx_CPU1: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.

C28xx_CPU1: Please make sure the memory location you are programming have not already been programmed.

...

 

I looked earlier in the output and it shows that CCS is writing Flash @ address 0x0007801c with length of 0x3.  So is any reason why CCS is attempting to rewrite this address which is where OTP_Boot value is located?  Is there some other setting(s) that aren't mentioned in the above 2 forum threads that also needs to be modified to always boot from Flash?  Also is the OTP actually "one time" programmable or can it be modified again (i.e. with the above error, is it still possible to correctly write the OTP to do a Zero Boot Mode or am I going to have to replace that microcontroller?)

Thanks.

  • Hello

    Are you seeing the expected programmed values when you view the memory at the OTP addresses? These OTP boot locations will only be used during standalone boot, not when debugger is connected.
    OTP is one time programmable, you won't be able to erase and re-program.

    Best regards
    Chris
  • Chris -

    Thanks for your reply.

    Christopher Chiarella said:
    Are you seeing the expected programmed values when you view the memory at the OTP addresses?


    I did a comparison of the microcontroller I attempted to rewrite the OTP on with one that had not been modified.  These values changed:

    Z1OTP-GPREG1 went from 0xFFFFFFFF to 0x5AFFFFFF

    Z1OTP-GPREG3 went from 0xFFFFFFFF to 0xFF48FF03

    Z1OTP-BOOTCTRL went from 0xFFFFFFFF to 0xFFFF46D0


    Based on the technical reference for the microcontroller, the 0x5AFFFFFF directs the microcontroller to boot in accordance with the boot table for boot mode 0 which is located in GPREG3 with a value of 0x03.  I did a few tests loading different GPIO toggle code loads into the microcontroller with the OTP modified and it appears to work when I apply external power from a power supply.  So it appears to be loading from Flash without any external pullups/pulldowns on GPIO24 & 32.

    Maybe I'm over looking that section of the technical reference but what is indicated by the additional changes to GPREG3 & BOOTCTRL (i.e. 0xFFFF... -> 0xFF48... and ...FFFF -> ....46D0)?

    Christopher Chiarella said:
    OTP is one time programmable, you won't be able to erase and re-program.

    So is the error I was getting most likely due to the fact I had already written the OTP once using the .asm and .link.cmd files and by leaving those directives in there CCS is simply indicating that it could not write that location again since it is a one-time shot?

    Also - is it preferable to use the .asm and .link.cmd files to write the OTP or is it recommended to use the On-Chip Flash to program the OTP?

    Thanks!

  • Hello

    Yes, those values look right for zero boot mode and booting to flash. GPREG3 and BOOTCTRL contain all values of the custom boot table. Technically everything should be Fs except for the 0x03 but since you programmed to have only the single boot mode, those other values won't matter. GPREG3 and BOOTCTRL form a 64-bit region where every byte is different boot mode, so if you used 3 boot pins, you can have 8 different boot modes.

    Yes I would agree that CCS programming error is due to fact that OTP is already written.
    I don't think one is preferable over the other, I think the on-chip flash utility is likely easier.

    Best regards
    Chris