I've got a custom Board with an XS1-A16A-128.
The Layout and peripherials is pretty close to the StartKit.
Debuging Programs works fine, but when I try to use the Flash I get the following Error:
Code: Select all
xflash: Error: F03096 Node "1" is configured to boot from SPI but no suitable device was found.
Thanks in advance,
JoeD
I've build a custom XN File for my board. It is based on the XN-File of the XS1-A16A.
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"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
<Type>Device</Type>
<Name>SensorBoard Device</Name>
<Declarations>
<Declaration>tileref tile[2]</Declaration>
<Declaration>tileref analog_tile</Declaration>
</Declarations>
<Packages>
<Package ID="0" Type="XS1-AnA-128-FB217">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS1-L8A-64" Oscillator="24MHz" SystemFrequency="500MHz">
<Boot>
<Source Location="SPI:bootFlash"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<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"/>
<Port Location="XS1_PORT_8A" Name="PORT_LED_SW"/>
</Tile>
</Node>
<Node Id="1" InPackageId="1" Type="XS1-L8A-64" Oscillator="24MHz" SystemFrequency="500MHz">
<Tile Number="0" Reference="tile[1]"/>
</Node>
<Node Id="2" InPackageId="2" Type="periph:XS1-SU" Reference="analog_tile">
<Service Proto="xs1_su_adc_service(chanend c)">
<Chanend Identifier="c" end="2" remote="31"/>
</Service>
</Node>
</Nodes>
</Package>
</Packages>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SPIFlash" Name="bootFlash" Type="S25FL204K">
<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>
<Links>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="XLG"/>
<LinkEndpoint NodeId="1" Link="XLF"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="XLH"/>
<LinkEndpoint NodeId="1" Link="XLE"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="XLE"/>
<LinkEndpoint NodeId="1" Link="XLH"/>
</Link>
<Link Encoding="5wire" Delays="0,1">
<LinkEndpoint NodeId="0" Link="XLF"/>
<LinkEndpoint NodeId="1" Link="XLG"/>
</Link>
<Link Encoding="5wire">
<LinkEndpoint NodeId="0" Link="XLC" Delays="52clk,52clk"/>
<LinkEndpoint NodeId="2" Link="XLC" Delays="1clk,1clk"/>
</Link>
</Links>
<JTAGChain>
<JTAGDevice NodeId="0"/>
<JTAGDevice NodeId="1"/>
<JTAGDevice NodeId="2"/>
</JTAGChain>
</Network>
Code: Select all
# The TARGET variable determines what target system the application is
# compiled for. It either refers to an XN file in the source directories
# or a valid argument for the --target option when compiling
TARGET = SensorBoard
# The APP_NAME variable determines the name of the final .xe file. It should
# not include the .xe postfix. If left blank the name will default to
# the project name
APP_NAME = Sensor-Test-Modul
# The USED_MODULES variable lists other module used by the application.
USED_MODULES =
# The flags passed to xcc when building the application
# You can also set the following to override flags for a particular language:
# XCC_XC_FLAGS, XCC_C_FLAGS, XCC_ASM_FLAGS, XCC_CPP_FLAGS
# If the variable XCC_MAP_FLAGS is set it overrides the flags passed to
# xcc for the final link (mapping) stage.
XCC_FLAGS_Debug = -O0 -g -lflash
XCC_FLAGS_Release = -O2 -g
# The XCORE_ARM_PROJECT variable, if set to 1, configures this
# project to create both xCORE and ARM binaries.
XCORE_ARM_PROJECT = 0
# The VERBOSE variable, if set to 1, enables verbose output from the make system.
VERBOSE = 0
XMOS_MAKE_PATH ?= ../..
-include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
Code: Select all
/*
* Sensor-Test-Modul.xc
*
* Created on: 01.09.2014
* Author: DJ32180
*/
//#include <stdio.h>
#include <timer.h>
#include <xs1.h>
#include <print.h>
port pLED1 = XS1_PORT_8A;
[[combinable]]
void flashing_led_task3(port p, int delay_in_ms) {
timer tmr;
unsigned t;
// Convert delay from ms to 100Mhz timer ticks
const int delay_ticks = delay_in_ms * 100000;
// The value we are going to output
unsigned val = 1;
//printf("Hello World3\n");
// read the initial timer value
tmr :> t;
while (1) {
select {
// This case will event when the timer moves past (t + delay_ticks) i.e
// delay_ticks after when we took the timestamp t
case tmr when timerafter(t + delay_ticks) :> void:
//val++;
val = val << 1;
if (val>0xF) val = 1;
p <: (0xF - val) ;
printstr("Value: ");
printuintln(val);
// set up the next event
t += delay_ticks;
break;
}
}
}
int main() {
flashing_led_task3(pLED1, 100);
return 0;
}