<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 對(duì)stm32啟動(dòng)代碼DCD sfe(CSTACK)的理解

          對(duì)stm32啟動(dòng)代碼DCD sfe(CSTACK)的理解

          作者: 時(shí)間:2016-12-01 來(lái)源:網(wǎng)絡(luò) 收藏
          復(fù)位序列:

          在離開(kāi)復(fù)位狀態(tài)后,CM3做的第一件事就是讀取下列兩個(gè)32位整數(shù)的值:
          1、從地址0x0000 0000 處取出MSP的初始值。(也就是stm32啟動(dòng)代碼DCD sfe(CSTACK)設(shè)置的棧頂指針值)
          PS:至于MSP的真實(shí)地址是多少我還不清楚,如果哪位大俠知道請(qǐng)告訴我??梢源_定的是它是在0x2000 0000--0x2002 0000之間的一個(gè)值,貌似是在0x20020000。


          本文引用地址:http://www.ex-cimer.com/article/201612/324549.htm

          2、從地址0x0000 0004 處取出PC的初始值 也就是復(fù)位向量的值。
          相關(guān)知識(shí):
          IAR匯編指令SFB和SFE
          SFB Segment begin 段開(kāi)始
          語(yǔ)法格式
          SFB(segment [{+|-} offset])

          參數(shù)
          segment: 可重定位段的段名, 必須在SFB使用前已定義
          offset : 從開(kāi)始地址的偏移, 是一個(gè)可選參數(shù), 當(dāng)偏移量省略時(shí), 可以不添加小括號(hào)

          描述
          SFB 右邊可以接受一個(gè)操作數(shù), 而且這個(gè)操作數(shù)必須是一個(gè)可重位段的段名.
          這個(gè)操作符計(jì)算段的首字節(jié)地址. 這個(gè)操作發(fā)生在連接時(shí).
          The operator evaluates to the absolute address of the first byte of that segment. This evaluation takes place at linking time.


          NAME demo
          RSEG CODE
          start: DC16 SFB(CODE)
          即使上面的代碼和多個(gè)其他的模塊進(jìn)行連接, start標(biāo)號(hào)處仍被置為段的首字節(jié)地址. Even if the above code is linked with many other modules, start will still be set to the address of the first byte of the segment.


          SFE Segment end

          語(yǔ)法格式
          SFE (segment [{+|-} offset])

          參數(shù)
          segment: 可重定位段的段名, 必須在SFB使用前已定義
          offset : 從開(kāi)始地址的偏移, 是一個(gè)可選參數(shù), 當(dāng)偏移量省略時(shí), 可以不添加小括號(hào)

          描述
          SFE在其右邊接收一個(gè)操作數(shù). 操作數(shù)必須是一個(gè)可重定位段的段名. SFE操作符將段起始地址和段大小相加. 這個(gè)操作在連接時(shí)發(fā)生.
          SFE accepts a single operand to its right. The operand must be the name of a relocatable segment. The operator evaluates to the segment start address plus the segment size. This evaluation takes place at linking time.


          NAME demo
          RSEG CODE
          end: DC16 SFE(CODE)
          即使當(dāng)上面的代碼被和多個(gè)模塊連接時(shí), end標(biāo)號(hào)仍然會(huì)被置為段最后一個(gè)字節(jié)的地址. Even if the above code is linked with many other modules, end will still be set to the address of thelastbyte of the segment.

          段MY_SEGMENT的大小可以通過(guò)以下方式計(jì)算而得:
          SFE(MY_SEGMENT)-SFB(MY_SEGMENT)



          關(guān)鍵詞: stm32啟動(dòng)代碼DCDsf

          評(píng)論


          技術(shù)專(zhuān)區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();