IAR常見錯誤列表

2021-06-19 22:11:56 字數 2394 閱讀 7883

很多朋友對於iar不是很熟悉,使用iar程式設計出錯時更不知道從**下手,先在網上找到一篇關於《iar常見錯誤列表》的文章,以饗讀者。

這篇文章**於

(1)error: copy protection check, no valid license found for this product 

原因:安裝的時候沒有把序號產生器的0x.....字串的小寫字母改為大寫字母。

(2)warning: last line of file ends without a newline f:\emotion\iar\pk 公升級\cc1110-8\main.c 

原因:在使用iar時常常會彈出類似這樣乙個警告,其實只要在最後一行多加乙個回車就不會再有這個警告了。

(3)error: segment bank_relays must be defined in a segment definition option (-z, -b or -p) 

原因:這是用730b編譯的錯誤,可能是由於相對於目標工程版本過高的,後改用720h,沒有發生錯誤。

(4)error: could not open source file "stdio.h" 

原因:標頭檔案路徑不對造成,改正的方法是在設定選項卡的c/c++ compiler -> preprocessor選項裡,將$toolkit_dir$\inc\clib\添到include paths中。

(5)error: could not open source file "hal.h" c:\users\user\desktop\例子程式\無線通訊綜合測試\library\cc2430\hal\source\settimer34period.c

原因:先檢查c:\users\user\desktop\例子程式\無線通訊綜合測試\library\cc2430\hal\source\有無settimer34period.c這個檔案,若有,則是因為iar對中文路徑支援不好的緣故,把這個工程複製到英文路徑下編譯就不會發生錯誤。

(6)error: segment code_c (size: 0x1869 align: 0) is too long for segment definition. at least 0x1259 more bytes needed.

原因:code不夠了,在xcl檔案中修改其大小,0x28ff+0x1259=0x3b58,設定為-d_code_end=0x3b58。

(7)error: segment xdata_z (size: 0x1ea7 align: 0) is too long for segment definition. at least 0x2a7 more bytes 

原因:在xcl檔案裡修改段大小,-d_ixdata_end=0xfd53    // revison d (this setting is safe for all revisions)還有可能是定義的大陣列太多了,有時候某些函式中定義的陣列有點大,在主函式中單獨測試這個函式時不會報錯。

(8)error: segment cstack (size: 0x50 align: 0x1) is too long for segment definition. at least 0x50 more bytes needed. the problem occurred while processing the segment placement command "-z(data)cstack+_stack_size#", 

原因:此錯誤是所定義的全域性變數和陣列緩衝區等所佔的ram超出硬體支援所致,size: 0x50 為超出的大小。只要減少不要的全域性變數和盡量縮小陣列緩衝區就可以了!

原因:只有沒有找到該函式的定義onboard_sendphoto(),只有宣告和使用。一般在鏈結時發生此錯誤。

(10)error:too much object code produced(more than 0x1000 bytes)for this package

原因:4k限制版,請使用非限制版的。

iar常見錯誤請先從以下幾個方面入手:

1、   序列號是否正確。

2、   使用版本是否正確,應該使用7.30b開啟的工程檔案不能用7.20h開啟。

3、   盡量不要使用中文路徑。

4、   zigbee協議棧資料夾需要放在iar安裝盤根目錄下。

5、   請確定當前編譯資料夾是否有讀寫許可權。

6、   使用的版本是否為限制版。

(11)fatal error[e72]: segment zignv_address_space must be defined in a segment definition option (-z, -b or -p) 

解決:重灌zstack-2007,在工程的option裡面不要動什麼東西,直接編譯就行!

HTTP錯誤列表

http 400 請求無效 http 401.1 未授權 登入失敗 http 401.2 未授權 伺服器配置問題導致登入失敗 http 401.3 acl 禁止訪問資源 http 401.4 未授權 授權被篩選器拒絕 http 401.5 未授權 isapi 或 cgi 授權失敗 http 403 ...

python迴圈刪除列表元素常見錯誤與正確方法

常見錯誤一 使用固定長度迴圈刪除列表元素 l a b c for i in range len l l.pop i 報錯 valueerror list.remove x x not in list 原因 在刪除list中的元素後,list的實際長度變小了,但是迴圈次數沒有減少,依然按照原來list...

python迴圈刪除列表元素常見錯誤與正確方法

使用固定長度迴圈pop方法刪除列表元素 num list 1 1,2,2,2,3 for i in range len num list 1 if num list 1 i 2 num list 1.pop i else print num list 1 i print num list 1 num...