STVD對stm8在線調(diào)試的使用_第1頁
STVD對stm8在線調(diào)試的使用_第2頁
STVD對stm8在線調(diào)試的使用_第3頁
STVD對stm8在線調(diào)試的使用_第4頁
STVD對stm8在線調(diào)試的使用_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、前一段時(shí)間使用單片機(jī)做一個(gè)項(xiàng)目的時(shí)候,由于是初次使用這個(gè)開發(fā)環(huán)境。剛開始非常的不熟悉,找了一些資料好像也不是很齊全使用在線仿真調(diào)試的時(shí)候費(fèi)了好大得勁才搞清楚如何使用。在下面總結(jié)一下在線調(diào)試仿真的時(shí)候一些具體步驟:1、Debuginstrument選項(xiàng)里面的下拉菜單選擇Add確定取消imST-LinkT:di_getDebugInstrumentSettingsShijwthmselert:rgetnutiic注tiuii注tEtartofdebi:DebugInstrijmentSele2tion:ReEt:rttheapplicaticmwithSwim0ffcmstop:T:ii-getF

2、ortSelection:應(yīng)用(A)SelecttheT:ii-gHtyouwanttousefordebugEHEEion._I|HdtPlugStartDebug(.onlywhennuapplicatiimiSeiertthmcoriiLH匚tionportforthmTar畢tseierabove.Remove51usL:/ueL2、選擇上圖中的swimST-Link,此選項(xiàng)適用于ST燒寫器的選項(xiàng)FileEditViewProjectBuildDebugDebuginstrumentToolsWindow旦elp直%也眄觀紺1z4%?4囤自stm0s2O7Debug三|翳幽團(tuán)矗矍國鈾3

3、、點(diǎn)擊紅色橢圓形的按鈕下載程序到stm8單片機(jī)T1RfToopentheWatuhwindow,sele匚tViewWatch.國細(xì)栄曲??贓在仿真調(diào)試的時(shí)候會(huì)使用的快捷鍵9(ahr-1Rf初始化TheWatchinformationwindowdisplaysthecurrentvalueofselectedprogramvariableswhentheexecutableisstoppisupdatedeachtimetheexecutablestops,orbymeansoftheRefreshAlloptionintheWatdisplayedarethoseinthecontexto

4、fthecurrentProgramCounter(PC)position.YoucanchaThevaluesSection4.1OrCallstackwindow).TheWatuhwindowisrefreshedtodisplayvariablevaluesatthepositicYoucanaddprogramsymbollsfromthesourcefilestotheWatchwindowinseveralways:Thevariablenamemaybetypeddirectlyintotheleftcolumn(double-clickonthefirstemptyro1Al

5、ternatively,avariiablemaybeselectedintheEditorwindowanddraggedanddroppedintothe窗ovidesthebuttonoptionAddtoW3tchftoi門匚ludetheQuidkWaffOglopi=52atsample!.c:99IValueVariable524.11LocalvariTheLocalVariableswindowshowsalistingofprogramvariablesthatarelocaltothefunctionsthatarebreakpoints)intherunningofth

6、eprogram.ToopentheLocalVariableswindow,eitherclickontheLocalVariableswindowiconintheViewIntheexampleshownbelow,thevalueofthevariableiiisequaltozerowhentheprogramishaltedatadisplaycurrent匚allata匚1ttOglop(i=52)atsample1.c:99tt10 xf259in就沖atsample2.s:21tt20 xf260in_tsttr7()atsample2.s:26tt30 xf0b8inmai

7、natsample1.c:133tt4Oxf1aein4.16Peripheralre_-S_ToopenthrPeripheralRegisterswiniJ&w,eitherclickonthPeripheralRegisterswindowicon1int|InadditiontotheuriptrurrcrrTFiePeripheralRegisterswindow,thissectioncontainsinformationaboulPeripheralregisterscontextualmenuPeripheralregistersdisplayoptionsForcedread

8、ofstatusregistersThePeripheralRegisterswindowshowsalistoftheperipheralsavailableonthetargetMCUfaswellastThisallowsyoutocheckthevalueoftheperipheralregistersatanybreakpointinthedebuggingofthepnValueigure146.PeripheralregisterswindowPeripheralregisters-PortFClxDClQfPFDR-DataRegister0 x0010PFDDR-DataDi

9、rectionRe.0 x0011PFOR-OptionRegister+I2C-SerialPeripheralInterface(SPI)0 x0021SPIDR-DataI/ORegister+0 x0022SPICR-ControlRegister+0 x0023SPICSR-Control/StalusRe.+InterruptSoftwarePriorityIT口+Flash_WatchDogTimer-0 x002aV/DGCR-ControlRegisterWDGA-ActivationBitT6:0-7-bitTimer+MainClockControl/StatusRegi

10、ster(MCC)+0 x0031TACR2-ControlRegister2+0 x0032TACR1-ControlRegister1+0 x0033TACSR-Control/StatusRe.+0 x0034TAIC1R-InputCapture1Fl.0 x000 x000 x00Intrusiveread0 x00Intrusiveread-Enabled0 x000 x00IntrusivereadIntrusiveread0-Disabled0-DisabledDisassemblyxl520 xb3intintheViewr.c:97看變?nèi)缓筮\(yùn)彳行程序。就會(huì)看到變量在程序運(yùn)行

11、過程中量堆棧的使用情況。二I在查看變量的時(shí)候,不能運(yùn)行程序,才能把變量拖放到4.10CallstacTheCallStackwjdowshowsthefunctioncalllsstoredonthemicrocontrollersCallStackfromthemostreaIwaysrptuuud-atthemostrecententryintheCallStackwindow(#0).ThestackkeepstrackofallthevariablesandparameterslocaltothepartoftheprogramwherethefuncticIfarntryiri_th

12、s匚all匚1isselectedanddouble-clicked,thesourcecodecorrespondingtothataddress:LocalVariableswindowwiththevaluestheyhadwhenthefunctioncallwasmade.ta.mevelDackwardsinthestackpermitsprogramstatescorrespondingtospecificentriesinthecFigure134.Callstackwindowandinteractionwithotherdebugwindows0 x042trapISR+6

13、6return;45trapISR+69Forexample,Figure134showsasnapshotoftheprogramatthecurrentProgrmmCounterposition.TheLocshownbothintermsoftheinstructionlineintheEditorwindow,andintermsofthedrePsJrrtheDisassetimer.c:107or(i=0;i化情況!匸匚ng-loopxf04&waiting_loop+2l-lv干廠1口:=i-/TiTi1inrr1i-n-it_i-1-44.11LocalvaricTheLoc

14、alVariableswindowshowsalistingofprogramvariablesthatmrmlocaltothefunctionsthatarebreakpoints)intherunningoftheprogrmm.Intheexampleshownbelow,thevalueofthevariableiisequaltozerowhentheprogramishaltedatapdisplaycurrentcallstackintheCallStackwindow,andthelistofvariablesinthecurrentcallstack.TheToopentheLocalVariableswindow,eitherclickontheLocalVariableswindowiconCallStackwindowLocalVariableswindowIIILocalsAParameters/空HOglop(i=52)atsample1.c:99tt10 xf259in就tratsample2.s:21tt20 xf260in_tsttr7atsample2.

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論