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.

CODECOMPOSER: Strange behavior of GEL_MemorySave()

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: MSPM0G3519

Tool/software:

Hello,

CCS 20.0.1, MSPM0G3519

It seem that setting the length beyond 128K causes GEL_MemorySave() to hang? It saves some content but beyond 128K it is always the same file limited at some data location.

Here the function that I use

dialog DumpMemoryRange(StartAdr "Start Address",
   Length "Length",
   Multiplier "Multiplie (size of the memory unit)",
   Page "Page: 0 (PM), 1 (DM) or 2 (I/O)")
{
   string file = "memory_dump.bin";
   int total_length = Length * Multiplier;

   if ((0 != Page) && (1 != Page) && (2 != Page))
   {
      GEL_TextOut("Invalid memory page %d. Valid: 0 (Program memory), 1 (Data memory) or 2 (I/O space). Aborting!\n",,,,, Page);
      return;
   }

   if (total_length == 0)
   {
      GEL_TextOut("Length is %x. Nothing to dump!\n",,,,, total_length);
      return;
   }

   if (0 == GEL_IsConnected())
   {
      GEL_TextOut("\nConnecting to target.\n");
      GEL_Connect();
   }

   GEL_TextOut("\nHalting target.\n");
   GEL_Halt();
   GEL_TextOut("Done.\n\n");

   GEL_TextOut(
      "Dumping Data Flash memory %x-%x to %s...\n",,,,,
      StartAdr,
      StartAdr + total_length - 1,
      file);
   GEL_MemorySave(
      StartAdr,
      Page,  // 0 (Program memory), 1 (Data memory) or 2 (I/O space)
      total_length,
      file,
      8,  // Raw binary
      0,  // Overwite file
      8,  // Bit size
      0); // No byte swap
   GEL_TextOut("Done.\n");
}
Regards,
Eugene
  • Hello Eugene,

    It seem that setting the length beyond 128K causes GEL_MemorySave() to hang?

    I can't seem to reproduce this issue. I have been able to export/save memory of lengths greater than 128K. The functionality should mimic the "export data to file" functionality in the memory view. If you use the memory view to export the file, do you see the same issue?

    Thanks

    ki

  • Hi Ki,

    I believe I figured it out. Lenth is in words rather than in bytes. That is absolutely not explained in the function description. 

    What does word mean here "length: defines the number of words to save."? Does this depend on native processor word size?

    What constitutes these memory types "page: identifies the type of memory to save: 0 (Program memory), 1 (Data memory) or 2 (I/O space)"? Is data memory RAM or Data Flash?

    Regards,

    Eugene

  • Does this depend on native processor word size?

    Yes.

    0 (Program memory), 1 (Data memory) or 2 (I/O space)"? Is data memory RAM or Data Flash?

    No, the pages really only apply to older C2000 devices where the memory was split into multiple pages. It does not really apply to other devices with unified single page memory layout.