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.

RTOS/MSP430FR5994: RTC_C not working on MSP-EXP430FR5994

Part Number: MSP430FR5994
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello,

I am working with CCS 7.1.0 and RTOS 2.20.00.06 for the mentioned launchpad.

I have defined a Hwi (graphically) as follows:

        

As shows my cmd file the interrupt number associated with the RTC is: RTC_C        : { * ( .int31 ) } > INT31 type = VECT_INIT

And this is my main file:

#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Log.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/drivers/GPIO.h>
#include <driverlib.h>
#include "Board.h"

volatile int16_t i16ToggleCount = 0;
volatile int16_t i16ToggleCount1 = 0;
volatile Calendar newTime;

void led1Toggle(void);
void led2Toggle(void);

int main(void)
{
Calendar currentTime;

Board_initGeneral();
Board_initGPIO();
GPIO_write(Board_LED0, Board_LED_ON);
GPIO_write(Board_LED1, Board_LED_ON);

currentTime.Seconds = 0x00;
currentTime.Minutes = 0x30;
currentTime.Hours = 0x17;
currentTime.DayOfWeek = 0x02;
currentTime.DayOfMonth = 0x30;
currentTime.Month = 0x04;
currentTime.Year = 0x2017;
RTC_C_initCalendar(RTC_C_BASE, &currentTime, RTC_C_FORMAT_BCD);

RTC_C_configureCalendarAlarmParam param = {0};
param.minutesAlarm = 0x35;
param.hoursAlarm = RTC_C_ALARMCONDITION_OFF;
param.dayOfWeekAlarm = RTC_C_ALARMCONDITION_OFF;
param.dayOfMonthAlarm = RTC_C_ALARMCONDITION_OFF;
RTC_C_configureCalendarAlarm(RTC_C_BASE, &param);

RTC_C_setCalendarEvent(RTC_C_BASE, RTC_C_CALENDAREVENT_MINUTECHANGE);

RTC_C_enableInterrupt(RTC_C_BASE, RTCRDYIE + RTCTEVIE + RTCAIE);
RTC_C_enableInterrupt(RTC_C_BASE, RTCRDYIFG + RTCTEVIFG + RTCAIFG);

RTC_C_startClock(RTC_C_BASE);

BIOS_start();

return (0);
}

void led1Toggle(void)
{
GPIO_toggle(Board_LED0);
i16ToggleCount += 1;
Log_info1("LED TOGGLED [%u] times", i16ToggleCount);
}

void led2Toggle(void)
{
GPIO_toggle(Board_LED1);
i16ToggleCount1 += 1;
Log_info1("LED TOGGLED [%u] times", i16ToggleCount1);
}

void RTC_ISR(uintptr_t arg)
{
led1Toggle();
}

I have configured several interrupts for the RTC and the LEDs are always on.

I also attach the CCS project.

Thanks and regards,

Juan Antonioblink_msp430_hwi_RTC.zip 

  • About this issue when I try to define the ISR in my code:

    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=RTC_VECTOR
    __interrupt
    #elif defined(__GNUC__)
    __attribute__((interrupt(RTC_VECTOR)))
    #endif
    void RTC_B_ISR(void)
    {

    I get an error indicating the redefinition of that ISR.

    I suppose that RTOS has this definition implemented, but I do not know which file is in.

    Any idea?

    Thanks and regards,

    Juan Antonio
  • Hello,

    I could solve de problem. The final example is attached. Specifically, two interrupts are configured: one every second and the other every minute. LED0 toggles with the first ISR and LED1 with the other one.

    I hope that it could help someone.

    On the other hand, the interrupt numbers that should be used when defining a Hwi could be found in the file MSP_EXP430FR5994.cmd, which is included with each RTOS project.2870.blink_msp430_hwi_RTC.zip

    Regards,

    Juan Antonio

  • Juan,

    Glad you were able to solve your issue, and thanks for posting a follow up with the solution!

**Attention** This is a public forum