XU208 reference design? how to?

New to XMOS and XCore? Get started here.
User avatar
valtechX
New User
Posts: 2
Joined: Wed Oct 23, 2024 7:13 pm

Post by valtechX »

Hi
I'm having a similar problem with custom hardware.
I had this mentioned error on Linux/Windows.

Code: Select all

device descriptor read/64 error -71
device not responding to setup address
1v0 PS failure

To test:
  • removed the 1v0 PS and used the bench PS, first power on 1v0.
    stand by = 1v0@45-50mA - I believe it is as expected.
  • after, connected the usb cable that powers the 3v3 regulators.
    usb connected = 1v0@125-130mA - I believe it is as expected.
Fixed. No more errors, but it doesn't detect the device.

Question:
  1. The mcu does not load the firmware by SPI? is it blocked by OTP? or is it mandatory to use QSPI?
Please, can any forum moderator post a reliable minimal project example with mcu(XU208-128-TQ64) and SPI! to check all these questions.
Blink led is enough.

Thanks for attention.
rengar
Member
Posts: 8
Joined: Wed Oct 09, 2024 4:55 am

Post by rengar »

Your reply motivated me to work again.

Thanks for this
valtechX wrote: Wed Oct 23, 2024 8:15 pm 1v0 PS failure
Replaced the 1v reg, and no errors in dmesg!
Either way, the device is not detected :(

I tried with the M25P40 eeprom, already tested on the XS1 and it works perfectly, so it should be compatible. But it didn't work with xu208.
Let's wait for an answer from some expert about why the firmware is not loaded.
User avatar
Ross
Verified
XCore Legend
Posts: 1117
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.
Still waiting on this. Need to debug one issue at a time.
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 24, 2024 1:06 am
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.
Still waiting on this. Need to debug one issue at a time.
Sorry, don't have XTAG to debug with xrun. But have more details:

I received firmware for testing from the supplier, and a beautiful USB Audio works perfectly :D
Flash the file.bin in different SPI eeproms like Macronix, Winbond and Atmel, of different sizes... and they all work perfectly.

Conclusion:
My hardware design is working with SPI boot.

I noticed a difference in the firmware that works, it starts before 0x80, my build, it is always after.
Does this have any relevance?
hexafirmware.png
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 »

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

Code: Select all

 xmake CONFIG=1gpio
bin generate

Code: Select all

xflash --factory app_1gpio_xu208_1gpio.xe --boot-partition-size 125000 --noinq --spi-spec MX25L1606E.spec -o xu208.bin
User avatar
Ross
Verified
XCore Legend
Posts: 1117
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

My guess is the device is locked down and the working binary is encrypted.

You didn't share much, but it looks encrypted.

Code: Select all

xflash --analyze
will confirm

expect something like:

Code: Select all

$ xflash --analyze a.bin  
xflash: Warning: F03151 --key not given, unable to decrypt and authenticate secure image.
.. etc.
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 25, 2024 12:47 am My guess is the device is locked down and the working binary is encrypted.

You didn't share much, but it looks encrypted.
Results:
Firmware that is loaded.

Code: Select all

$ xflash --analyze file.bin
xflash: Error: F03150 Failed to parse flash image: error reading switch setup code for image 0, check --factory-version and --key options are correct.
My firmware.

Code: Select all

$ xflash --analyze my_firmware.bin
Loader file.bin:
  Size: 0xEC0 bytes (0x3B0 words)
  CRC: 0xC7FE8B46 (GOOD)

  User address: 0xD200
  Search limit: 0x1E848

  ID number: 0 (0x0)
  ID string: None

Factory image file.bin[0]:
  Offset: 0xEC8
  Image tag: 0xCA7FA11
  Page CRC: 0x6118C955 (GOOD)
  Image CRC: 0x8C2EA0BF (GOOD)

  Version: 0x0
  Features: 0x40
    Switch setup present

  Size: 0xC2EC bytes
  Length: 0xC2EC bytes

  Boot address: 0x0
  Overlay address: 0x0
  Overlay offset: 0x0

  Switch setup table offset: 0x38
  Core table offset: 0x40

  Tools version: 15.2.1
  Image format: 5 (Tools 15.2)

    Switch setup file.bin[0]:
      Offset: 0x60
      Size: 0x1F28 bytes (0x7CA words)
      CRC: 0x076D28A3 (GOOD)

  Number of cores: 1

    Core file.bin[0][0]:
      Offset: 0x1F88
      Size: 0xA364 bytes (0x28D9 words)
      Channel end: 0x80020002
      CRC: 0xB362B0D1 (GOOD)

        SWMEM address: 0x0
        SWMEM offset: 0x0
        SWMEM size: 0x0 bytes

        EXTMEM offset: 0x0
        EXTMEM size: 0x0 bytes

Dumping stage 2 loader to loader.bin
Dumping image 0 to image0.bin
Dumping image 0 switch setup code to image0_swsetup.bin
Dumping image 0 core 0 code to image0_core0.bin
The file is encrypted and therefore the mcu is locked?
the mcu won't be able to load another file?
User avatar
valtechX
New User
Posts: 2
Joined: Wed Oct 23, 2024 7:13 pm

Post by valtechX »

rengar wrote: Fri Oct 25, 2024 4:16 am Results:
Firmware that is loaded.

Code: Select all

$ xflash --analyze file.bin
xflash: Error: F03150 Failed to parse flash image: error reading switch setup code for image 0, check --factory-version and --key options are correct.
The file is encrypted and therefore the mcu is locked?
the mcu won't be able to load another file?
My builds for XS1 with sw v6.15.2 have the same result, and were not encrypted, and I've never had any problems running it.
I still think it's something related to the software for the XU208, just notice that nthat no one talks about, as if it were something secret.
Probably the XU216/XU316 won't have any problems, because the reference design meets these models, but even so, i'm still afraid.
I've already spent time and money developing a prototype for the XU208, having to spend it all over again is demotivating.
User avatar
Ross
Verified
XCore Legend
Posts: 1117
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

There are no secrets and there are many 208 designs in the field. You should start a new thread on your issue.

The OP appears to be receiving parts from some unknown 3rd party “supplier”. Making some assumptions here as not much information has been given. Let me be clear, if you’re just getting parts from some regular distribution channel they have no possibility of being locked down and your issues is unrelated.
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: Sat Oct 26, 2024 11:18 am There are no secrets and there are many 208 designs in the field. You should start a new thread on your issue.

The OP appears to be receiving parts from some unknown 3rd party “supplier”. Making some assumptions here as not much information has been given. Let me be clear, if you’re just getting parts from some regular distribution channel they have no possibility of being locked down and your issues is unrelated.
Thank you for reply!
I believe that this could be the problem, and i'll be happy if it's just a malicious supplier.
already ordered a unit from a reliable supplier, need to resolve this issue.
will post the results as soon as possible.

best regards.