xflash with M25P16

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Paolomio
Experienced Member
Posts: 64
Joined: Tue Oct 05, 2010 7:33 pm

xflash with M25P16

Post by Paolomio »

I have a shiny new board with an L2 on it, and in the process of bring up. The board is coughing blood--I can flash LEDs and wiggle bits, running from an XTAG-2. The board has a M25P16 on it, and I've tried defining a suitable flash spec (see below), but when I say:

xflash Release\appname.xe --spi-spec M25P16.f

I get "Error: F03020 An unrecoverable error has occurred; exiting." back from xrun.

I've verified with a scope that the flash is getting proper signals, and it is answering something, so there is communication. But it just isn't the right thing, apparently.

Clearly I'm doing something wrong, but I can't see what it is.

Here's the M25P16 spec file:

Code: Select all

7,			/* inexplicable ID */
    256,                    /* page size */
    8192,                   /* num pages */
    3,                      /* address size */
    8,                      /* log2 clock divider */
    0x9f,                   /* SPI_RDID */
    0,                      /* id dummy bytes */
    3,                      /* id size in bytes */
    0x202015,               /* device id */
    0xD8,                   /* SPI_SSE */
    0,                      /* full sector erase */
    0x06,                   /* SPI_WREN */
    0x04,                   /* SPI_WRDI */
    0,         				/* no protection */
    {{0,0},{0,0}},          /* no values */
    0x02,                   /* SPI_PP */
    0x0b,                   /* SPI_READFAST */
    0,                      /* No read dummy byte */
    SECTOR_LAYOUT_REGULAR,  /* sane sectors */
    {65536,{0,{0}}},         /* regular sector size */
    0x05,                   /* SPI_RDSR */
    0x01,                   /* SPI_WRSR */
    0x01,                   /* SPI_WIP_BIT_MASK */
    
Any help much appreciated...

Paul


User avatar
bsmithyman
Experienced Member
Posts: 126
Joined: Fri Feb 12, 2010 10:31 pm

Post by bsmithyman »

Just a stab in the dark here, but the chip supports protection by sectors or status register, and you have it set to zero (i.e. no protection). Have you checked what happens if you tell it to use protection? I'm just wondering if it's possible that some of the write protection features are turned on and it's ignoring them (hence not clearing the lock).