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.

AM437x NIMU_ICSS and SPI1

Other Parts Discussed in Thread: SYSBIOS

Hi,

a customer of mine tries to integrate SPI1 in the PDK example NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_arm_Exampleproject. As a proof of concept, they used the MCSPI_BasicExample_idkAM437x_armTestProject. This worked out quite nicely. When trying to integrate the code of this SPI example into the ICSS project, they fail to send data. It gets stuck at line

retVal = SPI_transfer(handle, &transaction);

in the attached example.NIMU_ICSS_BasicExample.zip

Could you kindly look into this (attached their code) and suggest how to get this running?

Best regards,
Phil

  • The RTOS team have been notified. They will respond here.
  • Hi,

    We are looking at this. This may be PINMUX, interrupt or .cfg issue from merge.

    Regards, Eric
  • Phil,

    Can the customer explain how they merged two projects (MCSPI and NIMU_ICSS) together? I imported their attached project and able to build. Then I looked at the .map file (also attached) https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/NIMU_5F00_ICSS_5F00_BasicExample_5F00_idkAM437x_5F00_wSoCLib_5F00_armExampleproject.map, I didn't see the functions like SPI_open(), SPI_transfer() in the map file.

    We have the wiki page http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_QSPI-McSPI  explaining the API and the MCSPI_BasicExample_idkAM437x_armTestProject also has the main() program showing how the API was called in void spi_test(UArg arg0, UArg arg1). Customer needs has the same call sequence for SPI parts in their merged project.

    Regards, Eric

  • Eric,

    looks like the project settings got screwed up somehow: the project includes modified files like e.g. main_a9.c, but the files that are in the project are not the files from the folder, but links to the ones that are included in the PDK distribution.
    In the main_a9.c that is included in the example, function spi_test() calls SPI_open(). This one is used as a separate task that is created in main().

    Regards,
    Philipp

  • Philipp,

    Then what is the next? Customer will check the projects to make sure the right files used and re-test? Or it is still not working?

    Regards, Eric
  • Eric,

    in the archive from the customer, the correct files have been used. Somehow the wrong files got used on my computer when looking into this.
    In the map file of customer, SPI_open() etc. show up correctly, but doesn't output any data.
    Can you include the correct files in your project and verify if it works for you? I expect that it doesn't work either. The follow-up question is: why doesn't it work? What needs to be changed?

    Regards,
    Philipp
  • Philipp,

    I haven't get chance try to combine two projects (MCSPI and NIMU_ICSS) together from scratch then debug if doesn't work, that efforts take a few days. I don't know how customer merged them together, is something wrong procedural or real bug in our driver?

    Some suggestions to combine two projects together:

    CCS projects has several parts:

    • Source files
    • configuration file
    • Complier options
    • Linker options

    The .cfg file is a merger of individual .cfg files from all the projects. The typical .cfg file has the follows:
    • General configuration: SYSBIOS modules loaded
    • BIOS configuration
    • Task configuration
    • Driver configuration: PDK driver modules loaded, including:
    • Cache and MMU configuration: cache and MMU setting
    • Memory sections configuration: place pinmux in OCMC_RAM

    Individual SYSBIOS project typically has following in main():

    {

    Board initialization

    Other initialization routines (e.g. interrupt crossbar)

    Task creation

    BIOS starts
    }

     

    In the merged one, the main routine has the similar functions:

    {

    Board initialization

    Initialization routines for project 1

    Initialization routines for project 2

    Task creation for project 1
    Task creation for project 2

    BIOS starts
    }

    Try to see if they merged project correctly.

    Regards, Eric

  • Hi Eric,

    looking through the merged main_a9.c, it seems that the initialization as well as the task creation has been integrated quite well. The possible issue that I spotted is that BIOS_start() is called twice, in line 663 (right after task creation of SwitchTask and SPI task) and also at the end of main() (line 764) after creating additional tasks for the ICSS.
    Could this lead to incorrect operation of the SPI?

    Regards,
    Philipp
  • Hi,

    You can't have two BIOS_start() in the code. BIOS_start() starts up task threads which then take over the application's flow of execution. All the application code after the first BIOS_start() can't be executed. You can only have BIOS_start() and it is typically at the end of main().

    Regards, Eric
  • Hi Eric,

    customer has tested with BIOS_start() just at the end of main(). Still doesn't work.

    Please find attached an exported project that I cleaned a little bit by commenting the SPI_log() calls before the BIOS has been started and also commented the first BIOS_start(). Can you test this on an IDK, please? Please advise how to get the SPI working.AM437_ICSS_SPI.zip

    Regards,

    Philipp

  • Philipp,

    I spent some time to create a merged project. See attached CCS project and all source codes. Please look at the readme.doc first.merge.zip

    Regards, Eric