I am having trouble finding my mistake on this one.
For my master's thesis I am trying to build a 32 channel PDM to USB interface based on the mic array example code. The example code is written for a XUF216 but I want to use a XUF232, because the XUF216 does not provide enough cores for processing 32 PDM inputs and transferring them via USB.
In my project I tried to replace old .xn file for the XUF216 and replace it with the .xn file for the XUF232. The "XUF232-1024-FB374-C40.xn" contains the following:
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>XUF232-1024-FB374-C40 Device</Name>
<Declarations>
<Declaration>tileref tile[4]</Declaration>
<Declaration>tileref usb_tile</Declaration>
<!--
<Declaration>tileref usb_tile[2]</Declaration>
-->
</Declarations>
<Packages>
<Package id="0" Type="XS2-UFnA-1024-FB374">
<Nodes>
<Node Id="0" InPackageId="0" Type="XS2-L12A-512" Oscillator="24MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="bootFlash0"/>
<Bootee NodeId="2"/>
</Boot>
<Tile Number="0" Reference="tile[0]">
<Port Location="XS1_PORT_1B" Name="PORT_SQI_CS_0"/>
<Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK_0"/>
<Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO_0"/>
</Tile>
<Tile Number="1" Reference="tile[1]">
<!-- USB connections on tile[1] -->
<Port Location="XS1_PORT_1H" Name="PORT_USB_TX_READYIN"/>
<Port Location="XS1_PORT_1J" Name="PORT_USB_CLK"/>
<Port Location="XS1_PORT_1K" Name="PORT_USB_TX_READYOUT"/>
<Port Location="XS1_PORT_1I" Name="PORT_USB_RX_READY"/>
<Port Location="XS1_PORT_1E" Name="PORT_USB_FLAG0"/>
<Port Location="XS1_PORT_1F" Name="PORT_USB_FLAG1"/>
<Port Location="XS1_PORT_1G" Name="PORT_USB_FLAG2"/>
<Port Location="XS1_PORT_8A" Name="PORT_USB_TXD"/>
<Port Location="XS1_PORT_8B" Name="PORT_USB_RXD"/>
<!-- Audio Ports -->
<Port Location="XS1_PORT_4D" Name="PORT_PLL_REF"/>
<Port Location="XS1_PORT_1O" Name="PORT_MCLK_IN"/>
<Port Location="XS1_PORT_4E" Name="PORT_I2C"/>
<Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
</Tile>
</Node>
<Node Id="2" InPackageId="2" Type="XS2-L12A-512" Oscillator="24MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
<Boot>
<Source Location="LINK" BootMode="4"/>
</Boot>
<Tile Number="0" Reference="tile[2]">
<!-- Global PDM Clock -->
<Port Location="XS1_PORT_1E" Name="PORT_PDM_CLK"/>
<!-- PDM Mics 1-16 -->
<Port Location="XS1_PORT_8B" Name="PORT_PDM_DATA_01_TO_08"/>
<Port Location="XS1_PORT_8A" Name="PORT_PDM_DATA_09_TO_16"/>
<Port Location="XS1_PORT_1F" Name="PORT_PDM_MCLK"/>
</Tile>
<Tile Number="1" Reference="tile[3]">
<!-- PDM Mics 17-32 -->
<Port Location="XS1_PORT_8B" Name="PORT_PDM_DATA_17_TO_24"/>
<Port Location="XS1_PORT_8A" Name="PORT_PDM_DATA_25_TO_32"/>
<Port Location="XS1_PORT_1F" Name="PORT_PDM_MCLK"/>
</Tile>
</Node>
<Node Id="1" InPackageId="1" Type="periph:XS1-SU" Reference="usb_tile" Oscillator="24MHz">
</Node>
<!-- Commented this out after setting usb_tile[2] to usb_tile
<Node Id="3" InPackageId="3" Type="periph:XS1-SU" Reference="usb_tile[1]" Oscillator="24MHz">
</Node>
-->
</Nodes>
<Links>
<Link Encoding="5wire" Delays="3clk">
<LinkEndpoint NodeId="0" Link="7"/>
<LinkEndpoint NodeId="2" Link="0"/>
</Link>
<Link Encoding="5wire" Delays="3clk">
<LinkEndpoint NodeId="0" Link="4"/>
<LinkEndpoint NodeId="2" Link="3"/>
</Link>
<Link Encoding="5wire" Delays="3clk">
<LinkEndpoint NodeId="0" Link="6"/>
<LinkEndpoint NodeId="2" Link="1"/>
</Link>
<Link Encoding="5wire" Delays="3clk">
<LinkEndpoint NodeId="0" Link="5"/>
<LinkEndpoint NodeId="2" Link="2"/>
</Link>
<Link Encoding="5wire">
<LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk"/>
<LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk"/>
</Link>
<!-- Commented this out after setting usb_tile[2] to usb_tile
<Link Encoding="5wire">
<LinkEndpoint NodeId="2" Link="8" Delays="52clk,52clk"/>
<LinkEndpoint NodeId="3" Link="XL0" Delays="1clk,1clk"/>
</Link>
-->
</Links>
</Package>
</Packages>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash0" Type="S25LQ016B" PageSize="256" SectorSize="4096" NumPages="8192">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS_0"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK_0"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO_0"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0"/>
<JTAGDevice NodeId="2"/>
</JTAGChain>
</Network>
I also changed the target in the Makefile. My File looks as follows:
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 = XUF232-1024-FB374-C40
# 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 = PDM_USB
#### Original build flags with xscope option
# BUILD_FLAGS = -DFLASH_MAX_UPGRADE_SIZE=64*1024 -fcomment-asm -Xmapper --map -Xmapper MAPFILE -Wall -O3 -report -lquadflash -fsubword-select -save-temps -g -fxscope -DXSCOPE -DSDA_HIGH=2 -DSCL_HIGH=1 -DXUD_SERIES_SUPPORT=4 -march=xs2a -DUSB_TILE=tile[1] -DADAT_TX_USE_SHARED_BUFF=1 -DQUAD_SPI_FLASH=1 -Wno-timing
#### Build flags without xscope option
BUILD_FLAGS = -DFLASH_MAX_UPGRADE_SIZE=64*1024 -fcomment-asm -Xmapper --map -Xmapper MAPFILE -Wall -O3 -report -lquadflash -fsubword-select -save-temps -g -DSDA_HIGH=2 -DSCL_HIGH=1 -DXUD_SERIES_SUPPORT=4 -march=xs2a -DUSB_TILE=tile[1] -DADAT_TX_USE_SHARED_BUFF=1 -DQUAD_SPI_FLASH=1 -Wno-timing
# The USED_MODULES variable lists other module used by the application.
USED_MODULES = lib_logging lib_mic_array module_dfu module_i2c_shared module_i2c_single_port module_usb_device module_usb_shared module_xud
# 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 = $(BUILD_FLAGS) -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
MODULE_LIBRARIES = xud_x200
XMOS_MAKE_PATH ?= ../..
-include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
As a first step I tried to run a single 16 channel pdm receiver + decimator plus the application on tile[2] (this requires a total of 7 cores). The XUF232 should provide 8 cores per tile, but the build fails with this message:
Code: Select all
Creating PDM_USB.xe
Constraint check for tile[0]:
Cores available: 6, used: 1 . OKAY
Timers available: 10, used: 1 . OKAY
Chanends available: 32, used: 0 . OKAY
Memory available: 262144, used: 4468 . OKAY
(Stack: 348, Code: 3148, Data: 972)
Constraints checks PASSED.
Constraint check for tile[1]:
Cores available: 6, used: 6 . OKAY
Timers available: 10, used: 8 . OKAY
Chanends available: 32, used: 18 . OKAY
Memory available: 262144, used: 52268 . OKAY
(Stack: 4028, Code: 34508, Data: 13732)
Constraints checks PASSED.
xmap: Warning: More than 6 cores used on a tile. Ensure this is not the case on tile running XUD.
Constraint check for tile[2]:
Cores available: 6, used: 7 . FAILED
Timers available: 10, used: 7 . OKAY
Chanends available: 32, used: 17 . OKAY
Memory available: 262144, used: 17180 . OKAY
(Stack: 3692, Code: 9196, Data: 4292)
Error: Constraints check FAILED for tile[2].
Constraint check for tile[3]:
Cores available: 6, used: 1 . OKAY
Timers available: 10, used: 1 . OKAY
Chanends available: 32, used: 0 . OKAY
Memory available: 262144, used: 4460 . OKAY
(Stack: 348, Code: 3148, Data: 964)
Constraints checks PASSED.
xmake[1]: *** [bin//PDM_USB.xe] Error 1
xmake: *** [bin//PDM_USB.xe] Error 2
Any help is greatly appreciated. I tried for hours to find the mistake but did not have success.