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.

MSP430FR6047: TI-RTOS

Part Number: MSP430FR6047
Other Parts Discussed in Thread: EVM430-FR6047, , MSP430WARE

Tool/software:

Hi,

I've managed to install the TI-RTOS v2.20 and use it on a EVM430-FR6047 and it seems to work ok, but I can't figure out how to use the different drivers.

I've changed the paths inside tirtos.mak and added the MSP430FR6047 to the MSP430DEVLIST and it compiles fine, but lib files in 

/home/pen/ti/tirtos_msp43x_2_20_00_06/products/msp430_driverlib_2_70_01_01a/driverlib/MSP430F5xx_6xx/ccs/

isn't renewed and there is no MSP430FR6047.lib anywhere. Am I doing something wrong or how can I used the GPIO?

Best regards Peter Nielsen

  • Hi,

    In the file location, is there a folder name "MSP430FR5xx_6xx" instead of "MSP430F5xx_6xx"

    Best regards,

    Cash Hao

  • Hi Cash Hao,

    Thank you for replying.

    Yes, there are a folder named 

    ~/ti/tirtos_msp43x_2_20_00_06/products/msp430_driverlib_2_70_01_01a/driverlib/MSP430FR5xx_6xx/ccs/

    and I'm sorry I copied the wrong path in the original post. This folder isn't updated either and only contains the 3 base libs from 22016 not the MSP430FR6047.lib

    The output from 'make all' has some reference to MSP430FR6047 so something is happening.

    Best regards Peter Nielsen

  • Hi,

    Okay, sorry I am not familiar with the RTOS. 

    I searched in this document chapter 8.2 Rebuilding MSPWare's driverlib for TI-RTOS and Its Drivers. After you add the device name in MSP430DEVLIST. You also have to rebuild the TI-RTOS drivers. Have you check on this step on your side? 

    https://www.ti.com/lit/ug/spruhd4m/spruhd4m.pdf

    Best regards,
    Cash Hao

  • Hi Cash Hao,

    Yes, I'm actually following the guide step by step and looking at the make files for the example projects.

    Looking at the examples for msp430ware_3_80_14_01 I figured out another way to compile a project so that the library isn't needed. I just copy the entire driverlib source folder into my project and then it works.

    However, when I do something similar to the 'gpiointerrupt' example it will compile and run with the led blinking, but pressing a button causing an interrupt will stop that task and it looks like the code is still running inside the RTOS but very slow. Can you explain what is going on?

    Please note that I'll be out of office for 3 weeks and might not reply.

    Best regards Peter Nielsen

  • Hi,

    Get it. 

    So, is the code runs into your interrupt routine or not. Does the GPIO interrupt function works as normal? And the only affect is that after running the interrupt routine the LED blinking failed. 

    Best regards,

    Cash Hao

  • Hi Cash Hao,

    If I define an empty vector for the interrupt in the rtos cfg file and activate the button the kernel will end in a while(1) loop so I'm sure the interrupt works. When I use the debugger I can see the correct vector value to set in the cfg file.

    var hwiParams = new halHwi.Params();

    /* Add the GPIO port number as Hwi argument */
    hwiParams.arg = 5;
    Program.global.hwi0 = halHwi.create(36, "&GPIO_hwiIntFxn", hwiParams);

    When that is used the task controlling the led stops and when the debugger is paused it breaks different places in the rtos. The callbacks are never called.

    I've attached the code and it is based loosely on an empty rtos project and the TI-RTOS examples empty_min & gpiointerrupt.

    Regards Peter Nielsen

    Home rtos 240713.zip

  • Hi,

    Okay, get it. Let me check the code first and see if I can find something there. 

    Best regards,

    Cash Hao

  • Hi Cash Hao,

    I hope you have had a nice weekend. Have you checked the code or found the cause?

    Best regards Peter

  • Hi,

    Nice to hear you back. 

    I do not find mu clue in the code. The software seems very clear and simple. Just one question, where you define the GPIO interrupt routine? You do not need to add it in the code?

    Best regards,

    Cash Hao

  • Hi,

    Thank you for answering.

    I don't define GPIO interrupt routine, it is done from the RTOS configuration file 'hello.cfg' but I'm not sure about the syntax.

    hwiParams.arg = 2;
    Program.global.hwi0 = halHwi.create(36, "&GPIO_hwiIntFxn", hwiParams);

    I've changed the code slightly because it looks like arg is the port number. Now it works for up/left on port 2 but how do I add right/down on port 3?

    Best regards Peter 

  • Hi,

    No idea of using the hwiParams to change the port number. But you can still write to the P3OUT/P3DIR register to control the pin right?

    Best regards,

    Cash Hao

  • Hi,

    Sure, I can write directly to the pin. However, I would like the interrupt functions to work like 

    GPIO_setCallback(Board_BUTTON3, gpioButtonFxn3);
    GPIO_enableInt(Board_BUTTON3);

    but when I try to add the configuration in the RTOS cfg file like 

    hwiParams.arg = 2;
    Program.global.hwi0 = halHwi.create(36, "&GPIO_hwiIntFxn", hwiParams);

    hwiParams.arg = 3;
    Program.global.hwi0 = halHwi.create(33, "&GPIO_hwiIntFxn", hwiParams);

    the code stops working.

    Best regards Peter Nielsen

  • Hi Peter,

    I can find something in the chapter 5.2.8 TI-RTOS Driver Hwis for MSP43x Devices. It has a demo of how to configure an I2C interrupt routine. You can take a look and check with it. 

    https://www.ti.com/lit/ug/spruhd4m/spruhd4m.pdf

    Best regards,

    Cash Hao

  • Hi Cash Hao,

    Thank you very much, I figured out what was wrong.

    When additional inputs are added to the config structure like 

    GPIO_PinConfig gpioPinConfigs[] = {
    /* Input pins */
    GPIOMSP430_P2_5 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    GPIOMSP430_P2_6 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    GPIOMSP430_P3_0 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    GPIOMSP430_P3_2 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_RISING,
    
    /* Output pins */
    GPIOMSP430_P1_0 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    GPIOMSP430_P1_1 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    GPIOMSP430_P1_4 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
    };

    and interrupts are needed, they must be added to the CallbackFxn structure as well

    GPIO_CallbackFxn gpioCallbackFunctions[] = {
    NULL, /* MSP_EXP430FR6989_S1 */
    NULL, /* MSP_EXP430FR6989_S2 */
    NULL, /* MSP_EXP430FR6989_S1 */
    NULL /* MSP_EXP430FR6989_S2 */
    };

    and in the cfg file as above. I've attached a functional example if someone else is interested.

    Best regards Peter Nielsen

    Home rtos 240807.zip

  • Awesome, great work!

**Attention** This is a public forum