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.

Building/Running McSpi Flash Demo C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\starterware\examples\mcspi\flash on AM3359 ICE

Other Parts Discussed in Thread: SYSBIOS, AM3359

Have successfully built and run  "McSpi Flash Demo -  C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\starterware\examples\mcspi\flash" on an AM3359 ICE evaluation board. Now I'm developing a similar demo app for an energy measurement device attached to McSpi #1 as opposed to McSpi #0. Trying to leverage the flash demo as a baseline for this development effort. The flash demo uses as the AM3359 ICE evaluation board's McSPI #0 controller which is attached to the flash device "DEVICE_ID_W25Q64BV". Of course my energy measurement device is not "DEVICE_ID_W25Q64BV". The energy measurment device is a MAXIM 78615+PPM Energy Measurement IC. The IC's SPI slave interface lines "Clock, MOSI, MISO, and Chip Select" are physically connected to the AM3359 ICE evaluation board's J3 Expansion Header's pins 12-SPI1_SCLK,14-SPI1_D0,16-SPI1_D1 and 18-SPI1_CS0 respectively. On the TMDXICE3359 schematic SPI1_SCLK is attached to the AM335X MCASP0_ACLKX, SPI1_D0 to MCASP0_FSX, SPI1_D1 to MCASP0_AXR0, and SPI1_CS0 to MCASP0_AHCLKR pins.

This being the case, I'm in search for the changes I need to make to the McSPI initialization sequence so that when I execute the McSPI transfer I will see the J3 expansion header pins 12-SPI1_SCLK,14-SPI1_D0,16-SPI1_D1 and 18-SPI1_CS0 being driven by the McSPI #1 controller.

Obviously the data being transferred between the McSPI #1 master and the Energy IC SPI slave is Energy IC SPI specific as specified in its data sheet and hence to not need any help from TI in this regard.

I've attached the source file I've made the changes to. Please help me out. I believe the changes have to do w/the pin muxing of the McSPI#1 controller to the McASP0 lines, etc.

Thanks,

Ted0285.energy.c

  • Moving this to the Starterware forum.
  • Have yet to get an answer on this issue. I have followed the directions in starterware/docs/Board_and_ChipDB_Details but still no luck. I have to believe someone at TI can build the demo flash app which I have working here, make the necessary changes and attempt to run it using McSPI 1. Obviously the flash access wont work as there's nothing attached to McSPI 1 but they should observer the J3 connector SPI 1 lines being driven via a logic analyzer. Very frustrating. HELPPPPPPPPPPP
  • Ted,

    We have been checking on this internally, and did not have an update. Apologies for the trouble you have getting this going.
    I will try out your code and get back to you. Please bear with me.

    Lali
  • Hey Lali,

    Thanks for the reply. Actually you do not have to try my code per say. You can just make the starterware mcspi flash demo work w/McSPI Controller number #1 instead of McSpi Controller number #0. Obviously since the flash part is not connected to the J3 SPI 1 pins it won't work but if you put a logic analyzer on these pins you should see the initial chip select, clock, and mosi lines being driven by the McSPI master. If this can't be done my code won't make it any better ;-).

    Thanks Again,

    Ted

  • Hi Ted,

    I looked into this a bit and here's some feedback/things to try.

    Let's start at the top and try and modify the existing McSPI example in the IDK located at C:\ti\sysbios_ind_sdk_2.1.1.2\sdk\starterware\examples\mcspi\flash.

    Here are some changes to the project that seems to work for me. I did see traffic on J3 on my logic analyzer connecting pins 12,14,16,18.

    flash_app_main.c

    approx line 65
    #define MCSPI_FLASH_INST_NUM            (1U)
    
    approx line 182
    static const mcspiAppCfgObj_t MCSPIAPPFLASH_DEFAULT =
    
    {
    
    1U, /* instNum*/
    
    approx line 379
    
    /* MCSPI interrupt line number. */
    pObj->intrCfg.intrLine = 125U;

    I think you have the interrupt number incorrectly set in your .c file. According to the AM335x TRM table 6-1, the McSPI1INT is 125. Please let me know if this helps.

    Lali

  • Hi Lali,

    Thanks for the reply. Here's what I got.

    StarterWare MCSPI Flash Application!!
    BOARDInit status [0x0]
    SoC : [AM335X]
    Core : [A8]
    Board Detected : [ICE Ver 2]
    Base Board Revision : [UNKNOWN]
    Daughter Card Revision: [UNKNOWN]
    Invalid device ID!!
    Device is not available on this board!
    This example is not supported on this board!

    Are we both using the same board type? Or maybe there's some jumpers I need to change?

    Ted

  • Hi Ted,

    You would also have to comment out some of the code that checks to see if anything is connected on the bus. Since the default example is looking for the W25Q64BV, it will kick errors.

    In my case, since there was only a logic analyzer, commented out what's below to get into routines that would trigger some traffic on the bus:

    Inside: static int32_t McspiAppBoardInfoGet(mcspiAppCfgObj_t *pObj)
    flash_app_main.c approx line 336:
    /* if (CHIPDB_MOD_ID_INVALID == modId)
       {
            CONSOLEUtilsPrintf("Device is not available on this board!\n");
        }
        else if (CHIPDB_MOD_ID_MCSPI == modId)
        {
    */
    
    approx line 363:
    /*}
    else
    {
    CONSOLEUtilsPrintf("Device is not connected to MCSPI!\n");
     } */

    You may also have to comment out some other "check" code other than the ones mentioned above to see traffic on the bus. Please step (F5) through the code, get into the various functions, and see where that may be necessary. Hope this helps.

    Lali

  • Hey Lali,

    In addition to your changes I've stepped through the code and as a result in McspiAppBoardInfoGet() I've hardcoded mcspiInstNum=1 and mcspiCs=0 but still don't see anything on the analyzer. I get the following on the console:

    StarterWare MCSPI Flash Application!!
    BOARDInit status [0x0]
    SoC : [AM335X]
    Core : [A8]
    Board Detected : [ICE Ver 2]
    Base Board Revision : [UNKNOWN]
    Daughter Card Revision: [UNKNOWN]
    MCSPI Instance number: 1
    Channel/Chip Select number: 0
    The instance address is 481a0000

    and I'm sitting at line 231 in mcspi_app.c waiting for the isr to clear the gMcspiAppIsrFlag.

    I've included my modified flash_app_main.c. Please check it out and verify.

    /**
    * \file flash_app_main.c
    *
    * \brief Example application main source file, which configures the MCSPI IP
    * and executes the flash use-case.
    *
    */

    /**
    * \copyright Copyright (C) 2013 Texas Instruments Incorporated -
    * http://www.ti.com/
    */

    /*
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */

    /* ========================================================================== */
    /* Include Files */
    /* ========================================================================== */
    #include "types.h"
    #include "error.h"
    #include "board.h"
    #include "soc.h"
    #include "device.h"
    #include "chipdb.h"
    #include "mcspi.h"
    #include "console_utils.h"
    #include "serial_flash_w25q64bv.h"

    /* Application header files */
    #include "mcspi_app.h"

    /* ========================================================================== */
    /* Macros */
    /* ========================================================================== */
    /** \brief MCSPI instance number to which flash is connected*/
    //#define MCSPI_FLASH_INST_NUM (0U)
    #define MCSPI_FLASH_INST_NUM (1U)

    /* ========================================================================== */
    /* Structures and Enums */
    /* ========================================================================== */

    /* None */

    /* ========================================================================== */
    /* Internal Function Declarations */
    /* ========================================================================== */

    /**
    * \brief Fetch board information.
    *
    * \details This function will check if SPI flash is present on the board
    * and accordingly provide the MCSPI controllers instance number
    * and instance ID..
    *
    * \param pObj Pointer to the MCSPI application configuration
    * structure.
    *
    * \retval #S_PASS - Flash support is present for the MCSPI instance.
    * \retVal #E_FAIL - Flash support is not present for the MCSPI instance.
    */
    static int32_t McspiAppBoardInfoGet(mcspiAppCfgObj_t *pObj);

    /**
    * \brief Fetch the MCSPI instance address.
    *
    * \param pObj Pointer to the MCSPI application configuration
    * structure.
    *
    * \retval #S_PASS - MCSPI instance is present.
    * \retVal #E_FAIL - MCSPI instance is not present.
    */
    static int32_t McspiAppSocInfoGet(mcspiAppCfgObj_t *pObj);

    /**
    * \brief This function enables the flash to write data
    * to it.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    */
    static void McspiAppWriteEnable(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will check if the write enable command is
    * successfully latched to the flash device.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    * \retVal TRUE Write enable command is latched.
    * \retVal FALSE Write enable command is not latched.
    */
    static uint32_t McspiAppIsWriteSuccess(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will erase the sector of flash.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    */
    static void McspiAppSectorErase(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will check if the flash is busy.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    */
    static void McspiAppIsFlashBusy(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will read the status of flash.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    */
    static void McspiAppFlashStatus(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will program the flash with valid data.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    */
    static void McspiAppWriteToFlash(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will read the flash contents.
    *
    * \param pCfgMcspi Pointer to the MCSPI configuration structure.
    *
    */
    static void McspiAppReadFromFlash(mcspiAppCfgObj_t *pCfgMcspi);

    /**
    * \brief This function will verify the written and read data to the flash.
    *
    */
    static void McspiAppVerifyData(void);

    /* ========================================================================== */
    /* Global Variables */
    /* ========================================================================== */

    /* Transmit buffer to hold data of 1 page. */
    static uint8_t gFlashAppTxBuffer[260U];
    /* Receive buffer to hold data of 1 page. */
    static uint8_t gFlashAppRxBuffer[260U];
    /* Buffer used to verify the Written and read data. */
    static uint8_t gFlashAppVerifyData[256U];

    /** \brief Application default configuration */
    static const mcspiAppCfgObj_t MCSPIAPPFLASH_DEFAULT =
    {
    MCSPI_FLASH_INST_NUM, /* instNum.*/
    0U, /* instAddr.*/
    48000000U, /* inClk.*/
    24000000U, /* outClk.*/
    0U, /* channelNum.*/
    0U, /* dataLength.*/
    gFlashAppTxBuffer, /* pTx.*/
    gFlashAppRxBuffer, /* rTx.*/
    {
    MCSPI_CH_SINGLE, /* channel.*/
    MCSPI_TRANSFER_MODE_TX_RX, /* txRxMode.*/
    MCSPI_DATA_LINE_COMM_MODE_1, /* pinMode. */
    MCSPI_CLK_MODE_0, /* clkMode.*/
    8U, /* wordLength.*/
    MCSPI_CS_POL_LOW, /* csPolarity.*/
    TRUE, /* txFifoCfg.*/
    TRUE, /* rxFifoCfg.*/
    MCSPI_INTR_TX_EMPTY(0U) | \
    MCSPI_INTR_RX_FULL(0U) /* interrupt.*/
    },
    {
    INTC_TRIG_HIGH_LEVEL, /* trigType.*/
    0U, /* intrLine.*/
    10U, /* intrPriority.*/
    FALSE, /* isIntrSecure.*/
    NULL, /* pTxBuf.*/
    NULL, /* pRxBuf.*/
    NULL /* pFnIntrHandler.*/
    },
    {
    TRUE, /* csFlag.*/
    MCSPI_MODE_MASTER, /* modeFlag.*/
    MCSPI_INTERRUPT_MODE /* comFlag.*/
    }
    };

    /** \brief Global object for the MCSPI Flash application. */
    static mcspiAppCfgObj_t gFlashAppCfg;

    /* ========================================================================== */
    /* Function Definitions */
    /* ========================================================================== */

    /**
    * TODO: 1) While loop based delay used in main(). To be replaced with delay
    * utils once it is ready.
    * 2) Flash related functions are not generic currently.
    */

    int main()
    {
    int32_t status = S_PASS;
    volatile uint32_t count = 0x0FFFU;

    gFlashAppCfg = MCSPIAPPFLASH_DEFAULT;

    status = BOARDInit(NULL);

    /* Initialize the UART console */
    CONSOLEUtilsInit();

    /* Select the console type based on compile time check */
    CONSOLEUtilsSetType(CONSOLE_UTILS_TYPE_UART);

    CONSOLEUtilsPrintf("\nStarterWare MCSPI Flash Application!!\n");
    CONSOLEUtilsPrintf("BOARDInit status [0x%x]\n", status);

    /* Print SoC & Board Information. */
    SOCPrintInfo();
    BOARDPrintInfo();

    /* Get board info */
    status = McspiAppBoardInfoGet(&gFlashAppCfg);

    if (S_PASS == status)
    {
    /* Get SoC info */
    status = McspiAppSocInfoGet(&gFlashAppCfg);

    if (S_PASS == status)
    {
    /* Initialize the MCSPI controller. */
    status = MCSPIAppInit(&gFlashAppCfg);

    if(S_PASS == status)
    {
    /* Enable flash for writing data. */
    McspiAppWriteEnable(&gFlashAppCfg);

    /*
    * Wait until write enable command is successfully written to
    * flash.
    */
    while(FALSE == McspiAppIsWriteSuccess(&gFlashAppCfg));

    /* Erase a sector of flash.*/
    McspiAppSectorErase(&gFlashAppCfg);

    /* Pass the write enable command to flash.*/
    McspiAppWriteEnable(&gFlashAppCfg);

    /* Wait until write enable command is successfully written to flash.*/
    while(FALSE == McspiAppIsWriteSuccess(&gFlashAppCfg));

    /* Write data of 1 page size to flash.*/
    /* Currently the data is programmed for 256 bytes
    and is not configurable.*/
    McspiAppWriteToFlash(&gFlashAppCfg);

    /* Delay for Write to happen to Flash. */
    while(count--);
    count = 0x0FFFU;

    /* Read data of 1 page size from flash.*/
    McspiAppReadFromFlash(&gFlashAppCfg);

    /* Delay for read to happen from Flash. */
    while(count--);

    /* Verify the data written to and read from flash are same or not.*/
    McspiAppVerifyData();
    }
    else
    {
    CONSOLEUtilsPrintf("MCSPI initialization failed!\n");
    }
    }
    else
    {
    CONSOLEUtilsPrintf("MCSPI instance is not present\n");
    }
    }
    else
    {
    CONSOLEUtilsPrintf("This example is not supported on this board!\n");
    }

    return (S_PASS);
    }

    /* -------------------------------------------------------------------------- */
    /* Internal Function Definitions */
    /* -------------------------------------------------------------------------- */

    static int32_t McspiAppBoardInfoGet(mcspiAppCfgObj_t *pObj)
    {
    int32_t status = E_FAIL;
    chipdbModuleID_t modId;
    uint32_t mcspiInstNum;
    uint32_t mcspiCs;

    /* Get the MCSPI data for FLASH from the board data */
    //modId = BOARDGetDeviceCtrlModId(DEVICE_ID_W25Q64BV, MCSPI_FLASH_INST_NUM);

    /* if (CHIPDB_MOD_ID_INVALID == modId)
    {
    CONSOLEUtilsPrintf("Device is not available on this board!\n");
    }
    else if (CHIPDB_MOD_ID_MCSPI == modId)
    {
    */ /* Read the MCSPI instance number. */
    mcspiInstNum = 1; /*BOARDGetDeviceCtrlModInstNum(DEVICE_ID_W25Q64BV,
    MCSPI_FLASH_INST_NUM);*/

    /* Read the MCSPI chip select number. */
    mcspiCs = 0; /*BOARDGetDeviceCtrlInfo(DEVICE_ID_W25Q64BV,
    MCSPI_FLASH_INST_NUM);*/

    if ((INVALID_INST_NUM == mcspiInstNum) || (INVALID_INFO == mcspiCs))
    {
    CONSOLEUtilsPrintf("Invalid MCSPI board data!\n");
    }
    else
    {
    CONSOLEUtilsPrintf("MCSPI Instance number: %d\n", mcspiInstNum);
    CONSOLEUtilsPrintf("Channel/Chip Select number: %d\n", mcspiCs);
    pObj->instNum = mcspiInstNum;
    pObj->channelNum = mcspiCs;

    status = S_PASS;
    }
    /* }
    else
    {
    CONSOLEUtilsPrintf("Device is not connected to MCSPI!\n");
    } */

    return(status);
    }

    static int32_t McspiAppSocInfoGet(mcspiAppCfgObj_t *pObj)
    {
    int32_t status = E_FAIL;

    if (TRUE == CHIPDBIsResourcePresent(CHIPDB_MOD_ID_MCSPI, pObj->instNum))
    {
    /* MCSPI interrupt line number. */
    // pObj->intrCfg.intrLine = 65U;
    pObj->intrCfg.intrLine = 125U;

    /* Read the MCSPI instance base address. */
    pObj->instAddr = CHIPDBBaseAddress(CHIPDB_MOD_ID_MCSPI, pObj->instNum);
    CONSOLEUtilsPrintf("The instance address is %x\n", pObj->instAddr);

    status = S_PASS;
    }
    else
    {
    CONSOLEUtilsPrintf("The MCSPI instance number %d ", pObj->instNum);
    CONSOLEUtilsPrintf("is not present on the SOC\n");
    }

    return(status);
    }

    static void McspiAppWriteEnable(mcspiAppCfgObj_t *pCfgMcspi)
    {
    gFlashAppTxBuffer[0U] = FLASH_WRITE_ENABLE;

    pCfgMcspi->dataLength = 1U;

    MCSPIAppTransfer(pCfgMcspi);
    }

    static uint32_t McspiAppIsWriteSuccess(mcspiAppCfgObj_t *pCfgMcspi)
    {
    unsigned int retVal = FALSE;

    gFlashAppTxBuffer[0U] = FLASH_READ_STAT_REG1;
    gFlashAppTxBuffer[1U] = FLASH_DUMMY_BYTE;

    pCfgMcspi->dataLength = 2U;

    MCSPIAppTransfer(pCfgMcspi);

    if(0x02U == gFlashAppRxBuffer[1U])
    {
    retVal = TRUE;
    }

    return retVal;
    }

    static void McspiAppSectorErase(mcspiAppCfgObj_t *pCfgMcspi)
    {
    gFlashAppTxBuffer[0U] = FLASH_SECTOR_ERASE;
    gFlashAppTxBuffer[1U] = FLASH_SECTOR_ADD_HIGH;
    gFlashAppTxBuffer[2U] = FLASH_SECTOR_ADD_MID;
    gFlashAppTxBuffer[3U] = FLASH_SECTOR_ADD_LOW;

    pCfgMcspi->dataLength = 4U;

    MCSPIAppTransfer(pCfgMcspi);

    McspiAppIsFlashBusy(pCfgMcspi);
    }

    static void McspiAppIsFlashBusy(mcspiAppCfgObj_t *pCfgMcspi)
    {
    do{
    McspiAppFlashStatus(pCfgMcspi);
    } while(gFlashAppRxBuffer[1U] & FLASH_WRITE_IN_PROGRESS);
    }

    static void McspiAppFlashStatus(mcspiAppCfgObj_t *pCfgMcspi)
    {
    gFlashAppTxBuffer[0U] = FLASH_READ_STAT_REG1;
    gFlashAppTxBuffer[1U] = 0xFFU;

    pCfgMcspi->dataLength = 2U;

    MCSPIAppTransfer(pCfgMcspi);

    }

    static void McspiAppWriteToFlash(mcspiAppCfgObj_t *pCfgMcspi)
    {
    unsigned int index = 0U;

    gFlashAppTxBuffer[0U] = FLASH_PAGE_PROGRAM;
    gFlashAppTxBuffer[1U] = FLASH_SECTOR_ADD_HIGH;
    gFlashAppTxBuffer[2U] = FLASH_SECTOR_ADD_MID;
    gFlashAppTxBuffer[3U] = FLASH_SECTOR_ADD_LOW;

    for(index = 0U; index < 256U; index++)
    {
    gFlashAppTxBuffer[index + 4U] = (uint8_t) index;
    gFlashAppVerifyData[index] = (uint8_t) index;
    }

    pCfgMcspi->dataLength = 260U;

    MCSPIAppTransfer(pCfgMcspi);
    }

    static void McspiAppReadFromFlash(mcspiAppCfgObj_t *pCfgMcspi)
    {
    unsigned int index = 0U;

    gFlashAppTxBuffer[0U] = FLASH_DATA_READ;
    gFlashAppTxBuffer[1U] = FLASH_SECTOR_ADD_HIGH;
    gFlashAppTxBuffer[2U] = FLASH_SECTOR_ADD_MID;
    gFlashAppTxBuffer[3U] = FLASH_SECTOR_ADD_LOW;

    for(index = 4U; index < 260U; index++)
    {
    gFlashAppTxBuffer[index] = 0U;
    }

    pCfgMcspi->dataLength = 260U;

    MCSPIAppTransfer(pCfgMcspi);
    }

    static void McspiAppVerifyData(void)
    {
    unsigned int index = 0U;

    for(index = 4U; index < 260U; index++)
    {
    if(gFlashAppRxBuffer[index] != gFlashAppVerifyData[index - 4U])
    {
    CONSOLEUtilsPrintf("\r\nFAILURE!!!\r\n");
    CONSOLEUtilsPrintf("VerifyData: Comparing the data");
    CONSOLEUtilsPrintf(" written to and read");
    CONSOLEUtilsPrintf(" from Flash.\r\nThe two data blocks are");
    CONSOLEUtilsPrintf(" unequal. Mismatch found at index ");
    CONSOLEUtilsPrintf("%d", index);
    CONSOLEUtilsPrintf("\r\n");

    break;
    }
    }

    if(260U == index)
    {
    CONSOLEUtilsPrintf("\r\nSUCCESS!!!\r\nThe data in the Flash ");
    CONSOLEUtilsPrintf("and the one written to it are equal.\r\n");

    }
    }

    Thanks,
    Ted
  • Ted,
    Do you have something on the SPI bus along with the logic analyzer when you see the ISR hang behavior? I was able to step over this routine when running it. I only had the LA connected and just checking for any traffic on the bus.

    Lali
  • Lali,
    There's nothing on the SPI bus except the analyzer. Actually what I'm seeing may be as good as it gets until I make the same changes to my real device driver code and attach the SPI bus to our energy IC evaluation board's SPI interface. What is the slowest speed I can run the SPI Bus at? I'd like to run it at 9600 baud due to the fact that we are running the SPI bus from eval board to eval board. We're not looking for speed at this point till we have our real board designed with the SOC and device mounted together on it.
    Thanks,
    Ted
  • Ted,

    "Actually what I'm seeing may be as good as it gets..."

    You don't see any activity on the bus at all? or just traffic that doesn't make sense?

    I'm checking on the speed question. I don't know the floor to the speed.

    Lali

  • Lali,

    See good chip select but garbage on clock and mosi. Remember I'm not connected to anything at this point. The logic analyzer is clipped to pins inserted into the J3 connector like antennas. Need to run as slow as possible before running wires from the J3 connector to a similar spi connector on our maxim energy chip evaluation card. 

    So it would be great to know what my input and output clock settings need to be to get the slowest possible speed.

    Thanks,

    Ted

  • Ted,

    I saw garbage as well since I have a similar setup. Sorry that I could not provide more info than what I have already tried.
    I checked with a colleague on the min speed.
    He did not think that there was a minimum speed per say. The mins might be dictated by any sort of timeout that is implemented on the interfaced device, or the max divider the SPI module supports. You might even be able to go below 12MHz.

    Lali
  • Lali,

    OK I've attached the J3 SPI 1 interface to our maxim energy chip evaluation board SPI interface and have verified a good connection with our logic analyzer. I have the clock running at 15.63 KHZ.

    Thanks for the Support,

    Ted

  • Ted,

    Great! glad that I could help and thanks for using TI in your solution.

    Lali
  • Lali,

    FYI to make MISO J3 SPI1_DO work on our MM3359 ICE V2 Eval Board I had to modify the pin mux data for the board regarding the settings for the relavent mux'd SOC PIN_MCASP0_FSX . It was not "receiver enabled" so I enabled the receiver and now it works. I was always reading 0 from the McSPI 1 receive fifo now I'm reading the data I see on the logic analyzer coming from our attached slave device. Obviously this external J3 SPI1 interface was never tested with a real R/W SPI slave. Any customers using J3 SPI1_DO (MISO) attached to a real R/W SPI slave will encounter the same problem.

    See line 996 of the attached file for details.6278.am335x_icev2_pinmux_data.c

    Ted

  • Ted,
    Thanks for posting the file here and the feedback. I have passed it on to our developers.
    We are currently working on better documenting some of these procedures for our families of EVMs, so your feedback is invaluable.


    Lali