Can store program in OTP?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
User avatar
YedongWeng
Member
Posts: 8
Joined: Mon Sep 03, 2012 3:40 pm

Can store program in OTP?

Post by YedongWeng »

I would like to ask, how to store a small program in OTP without SPI-Flash?


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Hi,

You can store application code in the OTP using the xburn tool.
You will also have to blow a fuse to enable the Xcore from booting from the OTP.
After this it will ignore the mode pins for boot source selection!
User avatar
YedongWeng
Member
Posts: 8
Joined: Mon Sep 03, 2012 3:40 pm

Post by YedongWeng »

Bianco wrote:Hi,

You can store application code in the OTP using the xburn tool.
You will also have to blow a fuse to enable the Xcore from booting from the OTP.
After this it will ignore the mode pins for boot source selection!

thanks,

All the documents about OTP i had found from www.xmos.com, describe how to use the AES on OTP.
Where can I find some documents or demo code about how to stored application code on the OTP ?
How do I go to modify the boot load on OTP?
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

If you pass a .xe file to xburn then it will burn that executable to the OTP, e.g.

Code: Select all

xburn --target-file mytarget.xn myexecutable.xe
There isn't a separate document describing this but it is mentioned in the xburn command line manual: https://www.xmos.com/xburn-command-line ... ?support=1.

The OTP is only 8KB which limits the image size of the application you put there. If your application is slightly too big you may be able to compress your application so it fits (see https://github.com/xcore/tool_binary_compressor).
User avatar
YedongWeng
Member
Posts: 8
Joined: Mon Sep 03, 2012 3:40 pm

Post by YedongWeng »

richard wrote:If you pass a .xe file to xburn then it will burn that executable to the OTP, e.g.

Code: Select all

xburn --target-file mytarget.xn myexecutable.xe
There isn't a separate document describing this but it is mentioned in the xburn command line manual: https://www.xmos.com/xburn-command-line ... ?support=1.

The OTP is only 8KB which limits the image size of the application you put there. If your application is slightly too big you may be able to compress your application so it fits (see https://github.com/xcore/tool_binary_compressor).
Thanks for your help.And i will try it.

Now,i do not understand the code like:

Code: Select all

#define OTP_PORTS_INITIALIZER \
{ \
  XS1_PORT_32B, \
  XS1_PORT_16C, \
  XS1_PORT_16D \
}
Is there any documents described these ports?

Code: Select all

/// OTP control signals.
enum {
  OTP_CTRL_READ = 1 << 0,
  OTP_CTRL_STATUS = 1 << 5,
  OTP_CTRL_RESET_M = 1 << 13
};
Where can i find datasheets about these control signals?

What's the format of the MAC address stored on the OTP?
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

YedongWeng wrote: Now,i do not understand the code like:

Code: Select all

#define OTP_PORTS_INITIALIZER \
{ \
  XS1_PORT_32B, \
  XS1_PORT_16C, \
  XS1_PORT_16D \
}
Is there any documents described these ports?
Where can i find datasheets about these control signals?
What's the format of the MAC address stored on the OTP?
There is a 8KB OTP memory connected to each core. Each OTP memory can accessed from its local core using 3 ports. These ports are internal only (so you won't see them in the pinout given in the datasheet) and fixed (so the same 3 ports are always used for accessing the OTP). This initializer gives the resource IDs of the three ports.

Currently the there is no documentation on the OTP interface or the format in which MAC addresses, etc are written. Instead we provide xburn which can be used to write various things to the OTP via JTAG and the sc_otp module which can been used to read out the data written by xburn. Is there something you are want to do that isn't supported by this combination?
User avatar
YedongWeng
Member
Posts: 8
Joined: Mon Sep 03, 2012 3:40 pm

Post by YedongWeng »

richard wrote: Is there something you are want to do that isn't supported by this combination?
Thank you.

I want to store some read-only data in the OTP.If i use XBURN to store the data on OTP, and how can i read these data in the application.
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

YedongWeng wrote:
richard wrote: Is there something you are want to do that isn't supported by this combination?
Thank you.

I want to store some read-only data in the OTP.If i use XBURN to store the data on OTP, and how can i read these data in the application.
You can look at or use the sc_otp module as Richard has mentioned:
https://github.com/xcore/sc_otp

The static unsigned otp_read_word(otp_ports_t &ports, unsigned address) function in https://github.com/xcore/sc_otp/blob/ma ... rd_info.xc does what you need.