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.

F28377S Launchpad trouble with watch expression onADC output buffer

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am using an F28377S launchpad and trying my best to store 16-bit ADC readings into an array.  I am using the "adc_soc_continuous_cpu01" example program from controlSUITE, as I am still familiarizing myself with specifics of the CCS syntax and interrupt sequences.  In this example I change the RESULTS_BUFFER_SIZE to a higher value than 256, lets say 4096.  When I add a watch expression on the variable AdcaResults[ ] it will still have Type unsigned int[256].  I am trying to fill this array with a large amount of data please help.  

If you need any other information please let me know.

My version of CCS is v6.1.3.00033 and controlSUITEis v3.3.9

Best,

Conner Shoop

  • Hi Conner,

    I think the only code change you should have to make is to change the results buffer size:

    #define RESULTS_BUFFER_SIZE 4096

    One thing the expressions window will do is break a large array into smaller chunks - the additional array sections follow in the expressions window, but expand separately. Maybe this is what you are seeing?

    I would also recommend looking at the start address of the array in the expressions window, and then bringing up that memory location in the memory browser as an alternative way to examine a large array. The memory browser will also allow you to save the array contents to a text file, which you can then load into excel or similar.
  • Devin,

    Thanks for the feedback.  I did change the buffer size and export it to memory, however the memory file does not store past the original 256 data points.  Here is a picture of what is going on.  You can also see the watch expression also only stores to 256 in 3 separate folders.

  • Hi Conner,

    Can you confirm that after you make the change you:
    -Save the file
    -Build the specific adc_soc_continuous example without errors
    -Load the new .out file (or symbols) to the target
    (It shouldn't be necessary to run the program to observe the updated definition for the results array)
  • Hello Devin,

    I think you hit the problem on the head.  When I do save the new project, with only a change from RESULTS_BUFFER_SIZE from 256 to 4096 I get this Console read.

  • Hi Conner,

    Ok, so here you need to make contiguous space for your new buffer array, which is pretty large. This will involve editing the linker .cmd file to combine some sections of RAM memory. I think you should be able to find info on how to do this by searching the "program will not fit into available memory" error in the e2e forum (or using google search). If you run into issues, create a new post in the CCS forum.
  • Conner,

    What's going on is the array is too large to fit into the memory normally allocated for data (".ebss").  You can get this to work pretty simply as follows.

    In the source file "adc_soc_epwm_cpu01.c", add the following line just above where you define RESULTS_BUFFER_SIZE, so this will be line 30:

    #pragma DATA_SECTION(AdcaResults, "AdcBuffer")

    This line associates the array with a named section which we will use to place the data in a specific memory region.  Next, open the linker command file used for this project.  Navigate to 

    C:\ti\controlSUITE\device_support\F2837xS\v190\F2837xS_common\cmd

    ...and edit the file "2837xS_Generic_RAM.cmd".  Add the following line just before the final closing bracket ( } ):

       AdcBuffer           : > RAMGS6,    PAGE = 1

    This matches the section name with a specific block of physical memory.  I used RAMGS6 because it's not currently used for anything else.  Save all the files and re-build, hopefully without errors.  When you have done that, you might like to open the ".map" file in

    C:\ti\controlSUITE\device_support\F2837xS\v190\F2837xS_examples_Cpu1\adc_soc_epwm\cpu01\ccs\CPU1_RAM

    This shows you how much memory in each memory block is currently used, and lists variables by address.  As Devin says, you can find more information in the e2e forum.  Hope this helps.

    Regards,

    Richard

  • Hi Richard.

    I was wondering if there was any way to create a buffer larger than a size of 4096. Once I try to make a buffer with a size larger than 4096, I get more errors. Is it possible to link to multiple blocks of memory for a larger buffer?

    Thanks,

    May
  • Hi May,

    Yes, this is possible.  You will have to adjust you linker command file to create a single named section with enough space.  For example, on F28069 the largest RAM memory sector is 0x2000, and both sectors L7 & L8 are this size.

    If you wanted to allocate a section to hold a single buffer of size 0x4000 (for example) you could comment out those sections in the MEMORY part of your .cmd file and name a single section to hold them both.  Something like:

    RAML78 : origin = 0x010000, length = 0x004000

    You then map your buffer into this section as described in my previous post.  You would do something similar on F28377S.  

    Regards,

    Richard