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.

"econst" and "switch " in proj_labxx.c function

hi:

I don't understand these sentence in proj_labxx.c :

  #ifdef F2802xF
    //copy .econst to unsecure RAM
    if(*econst_end - *econst_start)
      {
        memCopy((uint16_t *)&econst_start,(uint16_t *)&econst_end,(uint16_t *)&econst_ram_load);
      }

    //copy .switch ot unsecure RAM
    if(*switch_end - *switch_start)
      {
        memCopy((uint16_t *)&switch_start,(uint16_t *)&switch_end,(uint16_t *)&switch_ram_load);
      }
  #endif

 

what const in these areas?

  • Hi

    Both of these sections are initialized code sections, accounts for contacts and switch for the constants in a switch table. Moving these sections from secure FLASH to unsecured RAM is required for InstaSPIN running on 02x.

    Lok at the MAP file for more details on which files are contributing to each section. Here's the MAP file for the accounts section for lab2b:

    .econst 1 003f6000 00000088 RUN ADDR = 000004e6
    003f6000 0000005c fast_public.lib : ctrl_priv.obj (.econst)
    003f605c 0000001c ctrl.obj (.econst)
    003f6078 00000008 user.obj (.econst)
    003f6080 00000004 hal.obj (.econst)
    003f6084 00000004 proj_lab02b.obj (.econst)


    Jeff
  • thanks Jeff:

    another question in lab11b

    1,

    in main();

            if(gFlag_speedStatsReset)
              {
                gFlag_speedStatsReset = false;
                gSpeed_max_pu = _IQ(0.0);
                gSpeed_min_pu = _IQ(1.0);
              }

    in mainISR():

              if(speed_pu > gSpeed_max_pu)
                {
                  gSpeed_max_pu = speed_pu;
                }

              if(speed_pu < gSpeed_min_pu)
                {
                  gSpeed_min_pu = speed_pu;
                }

    Why gSpeed_max_pu=_iq(0.0) and gSpeed_min_pu=_iq(1.0) ?

    2.

    in lab11b software structure is very different of other labs.  it is very useful to developed products  .

    I will creat my own control add into this lab. I will use GPIO pin to cotronl RUN/STOP  to trig " gMotorVars.Flag_Run_Identify"  ture or flase . and use AD to set "gMotorVars.SpeedRef_krpm".  such as ... And important is : how chang  use.h  contant  as  variables  ? because I will use SCI comunication set them.

     

    best regards!

     

  • 2 .my question is : has any software inteface can do my require? if not , what is your suggest?
  • Hi,

    To get addresses of variables in your compiled and linked code, checkout the ofd2000.exe utility "Object File Display Utility". It is documented in "TMS320C28x Assembly Language Tools User's Guide" [SPRU513].

    Here's a snippet from the user's guide:

    11.1 Invoking the Object File Display Utility
    The object file display utility, ofd2000, prints the contents of object files (.obj), executable files (.out),
    and/or archive libraries (.lib) in both text and XML formats. Hidden symbols are listed as no name, while
    localized symbols are listed like any other local symbol.

    You can then send data via the SCI to the specific address of the variable that you want to change in RAM.

    Jeff