XU208 reference design? how to?

New to XMOS and XCore? Get started here.
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

XU208 reference design? how to?

Post by rengar »

How to port the reference design code (v8.1.0) to XU208?
I tried following application note AN01027, fail, it is very old, functions are broken.
Isn't configuring the ports in the .XN file enough?
I noticed that when updating the libs the code also breaks...
It seems very confusing.

regards.
User avatar
Ross
Verified
XCore Legend
Posts: 1119
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

That app note refers to v6 so it relates to a couple of major versions off the latest (we use fairly strict semantic versioning so some major incompatibilities should be expected)

It should be just a case of making sure all the TILE defines (e.g. AUDIO_IO_TILE, XUD_TILE) are set to 0 and having a correct xn file.

You'll have to give us a bit more information on what you mean by "functions are broken" and the lib updating issue.
Technical Director @ XMOS. Opinions expressed are my own
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

Ross wrote: Thu Oct 10, 2024 3:24 pm It should be just a case of making sure all the TILE defines (e.g. AUDIO_IO_TILE, XUD_TILE) are set to 0 and having a correct xn file.
That was it, thks! :D

reference design v8.1
XTC tools v15.3

but there are warnings about the USB ports.
build.png
Attached is my .XN file.
xu208_128_tq64.xn
I added this config in the Makefile to set 2in/2out I2S, is that enough?

Code: Select all

INCLUDE_ONLY_IN_2i2xu208 = 
XCC_FLAGS_2i2xu208 = $(BUILD_FLAGS)  -DI2S_CHANS_ADC=2 \
			             -DI2S_CHANS_DAC=2 \
				     -DNUM_USB_CHAN_IN=2 \
				     -DNUM_USB_CHAN_OUT=2
regards.
You do not have the required permissions to view the files attached to this post.
Last edited by rengar on Fri Oct 11, 2024 5:47 am, edited 1 time in total.
User avatar
Ross
Verified
XCore Legend
Posts: 1119
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You can safely ignore those warnings, those ports are used internally to connect the xcore ports to the USB phy. The tools don't currently recognise this internal usage.
Technical Director @ XMOS. Opinions expressed are my own
User avatar
Ross
Verified
XCore Legend
Posts: 1119
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

On the channel count question it really depends on the specification of the product you're trying to produce (and how many pins you have left on the device you've selected)
Technical Director @ XMOS. Opinions expressed are my own
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

Ross wrote: Fri Oct 11, 2024 11:03 am You can safely ignore those warnings, those ports are used internally to connect the xcore ports to the USB phy. The tools don't currently recognise this internal usage.
ok. thanks! :)

another change is SQI to SPI flash (MX25L1606E).
Is the Device Type in the XN file compatible?

FILE .XN

Code: Select all

            <!-- 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" />
            ...
            <Device NodeId="0" Tile="0" Class="SPIFlash" Name="bootFlash" Type="MX25L1005C" PageSize="256" SectorSize="4096">
      	    	<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>
Makefile
BUILD_FLAGS
removed -lquadflash -DXUA_QUAD_SPI_FLASH=1
ADD -lflash

Pin config
boot_config_pins.png

BUILD to .bin

Code: Select all

xflash --factory app_usb_xu208_tq64_2i2xu208.xe --boot-partition-size 0x80000 --noinq -o xu208.bin
Something wrong or missing?
The device isn't detected in the s.o.
You do not have the required permissions to view the files attached to this post.
Last edited by rengar on Mon Oct 14, 2024 2:24 am, edited 2 times in total.
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

A few more tries...

A new simple blink led "project" to identify if the error is with the spi flash.

3 files only:
  • main.xc
  • Makefile
  • XN file XU208

Code: Select all

###### MAIN.XC #######
#include <xs1.h>
#include <stdio.h>
#include <platform.h>
#include <flash.h>
#include <timer.h>

on tile[0] : out port led1 = XS1_PORT_1A;

int main()
{
    while (1)
    {
          led1 <: 0;
          delay_milliseconds (1000);
          led1 <: 1;
          delay_milliseconds (1000);
    }
    return 0;
}

Code: Select all

###### MAKEFILE #######
TARGET = xu208_128_tq64.xn

BUILD_FLAGS = $(EXTRA_BUILD_FLAGS) -fcomment-asm -O3 -report -lflash -g -march=xs2a

USED_MODULES = 

XCC_FLAGS_led = $(BUILD_FLAGS)

XMOS_MAKE_PATH ?= ../..
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
It doesn't work... :(
Without much hope, I tried to change the file XMOS/target/include/SpecMacros.h with some data from the Macronix flash datasheet.

Code: Select all

#define FL_DEVICE_MACRONIX_MX25L1005C \
{ \
    MACRONIX_MX25L1005C, \
    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 */ \
    0x52,                  /* 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 */ \
    0x03,                  /* FAST_READ cmd */ \
    0,                     /* 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 */ \
}
Set the Type field in the XN file:

Code: Select all

 <Device NodeId="0" Tile="0" Class="SPIFlash" Name="bootFlash" Type="MACRONIX_MX25L1005C" PageSize="256" SectorSize="4096" NumPages="8192">
As a last attempt, measure some signal on the MISO MOSI SCLK pins.
mcu defective?
Attached images
You do not have the required permissions to view the files attached to this post.
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

Device descriptor error?
Windows / Linux
With or without the flash, the error is the same...
Apparently the firmware is not loading.
You do not have the required permissions to view the files attached to this post.
Last edited by rengar on Thu Oct 17, 2024 7:51 pm, edited 1 time in total.
User avatar
Ross
Verified
XCore Legend
Posts: 1119
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Can you run your LED program and usb audio program successfully with xrun?

im confused if this is a flash boot problem, a general program execution issue or a USB problem.

Is this running on custom hardware?
Technical Director @ XMOS. Opinions expressed are my own
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

Ross wrote: Fri Oct 18, 2024 10:41 pm You can run your LED program and usb audio program successfully with xrun?

im confused if this is a flash boot problem or a general program execution issue.

Is this running on custom hardware?
yep, custom hardware.
I asked a friend for help, and completed my tests... the mcu has a problem, not load the firmware.
Thank you for your attention.
I will take advantage of the bad situation, and buy the XU316 and start a new prototype journey.

regards.