Re: ATSAME54P20A--定址

作者 Gordon0010 於 2020年05月22日 10:51:39
假如我將定址改到其他位址。

uint8_t Can0MessageRAM
[CAN0_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned(32), address(0x20010000)));                                 

uint8_t Can1MessageRAM[CAN1_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned(32), address(0x20010000 + CAN0_MESSAGE_RAM_CONFIG_SIZE)));

確認map檔內容無誤。

_0c5519485ec73812
%1                 
0x20010060       0x60  
_0c5519485ec73812                
0x20010060       0x60 build
/sam_e54_xpro/production/_ext/1360937237/main_e54.o  
               
0x20010060                Can1MessageRAM  
_0c5518f05ec73812
%2                 
0x20010000       0x60
_0c5518f05ec73812

0x20010000       0x60 build
/sam_e54_xpro/production/_ext/1360937237/main_e54.o                 
0x20010000                Can0MessageRAM


RAM Data
-Memory Usage
section                    address  length
[bytes]      (dec)  Description
-------                 ----------  -------------------------  -----------
.
bss                    0x20000000           0x10          16  Uninitialized data
.data.impure_data       0x20000010          0x418        1048   
.data.__malloc_av_      0x20000428          0x408        1032   
.data.__global_locale   0x20000830          0x16c         364   
.bss.message            0x2000099c           0x40          64   
.bss.rx_message         0x200009dc           0x40          64   
.bss.can1RxMsg          0x20000a1c           0x30          48   
.bss.can0RxMsg          0x20000a4c           0x30          48   
.bss.can1Obj            0x20000a7c           0x28          40   
.bss.can0Obj            0x20000aa4           0x28          40   
.bss.__malloc_current_m 0x20000acc           0x28          40   
.bss.can1CallbackObj    0x20000af4           0x20          32   
.bss.can0CallbackObj    0x20000b14           0x20          32   
.bss                    0x20000b34           0x1c          28  Uninitialized data
.bss.messageID          0x20000b50            0x4           4   
.bss.rx_messageID       0x20000b54            0x4           4   
.bss.xferContext        0x20000b58            0x4           4   
.data._impure_ptr       0x20000b5c            0x4           4   
.bss.__malloc_max_sbrke 0x20000b60            0x4           4   
.bss.__malloc_max_total 0x20000b64            0x4           4   
.bss.__malloc_top_pad   0x20000b68            0x4           4   
.data.__malloc_sbrk_bas 0x20000b6c            0x4           4   
.data.__malloc_trim_thr 0x20000b70            0x4           4   
.bss                    0x20000b74            0x4           4  Uninitialized data
.bss.timestamp          0x20000b78            0x2           2   
.bss.messageMarker.8529 0x20000b7a            0x1           1   
.bss.loop_count         0x20000b7b            0x1           1   
.bss.messageLength      0x20000b7c            0x1           1   
.bss.rx_messageLength   0x20000b7d            0x1           1   
.data.state             0x20000b7e            0x1           1   
_0c63b8f05ec7381b       0x20010000           0x60          96   
_0c63b9485ec7381b       0x20010060           0x60          96   
         Total RAM used  
:       0xc3f        3135  1.2% of 0x40000
        
--------------------------------------------------------------------------
            
Total Data Memory used  :       0xc3f        3135  1.2% of 0x40000
        
--------------------------------------------------------------------------

但是通訊會有問題,data傳送內容為0x00,ID也是為0x00,
當然不定址就不會有這樣的狀況。
因為有特殊規劃,所以需要定址。
有無方式可以排除此狀況。

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=11&topic_id=22894&post_id=80671