How to program HEX file to OTP mem with SmartSnippets?

2 posts / 0 new
Last post
Jack Zhang
Last seen: 4 days 18 hours ago
Joined: 2019-01-17 06:45
How to program HEX file to OTP mem with SmartSnippets?

When I finish debugging my software, I want to download firmware to the OTP of chip. I plan to download the firmware to the chip by UART, for example, can I use the the pins of P0.4 and P0.5 to connect to my PC?  do you have any guidelines about hardware connection and software operation? Thank you!

Last seen: 11 hours 37 sec ago
Joined: 2018-02-08 11:03
Hi Jack Zhang,

Hi Jack Zhang,

I would strongly recommend you to use the latest version of the SmartSnippets studio, which is version 2.0.8.Through the studio, you could open the latest version of SmartSnippets toolbox.  The OTP has 3 areas where the user can burn data:

  • The OTP image area, where the user code is placed and mirrors to the sysram at boot.
  • The OTP NVDS area, where the NVDS structure is populated with the OTP at boot.
  • The OTP Header area, where flags and specific values that define the operation of the device are placed (more information regarding the values of the OTP Header can be found in the Smart Snippets User guide).

When the user tries to burn the OTP he have to make sure that the programming voltage is clean and must not exceed 6.8V. Also the 6.8V can only be applied to VPP after the VBAT3V is supplied and must be removed from VPP before the VBAT3V is removed, otherwise the chip could be damaged.

In order to burn the OTP with the most common configuration please follow the below instructions:

  • Open Smart Snippets either via JTAG or UART and hit open.
  • From the tool bar button choose the OTP programmer in order to open 3 different tabs, one for each OTP area.
  • Choose the OTP image tab and on the left tab browse to the .hex file you would like to burn and hit Burn.
  • As soon as the last step is complete you will have burned your custom's board OTP. Some additional configurations are required in order for your device to boot from it.

Go to the OTP Header tab.

  • Change both of the application flags to YES (this is required in order to start the booting from OTP, when one does that the primary bootloader is disabled - scan of the peripherals for valid image, the user can reprogram his board using JTAG only).
  • Hit the burn Button in order to burn the configuration to the OTP Header.

Some additional information about the OTP. When the OTP is burned and the application flags on the OTP header are also burned, the primary bootloader is disabled so the scanning procedure doesn't take place, thus you will not be able to boot from the SPI or UART or I2C. You will be able to directly burn your sysram though via JTAG as long as the OTP header field called JTAG enable flag stays Enabled. Also, OTP stands for One Time Programmable, thus you can’t erase and re-write the OTP multiple times, but you can only flip the bits that are still set to 0 and turn them to 1.

Thanks, PM_Dialog