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.

CCS/66AK2H14: Issue making SPI flash read test working on custom board

Part Number: 66AK2H14

Tool/software: Code Composer Studio

Hi,

I am currently working on a new custom board. I want to test the SPI NOR flash on this board and for this, I am using the SPI flash read test provided for EVMK2H in the pdk_k2hk_4_0_9. I use the c66x example.


I made it work on EVMK2H. Unfortunately, I got some troubles to make it work on our custom board. We have a different DDR3 and different NOR flash. The flash used is the Micron NOR flash MT25QU02GCBB.

The things done for now are:

-configure DDR3 in $pdk_k2hk_4_0_9/packages/ti/board/src/evmK2H/evmK2H_ddr.c using the parameters previously calculated for our GEL file (DDR has been tested with our new parameters and is working).

-configure the flash parameters:

1.change device ID from 0xBB18  to 0xBB22 in Board_flash.h .

2.In pdk_k2hk_4_0_9\packages\ti\board\src\flash\nor\device\n25q128.h

  • #define NOR_SIZE                    (256U * 65536U)       to      #define NOR_SIZE                    (4096U * 65536U)      /*NOR size is 2Gb*/
  • #define NOR_DEVICE_ID               (0xBB18)  /* Device ID */   to      #define NOR_DEVICE_ID               (0xBB22)     /* Device ID */


I re-built the PDK before compiling the project. However, I always get stuck at same function, using this configuration or not.

What I can say is that NOR_open(flashIntf, portNum, params) function always returns 0. I finally get  a "Board_flashOpen failed." in my console.

Do I miss something in my new configuration? Do you have any idea about my problem?

Thank you for your help.

Best regards.

  • Typical process to port TI Processor SDK RTOS package to custom platforms is described here:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_board.html#custom-board-addition

    If you have checked the DDR connectivity after creating the GEL file and modifying the EMIF timing and HW leveling then you don`t have to work about it while testing flash.  you may also need to check if you have basic HW connectivity done correctly.For example, have you checked if the SPI module Clock is configured as expected. Is the Micron NOR flash. If 

    During board flash Open call the SOC tries to read the Flash ID. Please compare the datasheet of the NOR used on the EVM and not just check the ID but the command/instruction set for the flash. The other important setting is the phase and polarity used can vary for different vendors. TI mode description that determines SPI phase and polarity doesn`t always match with mode# used in flash data so read the description to set that up on K2H.  Another thing to check out would be the sector size. 

    Regards,

    Rahul

  • Hi,


    Thank you for your answer, suggestions and the link for custom platforms.

    We have tested with an oscilloscope to observe spi and flash. We saw a read ID command sent to the flash and the ID returned by the flash that was 20h (it corresponds to the manufacturer ID as we expect). However, nothing is seen on SPI ==> it confirms that we should be blocked in board_flashopen.

    Do you have ideas about what can be the cause of this?


    I tried to change the phase and polarity but it doesn't change anything. I keep the same polarity as EVM for moment.

    The sector size is the same has the EVM flash so I didn't change it. I compared the command of both flash. Only NOR_CMD_BULK_ERASE is not available on our flash and has been replaced by  DIE_ERASE command. So for the moment, I just replaced the NOR_CMD_BULK_ERASE code that was 0xC7 by the DIE_ERASE code that is 0xC4.


    Best regards.

  • L Kiet,

    That is good information for us to know that the clock is there and the read command output from SPI provides a response from flash. Given the signal appears on the wire, we need to check if it is read into the SPI data register, can you read the SPIDAT register and see if 0x20 is detected. If you don`t see the data in the register it could indicate that we are not sampling the data on the SPI pin at the right time (phase polarity or timing) 

    The other information that I need to know if that did you rebuild the board library after making the changes and if you are able to  step through the code and set breakpoints in the board_flashopen and check where the code if waiting at. 

    Regards,

    Rahul

  • Hi,

    Looking at SPIDAT register while running the project, I don't see the value 0x20.

    Concerning the library, I rebuilt all librairies after making changes. I can add printf in some functions and then build it again.

    However, what do you want I do concerning board_flashopen? I can step into if needed. I can use breakpoints too without problems.

    Best regards.

    K.Luong

    Edit: I checked, on EVM, I don't see any changes on SPIDAT register too even if the test is working on EVM and I can get the SPI NOR device ID  and the manufacturer ID without problem.

  • I finally solved my problem.

    Indeed, using breakpoints in CCS and going into the several functions used, I saw that the manufacturer ID and the Device ID were well returned. However, my program was waiting a wrong Device ID and then when checking the condition devID == NOR_DEVICE_ID, it failed. I finally changed the header called in "PDK/packages/ti/board/src/flash/nor/spi/nor_spi.h". This file included n25q128.h but I created my new flash header that was "mt25qu02gcbb.h". I already replaced it in SPI_board.h that defines the TEST_NOR_DEV_ID and includes my specific header mt25qu02gcbb.h. However, It was still the EVM one that was included in nor_spi.h and then redefining the NOR_DEVICE_ID .

    Thank you for your help and suggestions.

    Best regards.

    K.Luong

  • Luong,

    Thanks for the update and glad to know that you are able to get the flash functionality functional with your custom HW.

    Regards,

    Rahul