My minimal project:
* Reference Design v8.1.0
* XTOOLS v15.2.1 (recommended)
Following the documentation I got here, but it doesn't load the firmware.
I don't know how to check if the mcu is blocked by OTP.
xu208_128_tq64.xn
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ManuallySpecifiedRouting="true">
<Type>Device</Type>
<Name>xu208tq64</Name>
<Declarations>
<Declaration>tileref tile[1]</Declaration>
<Declaration>tileref usb_tile</Declaration>
</Declarations>
<Packages>
<Package id="0" Type="XS2-UnA-128-TQ64">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS2-L8A-128" Oscillator="24MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="SPI:bootFlash" />
</Boot>
<Tile Number="0" Reference="tile[0]">
<!-- SPI FLASH PORTS -->
<Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO" />
<Port Location="XS1_PORT_1B" Name="PORT_SPI_SS" />
<Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK" />
<Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI" />
</Tile>
</Node>
<Node Id="1" InPackageId="1" Type="periph:XS1-SU" Reference="usb_tile" Oscillator="24MHz">
</Node>
</Nodes>
<Links>
<Link Encoding="5wire">
<LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk" />
<LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk" />
</Link>
</Links>
</Package>
</Packages>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SPIFlash" Name="bootFlash">
<Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO" />
<Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS" />
<Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK" />
<Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI" />
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0" />
</JTAGChain>
</Network>
main.xc
Code: Select all
#include <timer.h>
#include <platform.h>
port p = XS1_PORT_1L;
int main() {
while (1) {
p <: 0;
delay_milliseconds(1000);
p <: 1;
delay_milliseconds(1000);
}
return 0;
}
Makefile
Code: Select all
TARGET = xu208_128_tq64.xn
APP_NAME =
BUILD_FLAGS = $(EXTRA_BUILD_FLAGS) -O3 -report -lflash -g -march=xs2a
USED_MODULES =
XCC_FLAGS_1gpio = $(BUILD_FLAGS)
XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
MX25L1606E.spec DATASHEET
Code: Select all
14, /* libflash device ID */ \
256, /* Page size */ \
8192, /* Number of pages */ \
3, /* Address size */ \
8, /* Clock divider */ \
0x9F, /* RDID cmd */ \
0, /* RDID dummy bytes */ \
3, /* RDID data size in bytes */ \
0xC22015, /* RDID data */ \
0x20, /* SE cmd */ \
0, /* SE full sector erase */ \
0x06, /* WREN cmd */ \
0x04, /* WRDI cmd */ \
PROT_TYPE_SR, /* Protection type */ \
{{0x0C, 0x00},{0,0}}, /* SR protect and unprotect values */ \
0x02, /* PP cmd */ \
0x0B, /* FAST_READ cmd */ \
1, /* FAST_READ dummy bytes */ \
SECTOR_LAYOUT_REGULAR, /* Sector layout */ \
{4096,{0,{0}}}, /* Sector sizes */ \
0x05, /* RDSR cmd */ \
0x01, /* WRSR cmd */ \
0x01, /* WIP bit mask in SR */ \
build
bin generate
Code: Select all
xflash --factory app_1gpio_xu208_1gpio.xe --boot-partition-size 125000 --noinq --spi-spec MX25L1606E.spec -o xu208.bin