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.

LAUNCHXL-CC2640R2: Bluetooth Low Energy and TI Drivers, ADC

Part Number:  LAUNCHXL-CC2640R2

Hello, First of all, I should start by saying that I have no experience with this topic and this is my first time doing it. I want to make a project that sends the voltage value read from the ADC to the phone via bluetooth. When I browsed the sample projects in the resource explorer section, I saw that the sample project made in the link I will add does the project I want to do. Link of the project is

dev.ti.com/.../node

When I wanted to do this example as NON-POSIX and using the development board's own ADC pin without using a booster pack, I realized that the best way would be to use task 4,5 and 6. Then I started to follow the steps. I imported the SimplePeripheral project. SimplePeripheral project's link is

dev.ti.com/.../node

I created the myThread.c file inside the application file and added the code to the myThread.c file as it said in step 3 of task 4. But I couldn't understand what was written in step 4 of task 4 and what I had to do.I added the code snippet given in the box to the beginning of the main.c file, as in the image I added, and extern void myThread_create(void); and when I add the extern void myThread_create(void); code snippet to the main() function as I have shown in the image, I get the errors in image. How can i solve this problem.

Another problem is that it is said that button0 should be pressed to measure the value in the ADC. When I examine the product's datasheet and development board, it is seen that there are only 2 buttons on the board. The naming of these buttons is given as button1 and button2. There is another button on the board, but it is called the reset button. Would changing the places that call button 0 to button1 in the piece of code we overwrite the myThread.c file solve this problem?

By the way, I am using LAUNCHXL-CC2640R2 development kit.
Regards

  • Hi Riza,

    So the main issue you are having here is that you are trying to call undeclared functions. At the top of the main.c folder you call 

         SimplePeripheral_createTask();
    
          /* Call function to initialize temperature threads */
          myThread_create();
    
          /* enable interrupts and start SYS/BIOS */
          BIOS_start();

    That is incorrect, you will need to learn a bit more of c coding to see why you cant just all undeclared functions. I believe you got confused by the wording of adding the extern function on top of main.c

    What this means is to add the extern call for myThread_create in the main.c file so when you call the function it knows to look outside of the file for the function declaration. You will want to put it next to the other externs such as:

    The next step would be to call the myThread_create() function inside the int Main() function above the BIOS_start() call.

    Ex.

    int main()
    {
      /* Register Application callback to trap asserts raised in the Stack */
      RegisterAssertCback(AssertHandler);
    
      Board_initGeneral();
    
      // Enable iCache prefetching
      VIMSConfigure(VIMS_BASE, TRUE, TRUE);
      // Enable cache
      VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
    
    #if !defined( POWER_SAVING )
      /* Set constraints for Standby, powerdown and idle mode */
      // PowerCC26XX_SB_DISALLOW may be redundant
      Power_setConstraint(PowerCC26XX_SB_DISALLOW);
      Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
    #endif // POWER_SAVING
    
      /* Update User Configuration of the stack */
      user0Cfg.appServiceInfo->timerTickPeriod = Clock_tickPeriod;
      user0Cfg.appServiceInfo->timerMaxMillisecond  = ICall_getMaxMSecs();
    
      /* Initialize ICall module */
      ICall_init();
    
      /* Start tasks of external images - Priority 5 */
      ICall_createRemoteTasks();
    
      SimplePeripheral_createTask();
    
      myThread_create() 
    
      /* enable interrupts and start SYS/BIOS */
      BIOS_start();
    
      return 0;
    }

    I wish you luck with your future development endeavors.

    Kind Regards,

    Rogelio

  • And regarding the button, open up the syscfg file and check which button is associated with button0 (its usually the left button)