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.

MSPM0G3507: IAR Error[Pe028]: expression must have a constant value

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

Tool/software:

I'm porting from the CCS platform to the IAR platform and I'm finding that the TI-DRIVER stuff is reporting errors

  • Hi,

    I would suggest that to start empty_library or empty_non_sysconfig as a start IAR project. Then porting the .c and .h files in your CCS project to this IAR project. It can avoid dirver library building errors.

    Best regards,

    Cash Hao

  • I am porting the CCS .C and .h files based on this project, And I found IAR this project is not to TI-DRIVER library, use the DL library. but CCS is there TI-DRIVER code, please have IAR TI-driver demo code?

  • Hi,

    If there is a sysconfig file in your project. I think you can include the TI driver easily. 

     

    Best regards,

    Cash Hao

  • Why am I grayed out, I'm operating in IAR 9.5.0 IDE.

  • Hi,

    Can you try with the latest SDK version 2.00.01.00 and Sysconfig version 1.20. Check if it can help.

    Best regards,

    Cash Hao

  • Why is trying to use 2.00.01.00 still gray, which project are you based on. i am going to use freertos and ti-driver

  • Hi,

    I am using the no-rtos project. 

    If the sysconfig is not working. Then we can try add the TI driver manually in application code. Like " #include <ti/drivers/dma/DMAMSPM0.h>"

    Best regards,

    Cash Hao

  • And this mistake is?Are there any cases of IAR using freertos?

  • Hi,

    For now, we do not have freertos demo code based on IAR. Let me check with our software team about it. 

    Best regards,

    Cash Hao

  • I'll show you my temporary revision log and you can see if you can reproduce it.

    Please add the project C:\ti\mspm0_sdk_1_30_00_03\examples\rtos\LP_MSPM0G3507\kernel\blink_led\freertos\iar

    Custom Build cleared, since I added it manually to TI-driver, I don't need to go through sysconfig

    Then add the ti-driver library of IAR " $MSPM0_SDK_INSTALL_DIR$/source/ti/drivers/lib/iar/m0p/drivers_mspm0g1x0x_g3x0x.a "in the Linker's Extra Options.

    Then call GPIO_init() the api in ti_msp_dl_config.c 

    /*
     * Copyright (c) 2023, Texas Instruments Incorporated
     * 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.c =============
     *  Configured MSPM0 DriverLib module definitions
     *
     *  DO NOT EDIT - This file is generated for the MSPM0G350X
     *  by the SysConfig tool.
     */
    
    #include "ti_msp_dl_config.h"
    
    /*
     *  ======== SYSCFG_DL_init ========
     *  Perform any initialization needed before using any board APIs
     */
    SYSCONFIG_WEAK void SYSCFG_DL_init(void)
    {
        SYSCFG_DL_initPower();
        SYSCFG_DL_GPIO_init();
        /* Module-Specific Initializations*/
        SYSCFG_DL_SYSCTL_init();
    }
    
    SYSCONFIG_WEAK void SYSCFG_DL_initPower(void)
    {
        DL_GPIO_reset(GPIOA);
        DL_GPIO_reset(GPIOB);
    
        DL_GPIO_enablePower(GPIOA);
        DL_GPIO_enablePower(GPIOB);
        delay_cycles(POWER_STARTUP_DELAY);
    }
    
    
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/gpio/GPIOMSPM0.h>
    
    /* The range of pins available on this device */
    const uint_least8_t GPIO_pinLowerBound = 0;
    const uint_least8_t GPIO_pinUpperBound = 60;
    
    GPIO_PinConfig gpioPinConfigs[60] = {
        GPIO_DO_NOT_CONFIG, /* PA0 */       /*I2C0_SDA*/
        GPIO_DO_NOT_CONFIG, /* PA1 */       /*I2C0_SCL*/
        GPIO_DO_NOT_CONFIG, /* PA2 */       /*AMP V/GDD EN*/
        GPIO_DO_NOT_CONFIG, /* PA3 */       /*I2C1_SDA*/
        GPIO_DO_NOT_CONFIG, /* PA4 */       /*I2C1_SCL*/
        GPIO_DO_NOT_CONFIG, /* PA5 */
        GPIO_DO_NOT_CONFIG, /* PA6 */
        GPIO_DO_NOT_CONFIG, /* PA7 */
        GPIO_DO_NOT_CONFIG, /* PA8 */
        GPIO_DO_NOT_CONFIG, /* PA9 */       /*USB ILIM EN*/
        GPIO_DO_NOT_CONFIG, /* PA10 */      /*USB PWR EN*/
        GPIO_DO_NOT_CONFIG, /* PA11 */      /*CHG EN*/
        GPIO_DO_NOT_CONFIG, /* PA12 */
        GPIO_DO_NOT_CONFIG, /* PA13 */
        GPIO_DO_NOT_CONFIG, /* PA14 */
        GPIO_DO_NOT_CONFIG, /* PA15 */
        GPIO_DO_NOT_CONFIG, /* PA16 */      /*USB BT5V EN*/
        GPIO_DO_NOT_CONFIG, /* PA17 */      /*HW VERSION OET*/
        GPIO_DO_NOT_CONFIG, /* PA18 */ /*BSL_INVOKE_BTM*/
        GPIO_DO_NOT_CONFIG, /* PA19 */      /*MCU SWCLK*/
        GPIO_DO_NOT_CONFIG, /* PA20 */      /*MCU SWDIO*/
        GPIO_DO_NOT_CONFIG, /* PA21 */      /*CH2 R*/
        GPIO_DO_NOT_CONFIG, /* PA22 */      /*CH1 G*/
        GPIO_DO_NOT_CONFIG, /* PA23 */      /*DSP I2C SEL*/
        GPIO_DO_NOT_CONFIG, /* PA24 */      /*CHG STAT2*/
        GPIO_DO_NOT_CONFIG, /* PA25 */      /*CHG STAT1*/
        GPIO_DO_NOT_CONFIG, /* PA26 *//* Owned by CONFIG_ADC_0, channel 1 as ADC Pin */
        GPIO_DO_NOT_CONFIG, /* PA27 *//* Owned by CONFIG_ADC_0, channel 0 as ADC Pin */
        GPIO_DO_NOT_CONFIG, /* PA28 */      /*LED_DRV_SDB*/
        GPIO_DO_NOT_CONFIG, /* PA29 */
        GPIO_DO_NOT_CONFIG, /* PA30 */
        GPIO_DO_NOT_CONFIG, /* PA31 */
        GPIO_DO_NOT_CONFIG, /* PB0 */   /*---------------32------------------*/
        GPIO_DO_NOT_CONFIG, /* PB1 */
        GPIO_DO_NOT_CONFIG, /* PB2 */
        GPIO_DO_NOT_CONFIG, /* PB3 */
        GPIO_DO_NOT_CONFIG, /* PB4 */
        GPIO_DO_NOT_CONFIG, /* PB5 */
        GPIO_DO_NOT_CONFIG, /* PB6 */       /*CHG ISET*/
        GPIO_DO_NOT_CONFIG, /* PB7 */
        GPIO_DO_NOT_CONFIG, /* PB8 */
        GPIO_DO_NOT_CONFIG, /* PB9 */
        GPIO_DO_NOT_CONFIG, /* PB10 */
        GPIO_DO_NOT_CONFIG, /* PB11 */
        GPIO_DO_NOT_CONFIG, /* PB12 */
        GPIO_DO_NOT_CONFIG, /* PB13 */
        GPIO_DO_NOT_CONFIG, /* PB14 */
        GPIO_DO_NOT_CONFIG, /* PB15 */      /*BT_UART_RX*/
        GPIO_DO_NOT_CONFIG, /* PB16 */      /*BT_UART_TX*/
        GPIO_DO_NOT_CONFIG, /* PB17 */
        GPIO_DO_NOT_CONFIG, /* PB18 */
        GPIO_DO_NOT_CONFIG, /* PB19 */
        GPIO_DO_NOT_CONFIG, /* PB20 */
        GPIO_DO_NOT_CONFIG, /* PB21 */
        GPIO_DO_NOT_CONFIG, /* PB22 */
        GPIO_DO_NOT_CONFIG, /* PB23 */
        GPIO_DO_NOT_CONFIG, /* PB24 */
        GPIO_DO_NOT_CONFIG, /* PB25 */
        GPIO_DO_NOT_CONFIG, /* PB26 */
        GPIO_DO_NOT_CONFIG, /* PB27 */
    };
    
    /* This is an interrupt example, use callbacks */
    GPIO_CallbackFxn gpioCallbackFunctions[60] = {0};
    
    void *gpioUserArgs[60];
    
    const GPIO_Config GPIO_config = {
        .configs = (GPIO_PinConfig *) gpioPinConfigs,
        .callbacks   = (GPIO_CallbackFxn *) gpioCallbackFunctions,
        .userArgs    = gpioUserArgs,
        .intPriority = (~0)};
    
    SYSCONFIG_WEAK void SYSCFG_DL_GPIO_init(void)
    {
    
        DL_GPIO_initDigitalOutput(GPIO_LEDS_USER_LED_1_IOMUX);
    
        DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
        DL_GPIO_enableOutput(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
        GPIO_init();
    }
    
    
    
    SYSCONFIG_WEAK void SYSCFG_DL_SYSCTL_init(void)
    {
    
    	//Low Power Mode is configured to be SLEEP0
        DL_SYSCTL_setBORThreshold(DL_SYSCTL_BOR_THRESHOLD_LEVEL_0);
    
        DL_SYSCTL_setSYSOSCFreq(DL_SYSCTL_SYSOSC_FREQ_BASE);
    
    }
    
    
    

    And then it will report an error.

  • Hi,

    I will try to reproduce this issue on my side. Let's wait for our software reply about whether we have a freertos example project based on IAR.

    Best regards,

    Cash Hao