:::


Browsing this Thread:   1 Anonymous Users






Re: MHC 創建 Keil 問題
#5
中級會員
中級會員


查看用戶資訊
Hi Liba
感謝~~~~

發表於: 2021/10/31 0:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MHC 創建 Keil 問題
#4
管理員
管理員


查看用戶資訊
您應該是參考這篇APP note
https://microchip-mplab-harmony.github ... ing_iar_keil_project.html

由於您的舊專案使用的Harmony Framework 版本比較舊,
但是在您電腦中的 Framework 已經升到新版的Framework,
縮圖


當重新使用MHC建立 Keil Project 並Gencode時,
會使用電腦中較新的 Framework 來 Gencode,
導致舊專案中的Application code發生錯誤,
這是因為新的Framework可能採用完全不同的API function或是Definition,
舊專案要能使用時,
1. 必須使用當時舊版的Framework版本, 或是
2. 將舊專案的Application改寫成可以使用新版Framework的用法.

在Harmony Content Manager中可以, 選擇將當前的 Framework 降版, 如果降版發生錯誤時, 請刪除該 Module 重新下載一次之後, 再降版
縮圖

Attach file:



jpg  Framework_diff.jpg (131.10 KB)
67979_617b77685647b.jpg 781X376 px

jpg  Framework_downgrade.jpg (127.73 KB)
67979_617b777c2f205.jpg 588X520 px

發表於: 2021/10/29 12:24
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MHC 創建 Keil 問題
#3
中級會員
中級會員


查看用戶資訊
Hi Libra
已發信給你再麻煩你看看

發表於: 2021/10/29 9:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MHC 創建 Keil 問題
#2
管理員
管理員


查看用戶資訊
我嘗試轉了一個SAM2002的Lab, 在Keil下編譯並沒有出錯.
方便將專案寄給我測試看看嗎?
libra.chien@microchip.com

發表於: 2021/10/29 9:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


MHC 創建 Keil 問題
#1
中級會員
中級會員


查看用戶資訊
1. 使用MPLAB X IDE 叫出之前專案檔,在TOOLS->EMBEDDED->MPLAB Harmony 3 configuator 叫出配置檔

在file -> save configuation,之後關閉MPLAB X IDE


D:\Harmony3\mhc\runmhc.bat 單獨叫出 MPLAB Harmony configuator 配置檔

在file -> open configuation,叫出 專案夾路徑\firmware\src\config\default

選擇編譯器->Keil,然後按下generate code ,然後找到對應產生Keil 專案檔,在keil 編譯有錯



使用Keil 編譯錯誤如下:
compiling plib_sercom2_i2c_master.c...
compiling plib_sercom3_usart.c...
../src/main.c(124): error: unknown type name 'CAN_MSG_RX_FRAME_ATTRIBUTE'
static CAN_MSG_RX_FRAME_ATTRIBUTE msgFrameAttr = CAN_MSG_RX_DATA_FRAME;
^
../src/main.c(124): error: use of undeclared identifier 'CAN_MSG_RX_DATA_FRAME'
static CAN_MSG_RX_FRAME_ATTRIBUTE msgFrameAttr = CAN_MSG_RX_DATA_FRAME;
^
../src/main.c(587): warning: implicit declaration of function 'CAN0_TxCallbackRegister' is invalid in C99 [-Wimplicit-function-declaration]
CAN0_TxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_TRANSMIT );
^
../src/main.c(589): warning: implicit declaration of function 'CAN0_MessageTransmit' is invalid in C99 [-Wimplicit-function-declaration]
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(589): error: use of undeclared identifier 'CAN_MODE_FD_WITH_BRS'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(589): error: use of undeclared identifier 'CAN_MSG_ATTR_TX_FIFO_DATA_FRAME'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(603): error: use of undeclared identifier 'CAN_MODE_FD_WITH_BRS'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(603): error: use of undeclared identifier 'CAN_MSG_ATTR_TX_FIFO_DATA_FRAME'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(611): warning: implicit declaration of function 'CAN0_RxCallbackRegister' is invalid in C99 [-Wimplicit-function-declaration]
CAN0_RxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_RECEIVE, CAN_MSG_ATTR_RX_BUFFER );
^
../src/main.c(611): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_BUFFER'
CAN0_RxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_RECEIVE, CAN_MSG_ATTR_RX_BUFFER );
^
../src/main.c(615): warning: implicit declaration of function 'CAN0_MessageReceive' is invalid in C99 [-Wimplicit-function-declaration]
if (CAN0_MessageReceive(&rx_messageID, &rx_messageLength, rx_message, ×tamp, CAN_MSG_ATTR_RX_BUFFER, &msgFrameAttr) == false)
^
../src/main.c(615): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_BUFFER'
if (CAN0_MessageReceive(&rx_messageID, &rx_messageLength, rx_message, ×tamp, CAN_MSG_ATTR_RX_BUFFER, &msgFrameAttr) == false)
^
../src/main.c(623): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_FIFO0'
CAN0_RxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_RECEIVE, CAN_MSG_ATTR_RX_FIFO0 );
^
../src/main.c(627): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_FIFO0'
if (CAN0_MessageReceive(&rx_messageID, &rx_messageLength, rx_message, ×tamp, CAN_MSG_ATTR_RX_FIFO0, &msgFrameAttr) == false)
^
../src/main.c(635): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_BUFFER'
CAN0_RxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_RECEIVE, CAN_MSG_ATTR_RX_BUFFER );
^
../src/main.c(639): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_BUFFER'
if (CAN0_MessageReceive(&rx_messageID, &rx_messageLength, rx_message, ×tamp, CAN_MSG_ATTR_RX_BUFFER, &msgFrameAttr) == false)
^
../src/main.c(647): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_FIFO1'
CAN0_RxCallbackRegister( APP_CAN_Callback, (uintptr_t)APP_STATE_CAN_RECEIVE, CAN_MSG_ATTR_RX_FIFO1 );
^
../src/main.c(651): error: use of undeclared identifier 'CAN_MSG_ATTR_RX_FIFO1'
if (CAN0_MessageReceive(&rx_messageID, &rx_messageLength, rx_message, ×tamp, CAN_MSG_ATTR_RX_FIFO1, &msgFrameAttr) == false)
^
../src/main.c(665): error: use of undeclared identifier 'CAN_MODE_FD_WITH_BRS'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(665): error: use of undeclared identifier 'CAN_MSG_ATTR_TX_FIFO_DATA_FRAME'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(679): error: use of undeclared identifier 'CAN_MODE_FD_WITH_BRS'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(679): error: use of undeclared identifier 'CAN_MSG_ATTR_TX_FIFO_DATA_FRAME'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_FD_WITH_BRS, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
../src/main.c(694): error: use of undeclared identifier 'CAN_MODE_NORMAL'
if (CAN0_MessageTransmit(messageID, messageLength, message, CAN_MODE_NORMAL, CAN_MSG_ATTR_TX_FIFO_DATA_FRAME) == false)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Attach file:



jpg  產生程式碼.jpg (61.70 KB)
110549_617a3b921d4ee.jpg 625X657 px

jpg  修改keil編譯.jpg (357.64 KB)
110549_617a3c23f10af.jpg 1783X1027 px

jpg  open_configuator.jpg (67.39 KB)
110549_617a3c33ed7c5.jpg 832X494 px

發表於: 2021/10/28 13:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

會員登入

知識列車系列 IV – 2022 MU選粹網路研討會

http://www.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
[ more... ]
:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
https://mu.microchip.com/page/tmu
http://www.microchip.com.tw/modules/tadnews/page.php?ncsn=2&nsn=41
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

課程 - 台北教育訓練中心
課程 - 新竹教育訓練中心
課程 - 高雄教育訓練中心
教育訓練中心介紹
購買 - 實驗工具
臺灣實驗板介紹與資源