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.

错误求助#error NO CHIP DEFINED (use -dCHIP_XXXX where XXXX is chip number, i.e. 6201)

Other Parts Discussed in Thread: CCSTUDIO

使用CCS3.3,所选芯片为C6412 device cycle accurate simulatour. 在使用CSL库,配置GPIO时出现错误


"C:/CCStudio_v3.3/C6000/csl/include/csl_chiphal.h", line 267: fatal error: #error NO CHIP DEFINED (use -dCHIP_XXXX where XXXX is chip number, i.e. 6201)
1 fatal error detected in the compilation of "GPIO.c".


请高手指教该如何解决呢?
急求!!

  • 这个错误的意思是使用csl_chiphal.h文件时候,没有定义一个宏,即芯片名称,这应该是使用该库的时候,需要做的一个地方。

  • 在CCS中双击错误表示,进入发生错误的文件中,在芯片定义与否的判断语句前,添加一个宏,以便该判断语句顺利执行下去。

  • 你好,按照你说的方法以解决上述问题。在使用CSL库对GPIO操作时出现了以下错误:

    undefined                        first referenced
     symbol                              in file
    ---------                        ----------------
    _GPIO_open                       C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _CSL6412_LIB_                    C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _GPIO_pinEnable                  C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _GPIO_pinDirection               C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _IRQ_globalDisable               C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _GPIO_close                      C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    __CSL_init                       C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj
    _GPIO_pinWrite                   C:\\CCStudio_v3.3\\MyProjects\\c64xx_project\\led\\Debug\\sine.obj

    请问使用仿真芯片如何调用CSL库呢,怎么配置?

    主函数代码如下:

    #include <stdio.h>
    #include <csl.h>
    #include <csl_gpio.h>
    #include <csl_chip.h>

     


    extern far void vectors();
    static GPIO_Handle  hGpio;
    void delay(unsigned int n)
    {
     unsigned int i,j;
     for(i = 0;i<100*n;i++)
         for(j= 0;j<10000;j++);
    }

    void main(void)
    {
     unsigned int i;
     CSL_init();
     IRQ_globalDisable();
     hGpio=GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);//打开GPIO资源 
        GPIO_pinEnable(hGpio,GPIO_PIN4); 
        GPIO_pinEnable(hGpio,GPIO_PIN5); 
        GPIO_pinEnable(hGpio,GPIO_PIN6); 
        GPIO_pinEnable(hGpio,GPIO_PIN7); 
        GPIO_pinDirection(hGpio,GPIO_PIN4,GPIO_OUTPUT); 
        GPIO_pinDirection(hGpio,GPIO_PIN5,GPIO_OUTPUT); 
        GPIO_pinDirection(hGpio,GPIO_PIN6,GPIO_OUTPUT); 
        GPIO_pinDirection(hGpio,GPIO_PIN7,GPIO_OUTPUT); 
        for(i=0;i<8;i++) 
        { 
            GPIO_pinWrite(hGpio,GPIO_PIN4,0); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN5,0); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN6,0); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN7,0); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN4,1); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN5,1); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN6,1); 
            delay(100); 
            GPIO_pinWrite(hGpio,GPIO_PIN7,1); 
            delay(100); 
        } 
        GPIO_close(hGpio);//关闭GPIO资源 
        printf("The led code is working well!");
    }

  • 这个错误是库文件没有添加到工程上,检查一下工程中库文件的路径,是否和你本地电脑里库所在的路径一致。

  • 谢谢,问题以解决。我想用此仿真在PC机上运行,配置GPIO,运行程序看参数变量,这种可行吗?目前我没有实际的开发板,想学C6000系列,请指教。

  • 可以,CCS提供有simulator机制,你可以在选择仿真器的时候选择ti simulator选项,调试程序和真实板子连仿真器一样,处理数据,查看寄存器、变量等都不受影响。

    但要注意外设等条件等限制。

  • 你好,在使用SIMULATOR 配置GPIO时,编译没有错误,但是在进行LOAD PROGRAM运行程序事,提示错误Error:   Memory Map Error: WRITE access by CPU to address 0x1b00020, (GPIO Config Address) which is NOT SUPPORTED in Simulator.其中CSL库中定义#define _GPIO_BASE_ADDR    0x01B00000u ,在SIMULATOR机制下不能对GPIO 进行操作吗?