XFLASH --s2l-partition-size settings

Technical questions regarding the XTC tools and programming with XMOS.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

XFLASH --s2l-partition-size settings

Post by bearcat »

I am a little unclear as to the correct setting for this parameter. The manual didn't help much.

I used the memory size - boot loader size (I believe that was the number listed). Which worked out to be 48496. This worked. Is that the correct parameter, or is some 2^ alignment what should be used, or just the boot loader size? Maybe some extra amount?

How does this effect the factory partition size? I had to bump it up also. In my case, my flash size is plenty big enough, so not an issue there.


colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

The default space allocated for the stage2loader is 0x1000 bytes (0x4000 for secure boot). When xflash compiles the stage2loader it performs a constraints check to verify the s2l is within this size. If not, a F03010 error message is displayed with the constraints check info preceeding the error.
i.e.
Constraint check for "tile[0]" (node "0", tile 0):
Cores available: 8, used: 1+. MAYBE
Timers available: 10, used: 1+. MAYBE
Chanends available: 32, used: 0+. MAYBE
Memory available: 4096, used: 4796+. FAILED
(Stack: 336+, Code: 3750, Data: 710)
Error: Constraints check FAILED for tile[0].
Error: F03010 Failed to compile stage two loader.

From the Memory available info, you can take the used value (or any value bigger than this) and supply this as the value to --s2l-partition-size

i.e.
xflash --s2l-partition-size 0x12BC (4796).

By increasing the size of the s2l partition, the amount of space in the boot partition for the factory image is reduced by the increased amount. Also note that the s2l runs at the top of memory on the tile performing the boot from flash. If the s2l increases in size, the amount of space available for the application being booted to run on the this tile is also reduced.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Thanks colin for the better explanation. I had it wrong. Will try it again.