Re: EXTERN(__resetPRI) 位址問題 (+燒錄問題)
|
||||
---|---|---|---|---|
版主
|
我的想法是,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
|
|||
|
Re: EXTERN(__resetPRI) 位址問題 (+燒錄問題)
|
||||
---|---|---|---|---|
資深會員
|
歹勢~~容小弟自己頂一下, 因為燒一次四分鐘, 實在是好浪費生命!! 哈哈!!
發表於: 2008/10/21 11:08
|
|||
Thanks,
Edward Lee |
||||
|
Re: EXTERN(__resetPRI) 位址問題
|
||||
---|---|---|---|---|
資深會員
|
找到原因了, 因為承接已經做到一半的程式, 部分細節沒注意到.
問題出現在原程式內, 宣告 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 |
||||
|
Re: EXTERN(__resetPRI) 位址問題
|
||||
---|---|---|---|---|
資深會員
|
補充: 未知原因, 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 |
||||
|
EXTERN(__resetPRI) 位址問題
|
||||
---|---|---|---|---|
資深會員
|
小弟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 |
||||
|