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.

Problem of running switch test project with ezDSP5535 USB

Hi,

I have tested several example projects from ezdsp5535_v1 and works except the switch test project on ezDSP5535 USB. First of all, the gel echoes seem correct:

C55xx: GEL Output:
StartUp()
C55xx: GEL Output:
OnTargetConnect()
C55xx: GEL Output:
OnReset()
C55xx: GEL Output: Reset Peripherals is complete.
C55xx: GEL Output: Configuring PLL (100 MHz).
C55xx: GEL Output: PLL Init Done.
C55xx: GEL Output: Target Connection Complete.
C55xx: GEL Output:
OnPreFileLoaded()
C55xx: GEL Output: Reset Peripherals is complete.
C55xx: GEL Output: Configuring PLL (100 MHz).
C55xx: GEL Output: PLL Init Done.
C55xx: GEL Output:
OnRestart()
C55xx: GEL Output: Reset Peripherals is complete.
C55xx: GEL Output:
OnRestart()
C55xx: GEL Output: Reset Peripherals is complete.

When run it with debugger, it outputs:


Testing Switches...
Press SW1 or SW2 to toggle LEDs.
Press both to toggle LEDs DS3 & DS4 and end test.

Testing Switches...
Press SW1 or SW2 to toggle LEDs.
Press both to toggle LEDs DS3 & DS4 and end test.

It stops at while line below:

Uint16 EZDSP5535_SAR_getKey(void)
{
CSL_Status status;
Uint16 val;

/* Check whether the ADC data is available or not */
while(CSL_SAR_DATA_AVAILABLE != SAR_getStatus(SarHandle,&status));

no matter how to press the keys.

I have attached the zip project, hoping someone can test it for me.

Thanks,

The CSL library has been modified with csl_general.h for 5535.

1362.switch.zip1145.lib.zip4705.C55XXCSL_LP.zip

  • My computer uses CCS 5.5.0.0007, Windows 7, 64-bit OS.

    A previous post: http://e2e.ti.com/support/dsp/c5000/f/109/t/187197.aspx

    talked about clk divider, but without following post.

    I post the used init of my project. Anything I can do to diagnoses  the problem (I press any key, but no key detected by the program)?

    Uint8 EZDSP5535_SAR_init(void)
    {
    CSL_Status status;
    CSL_SarChSetup param;
    int chanNo;

    /* Set Bus for GPIOs */
    CSL_FINST(CSL_SYSCTRL_REGS->EBSR, SYS_EBSR_PPMODE, MODE6);

    /* Initialize the SAR module */
    status = SAR_init();
    if(status != CSL_SOK)
    return 1; // Fail

    /* Open SAR channel */
    status = SAR_chanOpen(&SarObj,CSL_SAR_CHAN_3);
    SarHandle = &SarObj;
    if(status != CSL_SOK)
    return 1; // Fail

    /* Initialize channel */
    status = SAR_chanInit(SarHandle);
    if(status != CSL_SOK)
    return 1; // Fail

    param.OpMode = CSL_SAR_POLLING;
    param.MultiCh = CSL_SAR_NO_DISCHARGE;
    param.RefVoltage = CSL_SAR_REF_VIN;
    param.SysClkDiv = 0x0b ;

    /* Configuration for SAR module */
    status = SAR_chanSetup(SarHandle,&param);
    if(status != CSL_SOK)
    return 1; // Fail

    /* Set channel cycle set */
    status = SAR_chanCycSet(SarHandle,CSL_SAR_CONTINUOUS_CONVERSION);
    if(status != CSL_SOK)
    return 1; // Fail

    /* Set ADC Measurement parameters */
    status = SAR_A2DMeasParamSet(SarHandle,CSL_KEYPAD_MEAS,&chanNo);
    if(status != CSL_SOK)
    return 1; // Fail

    /* Start the conversion */
    status = SAR_startConversion(SarHandle);
    if(status != CSL_SOK)
    return 1; // Fail

    return 0;
    }

  • Hi,

    Please give us some time and the team is working on. We will get back to youi.

    Thanks & regards,

    Sivaraj K

  • Could you try following the order, testing each led and switch as standalone experiments:

    1) Connect target and Load the test, wait for the test to pause at main()
    2) Press SW1
    3) Then Run the test
    or
    1) Connect target and Load the test, wait for the test to pause at main()
    2) Press SW2
    3) Then Run the test
    or
    1) Connect target and Load the test, wait for the test to pause at main()
    2) Press SW1 and SW2
    3) Then Run the test

    Also, please ignore DS2 for the test. Instead observe DS3-DS6.

    Pressing SW1 should affect DS3.

    SW2 should affect DS6.

    Both SW1&SW2: DS4 and DS5.

    Hope the same helps.

    Best Regards.

  • Thanks. It seems the problem is caused by stack overflow. I find that the project is imported from the download project files. The stack and heap are blank.

    Now my new problem is that there are some CCS project files on the original folder: .ccsproject .cdtbuild .cdtproject .project. How can I create a project with the original project settings? (either a worked import, or other way for the new project)

  • Does the issue still persist? It isn't clear from the above post if the leds-not-blinking-when-pressing-SW1-and-SW2-issue got resolved or not.

    Stack and heap definitions would be in the lnkx.cmd file in the ..../switch folder.

    .ccsproject .cdtbuild .cdtproject .project files get created by CCS only when one uses the tool to create a project. Can't be manually generated.

    Best Regards.

  • Thanks for your reply.

    I find that there is a line 

    -sysstack 0x1000 /* Secondary stack size */

    in the lnkx.cmd file, pasted below.

    What use is it for? This is a non-BIOS project.

    /******************************************************************************/
    /* LNKX.CMD - COMMAND FILE FOR LINKING C PROGRAMS IN LARGE/HUGE MEMORY MODEL */
    /* */
    /* Usage: */
    /* cl55 <src files> -z -o<out file> -m<map file> lnkx.cmd -l<RTS library> */
    /* */
    /* Description: This file is a sample command file that can be used for */
    /* linking programs built with the C Compiler. Use it as a */
    /* guideline; you may want to change the allocation scheme */
    /* according to the size of your program and the memory layout */
    /* of your target system. */
    /* */
    /* Notes: (1) You must specify the directory in which <RTS library> is */
    /* located. Either add a "-i<directory>" line to this file */
    /* file, or use the system environment variable C55X_C_DIR to */
    /* specify a search path for the libraries. */
    /* */
    /******************************************************************************/

    -stack 0x2000 /* Primary stack size */
    -sysstack 0x1000 /* Secondary stack size */
    -heap 0x2000 /* Heap area size */

    -c /* Use C linking conventions: auto-init vars at runtime */
    -u _Reset /* Force load of reset interrupt handler */

    /* SPECIFY THE SYSTEM MEMORY MAP */

    MEMORY
    {
    PAGE 0: /* ---- Unified Program/Data Address Space ---- */

    MMR (RWIX): origin = 0x000000, length = 0x0000c0 /* MMRs */
    DARAM0 (RWIX): origin = 0x0000c0, length = 0x00ff40 /* 64KB - MMRs */
    SARAM0 (RWIX): origin = 0x010000, length = 0x010000 /* 64KB */
    SARAM1 (RWIX): origin = 0x020000, length = 0x020000 /* 128KB */
    SARAM2 (RWIX): origin = 0x040000, length = 0x00FE00 /* 64KB */
    VECS (RWIX): origin = 0x04FE00, length = 0x000200 /* 512B */
    PDROM (RIX): origin = 0xff8000, length = 0x008000 /* 32KB */

    PAGE 2: /* -------- 64K-word I/O Address Space -------- */

    IOPORT (RWI) : origin = 0x000000, length = 0x020000
    }

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

    SECTIONS
    {
    .text >> SARAM1|SARAM2|SARAM0 /* Code */

    /* Both stacks must be on same physical memory page */
    .stack > DARAM0 /* Primary system stack */
    .sysstack > DARAM0 /* Secondary system stack */

    .data >> DARAM0|SARAM0|SARAM1 /* Initialized vars */
    .bss >> DARAM0|SARAM0|SARAM1 /* Global & static vars */
    .const >> DARAM0|SARAM0|SARAM1 /* Constant data */
    .sysmem > DARAM0|SARAM0|SARAM1 /* Dynamic memory (malloc) */
    .switch > SARAM2 /* Switch statement tables */
    .cinit > SARAM2 /* Auto-initialization tables */
    .pinit > SARAM2 /* Initialization fn tables */
    .cio > SARAM2 /* C I/O buffers */
    .args > SARAM2 /* Arguments to main() */

    vectors > VECS /* Interrupt vectors */

    .ioport > IOPORT PAGE 2 /* Global & static ioport vars */
    }

  • Please refer sections Linker Command Files, define stack, define heap, etc. for their usage in the CCS Tool Help > Help Contents. There isn't a limitation on usage of linker command files, both bios/non-bios projects can use the same.

    Best Regards.

     

  • I am having the same issue while testing the switch test code. When you say standalone experiments, should I comment out the other conditionals? and am I supposed to keep the switch pressed until the end of the run?

    Thanks.
  • Hi

    There were three experiments suggested. Standalone here means this needs to be performed independently

    I believe the switch variance was talked about in each of the experiments suggested.

    Hope this clarifies.

    Regards

    Vasanth

  • Hi,
    I tried running just the SW1 conditional without a continuous while loop. I ran the test while keeping SW1 pressed; most of the time this just results in the code stopping right before the EZDSP_SAR_getKey(); sometimes the code does pass through and I am able to turn one of the LEDs on. I am not sure why this is being inconsistent.

    Thanks,
    Abraham