• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: ATSAME54P20A--定址
#13
新會員
新會員


查看用戶資訊
參照:

Gordon0010 寫道:
參照:

Libra 寫道:
真奇怪, 我的就可以, 把我的.ld 跟 .map寄給你看一下
這檔案用7z壓縮的, 要用7z解壓縮, 不能在Windows直接點用winzip解壓縮


一樣,我用你給的ld檔一樣沒有變更RAM的配置。


OK了!我重新開一個專案就可以了!
感謝Libra幫忙!
無法link進compiler的原因,應該是我直接把
Harmony下的專案直接copy過來改。

發表於: 2020/5/25 13:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#12
管理員
管理員


查看用戶資訊
你是用SAME54-XPlained PRO EVB? 可以把你的專案寄給我試試, 另外提供你目前使用的環境
1. Windows 版本
2. MPLAB X IDE 版本
3. DFP 版本
4. CMSIS 版本
5. XC32 版本
6. Harmony3 版本

我有另外寄e-mail到你的Yahoo信箱了, 如果有公司的E-mail可以改用公司的E-Mail寄給我比較不會退件

發表於: 2020/5/25 13:33
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#11
新會員
新會員


查看用戶資訊
參照:

Libra 寫道:
真奇怪, 我的就可以, 把我的.ld 跟 .map寄給你看一下
這檔案用7z壓縮的, 要用7z解壓縮, 不能在Windows直接點用winzip解壓縮


一樣,我用你給的ld檔一樣沒有變更RAM的配置。

發表於: 2020/5/25 11:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#10
管理員
管理員


查看用戶資訊
真奇怪, 我的就可以, 把我的.ld 跟 .map寄給你看一下
這檔案用7z壓縮的, 要用7z解壓縮, 不能在Windows直接點用winzip解壓縮

Attach file:


Link only for registered users

發表於: 2020/5/25 11:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#9
新會員
新會員


查看用戶資訊
參照:

Libra 寫道:
你改過的.ld要在X IDE的專案中, 加到Linker File底下, Compiler才會引用到, 不是Copy過來而已
Linker Files\ 按右鍵 -> Add Existing Item


感謝!Libra.
這部分有我有做,就是因為這樣,但還是無法變更所以才很納悶!
如圖:

Attach file:



jpg  (0.00 KB)


發表於: 2020/5/25 10:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#8
管理員
管理員


查看用戶資訊
你改過的.ld要在X IDE的專案中, 加到Linker File底下, Compiler才會引用到, 不是Copy過來而已
Linker Files\ 按右鍵 -> Add Existing Item

發表於: 2020/5/25 8:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#7
新會員
新會員


查看用戶資訊
參照:

Libra 寫道:
所以如果使用自動變數就會正常?
uint8_t Can0MessageRAM[CAN0_MESSAGE_RAM_CONFIG_SIZE];
uint8_t Can1MessageRAM[CAN1_MESSAGE_RAM_CONFIG_SIZE];


是的,CAN的傳送接收都正常。
但一定址就會出問題。


參照:

Libra 寫道:
.bss是在linker file中去指定的
SAME54的Global Linker file在(XC32 v2.40之後只有64bit)
C:\Program Files\Microchip\xc32\v2.40\pic32c\lib\proc\ATSAME54P20A\ATSAME54P20A.ld

這裡不可以改它, 如果你要修改時, 要把它Copy到你的專案下, 然後在你的專案下的\Linker Files中加進來


縮圖













以下為ld檔修改的內容:
#ifndef RAM_LENGTH
#  define RAM_LENGTH 0x40000
#elif (RAM_LENGTH > 0x40000)
#  error RAM_LENGTH is greater than the max size of 0x40000
#endif
//---------------------------------------
#ifndef RAM_LENGTH_01
#  define RAM_LENGTH_01 0x3FEC0
#elif (RAM_LENGTH_01 > 0x3FEC0)
#  error RAM_LENGTH_01 is greater than the max size of 0x3FEC0
#endif

MEMORY
{
  
rom (LRX) : ORIGIN ROM_ORIGINLENGTH ROM_LENGTH
  
//--------------------------------------------------------
  /*ram (WX!R) : ORIGIN = RAM_ORIGIN, LENGTH = RAM_LENGTH*/
  
ram (WX!R) : ORIGIN RAM_ORIGIN_01LENGTH RAM_LENGTH_01
  
//--------------------------------------------------------
  
tcm (WX) : ORIGIN TCM_ORIGINLENGTH __XC32_TCM_LENGTH
  config_00804000 
ORIGIN 0x00804000LENGTH 0x4
  config_00804004 
ORIGIN 0x00804004LENGTH 0x4
  config_00804008 
ORIGIN 0x00804008LENGTH 0x4

}


依照一樣的方式,並未造成任何變更。
1.    RAM Data-Memory Usage
2.    section                    address  length 
[bytes]      (dec)  Description
3.    
-------                 ----------  -------------------------  -----------
4.    .bss                    0x20000000          0x178         376  Uninitialized data
5.    
.data.impure_data       0x20000178          0x418        1048
6.    
.data.__malloc_av_      0x20000590          0x408        1032
7.    
.data.__global_locale   0x20000998          0x16c         364
8.    
.bss.message            0x20000b04           0x40          64
9.    
.bss.rx_message         0x20000b44           0x40          64
10.    
.bss.can1RxMsg          0x20000b84           0x30          48
11.    
.bss.can0RxMsg          0x20000bb4           0x30          48
12.    
.bss.can1Obj            0x20000be4           0x28          40
13.    
.bss.can0Obj            0x20000c0c           0x28          40
14.    
.bss.__malloc_current_m 0x20000c34           0x28          40
15.    
.bss.can1CallbackObj    0x20000c5c           0x20          32
16.    
.bss.can0CallbackObj    0x20000c7c           0x20          32
17.    
.bss                    0x20000c9c           0x1c          28  Uninitialized data
18.    
.bss.messageID          0x20000cb8            0x4           4
19.    
.bss.rx_messageID       0x20000cbc            0x4           4
20.    
.bss.xferContext        0x20000cc0            0x4           4
21.    
.data._impure_ptr       0x20000cc4            0x4           4
22.    
.bss.__malloc_max_sbrke 0x20000cc8            0x4           4
23.    
.bss.__malloc_max_total 0x20000ccc            0x4           4
24.    
.bss.__malloc_top_pad   0x20000cd0            0x4           4
25.    
.data.__malloc_sbrk_bas 0x20000cd4            0x4           4
26.    
.data.__malloc_trim_thr 0x20000cd8            0x4           4
27.    
.bss                    0x20000cdc            0x4           4  Uninitialized data
28.    
.bss.timestamp          0x20000ce0            0x2           2
29.    
.bss.messageMarker.8529 0x20000ce2            0x1           1
30.    
.bss.loop_count         0x20000ce3            0x1           1
31.    
.bss.messageLength      0x20000ce4            0x1           1
32.    
.bss.rx_messageLength   0x20000ce5            0x1           1
33.    
.data.state             0x20000ce6            0x1           1
34.    _0c5728f05ec78eed       0x20010000           0x60          96
35.    _0c5729485ec78eed       0x20010060           0x60          96
1.    Total RAM used  
:       0xda7        3495  1.3of 0x40000
ii
.    --------------------------------------------------------------------------
1.    Total Data Memory used  :       0xda7        3495  1.3of 0x40000
iii
.    --------------------------------------------------------------------------


這是使用定址的異常狀況:
縮圖


















這是不使用定址的傳送與接收:
ID=0x469

縮圖














ID=0x111

縮圖

Attach file:



jpg  (0.00 KB)


jpg  (0.00 KB)


jpg  (0.00 KB)


jpg  (0.00 KB)


發表於: 2020/5/22 16:52

Edited by Gordon0010 on 2020年05月22日 17:12:31
Edited by Gordon0010 on 2020年05月22日 17:17:34
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#6
管理員
管理員


查看用戶資訊
所以如果使用自動變數就會正常?
uint8_t Can0MessageRAM[CAN0_MESSAGE_RAM_CONFIG_SIZE];
uint8_t Can1MessageRAM[CAN1_MESSAGE_RAM_CONFIG_SIZE];

.bss是在linker file中去指定的
SAME54的Global Linker file在(XC32 v2.40之後只有64bit)
C:\Program Files\Microchip\xc32\v2.40\pic32c\lib\proc\ATSAME54P20A\ATSAME54P20A.ld

這裡不可以改它, 如果你要修改時, 要把它Copy到你的專案下, 然後在你的專案下的\Linker Files中加進來
縮圖

ATSAME54P20A.ld中
RAM_ORIGIN 0x20000000
RAM_LENGTH 0x40000
決定了Compiler可以管理的SRAM起始位置及大小
當然也可以去改變它後, 得到這樣的結果
RAM Data-Memory Usage
section                    address  length 
[bytes]      (dec)  Description
-------                 ----------  -------------------------  -----------
.
bss                    0x20010000            0xc          12  Uninitialized data 
.bss.can1Obj            0x2001000c           0x28          40   
.bss.can0Obj            0x20010034           0x28          40


在程式中沒人管的區段, 就任憑自己去處置了
uint32_t *Can0MessageRAM = (uint32_t *)(0x20000000U);
uint32_t *Can1MessageRAM = (uint32_t *)(0x20000040U);
((uint8_t*)Can0MessageRAM)[0] = 0x12;
((uint8_t*)Can0MessageRAM)[1] = 0x34;
((uint8_t*)Can1MessageRAM)[0] = 0x56;
((uint8_t*)Can1MessageRAM)[1] = 0x78;

更動記憶體配置可能造成不可預期的結果, 請務必小心謹慎後果自負.

Attach file:



jpg  (0.00 KB)


發表於: 2020/5/22 15:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#5
新會員
新會員


查看用戶資訊
感謝 Libra及Adam 。
我另外多加的了一些Module,確實可以用的位址確實往後移了。
1.    RAM Data-Memory Usage
2.    section                    address  length 
[bytes]      (dec)  Description
3.    
-------                 ----------  -------------------------  -----------
4.    .bss                    0x20000000         0x5460       21600  Uninitialized data
5.    
.data.impure_data       0x20005460          0x418        1048
6.    
.data.__malloc_av_      0x20005878          0x408        1032
7.    
.data.InitBMSInParamSet 0x20005c80          0x170         368
8.    
.data.__global_locale   0x20005df0          0x16c         364
9.    
.bss.can1Obj            0x20005f5c           0x28          40
10.    
.bss.sercom7I2CObj      0x20005f84           0x28          40
11.    
.bss.can0Obj            0x20005fac           0x28          40
12.    
.bss.sercom4I2CObj      0x20005fd4           0x28          40
13.    
.bss.__malloc_current_m 0x20005ffc           0x28          40
14.    
.data.messageError      0x20006024           0x21          33
15.    
.bss.writeStatus        0x20006045            0x1           1
16.    
.bss.readStatus         0x20006046            0x1           1
17.    
.bss.writeStatus5       0x20006047            0x1           1
18.    
.bss.can1RxMsg          0x20006048           0x20          32
19.    
.bss.can1CallbackObj    0x20006068           0x20          32
20.    
.bss.can0RxMsg          0x20006088           0x20          32
21.    
.bss.can0CallbackObj    0x200060a8           0x20          32
22.    
.bss                    0x200060c8           0x1c          28  Uninitialized data
23.    
.bss.receiveBuffer      0x200060e4            0xa          10
24.    
.bss.messageMarker.8529 0x200060ee            0x1           1
25.    
.bss.errorStatus        0x200060ef            0x1           1
26.    
.bss.message1ID         0x200060f0            0x4           4
27.    
.bss.status0            0x200060f4            0x4           4
28.    
.bss.status1            0x200060f8            0x4           4
29.    
.bss.messageID          0x200060fc            0x4           4
30.    
.bss.rx_message0ID      0x20006100            0x4           4
31.    
.bss.rx_message1ID      0x20006104            0x4           4
32.    
.bss.xfer0Context       0x20006108            0x4           4
33.    
.bss.xfer1Context       0x2000610c            0x4           4
34.    
.data._impure_ptr       0x20006110            0x4           4
35.    
.bss.__malloc_max_sbrke 0x20006114            0x4           4
36.    
.bss.__malloc_max_total 0x20006118            0x4           4
37.    
.bss.__malloc_top_pad   0x2000611c            0x4           4
38.    
.data.__malloc_sbrk_bas 0x20006120            0x4           4
39.    
.data.__malloc_trim_thr 0x20006124            0x4           4
40.    
.bss                    0x20006128            0x4           4  Uninitialized data
41.    
.bss.retStatus          0x2000612c            0x1           1
42.    
.bss.message0Length     0x2000612d            0x1           1
43.    
.bss.message1Length     0x2000612e            0x1           1
44.    
.bss.rx_message0Length  0x2000612f            0x1           1
45.    
.bss.rx_message1Length  0x20006130            0x1           1
46.    
.data.state0            0x20006131            0x1           1
47.    
.data.state1            0x20006132            0x1           1
48.    
.bss.messageMarker.8529 0x20006133            0x1           1
49.    _0cfed8405ec77515       0x20010000           0x44          68
50.    
.data.messageStart      0x20010044           0x48          72
51.    
.bss.echoBuffer         0x2001008c            0xe          14
52.    
.bss.timestamp          0x2001009a            0x2           2
53.    
.bss.message0ID         0x2001009c            0x4           4
54.    _0cfed8985ec77515       0x200100a0           0x44          68
55.    Total RAM used  
:      0x6218       25112  9.6of 0x40000
56.    
--------------------------------------------------------------------------
57.    Total Data Memory used  :      0x6218       25112  9.6of 0x40000
58.    
--------------------------------------------------------------------------

_0cfed8405ec77515 Can0MessageRAM
_0cfed8985ec77515 Can1MessageRAM
也將定址位址往後移,但是通訊還是有問題,data傳送內容一樣為0x00,ID也是為0x00。

假如,修改linker script是否可以將.bss的位址調整,
空出SRAM一部分專用。
要如何修改linker script(我知道這很麻煩,拜託幫幫忙!)
修改後的linker檔案(*.ld)要如何加入編輯,
我按照文件的方式後,看起來還是使用原本的script。

發表於: 2020/5/22 15:01
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: ATSAME54P20A--定址
#4
管理員
管理員


查看用戶資訊
看起來是Compiler強佔民房了, 目前不知道實際的用途,
但確實是拿了0x20000000的位置, 放了一些東西....
0x20000000的位置, 看起來使用無望..

makefile
.bss (NOLOAD) :
    {
        . = 
ALIGN(4);
        
__bss_start__ = .;
        
_sbss = . ;
        
_szero = .;
        *(
COMMON)
        . = 
ALIGN(4);
        
__bss_end__ = .;
        
_ebss = . ;
        
_ezero = .;
    } > 
DATA_REGION


.map
.bss            0x20000000        0x0
                0x20000000                
. = ALIGN (0x4)
                
0x20000000                __bss_start__ = .
                
0x20000000                _sbss = .
                
0x20000000                _szero = .
 *(
COMMON)
                
0x20000000                . = ALIGN (0x4)
                
0x20000000                __bss_end__ = .
                
0x20000000                _ebss = .
                
0x20000000                _ezero = .
                
0x20000000                . = ALIGN (0x4)
                
0x20000000                _end = .
                
0x2003ffff                _ram_end_ = ((ORIGIN (ram) + LENGTH (ram)) - 0x1)

發表於: 2020/5/22 12:02
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... ]

教育訓練中心

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