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.

MSPM0G1107: FreeRTOS examples with/without Sysconfig

Part Number: MSPM0G1107
Other Parts Discussed in Thread: SYSCONFIG, MSPM0G3507

Tool/software:

We're running MSPM0 SDK 2.01.00.03 and would like to start a project using FreeRTOS and TI-Driver Library. We used a similarly named library on the CC1352 with TI-RTOS and SysConfig. This 4-month old thread says SysConfig is not supported, but the UART callback example's README (mspm0_sdk_2_01_00_03/examples/rtos/LP_MSPM0G3507/drivers/uart_callback/README.md) says "SysConfig allows developers to easily configure unused pins by selecting Board→Configure Unused Pins". The example also has source files called ti_drivers_config.c/h which it clearly uses.

Is SysConfig supported on the MSPM0Gxx platform? If not, how do we make use of TI-Driver Library without being able to auto-generate the necessary structs and macro definitions? Is there a recommendation for starting a project with FreeRTOS and using RTOS-safe drivers in general?

  • Hi,

    From my perspective, you can use Sysconfig for easy configuration and generate ti_msp_dl_config.c/h to replace the older one.

    Regards,

    Zoey

  • Can you clarify how it's supposed to work? I have this warning in SysConfig. Is this my issue?

    When I open ti_msp_dl_config.h, I can see that it's generating code based off of my SysConfig selections, but these are different from what the TI-Driver Library calls expect.

    /*
     * Copyright (c) 2023, Texas Instruments Incorporated - http://www.ti.com
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ============ ti_msp_dl_config.h =============
     *  Configured MSPM0 DriverLib module declarations
     *
     *  DO NOT EDIT - This file is generated for the MSPM0G110X
     *  by the SysConfig tool.
     */
    #ifndef ti_msp_dl_config_h
    #define ti_msp_dl_config_h
    
    #define CONFIG_MSPM0G110X
    
    #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
    #define SYSCONFIG_WEAK __attribute__((weak))
    #elif defined(__IAR_SYSTEMS_ICC__)
    #define SYSCONFIG_WEAK __weak
    #elif defined(__GNUC__)
    #define SYSCONFIG_WEAK __attribute__((weak))
    #endif
    
    #include <ti/devices/msp/msp.h>
    #include <ti/driverlib/driverlib.h>
    #include <ti/driverlib/m0p/dl_core.h>
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /*
     *  ======== SYSCFG_DL_init ========
     *  Perform all required MSP DL initialization
     *
     *  This function should be called once at a point before any use of
     *  MSP DL.
     */
    
    
    /* clang-format off */
    
    #define POWER_STARTUP_DELAY                                                (16)
    
    
    
    #define CPUCLK_FREQ                                                     80000000
    
    
    
    /* Defines for UART_RS485 */
    #define UART_RS485_INST                                                    UART0
    #define UART_RS485_INST_IRQHandler                              UART0_IRQHandler
    #define UART_RS485_INST_INT_IRQN                                  UART0_INT_IRQn
    #define GPIO_UART_RS485_RX_PORT                                            GPIOA
    #define GPIO_UART_RS485_TX_PORT                                            GPIOA
    #define GPIO_UART_RS485_RX_PIN                                     DL_GPIO_PIN_1
    #define GPIO_UART_RS485_TX_PIN                                     DL_GPIO_PIN_0
    #define GPIO_UART_RS485_IOMUX_RX                                  (IOMUX_PINCM2)
    #define GPIO_UART_RS485_IOMUX_TX                                  (IOMUX_PINCM1)
    #define GPIO_UART_RS485_IOMUX_RX_FUNC                   IOMUX_PINCM2_PF_UART0_RX
    #define GPIO_UART_RS485_IOMUX_TX_FUNC                   IOMUX_PINCM1_PF_UART0_TX
    #define UART_RS485_BAUD_RATE                                           (5000000)
    #define UART_RS485_IBRD_40_MHZ_5000000_BAUD                                  (1)
    #define UART_RS485_FBRD_40_MHZ_5000000_BAUD                                  (0)
    
    
    
    /* clang-format on */
    
    void SYSCFG_DL_init(void);
    void SYSCFG_DL_initPower(void);
    void SYSCFG_DL_GPIO_init(void);
    void SYSCFG_DL_SYSCTL_init(void);
    void SYSCFG_DL_SYSCTL_CLK_init(void);
    void SYSCFG_DL_UART_RS485_init(void);
    
    bool SYSCFG_DL_saveConfiguration(void);
    bool SYSCFG_DL_restoreConfiguration(void);
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif /* ti_msp_dl_config_h */
    

      

    The ti_drivers_config.h file from the UART example is:

    /*
     * Copyright (c) 2021, Texas Instruments Incorporated - http://www.ti.com
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ============ ti_drivers_config.h =============
     *  Configured MSPM0 Driver module declarations
     *
     *  DO NOT EDIT - This file is generated for the LP_MSPM0G3507
     *  by the SysConfig tool.
     */
    #ifndef ti_drivers_config_h
    #define ti_drivers_config_h
    
    #define CONFIG_LP_MSPM0G3507
    
    #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
    #define SYSCONFIG_WEAK __attribute__((weak))
    #elif defined(__IAR_SYSTEMS_ICC__)
    #define SYSCONFIG_WEAK __weak
    #elif defined(__GNUC__)
    #define SYSCONFIG_WEAK __attribute__((weak))
    #endif
    
    #include <stdio.h>
    #include <ti/devices/msp/msp.h>
    #include <ti/driverlib/driverlib.h>
    #include <ti/driverlib/m0p/dl_core.h>
    #include <ti/drivers/UART.h>
    #include <ti/drivers/dma/DMAMSPM0.h>
    #include <ti/drivers/uart/UARTMSPM0.h>
    
    #define CONFIG_UART_COUNT 1
    #define CONFIG_UART_BUFFER_LENGTH 1
    
    #define CONFIG_DMA_COUNT 1
    #define CONFIG_DMA_CH_COUNT 1
    #define DEFAULT_DMA_PRIORITY 31
    
    extern const uint_least8_t CONFIG_UART_0;
    extern const uint_least8_t UART_count;
    
    uint8_t rxBuffer[CONFIG_UART_BUFFER_LENGTH];
    uint8_t txBuffer[CONFIG_UART_BUFFER_LENGTH];
    
    /* clang-format on */
    void UART0_IRQHandler(void);
    /*
     *  ======== SYSCFG_DL_init ========
     *  Perform all required MSP DL initialization
     *
     *  This function should be called once at a point before any use of
     *  MSP DL.
     */
    
    /* clang-format off */
    
    
    
    /* Defines for CONFIG_UART_0 */
    #define CONFIG_UART_0_INST                                                 UART0
    #define CONFIG_UART_BAUD_RATE                                           (115200)
    
    /* Port definition for Pin Group GPIO_GRP_0 */
    #define GPIO_GRP_0_PORT                                                  (GPIOA)
    
    /* Defines for PIN_0: GPIOA.0 with pinCMx 1 on package pin 33 */
    #define GPIO_GRP_0_PIN_0_PIN                                     (DL_GPIO_PIN_0)
    #define GPIO_GRP_0_PIN_0_IOMUX                                    (IOMUX_PINCM1)
    /* clang-format on */
    
    #endif /* ti_drivers_config_h */
    

      

    The UART example calls this to open the UART handle and passes a const uint_least8_t. These don't exist in the ti_msp_dl_config.h from above.

    extern const uint_least8_t CONFIG_UART_0;
    
    uart = UART_open(CONFIG_UART_0, &uartParams);

      

    I can see that it generates initialization calls (SYSCFG_DL_*) for everything I configured. This is different form the UART example. I'm not sure how to use this with TI-Driver Library. What am I doing wrong? 

    I just found this recent thread: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1356956/mspm0g3507-ti_drivers_config-c-not-generated-by-sysconfig. Is this still true that it only works for the low-level DriverLib and not the thread-safe TI-Drivers? If so, this is a large hole if we're to move to the M0 platform.

  • Hi,

    Only ti_msp_dl_config.h/c will be generated by Sysconfig using driverlib file.

    And ti_drivers_config.c/h use TI-_drivers.

    To use sysconfig, please add Sysconfig into Products. And you can find auto-generated file in Debug file. Please remember to remove the old one.

    Also, you can refer to below demo code:

    ...\examples\rtos\LP_MSPM0G3507\kernel\blink_led

    Regards,

    Zoey