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.

  • Resolved

Compiler: [CC2640]How to use NOINIT on stack 4.2

Tool/software: TI C/C++ Compiler

Hi All

I have a case need to upgrade stack4.0 to stack4.2.

I have two versions of CCS(7.4 and 8.1) in different PC.

Then add "pargma NOINIT" in the glucose sample code of stack 4.0 & 4.2

In stack 4.0 is success.(sample code not modified)

In Stack 4.2, glucose sample code, CCS7.4 & 8.1
<main.c>
#pragma NOINIT (GLUValue)
uint8_t GLUValue;
.......
int main()
{
     RegisterAssertCback()
     PIN_init()
     ICall_init()
     ICall_createRemoteTask()
     GAPRole_createTask()

GLUValue = 1;   <== if have assign value, The program will stop in create task.

     GlucoseSensor_createTask()
     BIOS_start()
     return 0;
}


<glucose.c>
GlucoseSensor_createTask(void)
{
          .........
          Task_construct(&glucoseTask, GlucoseSensor_taskFxn, &taskParams, NULL);  <== stop here(CCS 7.4 & 8.1 are the same )
}

---------------------------

Have tried to tune the optimization leve on CCS. The same situation.

What should I do?

  • Initializing NOINIT variables is not supported.  The ARM compiler manual, in the section titled The NOINIT and PERSISTENT Pragmas, states:

    The NOINIT pragma may only be used with uninitialized variables.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Sorry, I didn't explain the details,
    I have re-edited.
  • In reply to George Mock:

    Sorry, I didn't explain the details,
    I have re-edited.

    #pragma NOINIT (GLUValue)
    uint8_t GLUValue;
    .......
    int main()
    {
    RegisterAssertCback()
    PIN_init()
    ICall_init()
    ICall_createRemoteTask()
    GAPRole_createTask()

    GLUValue = 1; <==== assign value
  • In reply to kuo austin:

    Am curious on the answer

  • In reply to kuo austin:

    Hi kuo,

    What is the purpose of using NOINIT in this use-case? I think that NOINIT may not currently be supported on BLE-Stack projects based on the linker files provided. I'll take an action to file this.

    Regards,
    Katie
  • In reply to Katie Pier:

    Hi Katie Pier

    This is an existing project that my customer has already listed.

    Now, My customer hope to upgrade BLE 4.2.

    So, I can't modify the program at will.

    Use NOINIT at:

    #pragma NOINIT (dev_type)

    uint8_t dev_type;

    2640 power on --> uart tx send cmd --> multiple device(dev1 or dev2 or...) --> uart rx receive cmd

    --> dev_type = dev1 --> sw reset --> 

    switch(dev_type)
    {
         case dev1:
              GlucoseSensor_createTask();  <== Second run
              Custom_createTask();
              break;
         case dev2:
              BloodPressure_createTask();   <== Second run
              Custom_createTask();
              break;
         "case  dev3, dev4....."
         default:
              Custom_createTask();   <== First run --> get devX --> sw reset
              break;
    }

    Of course, There are other code to handle like this.

  • In reply to kuo austin:

    Hi kuo austin,

    Thank you I think I understand better now. We don't usually use the naming convention of 4.0 and 4.2 in regards to our stack versions as these refer more to the BLE SIG spec version. Can you clarify what is the BLE-STACK version used on the working case, and on the failing case? You can find this version from the file system folder naming convention for the stack, or from the release notes included with the stack. This can help us determine what is different. 

    Can you also confirm that the device you are using is CC2640 not CC2640R2? 

    Regards,

    Katie

  • In reply to Katie Pier:

    Ok, It's fail on the "ble_sdk_2_02_02_25"

    Sample code path: "C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\glucose_sensor"

    NOINIT work normal on the "ble_cc26xx_2_01_00_44423"

    Sample code path:"C:\ti\simplelink\ble_cc26xx_2_01_00_44423_meter\Projects\ble\GlucoseSensor"

    Hope to work on the stack 2.2.2.

    It will be troublesome if I need to modify it.

    Or...Is there another sdk version of bluetooth 4.2 and support to use NOINIT?

    Thanks a lot.

  • In reply to Katie Pier:

    Hi Katie

    Do you have any idea?

  • In reply to kuo austin:

    Dear Katie,

    Austin have updated the SDK they used. Could you kindly help look at NOINIT usage in different version SDK?
    NOINIT is normal pragmas usage, and I think Austin's use is correct.
    Why does he meet the problem in different version SDK?

    Please feel free to let us know if you have any suggestion.
    Thanks a lot.

    ----------------------------------

    Best Regards,

    Janet Shen

    Field Application Engineer

    Texas Instruments, Taiwan

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.