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.

AM572x RTOS pinmux configuration

Other Parts Discussed in Thread: AM5728

We  have a requirement that we need to run Linux on Cortex A15 and TI RTOS on Cortex M4. The daughter board( microcontroller )
need to be connected via SPI from cortex M4(TI RTOS running here)

We have done the Pin configuration using PinMux tool and got the below generated files.
boardPadDelay.h
boardPadDelayDevice.c
boardPadDelayTune.h
boardPadDelayInit.c
genericFileFormatIOdelay.txt
genericFileFormatPadConf.txt

I have done the configuration in Linux in U-boot file mux_data.h by using above .txt files.

How to do the changes in TI RTOS running in Cortex M4. Is same generated files(.h and .c files) from Pin Mux tool be used here

or

only SPI peripheral configuration is enough and how to do the same.?

Example will be helpful.

  • Hi Vinay,

    I moved your thread to the device forum.

    Todd
  • Once the pinmux has been done in Linux, there is no need to do anything additionally.
  • Ok, thank you.

    In that case I have a question, How TI RTOS(running on Cortex M4) will know the pin configuration done on Linux( which is running on Cortex A15).


    Also please provide me the steps to use the PinMux generated files for pin configuration in case i run only TI-RTOS.

  • I have notified the RTOS team. They will reply here, but response may be delayed due to holidays in the USA.
  • Hi,

    For how to use the PINMUX files in RTOS enviornment, please check the wiki http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_Board_Support

    Regards, Eric

  • Vinay,

    In the Processor SDK RTOS, all the device driver examples and components rely on the Board library to do the SOC and EVM/custom hardware configuration before accessing the interfaces. In case were ARM is the system master and the u-boot code is used to initialize the device, the code on the slave cores, don`t need to initialize the SOC clocks, DDR, pinmux as specified by Biser.

    From the TI RTOS side, you should be using the BOARD_init call from the board library to initialize the device, when using with u-boot comment out that call and when you are debugging on the slave core and the u-boot is not used, you can call into the Board_init API to initialize the SOC and the EVM hardware.

    Hope this helps.

    Regards,
    Rahul
  • For incorporating the pinmux files into the PDK board library and making the correct IO delay configuration selection, please refer to the app note:

    Application Notes:
    www.ti.com/.../sprac44.pdf

    Section 9 of the Application development with Processor SDK RTOS training:
    software-dl.ti.com/.../index.html
  • Thank you Rahul, It is very useful information.

    And also i was going thorough the MCSPI_BasicExample_idkAM572x_m4ExampleProject there is a function MCSPI_Board_crossbarInit() in file SPI_idkAM572x_board.c. Is this for pin configuration?

    If I need to modify the same SPI example for evmAM572x what should I do?

  • Vinay,

     MCSPI_Board_crossbarInit doesn`t refer to the pinmux configuration. It refers to the IRQ_CROSSBAR module configuration that is part of the system interconnect on these devices that use to connect a hardware event generated from the peripheral to the Core interrupt controllers. Please refer to section 18.4.6.4 in the Technical reference manual for details regarding IRQ_CROSSBAR configuration on this device. 

    I believe this example is not supported on the EVM as the MCSPI pins are not brought out on that EVM or connected to any SPI slave devices. One critical change for testing this example on the EVM is to link to evmAM572x board library instead of idkAM572x board library you can do that by changing following lines in the .cfg script of that example.

    Remove line marked in red and add line marked in green

    /* Load the board package */
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "idkAM572x";

    Board.Settings.boardName = "evmAM572x";

    With this setting, when you call Board_Init API, the clocks, DDR, pinmux, PRCM initialization for EVM will be invoked instead of IDK. Please note that if MCSPI interface is not available or pinned out on the EVM, the pinmux will not be set similar to the IDK.

    Regards,

    Rahul

     


  • Thank you Rahul,

    we have connected 2 SPI slave devices to evm. Configured one with SPI4 and other with SPI3.

    we have done the pin configuration for the same in linux.

    One slave device connected with SPI4 pins, which  needs to communicate from CortexM4 running with TI-RTOS, and other with Linux.

    Currently my focus is to communicate with one SPI slave device from Cortex M4 with TI-RTOS.

    To assign the pins for SPI communication in linux, we modify in device tree. In TI TROS where do we assign which pins to use for SPI communication.

    Following is the pin configuration for SPI4 pins: if required we can modify pin configuration in TI RTOS also for verifying now.
    SPI4_IOSet_5
    spi4_sclk    AC8
    spi4_d0    AB8
    spi4_d1    AD6
    spi4_cs0    AB5
      gpio6_19        B26        DataR

    boardPadDelayInit.c:

    /* SPI4 - spi4_sclk on AC8 - SPI4 (exp) */
         {0x1794, 0x10001, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

    /* SPI4 - spi4_d0 on AB8 - SPI4 (exp) */
         {0x179C, 0x10001, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

    /* SPI4 - spi4_d1 on AD6 - SPI4 (exp) */
         {0x1798, 0x50001, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

    /* SPI4 - spi4_cs0 on AB5 - SPI4 (exp) */
         {0x17A0, 0x10001, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

  • Hi,

    Please let me know where do we assign which pins to use for SPI communication in TI RTOS for the above pin configuration.

    Regards,

    Vinay

  • Vinay,

    Once you have initialized the Pinmux from u-boot/Linux, you shouldn`t be required to re do the setup on the M4, you can comment out the Board_Init() that happens in M4 RTOS examples and just uses the initialization.

    The only example that I have to share with you at this time is provided in the APp Note 

    The code uses ICSS_EMAC and PRUSS driver on the M4 while Linux application is running on the ARM. The example uses IPC example as a starting point and then integrates the ICSS M4 driver in the M4 code. We do plan to add more examples to the SDK that demonstrate this use case.

    Regards,

    Rahul

  • Hello Mr Prabhu.

     

    I'm joining to this discussion because we have similar problem (perhaps) with a different board: we are using a Phytec phyCoreAm572x SOM, a module based on Sitara AM5728, and we are following the same idea of Mr. Visnay (A15 running under Linux and M4+DSP under TI-RTOS). Starting from Pinmux file we regenerated libraries in AM57xx SDK after overwriting four files generated by Pinmux Tool but later any attempt to use physical resources like GPIO pin or I2C ends with a crash. Let me explain better the problem: unfortunately, Phytec is not releasing any GEL file to debug code tailored for phyCore AM572x SOM and in two months of research in TI site we found only a very old document describing GEL format but no indication about creation. Following one of the on-line training you suggested to Mr. Visnay, Clock Tree Tool was indicated for generating this kind of files and it's plausible that some GEL files come from this tool because clock tree must be configured at some point during the initialization performed via GEL files (by the way we tried to play with Sitara CTT  but we didn't discover the way to generate any GEL file: do you know if CTT is the right tool to get GEL file for a custom board and, if it is, do you know what is the procedure to generate GEL files?). But it's not clear how CTT could address the pad configuration problem: digging in GEL files folder under <CCS installation folder>\ccs_base\emulation\boards\am572x\gel  in AM572x_pad_config.gel we found the following comment at line 129 : "Based on Pad Configuration Tool" but a Pad Configuration Tool is not released by TI for Sitara AM57xx. So this lead us to the first request: do you know what tools are required to generate GEL file for a custom board? Do you know where I can find documentation about this topic?

    In this conditions and due to the PMIC management we followed two main ideas s but none successful:

    a) Let Uboot and Linux kernel to initialize the board and then via JTAG using GEL files tailored for the TI's AM572x GP EVM, reset A15 and then take the control of the board (I can describe better the process if needed): at this point our hope was that calling Board_init  from M4 or A15 was enough to reconfigure the system superimposing in this way the new pin configuration to the old one performed by GEL files. Unfortunately, this works until we don't touch some hw resources like GPIO pin or I2C channel: a Hello World demo or something more complex runs without problem on M4 or DSP.; but on hw resources the situation varies a lot depending by parameters passed to the Board_init function. We have an immediate crash calling it whit BOARD_INIT_ALL parameter or strange behaviors calling only BOARD_INIT_PINMUX_CONFIG and BOARD_INIT_MODULE_CLOCK: depending by the channel we deal with, we have a crash (for example choosing I2C channel 5), no activity on I2C after calling I2C_transfer (in case of channel 3) or only slave addressing and no more (in case of channel 1): in the last two cases the sw is blocked in Idle Task waiting some event releasing the calling task of I2C_transfer API function. 

    b) After loading Linux image on A15 and with A15 alive running under Linux, from “Non Debuggable Devices" connect IcePick_d: this releases IPU cores from reset so after connecting IPU0, a code is downloaded via JTAG. But later a reset of the M4 core, perhaps triggered by A15, occurs during handle creation (output of I2C_open API function): this occurs independently by the chosen channel number.

    We made many experiments but nothing is working with Phytec board; recently we bought a TI's AM772x GP EVM and using original SDK and GEL files provided by TI everything is fine: all code examples in SDK are working, running under TI RTOS on A15 or M4. The only thing we discovered was that omitting parameters like BOARD_INIT_PINMUX_CONFIG or BOARD_INIT_UART_STDIO the code stops to work: this means that some initialization is needed even if GEL files take care to initialize the board: there exists a document describing what is done by Board_init and what initialization is required?

    Another important point is that it's not clear how to configure the system in a way that later allows to debug the entire multicore with A15 running under Linux: the final goal is always to have A15 working with Linux and remaining cores with TI RTOS so at some point we need to debug IPC and synchronization mechanism: in TI's AM572x GP EVM Hardware Setup site there is a brief description in the paragraph "Connect after booting from SD card" but it's not enough to understand how it works. Do you have further information about it ? 

    Thank you for your attention and best regards,

    Scianni Vincenzo

  • Hi,

    Some for your questions:
    in TI's AM572x GP EVM Hardware Setup site there is a brief description in the paragraph "Connect after booting from SD card" but it's not enough to understand how it works. Do you have further information about it ?

    When you boot an image from the SD card, the secondary boot loader (SBL/MLO) will configure the device clocks, DDR and wake up the slave cores on the AM572x processor on GP EVM hence you don`t need the GEL initialization scripts to redo the clock and DDR settings.

    How do you create a CCS target configuration WITHOUT GEL file? It is explained in the next pargrapgh: ... Select .... and target as AM5728_RevA. This target setting will not populate the GEL files when you connect to the target.

    there exists a document describing what is done by Board_init and what initialization is required?
    To understand what exactly intialized, you need to look at the source code in Board folderpdk_am57xx_1_0_6\packages\ti\board\src\evmAM572x , such as individual functions:

    Board_STATUS Board_init(Board_initCfg cfg)
    {
    Board_STATUS ret = BOARD_SOK;

    if (cfg & BOARD_INIT_UNLOCK_MMR)
    ret = Board_unlockMMR();
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_PLL)
    ret = Board_PLLInit(OPP_NOM);
    else if(cfg & BOARD_INIT_PLL_OPP_HIGH)
    ret = Board_PLLInit(OPP_HIGH);
    else if(cfg & BOARD_INIT_PLL_OPP_OD)
    ret = Board_PLLInit(OPP_OD);
    else if(cfg & BOARD_INIT_PLL_OPP_NOM)
    ret = Board_PLLInit(OPP_NOM);
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_MODULE_CLOCK)
    ret = Board_moduleClockInit();
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_PINMUX_CONFIG)
    ret = Board_pinmuxConfig();
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_DDR)
    ret = Board_DDR3Init();
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_WATCHDOG_DISABLE)
    ret = Board_watchdogDisable();
    if (ret != BOARD_SOK)
    return ret;

    if (cfg & BOARD_INIT_UART_STDIO)
    ret = Board_uartStdioInit();
    if (ret != BOARD_SOK)
    return ret;

    return ret;
    }

    For example in Board_moduleClockInit(), I2C1/2/3/4 clock is enabled, no I2C5. In that case, you need adapt your own board for this.

    Regards, Eric