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.

getdriveid() fails

I'm trying to integrate the RTFS NAND example into an existing project.  The example runs perfectly on my C6748 eval board but when I run the project, getdriveid() returns -1.

Can anyone suggest why getdriveid() would fail once nandStorageInit() has succeeded?  There doesn't seem to be any indication as to why the call has failed (rtfserrno is 0).  I have tried to debug it but the source for getdriveid() is not included in the RTFS distribution (perhaps it can be downloaded somewhere else, I don't know).

Thanks

Paul

 

  • Hi paul,

    Could you please mention the BIOS PSP version and the RTFS package version which you are using?

    Considering the BIOS PSP package 1.30.01 is being used by you, i can suggest few points:

    1. As mention in the C6748_BIOSPSP_Userguide.doc section 14.12.1.3, you need to have a daughter card connected to EVM.

    2. Try with the example provided in the PSP (pspdrivers_01_30_01\packages\ti\pspiom\examples\evm6748\nand ), which exercises the NAND in raw mode.

    Once after considering the above points if the issue still persists, Please let me know.

    Thanks and Regards,

    Sandeep K

  • Paul,

    Did you have any luck with Sandeep's suggestions from the above post?

    Thanks,

     

    Steve

  • Hi!

    My configuration is:

    ccsv_4.2.0.10018
    bios_6.30.02.42
    xdc_3.20.03.63
    edma3_lld_2.10.03.04
    ipc_1.21.02.23
    ndk_2.20.00.19
    psp_02.10.01

    OMAPL137 DSP core

    I have the same problem on my custom board.

    When I work with the 2048 page size NAND, RTFS works fine

    When I switch to the 4096 page size NAND, RTFS failes at GetDriveID

    In raw mode both of NAND works fine (I had to add 4096 support to NAND psp driver)

    I think  RTFS doesn`t support 4096 page size:

    /* use config modules to get RTFS configuration libraries */
    xdc.useModule('ti.rtfs.xdcconfig.Rtfs');

    /* used the Drive module to configure a Nand flash drive for RTFS */
    var Drive = xdc.useModule('ti.rtfs.xdcconfig.Drive');
    // configure a nand device
    var nand = Drive.create();
    nand.sectorSize = 4096;
    // set the type of this drive
    nand.driveType = Drive.DriveType_NAND;

    // create + configure partitions
    var nandPart0 = new Drive.Partition();
    nand.addPartition(nandPart0);

  • I think I should change

    NAND_CFG_SECTORSIZE

    option in fsadaptmem.h

    and rebuild RTFS

    Am I right?

     

     

  • Yuri,

    which version of RTFS are you using?  I think you left that one out ...

    I'm debugging this issue right now to get to the root of it.  I'll get back to you as soon as I have more info

    Steve

  • Steve,

    thank you for the answer!

    I`m using RTFS 1.10.02.32

  • Yuri,

    I found the code that is causing the error, and it is checking the sector size value of 4096 - set in your RTFS configuration - against the sector size set by the PSP NAND driver - which is 2048.

    According to the PSP driver documentation for NAND (), I see that the driver is designed to find the sector size that is supported by the actual NAND part, and the driver then sets sector size to whatever the hardware supports.  Here's what I see in the docs:

    14.3.2 Supports 512-byte page and 2048-byte page NAND devices
    NAND driver supports both 512-byte page and 2048-byte page devices. The driver
    learns about the page size of the device by looking up the device ID and
    manufacturer ID in the NAND device organization lookup table. Sector write and read
    operations are then performed for the entire length of the sector without requiring
    additional configurations.

    So, it looks like the a sector size of 4096 is not supported.  But, if you would like more information, we can ask the PSP drivers team for further details on this.

    Also, I tried setting the nand.sectorSize = 512, but this also fails with the same error.  I suspect that if the NAND chip on the 6747 EVM does support that size, then it may be necessary to configure the driver for that sector size.

    I've filed a bug to update the RTFS documentation to warn the user about this issue:

    SDOCM00081796 RTFS cdoc should inform user that sectorSize must match the sector size of the actual device, as determined/configured by PSP

    Steve

  • Steve,

    As I posted later I`ve changed PSP NAND driver to work with 4096 page NAND. So the sector size in the PSP matches the sector size in RTFS. Any other sugessions?

  • Hi Yuri,

    I'm not sure that I saw your post in which you said you tried that already.  Could you explain the changes you made to the PSP NAND driver for a 4096 page size?  (or if you have already explained these details in the post  you are referring to, could you please reply with the link to that post?).

    As I said previously, I suspect that the flash hardware on the evm 6747 board does not support a page size of 4096.  I will ask for the PSP team to comment on this.

    Thanks,

    Steve

  • Yuri,

    I have contacted someone from the PSP drivers team.  Here is what he said:

    "As far as NAND driver (in PSP 2.10.01 for evm6747) is concerned, it supports only 512 and 2048 bytes page size. Refer section 14.1.1 of user guide “DA830_BIOSPSP_Userguide”. So to support 4096 bytes, the driver needs to be modified.

     If you refer the  http://focus.ti.com/lit/ug/sprufl6f/sprufl6f.pdf  (EMIFA document), there is no mention of page size restriction for NAND Flash. Only thing, which need to be considered is data width of the NAND which either can be 8 bit or 16 bit.

     As per the post, the NAND driver works fine for 4096 bytes (after modification) in raw mode of operation. So then there could be some problem (in RTFS mode) in populating the NAND device info and RTFS might be getting confused.

     Let me know, if you have any more info."

    I see that there is a check in RTFS where this failure is occurring:

            /* Check for a missmatch */

            if ((int)pmedia_parms->sector_size_bytes != pconfig->sector_size)  // ********* this check fails b/c 4096 != 2048.  pcofnig->sector_size is set in PSP driver

                    return(-1);

    So, I think that if you rebuild the NAND driver to use a sector size of 4096 bytes, this will allow the above check to pass and your RTFS app to work.

    Thanks,

    Steve

  • Steve,

    this is the driver with the 4096 page support

    7026.nand_psp.rar

  • Yuriy,

    Just to confirm the driver is properly returning with the appropriate page size(4096). Could you place the breakpoint in LLC_nandLookupDeviceInfo() in the file llc_nand.c and check the values populate in the "devInfo".

    This will verify that the llc driver is returning back with proper page size or not.

    Let me know the result.  

    Thanks and Regards,

    Sandeep K

  • Sandeep,

    I don`t determine device info automatically from the tables, so LLC_nandLookupDeviceInfo() doesn`t execute.

    I fill the stucture of devinfo manually and pass it to the driver.

    After breakpoint in the LLC_nandInit at lines:

     else
            {
                /* Application has provided the device configuration. Keep a      *
                 * copy of this information.                                      */
                memcpy(
                    (Ptr)&appNandDevInfo,
                    (Ptr)initCfg->deviceInfo,
                    sizeof(PSP_nandDeviceInfo));

                hNandObj->nandDevInfo = (PSP_nandDeviceInfo*)&appNandDevInfo;
                *devInfo = hNandObj->nandDevInfo;

    ............................................................

     

    *(nandDevInfo) = {...}

    vendorId = 236

    deviceId = 213

    pageSize = 4096

    pagesPerBlock = 64

    numBlocks = 8192

    spareAreaSize = 128

    dataBusWidth = 8

     

    Best regards,

    Yuriy

  • Yuriy,

    Sorry for the delayed response.

    The device info has to be checked at several places to find out the driver is properly updating it or not, those are,

    1. LLC_nandInit() - (You have already checked it)

    2. PSP_nandInit() - ddc_nand.c - This will update the "DDC_nandObj" which needs to be checked for the device info.

    3. DDC_nandFtlInit() - ddc_nandFtl.c - This will populate the "DDC_nandFtlObj".

    If all the above places, the device info is as per the expectation (Sector size 4096 byte), then,

    Is it possible to get the driver info from the application, by using the API "getdrvinfo()"? Can please you check the driver device info is reflected or not?

    Regards,

    Sandeep K

  • Sandeep,

    I`ve checked all the places you mentioned.

    All the structures contain the same NAND device information (which is good one)

    I`ve checked ftlInitObj, ftlObj, hNandObj, llcInitCfg - everywhere sector size is 4096.

    I can`t execute getdrvinfo because the first parameter of the fuction is the drive handle

    This drive handle should be returned by the getdriveid function, but it fails.

    Best regards,

    Yuriy

  • Hi Paul,

    My apologies for the lack of response, your forum post slipped through the cracks.

    You say you're merging in the RTFS NAND example into an existing application.  What is the existing application?  Is it a network application?

    You may be seeing an issue in which both the NAND and another peripheral are being configured to use the same hardware interrupt.  Please see the following post, which sounds similar to your problem.  In this case, the NAND had a conflict with the EMAC when the customer tried to merge the NAND example and NDK network example.

    http://e2e.ti.com/support/embedded/f/355/p/112802/417020.aspx#417020

    Thanks,

    Steve