Page 1 of 1

How to boot second Core from first Core?

Posted: Mon Jan 18, 2010 3:43 am
by tonyshao
Our application have three part, image A,B,C. We called image A as bootloader, image B and C as application, Image A run on first Core and boot from external SPI flash, and first Core boot Image A or B to second core depends on a external signal, for example, first core receive a commnad from Host through USB interface or first core read external I/O status.

SPI flash Image:
|first sector | second sector | third sector |
| image A | image B | image C |

How to write the bootloader, anybody can help me?

Re: How to boot second Core from first Core?

Posted: Tue Jan 19, 2010 10:19 am
by trousers
The easiest way to do this would be to boot the first system from SPI as if it was the only one then, when you've got a signal from USB, boot the other over an xlink using an image stored in flash. The boot ROM allows a boot-from-link start for both L1 and G4; libflash gives you easy access to the flash.

The disadvantage of this is that you'd have configure the xlink manually, and manually set up any channels you want to use between the two cores after the second core has booted. This is unlikely to be pretty.

xobjdump is able to extract a bootable image that can be sent over a link. It would need only a length word and a CRC adding during transmission.

An alternative would be to boot their pair of them from a single flash (the tools support this). The initial program on the second core would then be able to dynamicaly load and execute code sent to it over a link. This has the advantage that the xmos tools will handle xlink initialisation and channel instantiation but requires some very with setting up the machine context during dynamic code loading.

Which is best would depend on your application, particularly what kind of communiction they'll be between the two cores once booted.

Re: How to boot second Core from first Core?

Posted: Thu Jan 21, 2010 4:28 am
by tonyshao
Thanks Awesome_pants.