This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI FLASH (W25Q128FV) interfacing and boot loading - Starter Kit Am3358.

Other Parts Discussed in Thread: AM3358

Hello Community,

I have interface Winbound SPI Flash (W25Q128FV) With AM3358 Starter Kit - ZigBEE header by usin Following schematic.

Now i am trying to boot load this SPI Flash using Starter Ware Flash Writer Utility- SPI Flashing Tool. I cannot use the given "spi_flash_writer_AM335X.out"  binary as it does not support id- code: 4018 of W25Q128FV.

I have used given initiating script "AM335x_SK_1.2.gel" for CORTEX-A8 in the CCXML Config File.

Made the following change in Main to support Starter KIT instead of General purpose EVM.

board = GP_BOARD; //getPlatform();

Added Support for W25Q128FV by adding following in the winbond_spi_flash_table[]

{
WINBOND_ID_W25Q128, // 4018 Id-Code 
256,
16,
4096,
"W25Q128",
},

After executing this project in CSS it Gave the following output on the CCS console 

"

[CortxA8] AM335X part detected. SF: Got idcode ef 40 18
Checking if Winbond flash writer can be used..
SF: Detected W25Q128 with page size 256, total 16777216 bytes
Flash page size: 256 bytes
Flash sector size: 4096 bytes
Starting SPIWriter.
Enter the File Name
E:\boot_ti.bin
Enter the Offset in bytes (in HEX)
0x00000
Erasing flash at byte offset: 0, byte length: 24576
SE: cmd = { 0x20 0x000000 }

"

and nothing really happens after that. it seem code is stuck somewhere....!

So my Question is what i have to do in order to Boot Load  SPI Flash W25Q128FV using StarterWare SPI Flashing tool as W25Q128FV  is not supported by this  tool (By Default).... ?

Is it possible to interface and bootload W25Q128FV  - 16MB SPI FLASH with AM3358 Starter Kit using StarterWare's SPI Flashing tool  ?

 

Any kind of Help is greatly appreciated.....!

 

  • Hello community ,

    I am trying to boot load Am335x starter Kit's SPI Flash W25Q128FV (Winbound) using Starter Ware's CCS based utility SPI-FLASH-Write.

    When i try to load the "spi_flash_writer_AM335x.out" file it gave the following Error,

    Part Detected

    SF: Got ID code EF 40 18

    Checking if winbound flash writer can be used....

    SF: Unsupported  Winbound Id 4018

    No known serial flash found

    and exit...!

    i don't understand why this ID is unsupported even if the interfaced flash is from Winbound ?

    Please Guide me in this regard.

  • Any Kind of Help is greatly appreciated......!
  • Shehrooz,
    Do you see where it gets stuck when you halt the program?
    Are you able to ERASE the flash from the menu you see in the writer tool?

    Choose Operation:
    Enter 1 ----> To FLASH an Image
    Enter 2 ----> To ERASE Flash
    Enter 3 ----> To EXIT

    As you know, the 64MB version is supported on the GPEVM and I can see that you are trying the 128MB version on the SK using the Zigbee header. I don't think this has been tried before, and isn't supported currently, so its hard to say what the behavior is going to be. However, I would assume that the boot table parameters that you custom entered seem correct. Is the pages_per_sector correct for the variant you are using?

    Your HW connections seem correct.

    I also noticed that you have multiple threads opened in the forum. Would appreciate it if you could consolidate all the threads into 1 thread so that it would help us track the problem. Please close any duplicates. Thanks.

    Lali
  • Thank you for the detailed answer i really appreciate it. The write code get stuck in the "winbond_wait _ready " function...!

    In "winbond_erase" every thing seems to work correctky, including Erasing Sector and Writing NULL to Erased Sector but when it calls      "winbond_wait _ready " (to wait up to 2 sec) then the program Got stuck and Just stays there. I have executed all the code Line by Line but i am not able to understand what could cause this problem as page-sector and other memory calculations are seems to be correct up to my best of Knowledge...!

    Any suggestion or Guide line related to this issue is greatly appreciated .... !

    Writer Tool doesn't show any menu like you have mentioned above. The console output of this program is  ...

    "[CortxA8] AM335X part detected. SF: Got idcode ef 40 18

    Checking if Winbond flash writer can be used..

    SF: Detected W25Q128 with page size 256, total 16777216 bytes

    Flash page size: 256 bytes

    Flash sector size: 4096 bytes

    Starting SPIWriter.

    Enter the File Name

    E:\boot_ti.bin

    Enter the Offset in bytes (in HEX)

    0x00000

    Erasing flash at byte offset: 0, byte length: 24576

    SE: cmd = { 0x20 0x000000 } "

    and nothing really happens after that. it seem code is stuck .There is also nothing on Uart Serial Monitor as Well....!

    I am currently using StarterWare 02_00_01_01 version, Please guide me where this menu  is displayed by the Writer Tool?

    SPI Flash Id (4018), Page memory(256), Number of pages per sector (16), and number of sector(4096) in whole device  are correct. Memory calculation according to these number is correct. 256*16*4096 = 16777216 which is equal to 16MByte. According to datasheet...

    Lastly, I have created another thread in Sitara fourm and  find out they do not deal with starterWare related issue. I will close any other duplicate threads, sorry for the inconvenience.

    Any kinf of help is greatly appreciated...!

     

  • When the program got stuck it opens another window in the editor and gave the following Error ...

    "No source available for 0x20010"

    it does not make any sense to me ...!

  • Hi Lalindra,

    The SPI writer code get stuck at the highlighted line below in "Winbond_wait_ready" function in winbond.c file.

    static int winbond_wait_ready(struct spi_flash *flash, unsigned long timeout) {

    struct spi_slave *spi = flash->spi;

    int ret;

    u8 status;

    u8 cmd[4] = { CMD_W25_RDSR, 0xff, 0xff, 0xff };

    ret = spi_xfer(spi, 32, &cmd[0], NULL, SPI_XFER_BEGIN);

    if (ret) {

    printf("SF: Failed to send command %02x: %d\n", cmd, ret);

    return ret;

    }

    do {

    ret = spi_xfer(spi, 8, NULL, &status, 0);

    if (ret)

    return -1;

    if ((status & WINBOND_SR_WIP) == 0)

    break;

    timeout--;

    if (!timeout)

    break; ..... } "

    Any kind of help is greatly appreciated, as i am stuck here since the  last week....!

  • Hi,

    I have modified the SPI Flash writer code in CCSv6 for Sitara AM3358 Starter KIT and Now i am able to execute SPI Flash writer code, successfully, for W25Q128FV (winbond SPI Flash - 16 Mbyte) flash (which is not supported otherwise).

    I run the utility   to load "Boot_ti.bin file" (which is build for the SPI boot) at 0x00000 location for the first time and after successfully erasing and writing boot loader image, this utility ends without asking about the application binary file (starterWare application image file).

    So i have no choice but to run the code a second time. At this instance i load the "application_ti.bin" file at 0x20000 location and SPI writer code ends after successfully erasing, writing and verifying the data content.

    After successfully writing boot and application image files at the correct locations,  i disconnected the target from CCS and press Warm-Reset  or restart the  AM3358 Starter KIT while hoping that it will boot from the SPI.

    The problem is, nothing Really happens after restarting the board, it seems there is some kind of problem that is restraining the Starter Kit from (SPI Flash)  Booting?

    Note: I am using the  SPI Flash writer code instead of the given binary files "spi_flash_writer_AM335X.out"

    Any kind of help is greatly appreciated....!

  • Hi, shehrooz sattar,  have you solved the problem,  would you  share some experience ?

    The almost same issue on my board,  booting from spi flash .

  • key dongle,
    Did you get it to a point where you see the same behavior as Shehrooz did i.e able to burn the image to flash but not boot from it?

    Lali
  • Hi,

    If you are using starterWare and trying to boot AM335x Starter Kit then most probably the problem is ....
    In StarterWare the Spi Flash Boot Loader is given for the AM335x Evaluation Board not For AM335x Starter Kit. So you have to change the code for AM335X Starter Kit. I don't remember exactly but these are mostly configuration changes. After making those changes we build the image and did the rebooting again and it worked for us.
    I hope this helps.

    Best,
    Shehrooz
  • Hi shehrooz, finally glad to see your reply, deeply grateful!
    yeah, the original spi boot loader is fit for evmAm335x board, not for evmskAm335x. i have make some change for configuration, but do not work yet.
    e2e.ti.com/.../615624 this thread descriped some changes i made on the project.
    Would you try to share some key points or some easily ignored details ?
    Thank you from the bottom of heart!

    BS,
    keydongle
  • Shehrooz,

    Do you have the specific changes you made to the bootloader that enabled it to work with this Winbond device? Would appreciate it if you could share.

    Thanks.

    Lali
  • Hi Key,

    Sorry, I can't remember the exact changes as its been a year since we did it and i do not have any access to the written Code now. Please go through the code thoroughly and identify possible configuration changes for starter kit...
  • Hi schehrooz,

    thank you all the same for you patient reply. i would have try many times, not work yet.

    BS,

    keydongle