Part Number: CCSTUDIO
Other Parts Discussed in Thread: MSPM0G3507
我是ccs新手。现在我的mspm0g3507快递还没到,但是尝试在ccs中build例程的时候出现了编译错误。依照我找到的资料,Build和电脑有没有连接板子,两件事情之间没有关联。但是由于下述问题也很奇怪,我先把这点说明吧。我选择的例程具体是D:\TI\M0SDK\mspm0_sdk_2_01_00_03\examples\nortos\LP_MSPM0G3507\driverlib\gpio_software_poll但我在build的过程中遇到了很离奇的问题。我在ccs里的syscfg中配置完board为mspm0g3507 launchpad, device为mspm0g3507, package为LQFP-64(PM) 后。尝试进行build,然而出现了报错,具体的报错信息是:Arm Compiler - building file: "../gpio_software_poll.c""D:/TI/CCS2051/ccs/tools/compiler/ti-cgt-armllvm_4.0.4.LTS/bin/tiarmclang.exe" -c @"device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"C:/Users/34247/workspace_ccstheia/gpio_software_poll_LP_MSPM0G3507_nortos_ticlang" -I"C:/Users/34247/workspace_ccstheia/gpio_software_poll_LP_MSPM0G3507_nortos_ticlang/Debug" -I"D:/TI/M0SDK/mspm0_sdk_2_01_00_03/source/third_party/CMSIS/Core/Include" -I"D:/TI/M0SDK/mspm0_sdk_2_01_00_03/source" -gdwarf-3 -MMD -MP -MF"gpio_software_poll.d_raw" -MT"gpio_software_poll.o" @"./device.opt" -o"gpio_software_poll.o" "../gpio_software_poll.c"[3]../gpio_software_poll.c:43:17: error: use of undeclared identifier 'GPIOC'43 | GPIO_SWITCHES_PORT, GPIO_SWITCHES_USER_SWITCH_1_PIN)) {| ^[4]C:/Users/34247/workspace_ccstheia/gpio_software_poll_LP_MSPM0G3507_nortos_ticlang/Debug\ti_msp_dl_config.h:88:75: note: expanded from macro 'GPIO_SWITCHES_PORT'88 | #define GPIO_SWITCHES_PORT (GPIOC)| ^1 error generated.然而,我确实已经在syscfg中进行了对应的配置,而且我以txt的形式打开对应的syscfg文件,其中内容也指明了当前配置确实应该没有问题,具体的内容是
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
*/
// @cliArgs --device "MSPM0G350X" --package "LQFP-64(PM)" --part "Default"
// @cliArgs --board /ti/boards/LP_MSPM0G3507 --rtos nortos
/**
* Import the modules used in this configuration.
*/
const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
const GPIO1 = GPIO.addInstance();
const GPIO2 = GPIO.addInstance();
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
/**
* Write custom configuration values to the imported modules.
*/
GPIO1.$name = "GPIO_LEDS";
GPIO1.associatedPins[0].$name = "USER_LED_1";
GPIO1.associatedPins[0].assignedPort = "PORTA";
GPIO1.associatedPins[0].assignedPin = "0";
GPIO1.associatedPins[0].initialValue = "SET";
const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
GPIO2.$name = "GPIO_SWITCHES";
GPIO2.associatedPins[0].assignedPort = "PORTB";
GPIO2.associatedPins[0].assignedPin = "21";
GPIO2.associatedPins[0].$name = "USER_SWITCH_1";
GPIO2.associatedPins[0].direction = "INPUT";
GPIO2.associatedPins[0].internalResistor = "PULL_UP";
SYSCTL.forceDefaultClkConfig = true;
SYSCTL.clockTreeEn = true;