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.

Newbee question

Other Parts Discussed in Thread: OMAP-L137

Folks,

I am trying to learn the basic of programming TI 6747 DSP with CCS 3.3. I have a OMAP-L137/6747 EVM. And by looking around at the various wiki links at site http://wiki.davincidsp.com/ I was able to load the uartExample through CCS onto target. I was also able to modify it to basically echo characters back to UART interface. However, I can only run it through CCS. When I try to make an AIS bin file from the uartsample.out for EVM target platform and boot it through UART, It does not work.  UartHost.exe indicates it is able to copy the ais/bin file fine. When I reset the board whilie connected to board using Hyperterminal I see word BOOTME and typeing R results in echo back of character X. Which indicates that the EVM is correctly set to boot from UART.

I read the link index.php/Flashing_the_C6747#Flashing_the_Board and I guess I have to do something similar. for this to work. But I do not understand what.

I guess my question is that why are the libraries from uartSample program not used by default. In general, what is the way of making bin files from .out files. 

 

I should mention I am complete newbee to this platform/DSP development so something very simple may be a problem here.

 

Also Is there a good introductory tutorial on how to write a helloworld program for this DSP and having it echo-ed back through UART interface. (preferably in a while 1 loop)

 

thanks

Arun

  • Hi Arun,

    Did you put the initializations that are in the GEL file into you code? This is described at: 

    http://tiexpressdsp.com/index.php/Flashing_the_C6747#Modifying_PSP_Examples

  • Mariana,

    Yes, I have read the instructions on that link already. what I want to know is, if the initialization code mentioned in the above link work for uart example ? 

    I am also looking at thread http://e2e.ti.com/forums/p/2421/9140.aspx and it seems to me that I should be able to cut paste code from gel file. But which part ? Also it seems one of the TI engineers discourages against doing that ? So I am a bit confused.

    thanks

    Arun

  • Hi Arun,

    If the functions inside the GEL file can be easily converted to C code there is no problem in doing it. What Tim means in this post is that the examples should come with initialization code and not depend on the GEL file: 

    http://e2e.ti.com/members/1123652/default.aspx

    As they do not come with initialization code, you can look at the GEL file and get the initializations from there.

    I will need to take a look in the uart example to see if the initializations match, but you can take a look at the gel file and see if there is anything else there that fits the UART example.

  • Hi Arun,

    I did the exact initializations that are made in the article for the audio example for the uart example and I was able to make it work from flash. The ais file attached works if burned to flash according to the article. Please try it. This way we can know if you are not making the initializations correctly or you are not burning the flash correctly.

    You will need to rename the attached file from .txt to .ais as the forum will not let me post a .ais file.

  • Hi Mariana,

    thanks, I appreciate your help. And just to be clear I am a complete newbie to this DSP and CCS.

    Let me describe again what I am trying to do. (I have a Eval Module OMAP-L137)

    In our design we want to boot C6747 using UART. 

     I read the document sprab04.pdf, section 8 on booting over UART using PC. To verify the boot instructions, I decided to boot one of the examples onto the EVM board using UART. The idea is that If I can get the the example image to boot using uarthost.exe then I can use the uarthost.cs file and modify it and put the image using UART on my board.So I took uartSample.out file and converted it to bin file using the AISGen tool as described in sprab04.pdf and also one of the wiki links you mentioned. I put it on to EVM board using uarthost.exe from my PC. The image is put onto the board but the uart example did not work. 

    Yesterday, after your reply I decided to use audioSample.out for the same. I verified I could program C6747 using the EVM board through CCS. The line-in was being echoed to HP-out correctly. Next I tried to follow the instructions per http://tiexpressdsp.com/index.php/Flashing_the_C6747#Modifying_PSP_Example But the bin file I generated using AIS and transferred to C6747 through UART does not do the audio Echo.

    Is there a problem using AISgen to generate a binary file for boot over UART. By default it tries to generate image for boot using SPI flash.

    This is my audiosample_main.c. I did not modify audiosample_io.c. I would also like to learn how the function audio_echo_task is invoked from the entry point. I cannot figure it out by just looking at this code.

     

     

    #include <stdio.h>

    #include <std.h>

    #include <log.h>

    #include "ti/pspiom/psc/Psc.h"

    #include "ti/pspiom/cslr/cslr_psc_C6747.h"

    #include "ti/pspiom/mcasp/Mcasp.h"

    #include "ti/pspiom/cslr/cslr_psc_C6747.h"

    #include "ti/pspiom/platforms/codec/Aic31.h"

    #include "ti/pspiom/platforms/evm6747/audio/Audio.h"

    #include "ti/pspiom/platforms/evm6747/Audio_evmInit.h"

     

    extern LOG_Obj trace;

     

    /* ========================================================================== */

    /*                           MACRO DEFINTIONS                                 */

    /* ========================================================================== */

     

    /*

     * Mcasp device params. To be filled in userMcaspInit function which

     * is called before driver creation

     */

    Mcasp_Params audioMcaspParams;

     

    /*

     * Aic31 device params. To be filled in userAic31Init function which

     * is called before driver creation

     */

    Aic31_Params audioAic31Params;

     

    /*

     * Audio device params. To be filled in userAudioInit function which

     * is called before driver creation

     */

     

    Audio_Params audioParams;

     

     

     

    #define SYS_BASE               0x01C14000

    #define KICK0R                 *(unsigned int*)(SYS_BASE + 0x038)  

    #define KICK1R                 *(unsigned int*)(SYS_BASE + 0x03c)  

    #define PINMUX0               *(unsigned int*)(SYS_BASE + 0x120) //PINMUX0

    #define PINMUX1       *(unsigned int*)(SYS_BASE + 0x124) //PINMUX1

    #define PINMUX2       *(unsigned int*)(SYS_BASE + 0x128) //PINMUX2

    #define PINMUX3       *(unsigned int*)(SYS_BASE + 0x12C) //PINMUX3

    #define PINMUX4       *(unsigned int*)(SYS_BASE + 0x130) //PINMUX4

    #define PINMUX5       *(unsigned int*)(SYS_BASE + 0x134) //PINMUX5

    #define PINMUX6       *(unsigned int*)(SYS_BASE + 0x138) //PINMUX6

    #define PINMUX7       *(unsigned int*)(SYS_BASE + 0x13C) //PINMUX7

    #define PINMUX8       *(unsigned int*)(SYS_BASE + 0x140) //PINMUX8

    #define PINMUX9       *(unsigned int*)(SYS_BASE + 0x144) //PINMUX9

    #define PINMUX10       *(unsigned int*)(SYS_BASE + 0x148) //PINMUX10

    #define PINMUX11       *(unsigned int*)(SYS_BASE + 0x14C) //PINMUX11

    #define PINMUX12       *(unsigned int*)(SYS_BASE + 0x150) //PINMUX12

    #define PINMUX13       *(unsigned int*)(SYS_BASE + 0x154) //PINMUX13

    #define PINMUX14       *(unsigned int*)(SYS_BASE + 0x158) //PINMUX14

    #define PINMUX15       *(unsigned int*)(SYS_BASE + 0x15C) //PINMUX15

    #define PINMUX16       *(unsigned int*)(SYS_BASE + 0x160) //PINMUX16

    #define PINMUX17       *(unsigned int*)(SYS_BASE + 0x164) //PINMUX17

    #define PINMUX18       *(unsigned int*)(SYS_BASE + 0x168) //PINMUX18

    #define PINMUX19       *(unsigned int*)(SYS_BASE + 0x16C) //PINMUX19

    #define CFGCHIP2               *(unsigned int*)(SYS_BASE + 0x184) 

     

    /*PSC Module Related Registers*/ 

     

    #define PSC0_BASE   0x01C10000 

    #define PSC1_BASE   0x01E27000

     

    #define PSC0_MDCTL (PSC0_BASE+0xA00)

    #define PSC0_MDSTAT (PSC0_BASE+0x800)

    #define PSC0_PTCMD   *(unsigned int*) (PSC0_BASE + 0x120)

    #define PSC0_PTSTAT *(unsigned int*) (PSC0_BASE + 0x128)

     

    #define PSC1_MDCTL   (PSC1_BASE+0xA00)

    #define PSC1_MDSTAT (PSC1_BASE+0x800)

    #define PSC1_PTCMD   *(unsigned int*) (PSC1_BASE + 0x120)

     

    #define PSC1_PTSTAT *(unsigned int*) (PSC1_BASE + 0x128)

    /* ========================================================================== */

    /*                           FUNCTION DEFINITIONS                             */

    /* ========================================================================== */

    /*Enable Function for PSC0*/

     

    void PSC0_lPSC_enable(unsigned int PD, unsigned int LPSC_num) {

     

     *(unsigned int*) (PSC0_MDCTL+4*LPSC_num) = (*(unsigned int*) (PSC0_MDCTL+4*LPSC_num) & 0xFFFFFFE0) | 0x0003;

     PSC0_PTCMD = 0x1<<PD;

     while( (PSC0_PTSTAT & (0x1<<PD) ) !=0) ; /*Wait for power state transition to finish*/

     while( (*(unsigned int*)(PSC0_MDSTAT+4 * LPSC_num) & 0x1F) !=0x3); 

    }

     

    /*Enable Function for PSC1*/

     

    void PSC1_lPSC_enable(unsigned int PD, unsigned int LPSC_num) {

     

     *(unsigned int*) (PSC1_MDCTL+4*LPSC_num) = (*(unsigned int*) (PSC1_MDCTL+4*LPSC_num) & 0xFFFFFFE0) | 0x0003;

     PSC1_PTCMD = 0x1<<PD;

     while( (PSC1_PTSTAT & (0x1<<PD) ) !=0) ; /*Wait for power state transition to finish*/

     while( (*(unsigned int*)(PSC1_MDSTAT+4 * LPSC_num) & 0x1F) !=0x3);

    }

     

    void Setup_System_Config( )

    {

     

        KICK0R = 0x83e70b13;  // Kick0 register + data (unlock)

        KICK1R = 0x95a4f1e0;  // Kick1 register + data (unlock)

     

        PINMUX0  = 0x11111188;  // EMIFB, Check EMU0/RTCK

        PINMUX1  = 0x11111111;  // EMIFB

        PINMUX2  = 0x11111111;  // EMIFB

        PINMUX3  = 0x11111111;  // EMIFB

        PINMUX4  = 0x11111111;  // EMIFB

        PINMUX5  = 0x11111111;  // EMIFB

        PINMUX6  = 0x11111111;  // EMIFB

        PINMUX7  = 0x11111111;  // EMIFB, SPI0

        PINMUX8  = 0x21122111;  // UART2, McASP1, I2C0, I2C1

        PINMUX9  = 0x11011112;  // RMII CLK, McASP0, USB_DRVVBUS, UART2

        PINMUX10 = 0x22222221;  // RMII/ McASP0

        PINMUX11 = 0x11112222;  // McASP1, UART1, McASP0, MDIO (last 2 digits 0x22 for MDIO  instead of GPIO)

        PINMUX12 = 0x11111111;  // McASP0 / McASP1

        PINMUX13 = 0x22111111;  // SD / McASP1

        PINMUX14 = 0x88222222;  // SD / EMIFA

        PINMUX15 = 0x21888888;  // SD / EMIFA

        PINMUX16 = 0x11111112;  // SD / EMIFA

        PINMUX17 = 0x00100111;  // EMIFA

        PINMUX18 = 0x11111111;  // EMIFA

        PINMUX19 = 0x00000001;  // EMIFA

     

        CFGCHIP2 |= 0x00001000; // Enable USB1 clock

    }

     

     void Setup_Psc_All_On( )

    {

       int i;

     

       // PSC0

       PSC0_lPSC_enable(0, 0);

       PSC0_lPSC_enable(0, 1);

       PSC0_lPSC_enable(0, 2);

       PSC0_lPSC_enable(0, 3);  // EMIFA

       PSC0_lPSC_enable(0, 4);

       PSC0_lPSC_enable(0, 5);

       PSC0_lPSC_enable(0, 6);

       PSC0_lPSC_enable(0, 8);

       PSC0_lPSC_enable(0, 9);

       PSC0_lPSC_enable(0, 10);

       PSC0_lPSC_enable(0, 11);

       PSC0_lPSC_enable(0, 12);

       PSC0_lPSC_enable(0, 13);

     

    // PSC1

       PSC1_lPSC_enable(0, 1);

       PSC1_lPSC_enable(0, 2);

       PSC1_lPSC_enable(0, 3);

    PSC1_lPSC_enable(0, 4);

       PSC1_lPSC_enable(0, 5);

       PSC1_lPSC_enable(0, 6);  // EMIFB

       PSC1_lPSC_enable(0, 7);

       PSC1_lPSC_enable(0, 8);

       PSC1_lPSC_enable(0, 9);

       PSC1_lPSC_enable(0, 10);

       PSC1_lPSC_enable(0, 11);

       PSC1_lPSC_enable(0, 12);

       PSC1_lPSC_enable(0, 13);

       PSC1_lPSC_enable(0, 16);

       PSC1_lPSC_enable(0, 17);

       PSC1_lPSC_enable(0, 20);

       PSC1_lPSC_enable(0, 21);

       PSC1_lPSC_enable(0, 24);

       PSC1_lPSC_enable(0, 25);

       PSC1_lPSC_enable(0, 26);

       PSC1_lPSC_enable(0, 31);

    }

     

    /**

     *  \brief  Void main(Void)

     *

     *   Main function of the sample application. This function enables

     *   the mcasp instance in the power sleep controller and also

     *   enables the pinmux for the mcasp 1 instance.

     *

     *  \param  None

     *  \return None

     */

     

    Void main(Void)

    {

        LOG_printf(&trace,"\r\nAudio Sample Main\n");

     

     

        Setup_System_Config( );

        Setup_Psc_All_On( );

        /* call the function to configure the evm specific options                */

        configureAudio();

     

        return;

    }

     

     

    /*

     * Aic31 init function called when creating the driver.

     */

    void audioUserAic31Init()

    {

        Aic31_init();

        audioAic31Params = Aic31_PARAMS;

        audioAic31Params.acCtrlBusName = "/i2c0";

    }

     

    /*

     * Mcasp init function called when creating the driver.

     */

    void audioUserMcaspInit()

    {

        /* power on the Mcasp 1 instance in the PSC  */

        Psc_ModuleClkCtrl(Psc_DevId_1, CSL_PSC_MCASP1, TRUE);

     

        Mcasp_init();

        audioMcaspParams = Mcasp_PARAMS;

        audioMcaspParams.hwiNumber = 8;

     

    }

     

    /*

     * Audio init function called when creating the driver.

     */

    void audioUserAudioInit()

    {

        Audio_init();

        audioParams = Audio_PARAMS;

        audioParams.adDevType = Audio_DeviceType_McASP;

        audioParams.adDevName = "/mcasp1";

        audioParams.acNumCodecs = 1;

        audioParams.acDevName[0] = "/aic310";

    }

     

    /* ========================================================================== */

    /*                                END OF FILE                                 */

    /* ========================================================================== */

  • Hi Mariana,

    I would like to stress again, I am trying to boot using UART. I do not have a flash on my board so that is not an option for me.

     

    thanks

    Arun

  • Hi Mariana,

     

    I am now able to get the audiosample and uartsample to work on EVM OMAP-L137. By just trying various combination in AISGen tool.

    thanks

    Arun