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.

AM3358: MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject

Part Number: AM3358

The project compile is success. But If I add symbol SPI_DMA_ENABLE. The project compile failed. Here is what I get

makefile:147: recipe for target 'MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.out' failed

./main_mcspi_slave_mode.o: In function `MCSPIApp_edmaInit':

C:/ti/pdk_am335x_1_0_15/packages/ti/drv/spi/example/mcspi_slavemode/src/main_mcspi_slave_mode.c:446: undefined reference to `edma3init'

collect2.exe: error: ld returned 1 exit status

gmake[1]: *** [MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.out] Error 1

gmake: *** [all] Error 2

makefile:143: recipe for target 'all' failed

What am I missing. Thanks

  • I saw

    C:\ti\edma3_lld_2_12_05_30D\packages\ti\sdo\edma3\drv\sample\src\sample_arm_init has edma3init definition. What header file or

    ath am I missing? Thanks

  • Even if I add

    /* EDMA3 Header files */

    #include <ti/sdo/edma3/drv/edma3_drv.h>

    #include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>//which include edma3init and I add here

    #include <ti/sdo/edma3/rm/edma3_rm.h>

    #include <ti/sdo/edma3/rm/sample/bios6_edma3_rm_sample.h>

    I still get

    makefile:147: recipe for target 'MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.out' failed

    ./main_mcspi_slave_mode.o: In function `MCSPIApp_edmaInit':

    C:/ti/pdk_am335x_1_0_15/packages/ti/drv/spi/example/mcspi_slavemode/src/main_mcspi_slave_mode.c:447: undefined reference to `edma3init'

    collect2.exe: error: ld returned 1 exit status

    gmake[1]: *** [MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.out] Error 1

    makefile:143: recipe for target 'all' failed

    gmake: *** [all] Error 2

    What should I do to solve issue? Thanks

  • Hi Anping,

    Please see below for the steps I followed to get this example to build for BBB with SPI_DMA_ENABLE. Unfortunately I don't currently have access to any hardware, so I can't test whether the build operates correctly.

    Regards,
    Frank

    1. Check for "SPI_DMA_ENABLE" in examples

    $ cd pdk_am335x_1_0_15/packages/ti/drv/spi/example/mcspi_slavemode
    $ grep -rI -n -i --regexp="SPI_DMA_ENABLE" -l

    am437x/armv7/bios/MCSPI_SlaveMode_MasterExample_idkAM437x_armExampleProject.txt
    am437x/armv7/bios/MCSPI_SlaveMode_SlaveExample_idkAM437x_armExampleProject.txt
    am571x/armv7/bios/MCSPI_SlaveMode_MasterExample_idkAM571x_armExampleProject.txt
    etc.

    These are the .txt files which are used by the pdkProjectCreate script to generate the CCS projects. I noticed "SPI_DMA_ENABLE" doesn't appear in any of the am335x projects, but that it appears in AM437x projects.

    2. Create backup for existing AM335x project files. Update DMA settings to match those in AM437x project.

    • cd pdk_am335x_1_0_15\packages\ti\drv\spi\example\mcspi_slavemode\am335x\armv7\bios
    • copy MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.txt to MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject_bak.txt : need to add application-level EDMA3 integration code & SPI_DMA_ENABLE compiler pre-define
    • copy spi_arm_bbbAM335x_slavemode.cfg to spi_arm_bbbAM335x_slavemode_bak.cfg : need to add settings to include EDMA LLD & enable DMA for SPI LLD


    3. Generate AM335x projects using pdkProjectCreate:

    cd pdk_am335x_1_0_15\packages
    pdkprojectcreate AM335x bbbAM335x little spi all arm


    4. Import project into CCS & build project.

    The updated files are attached here.

    MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject.txt
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/soc/am335x/sample_am335x_arm_int_reg.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/soc/am335x/sample_am335x_cfg.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/soc/am335x/sample_arm_cs.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/soc/am335x/sample_arm_init.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/example/mcspi_slavemode/src/main_mcspi_slave_mode.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/example/mcspi_slavemode/src/SPI_log.c"
    -ccs.linkFile "PDK_INSTALL_PATH/ti/drv/spi/example/mcspi_slavemode/am335x/armv7/bios/spi_arm_bbbAM335x_slavemode.cfg"
    -ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DSOC_AM335x -DbbbAM335x -DMCSPI_MASTER_TASK -DSPI_DMA_ENABLE -DMCSPI_MULT_CHANNEL -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/spi "  -rtsc.enableRtsc
    -ccs.setLinkerOptions " -lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections  "
    

    spi_arm_bbbAM335x_slavemode.cfg

    Regards,
    Frank

  • Anping,

    Please let me know if this resolves your issue.

    Regards,
    Frank

  • Hi Frank

         I follow your steps. It build success but

    Symbols SPI_DMA_ENABLE doesn't define! I define Symbols SPI_DMA_ENABLE. It build success. I debug it

    line 446 gEdmaHandle = (EDMA3_RM_Handle)edma3init(edma3Id, &edmaResult); failed. I even can't check edmaResult because it doesn't reach next line. Console has

    CortxA8: Unhandled ADP_Stopped exception 0x8003F608

    Thanks

  • Anping,

    I would remove all optimizations for debugging:

    • Right click on project->Properties
    • Build->GNU Compiler->Optimization
    • Select blank or "None (-O0)" for Optimization level.

    Then rebuild the code.

    Can you put a breakpoint on the edma3init() call? You should be able to step into this function since it's defined at the application level in sample_arm_init.c. You might be able to get a better understanding of where the failure occurs, e.g. EDMA3_DRV_create(), edma3OsSemCreate(), EDMA3_DRV_open(), etc.

    Regards,
    Frank

  • Hi Frank

        I try to step into edma3init() but I get

    Can't find a source file at "src/sample_arm_init.c"

    Thanks

  • Anping,

    You should see a "locate file" button. Click on that and navigate to the folder which contains the file.

    pdk_am335x_1_0_15/packages/ti/drv/spi/soc/am335x

  • Hi Frank

    edma3Result = EDMA3_DRV_create (edma3Id, globalConfig ,

    (void *)&miscParam);

    failed.

    Thanks

  • Hi Frank

    result = EDMA3_RM_create(phyCtrllerInstId, (EDMA3_RM_GblConfigParams *)&rmGblCfgParams, miscParam);

    failed.

    I try to step into it I get

    Can't find a source file at "/db/ztree/library/trees/newlib/newlib-a00/src/linaro/gcc-arm-none-eabi-7-2017-q4-major/src/newlib/libgloss/arm/swi.h"

    Thanks

  • Hi Frank

        I stop at edma3resmgr.c line 6147 ptrEdmaccRegs->EMCR = EDMA3_RM_SET_ALL_BITS; Here is message

    Break at address "0x80022c10" with no debug information available, or outside of program code.

    How to fix it? By the way why I need to locate the file during debug? How to do to let the code to locate by itself. Thanks

  • Anping,

    I spoke with the developer about this. He said that although DMA mode is supported in the SPI driver for AM3, we've probably never had a test case to verify DMA mode. Verifying support will require some debug effort in the SPI & EDMA drivers.

    Regards,
    Frank

  • Hi Frank

           Does MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject work or not? If it works, MCSPIApp_edmaInit should work. But it doesn't!. My project use this function. Can you ask your developer about

    edma3resmgr.c line 6147 ptrEdmaccRegs->EMCR = EDMA3_RM_SET_ALL_BITS; Here is message

    Break at address "0x80022c10" with no debug information available, or outside of program code.

    ? Thanks

        

  • Anping,

    Like I said, I spoke with the developer about the problems you're encountering. He said that although DMA mode is supported in the SPI driver for AM3 (i.e. the code is available and compiles):

    1. We've probably never had a test case to verify DMA mode.
    2. Verifying DMA mode will require some debug effort in the SPI & EDMA drivers.

    I can't check whether it works right now since I don't have access to a board. Given your observations I would have to say it isn't working.

    Please let me know if this answers your question..

    Regards,
    Frank

  • Hi Frank

        It is not just for McSPI. UART use edma3init also. If TI can't solve it, user can't use your DMA mode at all. Please ask the developer why can the code not set register? I don't think it is very hard to solve it. Thanks

  • Anping,

    Thanks much for the feedback.

    I'm already pursuing the UART issue with the developer. I'll also pursue this issue myself when I obtain my BBB.

    Regards,
    Frank

  • Hi Frank

        The software components are fully tested to ensure that they work together with TI’s Code Composer Studio integrated development environment when I download your PDK. What can I say when you wrote

    although DMA mode is supported in the SPI driver for AM3, we've probably never had a test case to verify DMA mode. Verifying support will require some debug effort in the SPI & EDMA drivers.

    In fact we are very big customer for TI. We might order 10000+ AM3358 for our product. I really hope TI can solve this DMA issue. Thanks

  • Anping,

    I appreciate your concerns. I've notified the developer concerning your observations. I'll also raise this issue with my management.

    Unfortunately I'm constrained in what I can do to help since I don't have access to my hardware.

    https://www.bizjournals.com/dallas/news/2019/10/21/texas-instruments-closes-south-campus-storm-damage.html

    The South Campus site is now re-opened, but my office (containing my hardware) is still closed.

    Regards,
    Frank

  • Hi Frank

        When I debug, it pop up message box

    An internal error occurred during: "Computing hover expression".
    java.lang.NullPointerException

    What is wrong with it?

    We must go through all your example projects for AM3358 on BeagleBone Black and have better understanding on AM3358 before we go ahead. The workable DMA mode is big plus because DMA can improve the performance no matter with SPI and UART.

    When I execute edmaresmgr.c line 6147 ptrEdmaccRegs->EMCR = EDMA3_RM_SET_ALL_BITS; I get message

    Break at address "0x80022c10" with no debug information available, or outside of program code.

    what should I do? Is it memory issue? I notice task = Task_create(masterTaskFxn, NULL, &eb);

    Task use default value. What is default value? Is it large enugh? Thanks

  • Anping,

    I've looped in a colleague who's currently in a better position to help you. Thanks for your patience.

    Regards,
    Frank

  • Hi Anping,

    I was able to reproduce the issue you observed: "When I execute edmaresmgr.c line 6147 ptrEdmaccRegs->EMCR = EDMA3_RM_SET_ALL_BITS; I get message. Break at address "0x80022c10" with no debug information available, or outside of program code."

    Essentially this is caused by MMU configuration for EDMA TPCC, can you please try to add the followings in .cfg file:

    var peripheralBaseAddr = 0x49000000;

    /* Configure the corresponding MMU page descriptor accordingly */
    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
    peripheralBaseAddr,
    peripheralAttrs);

    Regards,

    Garrett

  • Hi Garrett

         It fixed the EDMA issue. TI should update your example projects also. Thanks

  • Anping,

    Thanks for your confirmation! Yes, we have created an internal JIRA ticket to track the issue and merge the fix in future PRSDK releases.

    Regards,

    Garrett

  • Hi Garrett

         For MCSPI_SlaveMode_MasterExample_bbbAM335x_armExampleProject

    spi_cfg.edmaHandle = MCSPIApp_edmaInit();

    execute without crash. But

    SPI master slave test master in dma mode have failed

    ->line 978 SPI_test_mst_slv_xfer return false

    ->line 834 SPI_verify_data(masterRxBuffer, srcPtr, xferBytes) return false

    what is wrong? Thanks

          

  • UART_BasicExample_bbbAM335x_armTestProject works fine.

  • Anping,

    Are you still observing this failure?

    Regards,
    Frank

  • Hi Frank

         Yes. I think only two boards work together for this test to pass. That is why I want to know how to debug these two McSPI example projects together. Thank

  • Anping,

    Understood, I'll close this thread and use the other thread for our discussions moving forward.

    https://e2e.ti.com/support/processors/f/791/t/853640

    Regards,
    Frank