• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: EXTERN(__resetPRI) 位址問題 (+燒錄問題)
#6
資深會員
資深會員


查看用戶資訊
感謝楊兄:
第一種方法, 應該可以試試, 只要能模擬使用Bootloader後的情況即可.

第二種方法, 我有試過, 接著按run, MPLAB不理我, 直接停止.
我是使用Real ICE.

另外異想天開, 不知有無可能, 直接結合程式, 一次燒錄兩部份?

發表於: 2008/10/21 12:00
Thanks,
Edward Lee
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: EXTERN(__resetPRI) 位址問題 (+燒錄問題)
#5
版主
版主


查看用戶資訊
我的想法是,Bootloader那一段暫時不要用,但是還是保留 AP 的部份且連AP的程式位址都不要更動,只要在原有的 AP 加入 Reset 向量的轉移(這原先是 Bootloader 的 Reset 位址) 將Reset 轉到 AP 程式的進入點,要注意的是 C得程式啟動是 AP 做掉的還是原先的 Bootloader 做掉的。也就是說暫時拿掉 Bootloader,AP程式直接用 ICD2 燒錄的方式去試。

再 AP 擺 Reset Vector 可以試試看用 __space(porg0,address (0x000000)) 的方式強定 Flash Menory 的起始位址,再用 #asm (In-Line Assembly)的方式加入 goto _reset 的方式跳到 AP 的 C 程式啟動的地方。

C30 的啟動模組進入點的 Label 是 _reset


還有一種方式是: Bootloader 就先不要管它,直接利用ICD2燒入AP後,直接用view Program 的方式找到 _reset 的 Lable 後用 Set Course to PC 的方式從這裡猜始執行AP的程式。

發表於: 2008/10/21 11:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: EXTERN(__resetPRI) 位址問題 (+燒錄問題)
#4
資深會員
資深會員


查看用戶資訊
歹勢~~容小弟自己頂一下, 因為燒一次四分鐘, 實在是好浪費生命!! 哈哈!!

發表於: 2008/10/21 11:08
Thanks,
Edward Lee
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: EXTERN(__resetPRI) 位址問題
#3
資深會員
資深會員


查看用戶資訊
找到原因了, 因為承接已經做到一半的程式, 部分細節沒注意到.

問題出現在原程式內, 宣告
const unsigned char __attribute__((space(prog),address(0x2400))) AA[256];
結果造成.text的推擠!!

增加一sector, 並且拿掉const關鍵字即可.

另外請教有誰知道, 如何快速燒錄, 暫時不使用Bootloader, 我的意思是, bootloader與App程式, 可以都透過ICD2 or REAL ICE去個別燒錄嗎? 但是不能將Bootloader移除, 因為不使用Bootloader時, App動作正確, 改了以後, 些許動作結果不同, 因此需要Debug, 但是每次更新app, 都得一定要使用Bootloader , 有夠慢!! 急性子~等不下去..

知道如何分開燒錄的先知, 提點一下~~
例如我在燒錄App程式時, 有設定區間, 結果一樣把其他區塊程式移除掉, 不知哪裡可以設定, 叫MPLAB只燒錄強制驅塊, 不破壞其他區塊?!!

發表於: 2008/10/21 8:37

Edited by edwardlee on 2008年10月21日 11:03:57
Thanks,
Edward Lee
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: EXTERN(__resetPRI) 位址問題
#2
資深會員
資深會員


查看用戶資訊
補充: 未知原因, 0xC00~2200程式空間不見了 .text定義0xC00開始, 卻跑到0x3000?

求救阿!!

Program Memory Usage

section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
_01325b6048fcaee0 0x2202 0x2 0x3 (3)
.u1rx_isr 0x2204 0x174 0x22e (558)
_01384d2048fcaee3 0x2400 0x100 0x180 (384)
_0138ba1048fcaee3 0x2500 0x300 0x480 (1152)
.dinit 0x2800 0xca 0x12f (303)
.adc1_isr 0x28ca 0xa6 0xf9 (249)
_0136546048fcaeeb 0x2c00 0x20 0x30 (48)
_013655b048fcaeeb 0x2c20 0x20 0x30 (48)
_0136570048fcaeeb 0x2c40 0x20 0x30 (48)
_0136585048fcaeeb 0x2c60 0x20 0x30 (48)
_013659a048fcaeeb 0x2c80 0x20 0x30 (48)
_01365af048fcaeeb 0x2ca0 0x20 0x30 (48)
_01365c4048fcaeeb 0x2cc0 0x20 0x30 (48)
_01365d9048fcaeeb 0x2ce0 0x20 0x30 (48)
_0137169048fcaeeb 0x2d00 0x300 0x480 (1152)
.text 0x3000 0x1eee 0x2e65 (11877)
.const 0x4eee 0x5ac 0x882 (2178)
.si2c2_isr 0x549a 0x35c 0x50a (1290)
.isr 0x57f6 0x2 0x3 (3)
__CONFIG2 0x57fc 0x2 0x3 (3)
__CONFIG1 0x57fe 0x2 0x3 (3)

發表於: 2008/10/21 0:24
Thanks,
Edward Lee
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


EXTERN(__resetPRI) 位址問題
#1
資深會員
資深會員


查看用戶資訊
小弟gld File大致是這樣定義的:

OUTPUT_ARCH("24FJ32GA002")
EXTERN(__resetPRI)
EXTERN(__resetALT)

OPTIONAL(-lpPIC24Fxxx)

MEMORY
{
data (a!xr) : ORIGIN = 0x800, LENGTH = 0x2000

/*Starting location and length of user program */
program (xr) : ORIGIN = 0xC00, LENGTH = 0x4BFC /*4BFC + C00 - 1 = 57FB*/
config2 : ORIGIN = 0x57FC, LENGTH = 0x2
config1 : ORIGIN = 0x57FE, LENGTH = 0x2
}

......

.text :
{
*(.init);
*(.handle);
*(.libc) *(.libm) *(.libdsp); /* keep together in this order */
*(.lib*);
*(.text);
} >program

主要是要配合Bootloader, 結果可以執行Bootloader, 但是後續好像當機, 我查到resetPRI並非在應該的位置0xC00, 請問如何讓它停在.text第一個位址不要亂跑?

發表於: 2008/10/21 0:03
Thanks,
Edward Lee
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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
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... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------