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.

5510DSK Programming Issues

We purchased a brand new 5510DSK (MFG P/N: TMDSDSK5510) from Spectrun Digital recently.  The purpose of the board is to test 256K of external asyncSRAM (32-bit) connected to the EMIF.  I am using CE2 for the memory starting at addr 0x400000. I wrote the program (see attachment), right or wrong I can’t tell but I am able to configure the EMIF using the CSL (I examined the registers inside CCS and verified they have the correct values as programmed). Where can I find examples on simple write/read to the external async memory? Slow speed is OK.  Just need to do write/read to/from memory locations.

 ecm_dpm.zipProblems/Questions:

  1. Functions getchar and gets (ecm_dpm.c line#270, 272 & 275) don’t work. When the program is executed, they are skipped.
  2. At ecm_dpm line #320 passes the parameter MEMORY_SCOPE_KB (non zero) to the function MemoryFlush. When MemoryFlush gets that passing parameter, it is always zero. Seems to me that passing parameters are always zero’s.
  3. Are the cmd and gel files correct? The cmd file is recommended to be used by a TI person. Different examples use different cmd files that are quite different. Are there any guidelines on cmd file. Based on what I try to do, is my cmd file okay?
  4. In CCS Memory Browser, it shows 3 types of memories: PROGRAM, DATA and IO. I know the IO is for the control registers. What are PROGRAM and DATA? For the external asyncSRAM, will it be under PROGRAM or DATA?

Note: I use the TMS320C5500 Chip Support Library for my program, it should be installed in C:\ti\ccsv5\c5500\C55xxCSL\lib in order for my program to build

  • Hi,

     This is being addressed in the below E2E post.

     http://e2e.ti.com/support/dsp/c5000/f/109/p/412563/1581755#1581755

     Will try to move this post to CCS team, may be you could get more information on this.

    Regards

     Vasanth

  • Hi,

    Moving your post to right forum to be better answered.

    Thanks & regards,
    Sivaraj K
  • Hi,

    Thanks for sending the project and detailed information. I was able to build it but unfortunately the 5510 device on my DSK board is blown. I ordered another sample which will arrive tomorrow or perhaps on Friday, thus I will be able to double-check the items #1 and #2 above.

    Regarding other items:
    #3: The linker CMD file you are using looks fine by me and, unless there is something very specific in your system, it should work just fine. The GEL file is a bit more HW involved, therefore I am not the best person to make comments.
    If you want a different point for comparison, CCSv5 provides a GEL file on the directory ccsv5/ccs_base/emulation/boards/dsk5510/gel

    #4: C54x family of devices had a Harvard architecture, meaning program and data accessed different buses and had overlapping addresses defined by PAGE numbers. Despite C55x is a modified Harvard architecture (multiple buses but the addressing is linear), I think this structure was maintained to ease code migration from C54x. That said, I am almost sure you only need to specify the address but the program or data page designator will be irrelevant. The C55x experts would know better, though.

    As soon as I get the board up and running I will reply to this thread.

    Hope this helps,
    Rafael
  • I am able to resolve the issue #2 - the problem is because int is 16-bit for 5510dsk (either small or larger memory model) and pointer is 16-bit for small and 23-bit for large memory model. Once I changed the declarations from int to long int passing parameters do get the correct values.

    I still have problem with issue #1 - getchar() still does not work.  When this statement is executed, straight characters are displayed and input from the operator is skipped.

    Attached is the latest project files. I changed the linker file (cmd) but it makes no difference.7823.ecm_dpm.zip

     

  • Hi,

    The 5510 arrived and I was able to test your project. I suspected the amount of heap necessary to be used by the get*.* functions, and I was right.

    If you increase the heap size by a small amount (I added to 0x500) the get*.* functions started to work.

    Hope this helps,

    Rafael

  • The solution works for the getchar statement, but I found another problem. I added the following 2 statement at the beginning of main, and when the printf is executed, the system hung. I changed heap size to 800 but it doesn't help.

    int i = 1;
    printf("%d\n", i);
  • Hi,

    I see the same problem and this time the stack is the limiter. I increased it to 0x400 and the code started working. Therefore, in this case the addition of the function to print an integer calls a different number of child functions that deal with the number formatting - thus requiring additional stack.

    Another alternative is to use the minimal printf support, which limits the number of supported types and thus limits memory requirements. Details are shown at:

    The main issue with Console I/O functions is they tend to be memory-hungry (not to mention they set a breakpoint that disrupts realtime execution), therefore in memory-limited systems this tends to be a hurdle. 

    In my experience the exact amount of stack and heap is achieved by trial and error. However, some additional details about the Console I/O implementation that can help you are described in the document below:

    Hope this helps,

    Rafael

  • I read the tips and tried to increase the stack and heap size and couldn't make the following work:

    unsigned long int i = 0x400000;

    unsigned long int j = 0x12345678;

    unsigned long int k = 0x87654321;

    printf("TEST ERROR: Reading on Memory Addr[0x%08X] - Expected: [0x%08X], Read: [0x%08X]\n", i, j, k);

    When I ran the program, this is what I got.  The values were not displayed correctly.

    TEST ERROR: Reading on Memory Addr[0x00000040] - Expected: [0x00000000], Read: [0x00001234]

  • Mark,

    Please try this with the printf display type modifier for long variables. You are using only X which is for int's and may not work correctly for long int's.

    I think it is a lower case L, but your C program manual should have this and it may be in the online documentation for the TI runtime support library. You can look for the latter in CCS->Help->Help contents and search for printf.

    Regards,
    RandyP