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.

TMS320F280049C: Setting Boot mode with hex file

Part Number: TMS320F280049C


Hi All,

in out production the microcontroller (TMS320F280049C) used on our electronics needs to be flashed with a .hex file containing a bootloader and also the Boot mode has to be set by flashing the GPREG and the OTPBOOTCTRL/GPREG3 to boot to the correct location in the flash. The procedure doing this is also including some additional data like serial number in the flashing process so each controller also already receives the unique number in the flash. To select the correct boot mode I always used the following lines of code in an .asm file and in the Linker file:

.sect "OTP_KEY_SECT"
.int 0x5AFF

.sect "OTP_BMODE_SECT"
.int 0xFFFF

.sect "OTP_BOOT_SECT"
.int 0xFF03

Linker:

OTP_BMODE : origin = 0x07800C, length = 0x000001
OTP_KEY : origin = 0x07800D, length = 0x000001
OTP_BOOT : origin = 0x07801C, length = 0x000001

OTP_BMODE_SECT : > OTP_BMODE, PAGE = 0
OTP_KEY_SECT : > OTP_KEY, PAGE = 0
OTP_BOOT_SECT : > OTP_BOOT, PAGE = 0

This worked always when I used the .out file to program the devices but when I want to change to .hex file it seems to fail. The weird thing is that it generates the following output in the .hex file:

:020000040007F3
:01800C00FF74
:01800D00FF73
:01801C000360

It seems like the compiler puts only one of the bytes in the desired address and throws away the remaining part. Could someone please explain what I am doing wrong here? To my understanding .int in an .asm file should translate to a 16 Bit value but it seems like there is something wrong. I also tried some other ways with .long or .byte but nothing worked for me.

Best regards

Wolfgang