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.

Sensor Controller interrupt generation



I can't seem to get the fwGenAlertInterrupt(); command to trigger the callback function scTaskAlertCallback(void).

I have debugged the sensor controller application using the sensor controller studio.  I made sure that the execution flows to the fwGenAlertInterrupt();.

But when debugging the application, I never hit a breakpoint inside of scTaskAlertCallback(void)

In my app (simpleBLEPeripheral.c) I have:

#include "scif.h"

...

// SensorController Callbacks
void scTaskAlertCallback(void) {
    // Set the driver pins to high-z mode
    //PIN_close(&sbpPins);
    PINCC26XX_setOutputEnable(Board_LED1, FALSE);
    PINCC26XX_setOutputEnable(Board_LED2, FALSE);
    PINCC26XX_setOutputEnable(Board_LED3, FALSE);
    PINCC26XX_setOutputEnable(Board_LED4, FALSE);
    scifClearAlertIntSource();
} // taskAlertCallback

void scCtrlReadyCallback(void) {

} // ctrlReadyCallback

...

Initialization called from SimpleBLEPeripheral_init:


      // Initialize the Sensor Controller
      scifOsalInit();
      scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
      scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
      scifInit(&scifDriverSetup);
      //scifStartRtcTicksNow(0x00010000 / 128);  // only need this if using RTC scheduling
      // Configure the Sensor Controller
      // Sensor task (not to be confused with OS tasks)
      scifTaskData.ecdDriver.cfg.adcMax = 2000;
      scifTaskData.ecdDriver.cfg.adcMin = 0;
      scifTaskData.ecdDriver.cfg.goodEnough = 50;

...

This code is run after a characteristic is changed from SimpleBLEPeripheral_processCharValueChangeEvt

    // Set the driver pins to output mode
    //hSbpPins = PIN_open(&sbpPins, SBP_configTable_SmartRF06);
    PINCC26XX_setOutputEnable(Board_LED1, TRUE);
    PINCC26XX_setOutputEnable(Board_LED2, TRUE);
    PINCC26XX_setOutputEnable(Board_LED3, TRUE);
    PINCC26XX_setOutputEnable(Board_LED4, TRUE);

    scifClearAlertIntSource(); // need this here?
    // Configure and start the Sensor Controller
    // Sensor task (not to be confused with OS tasks)
//    scifStartTasksNbl(BV(SCIF_ECD_DRIVER_TASK_ID));  // use this if sensorcontroller task is using RTC scheduling
    scifExecuteTasksOnceNbl(BV(SCIF_ECD_DRIVER_TASK_ID));  // just run it once without using RTC scheduling

  • Hello,

    I've asked a member of the SCS team to respond.

    Best wishes
  • Hello Paul,
    This occurs when you use the scifExecuteTasksOnceNbl call. This will be fixed in the next release that is expected to come out in august. You can to a small hack to make it work for now:

    1. In "<My Documents>\Texas Instruments\Sensor Controller Studio" add a new directory "fw_templates"
    2. Copy " framework_template.asm" from the corresponding installation directory into this directory
    3. In the following code section replace PowerDown with GenAlertInterrupt

    ; We're READY for another request
    iobset #IOB_EVCTL_SWEV_READY, [#IOP_EVCTL_SWEVSET]
    jmp PowerDown

    /handleReq:
    ; Restore the task ID, and load the function pointer (here to avoid pipeline hazard)
    ld R7, [#fwCtrlInt/taskId]
    ld R0, [R7+R0]

    In this case you will get the READY-interrupt before the ALERT-interrupt. Remember to remove this file manually when you upgrade to future versions of SCS!
  • This is fixed in the Sensor Controller Studio 1.1.0
    Thanks.