Is it possible to control SPI flash bootload address?

Technical questions regarding the XTC tools and programming with XMOS.
Vlad
Junior Member
Posts: 6
Joined: Wed Sep 04, 2013 1:45 pm

Is it possible to control SPI flash bootload address?

Post by Vlad »

Hello,

I need to have an ability to load program/data to XMOS chip from different SPI flash
addresses. As far as I understood from specs and from some topics of this forum the
data is read from flash address 0x0, after power is on.

But for example I want to update firmware via Ethernet, and during this process power
is off, so everyone in troubles then.

From other hand if I can control bootload address and I have a copy of firmware image
at some flash address, I can reprogram flash as many times as it's required, and as soon as
firmware is changed successfully, I just change boot address to a new one.

The second option I guess could be updating just some flash memory regions with main
program without touching bootloader program located at address 0x0. But I didnt find how
to pass control from booloader to main program, where some tiles and ports must change
completely their functionality. Theoretically it is just changing pc pointer, but there is no
examples or documents how to do it (((.

The third option probably is to use the OTP, but I'd like to manage with this task without OTP
if it is possible, and I still don't understand how pass control from OTP program to flash program.

Many thanks for any idea and help in advance
Vlad


richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

Is there any reason you can't use xflash's support for upgrade images (see the Design and manufacture systems with flash memory)? It would seem to solve exactly the problem you describe.

Using this scheme, the device firsts boot a small bootloader (the flash loader) that is located at address 0 of flash. The flash loader proceeds to search the rest of the flash for upgrade images before booting the upgrade image with the highest version number. If there is a problem writing an upgrade image (e.g. you lose power halfway through), the flash loader will spot that the CRC of the upgrade image is invalid and fallback to the next highest version it can find.
Vlad
Junior Member
Posts: 6
Joined: Wed Sep 04, 2013 1:45 pm

Post by Vlad »

Thank you for this link Richard, I will look through it