Does anyone know how to program the OTP in 28035? i'm trying to use a SPI bootloader and I need a bit changed for it to work. Thanks,
Amuliu
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.
Does anyone know how to program the OTP in 28035? i'm trying to use a SPI bootloader and I need a bit changed for it to work. Thanks,
Amuliu
The OTP programs the same as FLASH except that it cannot be erased.
You can program it in-system using the FLASH API.
You should also be able to program it by defining a section within your program and setting constant data to that section.
In SECTIONS of the linker command file you could put:
myotp : > OTP PAGE 0
Then in your program you can put:
#pragma DATA_SECTION(otpdata,"myotp");
const Uint16[4] = {0x1, 0x2, 0x3, 0x4};
The above will cause the program to allocate the 4 words to the section "myotp" which the linker will then place into OTP block.
Caution: check the linker map file to make sure you that the locations are what you want where you want. OTP begins at 0x3D7800 and ends at 0x3D7BFF.
When you load the program the OTP will be programmed along with the FLASH. (I haven't done this myself - I use in-system programming - but it should work). Just remember that once you program OTP locations with a zero bit you can never go back)
Depending on what you are doing you may find it better to program the OTP through a small program derived from the flash API examples.
If you are trying to program OTP_KEY and OTP_BMODE locations for the boot rom then you can modify the linker command file to create a block for each of these (they are the last two words of the OTP block) and then you can define them with a #pragma data section. This is similar to the way "BEGIN" is defined.
Hope this helps.
Hi Wally Ritchie,
I am trying to program the OTP sector of TMS320F2808 to add certain functions of my software following the steps mentioned below:
1. Created sections in OTP memory in the .cmd file
2. Used #pragma to allocate the said functions in the respective .c file
3. Created .out and verified using .map file that the functions are being allocated to the memory location listed in .cmd file
4. Created .hex from .out using hex2000.exe
5. Created .bin from .hex for flash and otp
Here in the 4th step, the hex file doesn't contain the OTP bytes. Also, in the otp.bin I can see all FFs instead of function program bytes.
How do I create a correct .hex file from the .out so that the OTP bytes are also included in the .hex which will eventually enable me to create a combiined .bin of flash.bin and otp.bin?
Kindly help
PS: I have already tried all the options available for hex2000.exe.
Hi Nitin,
For any new questions (especially if they are not exactly related), please create a new forum thread.
Thank you,
Brett