Re: dsPIC 編譯失敗
|
||||
---|---|---|---|---|
版主
|
參照:
Configuration Bits 的參數選項沒有 "BORV_20" 的設定項,請參考一下該元件的 h 檔裡對 PBOR 的定義。或可以參考底下的設定: _FOSC(CSW_FSCM_OFF & XT_PLL8); // XT with 8xPLL oscillator, Failsafe clock off _FWDT(WDT_OFF); // Watchdog timer disabled _FBORPOR(PBOR_OFF & MCLR_EN); // Brown-out reset disabled, MCLR reset enabled _FGS(CODE_PROT_OFF); // Code protect disabled 第二個錯誤請修正一下 main( ) 函數的使用: int main(void)
發表於: 2021/1/28 15:55
|
|||
|
Re: dsPIC 編譯失敗
|
||||
---|---|---|---|---|
新會員
|
您好:
最近在嘗試新的專案開發 寫完程式進行燒錄時又產生錯誤 因為編譯器上都沒有紅底 所以也不知道是哪邊錯誤 以下是錯誤訊息 make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf make[1]: Entering directory 'C:/Users/Feeddback/Desktop/AD.X' make -f nbproject/Makefile-default.mk dist/default/production/AD.X.production.hex make[2]: Entering directory 'C:/Users/Feeddback/Desktop/AD.X' AD.c:12: error: 'BORV_20' undeclared here (not in a function) "C:\Program Files (x86)\Microchip\MPLAB C30\bin\pic30-gcc.exe" -g -omf=elf -x c -c -mcpu=30F4011 -MMD -MF build/default/production/AD.o.d -o build/default/production/AD.o AD.c nbproject/Makefile-default.mk:118: recipe for target 'build/default/production/AD.o' failed make[2]: Leaving directory 'C:/Users/Feeddback/Desktop/AD.X' make[2]: *** [build/default/production/AD.o] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed make[1]: Leaving directory 'C:/Users/Feeddback/Desktop/AD.X' nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed BUILD FAILED (exit value 2, total time: 306ms) 也有參照之前的方式更改成以下設定 _FOSC(CSW_FSCM_OFF & XT_PLL8); // XT with 8xPLL oscillator, Failsafe clock off _FWDT(WDT_OFF); // Watchdog timer disabled _FBORPOR(PBOR_OFF & MCLR_EN); // Brown-out reset disabled, MCLR reset enabled _FGS(CODE_PROT_OFF); // Code protect disabled 但還是編譯失敗 MPLAB X IDE V5.20 C30 (V3_31)
發表於: 2021/3/31 17:30
|
|||
|
Re: dsPIC 編譯失敗
|
||||
---|---|---|---|---|
版主
|
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/Feeddback/Desktop/AD.X' make -f nbproject/Makefile-default.mk dist/default/production/AD.X.production.hex make[2]: Entering directory 'C:/Users/Feeddback/Desktop/AD.X' AD.c:12: error: 'BORV_20' undeclared here (not in a function) "C:\Program Files (x86)\Microchip\MPLAB C30\bin\pic30-gcc.exe" -g -omf=elf -x c -c -mcpu=30F4011 -MMD -MF build/default/production/AD.o.d -o build/default/production/AD.o AD.c nbproject/Makefile-default.mk:118: recipe for target : : 編譯只有一項錯誤如紅色標示。 BORV_20 的定義沒有宣告所以會產生錯誤。dsPIC30F4011 的周邊定義檔在: C:\Program Files (x86)\Microchip\MPLAB C30\support\dsPIC30F\h\p30f4011.h 在這 h 檔裡的後面有 Configuration Word 的名稱定義。其中 " Brown Out Voltage" 的定義是: #define BORV45 0xFFCF #define BORV42 0xFFDF #define BORV27 0xFFEF #define BORV20 0xFFFF 所以要將程式裡有關 BOR 的設定從 "BORV_20" 改成 "BROV20"。
發表於: 2021/4/6 12:08
|
|||
|