You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SD_Card_F401RE.list 652KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901
  1. SD_Card_F401RE.elf: file format elf32-littlearm
  2. Sections:
  3. Idx Name Size VMA LMA File off Algn
  4. 0 .isr_vector 00000194 08000000 08000000 00010000 2**0
  5. CONTENTS, ALLOC, LOAD, READONLY, DATA
  6. 1 .text 00006ec4 08000194 08000194 00010194 2**2
  7. CONTENTS, ALLOC, LOAD, READONLY, CODE
  8. 2 .rodata 0000055c 08007058 08007058 00017058 2**2
  9. CONTENTS, ALLOC, LOAD, READONLY, DATA
  10. 3 .ARM.extab 00000000 080075b4 080075b4 00020024 2**0
  11. CONTENTS
  12. 4 .ARM 00000008 080075b4 080075b4 000175b4 2**2
  13. CONTENTS, ALLOC, LOAD, READONLY, DATA
  14. 5 .preinit_array 00000000 080075bc 080075bc 00020024 2**0
  15. CONTENTS, ALLOC, LOAD, DATA
  16. 6 .init_array 00000004 080075bc 080075bc 000175bc 2**2
  17. CONTENTS, ALLOC, LOAD, DATA
  18. 7 .fini_array 00000004 080075c0 080075c0 000175c0 2**2
  19. CONTENTS, ALLOC, LOAD, DATA
  20. 8 .data 00000024 20000000 080075c4 00020000 2**2
  21. CONTENTS, ALLOC, LOAD, DATA
  22. 9 .bss 00004490 20000024 080075e8 00020024 2**2
  23. ALLOC
  24. 10 ._user_heap_stack 00000604 200044b4 080075e8 000244b4 2**0
  25. ALLOC
  26. 11 .ARM.attributes 00000030 00000000 00000000 00020024 2**0
  27. CONTENTS, READONLY
  28. 12 .debug_info 00011bcd 00000000 00000000 00020054 2**0
  29. CONTENTS, READONLY, DEBUGGING
  30. 13 .debug_abbrev 0000278e 00000000 00000000 00031c21 2**0
  31. CONTENTS, READONLY, DEBUGGING
  32. 14 .debug_aranges 00000d60 00000000 00000000 000343b0 2**3
  33. CONTENTS, READONLY, DEBUGGING
  34. 15 .debug_ranges 00000c28 00000000 00000000 00035110 2**3
  35. CONTENTS, READONLY, DEBUGGING
  36. 16 .debug_macro 00017fe5 00000000 00000000 00035d38 2**0
  37. CONTENTS, READONLY, DEBUGGING
  38. 17 .debug_line 0000d214 00000000 00000000 0004dd1d 2**0
  39. CONTENTS, READONLY, DEBUGGING
  40. 18 .debug_str 0008cc1d 00000000 00000000 0005af31 2**0
  41. CONTENTS, READONLY, DEBUGGING
  42. 19 .comment 0000007b 00000000 00000000 000e7b4e 2**0
  43. CONTENTS, READONLY
  44. 20 .debug_frame 0000363c 00000000 00000000 000e7bcc 2**2
  45. CONTENTS, READONLY, DEBUGGING
  46. Disassembly of section .text:
  47. 08000194 <__do_global_dtors_aux>:
  48. 8000194: b510 push {r4, lr}
  49. 8000196: 4c05 ldr r4, [pc, #20] ; (80001ac <__do_global_dtors_aux+0x18>)
  50. 8000198: 7823 ldrb r3, [r4, #0]
  51. 800019a: b933 cbnz r3, 80001aa <__do_global_dtors_aux+0x16>
  52. 800019c: 4b04 ldr r3, [pc, #16] ; (80001b0 <__do_global_dtors_aux+0x1c>)
  53. 800019e: b113 cbz r3, 80001a6 <__do_global_dtors_aux+0x12>
  54. 80001a0: 4804 ldr r0, [pc, #16] ; (80001b4 <__do_global_dtors_aux+0x20>)
  55. 80001a2: f3af 8000 nop.w
  56. 80001a6: 2301 movs r3, #1
  57. 80001a8: 7023 strb r3, [r4, #0]
  58. 80001aa: bd10 pop {r4, pc}
  59. 80001ac: 20000024 .word 0x20000024
  60. 80001b0: 00000000 .word 0x00000000
  61. 80001b4: 08007040 .word 0x08007040
  62. 080001b8 <frame_dummy>:
  63. 80001b8: b508 push {r3, lr}
  64. 80001ba: 4b03 ldr r3, [pc, #12] ; (80001c8 <frame_dummy+0x10>)
  65. 80001bc: b11b cbz r3, 80001c6 <frame_dummy+0xe>
  66. 80001be: 4903 ldr r1, [pc, #12] ; (80001cc <frame_dummy+0x14>)
  67. 80001c0: 4803 ldr r0, [pc, #12] ; (80001d0 <frame_dummy+0x18>)
  68. 80001c2: f3af 8000 nop.w
  69. 80001c6: bd08 pop {r3, pc}
  70. 80001c8: 00000000 .word 0x00000000
  71. 80001cc: 20000028 .word 0x20000028
  72. 80001d0: 08007040 .word 0x08007040
  73. 080001d4 <strlen>:
  74. 80001d4: 4603 mov r3, r0
  75. 80001d6: f813 2b01 ldrb.w r2, [r3], #1
  76. 80001da: 2a00 cmp r2, #0
  77. 80001dc: d1fb bne.n 80001d6 <strlen+0x2>
  78. 80001de: 1a18 subs r0, r3, r0
  79. 80001e0: 3801 subs r0, #1
  80. 80001e2: 4770 bx lr
  81. 080001e4 <__aeabi_uldivmod>:
  82. 80001e4: b953 cbnz r3, 80001fc <__aeabi_uldivmod+0x18>
  83. 80001e6: b94a cbnz r2, 80001fc <__aeabi_uldivmod+0x18>
  84. 80001e8: 2900 cmp r1, #0
  85. 80001ea: bf08 it eq
  86. 80001ec: 2800 cmpeq r0, #0
  87. 80001ee: bf1c itt ne
  88. 80001f0: f04f 31ff movne.w r1, #4294967295
  89. 80001f4: f04f 30ff movne.w r0, #4294967295
  90. 80001f8: f000 b972 b.w 80004e0 <__aeabi_idiv0>
  91. 80001fc: f1ad 0c08 sub.w ip, sp, #8
  92. 8000200: e96d ce04 strd ip, lr, [sp, #-16]!
  93. 8000204: f000 f806 bl 8000214 <__udivmoddi4>
  94. 8000208: f8dd e004 ldr.w lr, [sp, #4]
  95. 800020c: e9dd 2302 ldrd r2, r3, [sp, #8]
  96. 8000210: b004 add sp, #16
  97. 8000212: 4770 bx lr
  98. 08000214 <__udivmoddi4>:
  99. 8000214: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr}
  100. 8000218: 9e08 ldr r6, [sp, #32]
  101. 800021a: 4604 mov r4, r0
  102. 800021c: 4688 mov r8, r1
  103. 800021e: 2b00 cmp r3, #0
  104. 8000220: d14b bne.n 80002ba <__udivmoddi4+0xa6>
  105. 8000222: 428a cmp r2, r1
  106. 8000224: 4615 mov r5, r2
  107. 8000226: d967 bls.n 80002f8 <__udivmoddi4+0xe4>
  108. 8000228: fab2 f282 clz r2, r2
  109. 800022c: b14a cbz r2, 8000242 <__udivmoddi4+0x2e>
  110. 800022e: f1c2 0720 rsb r7, r2, #32
  111. 8000232: fa01 f302 lsl.w r3, r1, r2
  112. 8000236: fa20 f707 lsr.w r7, r0, r7
  113. 800023a: 4095 lsls r5, r2
  114. 800023c: ea47 0803 orr.w r8, r7, r3
  115. 8000240: 4094 lsls r4, r2
  116. 8000242: ea4f 4e15 mov.w lr, r5, lsr #16
  117. 8000246: 0c23 lsrs r3, r4, #16
  118. 8000248: fbb8 f7fe udiv r7, r8, lr
  119. 800024c: fa1f fc85 uxth.w ip, r5
  120. 8000250: fb0e 8817 mls r8, lr, r7, r8
  121. 8000254: ea43 4308 orr.w r3, r3, r8, lsl #16
  122. 8000258: fb07 f10c mul.w r1, r7, ip
  123. 800025c: 4299 cmp r1, r3
  124. 800025e: d909 bls.n 8000274 <__udivmoddi4+0x60>
  125. 8000260: 18eb adds r3, r5, r3
  126. 8000262: f107 30ff add.w r0, r7, #4294967295
  127. 8000266: f080 811b bcs.w 80004a0 <__udivmoddi4+0x28c>
  128. 800026a: 4299 cmp r1, r3
  129. 800026c: f240 8118 bls.w 80004a0 <__udivmoddi4+0x28c>
  130. 8000270: 3f02 subs r7, #2
  131. 8000272: 442b add r3, r5
  132. 8000274: 1a5b subs r3, r3, r1
  133. 8000276: b2a4 uxth r4, r4
  134. 8000278: fbb3 f0fe udiv r0, r3, lr
  135. 800027c: fb0e 3310 mls r3, lr, r0, r3
  136. 8000280: ea44 4403 orr.w r4, r4, r3, lsl #16
  137. 8000284: fb00 fc0c mul.w ip, r0, ip
  138. 8000288: 45a4 cmp ip, r4
  139. 800028a: d909 bls.n 80002a0 <__udivmoddi4+0x8c>
  140. 800028c: 192c adds r4, r5, r4
  141. 800028e: f100 33ff add.w r3, r0, #4294967295
  142. 8000292: f080 8107 bcs.w 80004a4 <__udivmoddi4+0x290>
  143. 8000296: 45a4 cmp ip, r4
  144. 8000298: f240 8104 bls.w 80004a4 <__udivmoddi4+0x290>
  145. 800029c: 3802 subs r0, #2
  146. 800029e: 442c add r4, r5
  147. 80002a0: ea40 4007 orr.w r0, r0, r7, lsl #16
  148. 80002a4: eba4 040c sub.w r4, r4, ip
  149. 80002a8: 2700 movs r7, #0
  150. 80002aa: b11e cbz r6, 80002b4 <__udivmoddi4+0xa0>
  151. 80002ac: 40d4 lsrs r4, r2
  152. 80002ae: 2300 movs r3, #0
  153. 80002b0: e9c6 4300 strd r4, r3, [r6]
  154. 80002b4: 4639 mov r1, r7
  155. 80002b6: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  156. 80002ba: 428b cmp r3, r1
  157. 80002bc: d909 bls.n 80002d2 <__udivmoddi4+0xbe>
  158. 80002be: 2e00 cmp r6, #0
  159. 80002c0: f000 80eb beq.w 800049a <__udivmoddi4+0x286>
  160. 80002c4: 2700 movs r7, #0
  161. 80002c6: e9c6 0100 strd r0, r1, [r6]
  162. 80002ca: 4638 mov r0, r7
  163. 80002cc: 4639 mov r1, r7
  164. 80002ce: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc}
  165. 80002d2: fab3 f783 clz r7, r3
  166. 80002d6: 2f00 cmp r7, #0
  167. 80002d8: d147 bne.n 800036a <__udivmoddi4+0x156>
  168. 80002da: 428b cmp r3, r1
  169. 80002dc: d302 bcc.n 80002e4 <__udivmoddi4+0xd0>
  170. 80002de: 4282 cmp r2, r0
  171. 80002e0: f200 80fa bhi.w 80004d8 <__udivmoddi4+0x2c4>
  172. 80002e4: 1a84 subs r4, r0, r2
  173. 80002e6: eb61 0303 sbc.w r3, r1, r3
  174. 80002ea: 2001 movs r0, #1
  175. 80002ec: 4698 mov r8, r3
  176. 80002ee: 2e00 cmp r6, #0
  177. 80002f0: d0e0 beq.n 80002b4 <__udivmoddi4+0xa0>
  178. 80002f2: e9c6 4800 strd r4, r8, [r6]
  179. 80002f6: e7dd b.n 80002b4 <__udivmoddi4+0xa0>
  180. 80002f8: b902 cbnz r2, 80002fc <__udivmoddi4+0xe8>
  181. 80002fa: deff udf #255 ; 0xff
  182. 80002fc: fab2 f282 clz r2, r2
  183. 8000300: 2a00 cmp r2, #0
  184. 8000302: f040 808f bne.w 8000424 <__udivmoddi4+0x210>
  185. 8000306: 1b49 subs r1, r1, r5
  186. 8000308: ea4f 4e15 mov.w lr, r5, lsr #16
  187. 800030c: fa1f f885 uxth.w r8, r5
  188. 8000310: 2701 movs r7, #1
  189. 8000312: fbb1 fcfe udiv ip, r1, lr
  190. 8000316: 0c23 lsrs r3, r4, #16
  191. 8000318: fb0e 111c mls r1, lr, ip, r1
  192. 800031c: ea43 4301 orr.w r3, r3, r1, lsl #16
  193. 8000320: fb08 f10c mul.w r1, r8, ip
  194. 8000324: 4299 cmp r1, r3
  195. 8000326: d907 bls.n 8000338 <__udivmoddi4+0x124>
  196. 8000328: 18eb adds r3, r5, r3
  197. 800032a: f10c 30ff add.w r0, ip, #4294967295
  198. 800032e: d202 bcs.n 8000336 <__udivmoddi4+0x122>
  199. 8000330: 4299 cmp r1, r3
  200. 8000332: f200 80cd bhi.w 80004d0 <__udivmoddi4+0x2bc>
  201. 8000336: 4684 mov ip, r0
  202. 8000338: 1a59 subs r1, r3, r1
  203. 800033a: b2a3 uxth r3, r4
  204. 800033c: fbb1 f0fe udiv r0, r1, lr
  205. 8000340: fb0e 1410 mls r4, lr, r0, r1
  206. 8000344: ea43 4404 orr.w r4, r3, r4, lsl #16
  207. 8000348: fb08 f800 mul.w r8, r8, r0
  208. 800034c: 45a0 cmp r8, r4
  209. 800034e: d907 bls.n 8000360 <__udivmoddi4+0x14c>
  210. 8000350: 192c adds r4, r5, r4
  211. 8000352: f100 33ff add.w r3, r0, #4294967295
  212. 8000356: d202 bcs.n 800035e <__udivmoddi4+0x14a>
  213. 8000358: 45a0 cmp r8, r4
  214. 800035a: f200 80b6 bhi.w 80004ca <__udivmoddi4+0x2b6>
  215. 800035e: 4618 mov r0, r3
  216. 8000360: eba4 0408 sub.w r4, r4, r8
  217. 8000364: ea40 400c orr.w r0, r0, ip, lsl #16
  218. 8000368: e79f b.n 80002aa <__udivmoddi4+0x96>
  219. 800036a: f1c7 0c20 rsb ip, r7, #32
  220. 800036e: 40bb lsls r3, r7
  221. 8000370: fa22 fe0c lsr.w lr, r2, ip
  222. 8000374: ea4e 0e03 orr.w lr, lr, r3
  223. 8000378: fa01 f407 lsl.w r4, r1, r7
  224. 800037c: fa20 f50c lsr.w r5, r0, ip
  225. 8000380: fa21 f30c lsr.w r3, r1, ip
  226. 8000384: ea4f 481e mov.w r8, lr, lsr #16
  227. 8000388: 4325 orrs r5, r4
  228. 800038a: fbb3 f9f8 udiv r9, r3, r8
  229. 800038e: 0c2c lsrs r4, r5, #16
  230. 8000390: fb08 3319 mls r3, r8, r9, r3
  231. 8000394: fa1f fa8e uxth.w sl, lr
  232. 8000398: ea44 4303 orr.w r3, r4, r3, lsl #16
  233. 800039c: fb09 f40a mul.w r4, r9, sl
  234. 80003a0: 429c cmp r4, r3
  235. 80003a2: fa02 f207 lsl.w r2, r2, r7
  236. 80003a6: fa00 f107 lsl.w r1, r0, r7
  237. 80003aa: d90b bls.n 80003c4 <__udivmoddi4+0x1b0>
  238. 80003ac: eb1e 0303 adds.w r3, lr, r3
  239. 80003b0: f109 30ff add.w r0, r9, #4294967295
  240. 80003b4: f080 8087 bcs.w 80004c6 <__udivmoddi4+0x2b2>
  241. 80003b8: 429c cmp r4, r3
  242. 80003ba: f240 8084 bls.w 80004c6 <__udivmoddi4+0x2b2>
  243. 80003be: f1a9 0902 sub.w r9, r9, #2
  244. 80003c2: 4473 add r3, lr
  245. 80003c4: 1b1b subs r3, r3, r4
  246. 80003c6: b2ad uxth r5, r5
  247. 80003c8: fbb3 f0f8 udiv r0, r3, r8
  248. 80003cc: fb08 3310 mls r3, r8, r0, r3
  249. 80003d0: ea45 4403 orr.w r4, r5, r3, lsl #16
  250. 80003d4: fb00 fa0a mul.w sl, r0, sl
  251. 80003d8: 45a2 cmp sl, r4
  252. 80003da: d908 bls.n 80003ee <__udivmoddi4+0x1da>
  253. 80003dc: eb1e 0404 adds.w r4, lr, r4
  254. 80003e0: f100 33ff add.w r3, r0, #4294967295
  255. 80003e4: d26b bcs.n 80004be <__udivmoddi4+0x2aa>
  256. 80003e6: 45a2 cmp sl, r4
  257. 80003e8: d969 bls.n 80004be <__udivmoddi4+0x2aa>
  258. 80003ea: 3802 subs r0, #2
  259. 80003ec: 4474 add r4, lr
  260. 80003ee: ea40 4009 orr.w r0, r0, r9, lsl #16
  261. 80003f2: fba0 8902 umull r8, r9, r0, r2
  262. 80003f6: eba4 040a sub.w r4, r4, sl
  263. 80003fa: 454c cmp r4, r9
  264. 80003fc: 46c2 mov sl, r8
  265. 80003fe: 464b mov r3, r9
  266. 8000400: d354 bcc.n 80004ac <__udivmoddi4+0x298>
  267. 8000402: d051 beq.n 80004a8 <__udivmoddi4+0x294>
  268. 8000404: 2e00 cmp r6, #0
  269. 8000406: d069 beq.n 80004dc <__udivmoddi4+0x2c8>
  270. 8000408: ebb1 050a subs.w r5, r1, sl
  271. 800040c: eb64 0403 sbc.w r4, r4, r3
  272. 8000410: fa04 fc0c lsl.w ip, r4, ip
  273. 8000414: 40fd lsrs r5, r7
  274. 8000416: 40fc lsrs r4, r7
  275. 8000418: ea4c 0505 orr.w r5, ip, r5
  276. 800041c: e9c6 5400 strd r5, r4, [r6]
  277. 8000420: 2700 movs r7, #0
  278. 8000422: e747 b.n 80002b4 <__udivmoddi4+0xa0>
  279. 8000424: f1c2 0320 rsb r3, r2, #32
  280. 8000428: fa20 f703 lsr.w r7, r0, r3
  281. 800042c: 4095 lsls r5, r2
  282. 800042e: fa01 f002 lsl.w r0, r1, r2
  283. 8000432: fa21 f303 lsr.w r3, r1, r3
  284. 8000436: ea4f 4e15 mov.w lr, r5, lsr #16
  285. 800043a: 4338 orrs r0, r7
  286. 800043c: 0c01 lsrs r1, r0, #16
  287. 800043e: fbb3 f7fe udiv r7, r3, lr
  288. 8000442: fa1f f885 uxth.w r8, r5
  289. 8000446: fb0e 3317 mls r3, lr, r7, r3
  290. 800044a: ea41 4103 orr.w r1, r1, r3, lsl #16
  291. 800044e: fb07 f308 mul.w r3, r7, r8
  292. 8000452: 428b cmp r3, r1
  293. 8000454: fa04 f402 lsl.w r4, r4, r2
  294. 8000458: d907 bls.n 800046a <__udivmoddi4+0x256>
  295. 800045a: 1869 adds r1, r5, r1
  296. 800045c: f107 3cff add.w ip, r7, #4294967295
  297. 8000460: d22f bcs.n 80004c2 <__udivmoddi4+0x2ae>
  298. 8000462: 428b cmp r3, r1
  299. 8000464: d92d bls.n 80004c2 <__udivmoddi4+0x2ae>
  300. 8000466: 3f02 subs r7, #2
  301. 8000468: 4429 add r1, r5
  302. 800046a: 1acb subs r3, r1, r3
  303. 800046c: b281 uxth r1, r0
  304. 800046e: fbb3 f0fe udiv r0, r3, lr
  305. 8000472: fb0e 3310 mls r3, lr, r0, r3
  306. 8000476: ea41 4103 orr.w r1, r1, r3, lsl #16
  307. 800047a: fb00 f308 mul.w r3, r0, r8
  308. 800047e: 428b cmp r3, r1
  309. 8000480: d907 bls.n 8000492 <__udivmoddi4+0x27e>
  310. 8000482: 1869 adds r1, r5, r1
  311. 8000484: f100 3cff add.w ip, r0, #4294967295
  312. 8000488: d217 bcs.n 80004ba <__udivmoddi4+0x2a6>
  313. 800048a: 428b cmp r3, r1
  314. 800048c: d915 bls.n 80004ba <__udivmoddi4+0x2a6>
  315. 800048e: 3802 subs r0, #2
  316. 8000490: 4429 add r1, r5
  317. 8000492: 1ac9 subs r1, r1, r3
  318. 8000494: ea40 4707 orr.w r7, r0, r7, lsl #16
  319. 8000498: e73b b.n 8000312 <__udivmoddi4+0xfe>
  320. 800049a: 4637 mov r7, r6
  321. 800049c: 4630 mov r0, r6
  322. 800049e: e709 b.n 80002b4 <__udivmoddi4+0xa0>
  323. 80004a0: 4607 mov r7, r0
  324. 80004a2: e6e7 b.n 8000274 <__udivmoddi4+0x60>
  325. 80004a4: 4618 mov r0, r3
  326. 80004a6: e6fb b.n 80002a0 <__udivmoddi4+0x8c>
  327. 80004a8: 4541 cmp r1, r8
  328. 80004aa: d2ab bcs.n 8000404 <__udivmoddi4+0x1f0>
  329. 80004ac: ebb8 0a02 subs.w sl, r8, r2
  330. 80004b0: eb69 020e sbc.w r2, r9, lr
  331. 80004b4: 3801 subs r0, #1
  332. 80004b6: 4613 mov r3, r2
  333. 80004b8: e7a4 b.n 8000404 <__udivmoddi4+0x1f0>
  334. 80004ba: 4660 mov r0, ip
  335. 80004bc: e7e9 b.n 8000492 <__udivmoddi4+0x27e>
  336. 80004be: 4618 mov r0, r3
  337. 80004c0: e795 b.n 80003ee <__udivmoddi4+0x1da>
  338. 80004c2: 4667 mov r7, ip
  339. 80004c4: e7d1 b.n 800046a <__udivmoddi4+0x256>
  340. 80004c6: 4681 mov r9, r0
  341. 80004c8: e77c b.n 80003c4 <__udivmoddi4+0x1b0>
  342. 80004ca: 3802 subs r0, #2
  343. 80004cc: 442c add r4, r5
  344. 80004ce: e747 b.n 8000360 <__udivmoddi4+0x14c>
  345. 80004d0: f1ac 0c02 sub.w ip, ip, #2
  346. 80004d4: 442b add r3, r5
  347. 80004d6: e72f b.n 8000338 <__udivmoddi4+0x124>
  348. 80004d8: 4638 mov r0, r7
  349. 80004da: e708 b.n 80002ee <__udivmoddi4+0xda>
  350. 80004dc: 4637 mov r7, r6
  351. 80004de: e6e9 b.n 80002b4 <__udivmoddi4+0xa0>
  352. 080004e0 <__aeabi_idiv0>:
  353. 80004e0: 4770 bx lr
  354. 80004e2: bf00 nop
  355. 080004e4 <SELECT>:
  356. * SPI functions
  357. **************************************/
  358. /* slave select */
  359. static void SELECT(void)
  360. {
  361. 80004e4: b580 push {r7, lr}
  362. 80004e6: af00 add r7, sp, #0
  363. HAL_GPIO_WritePin(SD_CS_PORT, SD_CS_PIN, GPIO_PIN_RESET);
  364. 80004e8: 2200 movs r2, #0
  365. 80004ea: 2140 movs r1, #64 ; 0x40
  366. 80004ec: 4803 ldr r0, [pc, #12] ; (80004fc <SELECT+0x18>)
  367. 80004ee: f002 f81f bl 8002530 <HAL_GPIO_WritePin>
  368. HAL_Delay(1);
  369. 80004f2: 2001 movs r0, #1
  370. 80004f4: f001 f8f2 bl 80016dc <HAL_Delay>
  371. }
  372. 80004f8: bf00 nop
  373. 80004fa: bd80 pop {r7, pc}
  374. 80004fc: 40020400 .word 0x40020400
  375. 08000500 <DESELECT>:
  376. /* slave deselect */
  377. static void DESELECT(void)
  378. {
  379. 8000500: b580 push {r7, lr}
  380. 8000502: af00 add r7, sp, #0
  381. HAL_GPIO_WritePin(SD_CS_PORT, SD_CS_PIN, GPIO_PIN_SET);
  382. 8000504: 2201 movs r2, #1
  383. 8000506: 2140 movs r1, #64 ; 0x40
  384. 8000508: 4803 ldr r0, [pc, #12] ; (8000518 <DESELECT+0x18>)
  385. 800050a: f002 f811 bl 8002530 <HAL_GPIO_WritePin>
  386. HAL_Delay(1);
  387. 800050e: 2001 movs r0, #1
  388. 8000510: f001 f8e4 bl 80016dc <HAL_Delay>
  389. }
  390. 8000514: bf00 nop
  391. 8000516: bd80 pop {r7, pc}
  392. 8000518: 40020400 .word 0x40020400
  393. 0800051c <SPI_TxByte>:
  394. /* SPI transmit a byte */
  395. static void SPI_TxByte(uint8_t data)
  396. {
  397. 800051c: b580 push {r7, lr}
  398. 800051e: b082 sub sp, #8
  399. 8000520: af00 add r7, sp, #0
  400. 8000522: 4603 mov r3, r0
  401. 8000524: 71fb strb r3, [r7, #7]
  402. while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
  403. 8000526: bf00 nop
  404. 8000528: 4b08 ldr r3, [pc, #32] ; (800054c <SPI_TxByte+0x30>)
  405. 800052a: 681b ldr r3, [r3, #0]
  406. 800052c: 689b ldr r3, [r3, #8]
  407. 800052e: f003 0302 and.w r3, r3, #2
  408. 8000532: 2b02 cmp r3, #2
  409. 8000534: d1f8 bne.n 8000528 <SPI_TxByte+0xc>
  410. HAL_SPI_Transmit(HSPI_SDCARD, &data, 1, SPI_TIMEOUT);
  411. 8000536: 1df9 adds r1, r7, #7
  412. 8000538: 2364 movs r3, #100 ; 0x64
  413. 800053a: 2201 movs r2, #1
  414. 800053c: 4803 ldr r0, [pc, #12] ; (800054c <SPI_TxByte+0x30>)
  415. 800053e: f002 fcd7 bl 8002ef0 <HAL_SPI_Transmit>
  416. }
  417. 8000542: bf00 nop
  418. 8000544: 3708 adds r7, #8
  419. 8000546: 46bd mov sp, r7
  420. 8000548: bd80 pop {r7, pc}
  421. 800054a: bf00 nop
  422. 800054c: 20001374 .word 0x20001374
  423. 08000550 <SPI_TxBuffer>:
  424. /* SPI transmit buffer */
  425. static void SPI_TxBuffer(uint8_t *buffer, uint16_t len)
  426. {
  427. 8000550: b580 push {r7, lr}
  428. 8000552: b082 sub sp, #8
  429. 8000554: af00 add r7, sp, #0
  430. 8000556: 6078 str r0, [r7, #4]
  431. 8000558: 460b mov r3, r1
  432. 800055a: 807b strh r3, [r7, #2]
  433. while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
  434. 800055c: bf00 nop
  435. 800055e: 4b08 ldr r3, [pc, #32] ; (8000580 <SPI_TxBuffer+0x30>)
  436. 8000560: 681b ldr r3, [r3, #0]
  437. 8000562: 689b ldr r3, [r3, #8]
  438. 8000564: f003 0302 and.w r3, r3, #2
  439. 8000568: 2b02 cmp r3, #2
  440. 800056a: d1f8 bne.n 800055e <SPI_TxBuffer+0xe>
  441. HAL_SPI_Transmit(HSPI_SDCARD, buffer, len, SPI_TIMEOUT);
  442. 800056c: 887a ldrh r2, [r7, #2]
  443. 800056e: 2364 movs r3, #100 ; 0x64
  444. 8000570: 6879 ldr r1, [r7, #4]
  445. 8000572: 4803 ldr r0, [pc, #12] ; (8000580 <SPI_TxBuffer+0x30>)
  446. 8000574: f002 fcbc bl 8002ef0 <HAL_SPI_Transmit>
  447. }
  448. 8000578: bf00 nop
  449. 800057a: 3708 adds r7, #8
  450. 800057c: 46bd mov sp, r7
  451. 800057e: bd80 pop {r7, pc}
  452. 8000580: 20001374 .word 0x20001374
  453. 08000584 <SPI_RxByte>:
  454. /* SPI receive a byte */
  455. static uint8_t SPI_RxByte(void)
  456. {
  457. 8000584: b580 push {r7, lr}
  458. 8000586: b084 sub sp, #16
  459. 8000588: af02 add r7, sp, #8
  460. uint8_t dummy, data;
  461. dummy = 0xFF;
  462. 800058a: 23ff movs r3, #255 ; 0xff
  463. 800058c: 71fb strb r3, [r7, #7]
  464. while(!__HAL_SPI_GET_FLAG(HSPI_SDCARD, SPI_FLAG_TXE));
  465. 800058e: bf00 nop
  466. 8000590: 4b09 ldr r3, [pc, #36] ; (80005b8 <SPI_RxByte+0x34>)
  467. 8000592: 681b ldr r3, [r3, #0]
  468. 8000594: 689b ldr r3, [r3, #8]
  469. 8000596: f003 0302 and.w r3, r3, #2
  470. 800059a: 2b02 cmp r3, #2
  471. 800059c: d1f8 bne.n 8000590 <SPI_RxByte+0xc>
  472. HAL_SPI_TransmitReceive(HSPI_SDCARD, &dummy, &data, 1, SPI_TIMEOUT);
  473. 800059e: 1dba adds r2, r7, #6
  474. 80005a0: 1df9 adds r1, r7, #7
  475. 80005a2: 2364 movs r3, #100 ; 0x64
  476. 80005a4: 9300 str r3, [sp, #0]
  477. 80005a6: 2301 movs r3, #1
  478. 80005a8: 4803 ldr r0, [pc, #12] ; (80005b8 <SPI_RxByte+0x34>)
  479. 80005aa: f002 fdd5 bl 8003158 <HAL_SPI_TransmitReceive>
  480. return data;
  481. 80005ae: 79bb ldrb r3, [r7, #6]
  482. }
  483. 80005b0: 4618 mov r0, r3
  484. 80005b2: 3708 adds r7, #8
  485. 80005b4: 46bd mov sp, r7
  486. 80005b6: bd80 pop {r7, pc}
  487. 80005b8: 20001374 .word 0x20001374
  488. 080005bc <SPI_RxBytePtr>:
  489. /* SPI receive a byte via pointer */
  490. static void SPI_RxBytePtr(uint8_t *buff)
  491. {
  492. 80005bc: b580 push {r7, lr}
  493. 80005be: b082 sub sp, #8
  494. 80005c0: af00 add r7, sp, #0
  495. 80005c2: 6078 str r0, [r7, #4]
  496. *buff = SPI_RxByte();
  497. 80005c4: f7ff ffde bl 8000584 <SPI_RxByte>
  498. 80005c8: 4603 mov r3, r0
  499. 80005ca: 461a mov r2, r3
  500. 80005cc: 687b ldr r3, [r7, #4]
  501. 80005ce: 701a strb r2, [r3, #0]
  502. }
  503. 80005d0: bf00 nop
  504. 80005d2: 3708 adds r7, #8
  505. 80005d4: 46bd mov sp, r7
  506. 80005d6: bd80 pop {r7, pc}
  507. 080005d8 <SD_ReadyWait>:
  508. * SD functions
  509. **************************************/
  510. /* wait SD ready */
  511. static uint8_t SD_ReadyWait(void)
  512. {
  513. 80005d8: b580 push {r7, lr}
  514. 80005da: b082 sub sp, #8
  515. 80005dc: af00 add r7, sp, #0
  516. uint8_t res;
  517. /* timeout 500ms */
  518. Timer2 = 500;
  519. 80005de: 4b0a ldr r3, [pc, #40] ; (8000608 <SD_ReadyWait+0x30>)
  520. 80005e0: f44f 72fa mov.w r2, #500 ; 0x1f4
  521. 80005e4: 801a strh r2, [r3, #0]
  522. /* if SD goes ready, receives 0xFF */
  523. do {
  524. res = SPI_RxByte();
  525. 80005e6: f7ff ffcd bl 8000584 <SPI_RxByte>
  526. 80005ea: 4603 mov r3, r0
  527. 80005ec: 71fb strb r3, [r7, #7]
  528. } while ((res != 0xFF) && Timer2);
  529. 80005ee: 79fb ldrb r3, [r7, #7]
  530. 80005f0: 2bff cmp r3, #255 ; 0xff
  531. 80005f2: d003 beq.n 80005fc <SD_ReadyWait+0x24>
  532. 80005f4: 4b04 ldr r3, [pc, #16] ; (8000608 <SD_ReadyWait+0x30>)
  533. 80005f6: 881b ldrh r3, [r3, #0]
  534. 80005f8: 2b00 cmp r3, #0
  535. 80005fa: d1f4 bne.n 80005e6 <SD_ReadyWait+0xe>
  536. return res;
  537. 80005fc: 79fb ldrb r3, [r7, #7]
  538. }
  539. 80005fe: 4618 mov r0, r3
  540. 8000600: 3708 adds r7, #8
  541. 8000602: 46bd mov sp, r7
  542. 8000604: bd80 pop {r7, pc}
  543. 8000606: bf00 nop
  544. 8000608: 20000278 .word 0x20000278
  545. 0800060c <SD_PowerOn>:
  546. /* power on */
  547. static void SD_PowerOn(void)
  548. {
  549. 800060c: b580 push {r7, lr}
  550. 800060e: b084 sub sp, #16
  551. 8000610: af00 add r7, sp, #0
  552. uint8_t args[6];
  553. uint32_t cnt = 0x1FFF;
  554. 8000612: f641 73ff movw r3, #8191 ; 0x1fff
  555. 8000616: 60fb str r3, [r7, #12]
  556. /* transmit bytes to wake up */
  557. DESELECT();
  558. 8000618: f7ff ff72 bl 8000500 <DESELECT>
  559. for(int i = 0; i < 10; i++)
  560. 800061c: 2300 movs r3, #0
  561. 800061e: 60bb str r3, [r7, #8]
  562. 8000620: e005 b.n 800062e <SD_PowerOn+0x22>
  563. {
  564. SPI_TxByte(0xFF);
  565. 8000622: 20ff movs r0, #255 ; 0xff
  566. 8000624: f7ff ff7a bl 800051c <SPI_TxByte>
  567. for(int i = 0; i < 10; i++)
  568. 8000628: 68bb ldr r3, [r7, #8]
  569. 800062a: 3301 adds r3, #1
  570. 800062c: 60bb str r3, [r7, #8]
  571. 800062e: 68bb ldr r3, [r7, #8]
  572. 8000630: 2b09 cmp r3, #9
  573. 8000632: ddf6 ble.n 8000622 <SD_PowerOn+0x16>
  574. }
  575. /* slave select */
  576. SELECT();
  577. 8000634: f7ff ff56 bl 80004e4 <SELECT>
  578. /* make idle state */
  579. args[0] = CMD0; /* CMD0:GO_IDLE_STATE */
  580. 8000638: 2340 movs r3, #64 ; 0x40
  581. 800063a: 703b strb r3, [r7, #0]
  582. args[1] = 0;
  583. 800063c: 2300 movs r3, #0
  584. 800063e: 707b strb r3, [r7, #1]
  585. args[2] = 0;
  586. 8000640: 2300 movs r3, #0
  587. 8000642: 70bb strb r3, [r7, #2]
  588. args[3] = 0;
  589. 8000644: 2300 movs r3, #0
  590. 8000646: 70fb strb r3, [r7, #3]
  591. args[4] = 0;
  592. 8000648: 2300 movs r3, #0
  593. 800064a: 713b strb r3, [r7, #4]
  594. args[5] = 0x95; /* CRC */
  595. 800064c: 2395 movs r3, #149 ; 0x95
  596. 800064e: 717b strb r3, [r7, #5]
  597. SPI_TxBuffer(args, sizeof(args));
  598. 8000650: 463b mov r3, r7
  599. 8000652: 2106 movs r1, #6
  600. 8000654: 4618 mov r0, r3
  601. 8000656: f7ff ff7b bl 8000550 <SPI_TxBuffer>
  602. /* wait response */
  603. while ((SPI_RxByte() != 0x01) && cnt)
  604. 800065a: e002 b.n 8000662 <SD_PowerOn+0x56>
  605. {
  606. cnt--;
  607. 800065c: 68fb ldr r3, [r7, #12]
  608. 800065e: 3b01 subs r3, #1
  609. 8000660: 60fb str r3, [r7, #12]
  610. while ((SPI_RxByte() != 0x01) && cnt)
  611. 8000662: f7ff ff8f bl 8000584 <SPI_RxByte>
  612. 8000666: 4603 mov r3, r0
  613. 8000668: 2b01 cmp r3, #1
  614. 800066a: d002 beq.n 8000672 <SD_PowerOn+0x66>
  615. 800066c: 68fb ldr r3, [r7, #12]
  616. 800066e: 2b00 cmp r3, #0
  617. 8000670: d1f4 bne.n 800065c <SD_PowerOn+0x50>
  618. }
  619. DESELECT();
  620. 8000672: f7ff ff45 bl 8000500 <DESELECT>
  621. SPI_TxByte(0XFF);
  622. 8000676: 20ff movs r0, #255 ; 0xff
  623. 8000678: f7ff ff50 bl 800051c <SPI_TxByte>
  624. PowerFlag = 1;
  625. 800067c: 4b03 ldr r3, [pc, #12] ; (800068c <SD_PowerOn+0x80>)
  626. 800067e: 2201 movs r2, #1
  627. 8000680: 701a strb r2, [r3, #0]
  628. }
  629. 8000682: bf00 nop
  630. 8000684: 3710 adds r7, #16
  631. 8000686: 46bd mov sp, r7
  632. 8000688: bd80 pop {r7, pc}
  633. 800068a: bf00 nop
  634. 800068c: 20000041 .word 0x20000041
  635. 08000690 <SD_PowerOff>:
  636. /* power off */
  637. static void SD_PowerOff(void)
  638. {
  639. 8000690: b480 push {r7}
  640. 8000692: af00 add r7, sp, #0
  641. PowerFlag = 0;
  642. 8000694: 4b03 ldr r3, [pc, #12] ; (80006a4 <SD_PowerOff+0x14>)
  643. 8000696: 2200 movs r2, #0
  644. 8000698: 701a strb r2, [r3, #0]
  645. }
  646. 800069a: bf00 nop
  647. 800069c: 46bd mov sp, r7
  648. 800069e: f85d 7b04 ldr.w r7, [sp], #4
  649. 80006a2: 4770 bx lr
  650. 80006a4: 20000041 .word 0x20000041
  651. 080006a8 <SD_CheckPower>:
  652. /* check power flag */
  653. static uint8_t SD_CheckPower(void)
  654. {
  655. 80006a8: b480 push {r7}
  656. 80006aa: af00 add r7, sp, #0
  657. return PowerFlag;
  658. 80006ac: 4b03 ldr r3, [pc, #12] ; (80006bc <SD_CheckPower+0x14>)
  659. 80006ae: 781b ldrb r3, [r3, #0]
  660. }
  661. 80006b0: 4618 mov r0, r3
  662. 80006b2: 46bd mov sp, r7
  663. 80006b4: f85d 7b04 ldr.w r7, [sp], #4
  664. 80006b8: 4770 bx lr
  665. 80006ba: bf00 nop
  666. 80006bc: 20000041 .word 0x20000041
  667. 080006c0 <SD_RxDataBlock>:
  668. /* receive data block */
  669. static bool SD_RxDataBlock(BYTE *buff, UINT len)
  670. {
  671. 80006c0: b580 push {r7, lr}
  672. 80006c2: b084 sub sp, #16
  673. 80006c4: af00 add r7, sp, #0
  674. 80006c6: 6078 str r0, [r7, #4]
  675. 80006c8: 6039 str r1, [r7, #0]
  676. uint8_t token;
  677. /* timeout 200ms */
  678. Timer1 = 200;
  679. 80006ca: 4b13 ldr r3, [pc, #76] ; (8000718 <SD_RxDataBlock+0x58>)
  680. 80006cc: 22c8 movs r2, #200 ; 0xc8
  681. 80006ce: 801a strh r2, [r3, #0]
  682. /* loop until receive a response or timeout */
  683. do {
  684. token = SPI_RxByte();
  685. 80006d0: f7ff ff58 bl 8000584 <SPI_RxByte>
  686. 80006d4: 4603 mov r3, r0
  687. 80006d6: 73fb strb r3, [r7, #15]
  688. } while((token == 0xFF) && Timer1);
  689. 80006d8: 7bfb ldrb r3, [r7, #15]
  690. 80006da: 2bff cmp r3, #255 ; 0xff
  691. 80006dc: d103 bne.n 80006e6 <SD_RxDataBlock+0x26>
  692. 80006de: 4b0e ldr r3, [pc, #56] ; (8000718 <SD_RxDataBlock+0x58>)
  693. 80006e0: 881b ldrh r3, [r3, #0]
  694. 80006e2: 2b00 cmp r3, #0
  695. 80006e4: d1f4 bne.n 80006d0 <SD_RxDataBlock+0x10>
  696. /* invalid response */
  697. if(token != 0xFE) return FALSE;
  698. 80006e6: 7bfb ldrb r3, [r7, #15]
  699. 80006e8: 2bfe cmp r3, #254 ; 0xfe
  700. 80006ea: d001 beq.n 80006f0 <SD_RxDataBlock+0x30>
  701. 80006ec: 2300 movs r3, #0
  702. 80006ee: e00f b.n 8000710 <SD_RxDataBlock+0x50>
  703. /* receive data */
  704. do {
  705. SPI_RxBytePtr(buff++);
  706. 80006f0: 687b ldr r3, [r7, #4]
  707. 80006f2: 1c5a adds r2, r3, #1
  708. 80006f4: 607a str r2, [r7, #4]
  709. 80006f6: 4618 mov r0, r3
  710. 80006f8: f7ff ff60 bl 80005bc <SPI_RxBytePtr>
  711. } while(len--);
  712. 80006fc: 683b ldr r3, [r7, #0]
  713. 80006fe: 1e5a subs r2, r3, #1
  714. 8000700: 603a str r2, [r7, #0]
  715. 8000702: 2b00 cmp r3, #0
  716. 8000704: d1f4 bne.n 80006f0 <SD_RxDataBlock+0x30>
  717. /* discard CRC */
  718. SPI_RxByte();
  719. 8000706: f7ff ff3d bl 8000584 <SPI_RxByte>
  720. SPI_RxByte();
  721. 800070a: f7ff ff3b bl 8000584 <SPI_RxByte>
  722. return TRUE;
  723. 800070e: 2301 movs r3, #1
  724. }
  725. 8000710: 4618 mov r0, r3
  726. 8000712: 3710 adds r7, #16
  727. 8000714: 46bd mov sp, r7
  728. 8000716: bd80 pop {r7, pc}
  729. 8000718: 2000027a .word 0x2000027a
  730. 0800071c <SD_TxDataBlock>:
  731. /* transmit data block */
  732. #if _USE_WRITE == 1
  733. static bool SD_TxDataBlock(const uint8_t *buff, BYTE token)
  734. {
  735. 800071c: b580 push {r7, lr}
  736. 800071e: b084 sub sp, #16
  737. 8000720: af00 add r7, sp, #0
  738. 8000722: 6078 str r0, [r7, #4]
  739. 8000724: 460b mov r3, r1
  740. 8000726: 70fb strb r3, [r7, #3]
  741. uint8_t resp;
  742. uint8_t i = 0;
  743. 8000728: 2300 movs r3, #0
  744. 800072a: 73bb strb r3, [r7, #14]
  745. /* wait SD ready */
  746. if (SD_ReadyWait() != 0xFF) return FALSE;
  747. 800072c: f7ff ff54 bl 80005d8 <SD_ReadyWait>
  748. 8000730: 4603 mov r3, r0
  749. 8000732: 2bff cmp r3, #255 ; 0xff
  750. 8000734: d001 beq.n 800073a <SD_TxDataBlock+0x1e>
  751. 8000736: 2300 movs r3, #0
  752. 8000738: e02f b.n 800079a <SD_TxDataBlock+0x7e>
  753. /* transmit token */
  754. SPI_TxByte(token);
  755. 800073a: 78fb ldrb r3, [r7, #3]
  756. 800073c: 4618 mov r0, r3
  757. 800073e: f7ff feed bl 800051c <SPI_TxByte>
  758. /* if it's not STOP token, transmit data */
  759. if (token != 0xFD)
  760. 8000742: 78fb ldrb r3, [r7, #3]
  761. 8000744: 2bfd cmp r3, #253 ; 0xfd
  762. 8000746: d020 beq.n 800078a <SD_TxDataBlock+0x6e>
  763. {
  764. SPI_TxBuffer((uint8_t*)buff, 512);
  765. 8000748: f44f 7100 mov.w r1, #512 ; 0x200
  766. 800074c: 6878 ldr r0, [r7, #4]
  767. 800074e: f7ff feff bl 8000550 <SPI_TxBuffer>
  768. /* discard CRC */
  769. SPI_RxByte();
  770. 8000752: f7ff ff17 bl 8000584 <SPI_RxByte>
  771. SPI_RxByte();
  772. 8000756: f7ff ff15 bl 8000584 <SPI_RxByte>
  773. /* receive response */
  774. while (i <= 64)
  775. 800075a: e00b b.n 8000774 <SD_TxDataBlock+0x58>
  776. {
  777. resp = SPI_RxByte();
  778. 800075c: f7ff ff12 bl 8000584 <SPI_RxByte>
  779. 8000760: 4603 mov r3, r0
  780. 8000762: 73fb strb r3, [r7, #15]
  781. /* transmit 0x05 accepted */
  782. if ((resp & 0x1F) == 0x05) break;
  783. 8000764: 7bfb ldrb r3, [r7, #15]
  784. 8000766: f003 031f and.w r3, r3, #31
  785. 800076a: 2b05 cmp r3, #5
  786. 800076c: d006 beq.n 800077c <SD_TxDataBlock+0x60>
  787. i++;
  788. 800076e: 7bbb ldrb r3, [r7, #14]
  789. 8000770: 3301 adds r3, #1
  790. 8000772: 73bb strb r3, [r7, #14]
  791. while (i <= 64)
  792. 8000774: 7bbb ldrb r3, [r7, #14]
  793. 8000776: 2b40 cmp r3, #64 ; 0x40
  794. 8000778: d9f0 bls.n 800075c <SD_TxDataBlock+0x40>
  795. 800077a: e000 b.n 800077e <SD_TxDataBlock+0x62>
  796. if ((resp & 0x1F) == 0x05) break;
  797. 800077c: bf00 nop
  798. }
  799. /* recv buffer clear */
  800. while (SPI_RxByte() == 0);
  801. 800077e: bf00 nop
  802. 8000780: f7ff ff00 bl 8000584 <SPI_RxByte>
  803. 8000784: 4603 mov r3, r0
  804. 8000786: 2b00 cmp r3, #0
  805. 8000788: d0fa beq.n 8000780 <SD_TxDataBlock+0x64>
  806. }
  807. /* transmit 0x05 accepted */
  808. if ((resp & 0x1F) == 0x05) return TRUE;
  809. 800078a: 7bfb ldrb r3, [r7, #15]
  810. 800078c: f003 031f and.w r3, r3, #31
  811. 8000790: 2b05 cmp r3, #5
  812. 8000792: d101 bne.n 8000798 <SD_TxDataBlock+0x7c>
  813. 8000794: 2301 movs r3, #1
  814. 8000796: e000 b.n 800079a <SD_TxDataBlock+0x7e>
  815. return FALSE;
  816. 8000798: 2300 movs r3, #0
  817. }
  818. 800079a: 4618 mov r0, r3
  819. 800079c: 3710 adds r7, #16
  820. 800079e: 46bd mov sp, r7
  821. 80007a0: bd80 pop {r7, pc}
  822. 080007a2 <SD_SendCmd>:
  823. #endif /* _USE_WRITE */
  824. /* transmit command */
  825. static BYTE SD_SendCmd(BYTE cmd, uint32_t arg)
  826. {
  827. 80007a2: b580 push {r7, lr}
  828. 80007a4: b084 sub sp, #16
  829. 80007a6: af00 add r7, sp, #0
  830. 80007a8: 4603 mov r3, r0
  831. 80007aa: 6039 str r1, [r7, #0]
  832. 80007ac: 71fb strb r3, [r7, #7]
  833. uint8_t crc, res;
  834. /* wait SD ready */
  835. if (SD_ReadyWait() != 0xFF) return 0xFF;
  836. 80007ae: f7ff ff13 bl 80005d8 <SD_ReadyWait>
  837. 80007b2: 4603 mov r3, r0
  838. 80007b4: 2bff cmp r3, #255 ; 0xff
  839. 80007b6: d001 beq.n 80007bc <SD_SendCmd+0x1a>
  840. 80007b8: 23ff movs r3, #255 ; 0xff
  841. 80007ba: e042 b.n 8000842 <SD_SendCmd+0xa0>
  842. /* transmit command */
  843. SPI_TxByte(cmd); /* Command */
  844. 80007bc: 79fb ldrb r3, [r7, #7]
  845. 80007be: 4618 mov r0, r3
  846. 80007c0: f7ff feac bl 800051c <SPI_TxByte>
  847. SPI_TxByte((uint8_t)(arg >> 24)); /* Argument[31..24] */
  848. 80007c4: 683b ldr r3, [r7, #0]
  849. 80007c6: 0e1b lsrs r3, r3, #24
  850. 80007c8: b2db uxtb r3, r3
  851. 80007ca: 4618 mov r0, r3
  852. 80007cc: f7ff fea6 bl 800051c <SPI_TxByte>
  853. SPI_TxByte((uint8_t)(arg >> 16)); /* Argument[23..16] */
  854. 80007d0: 683b ldr r3, [r7, #0]
  855. 80007d2: 0c1b lsrs r3, r3, #16
  856. 80007d4: b2db uxtb r3, r3
  857. 80007d6: 4618 mov r0, r3
  858. 80007d8: f7ff fea0 bl 800051c <SPI_TxByte>
  859. SPI_TxByte((uint8_t)(arg >> 8)); /* Argument[15..8] */
  860. 80007dc: 683b ldr r3, [r7, #0]
  861. 80007de: 0a1b lsrs r3, r3, #8
  862. 80007e0: b2db uxtb r3, r3
  863. 80007e2: 4618 mov r0, r3
  864. 80007e4: f7ff fe9a bl 800051c <SPI_TxByte>
  865. SPI_TxByte((uint8_t)arg); /* Argument[7..0] */
  866. 80007e8: 683b ldr r3, [r7, #0]
  867. 80007ea: b2db uxtb r3, r3
  868. 80007ec: 4618 mov r0, r3
  869. 80007ee: f7ff fe95 bl 800051c <SPI_TxByte>
  870. /* prepare CRC */
  871. if(cmd == CMD0) crc = 0x95; /* CRC for CMD0(0) */
  872. 80007f2: 79fb ldrb r3, [r7, #7]
  873. 80007f4: 2b40 cmp r3, #64 ; 0x40
  874. 80007f6: d102 bne.n 80007fe <SD_SendCmd+0x5c>
  875. 80007f8: 2395 movs r3, #149 ; 0x95
  876. 80007fa: 73fb strb r3, [r7, #15]
  877. 80007fc: e007 b.n 800080e <SD_SendCmd+0x6c>
  878. else if(cmd == CMD8) crc = 0x87; /* CRC for CMD8(0x1AA) */
  879. 80007fe: 79fb ldrb r3, [r7, #7]
  880. 8000800: 2b48 cmp r3, #72 ; 0x48
  881. 8000802: d102 bne.n 800080a <SD_SendCmd+0x68>
  882. 8000804: 2387 movs r3, #135 ; 0x87
  883. 8000806: 73fb strb r3, [r7, #15]
  884. 8000808: e001 b.n 800080e <SD_SendCmd+0x6c>
  885. else crc = 1;
  886. 800080a: 2301 movs r3, #1
  887. 800080c: 73fb strb r3, [r7, #15]
  888. /* transmit CRC */
  889. SPI_TxByte(crc);
  890. 800080e: 7bfb ldrb r3, [r7, #15]
  891. 8000810: 4618 mov r0, r3
  892. 8000812: f7ff fe83 bl 800051c <SPI_TxByte>
  893. /* Skip a stuff byte when STOP_TRANSMISSION */
  894. if (cmd == CMD12) SPI_RxByte();
  895. 8000816: 79fb ldrb r3, [r7, #7]
  896. 8000818: 2b4c cmp r3, #76 ; 0x4c
  897. 800081a: d101 bne.n 8000820 <SD_SendCmd+0x7e>
  898. 800081c: f7ff feb2 bl 8000584 <SPI_RxByte>
  899. /* receive response */
  900. uint8_t n = 10;
  901. 8000820: 230a movs r3, #10
  902. 8000822: 73bb strb r3, [r7, #14]
  903. do {
  904. res = SPI_RxByte();
  905. 8000824: f7ff feae bl 8000584 <SPI_RxByte>
  906. 8000828: 4603 mov r3, r0
  907. 800082a: 737b strb r3, [r7, #13]
  908. } while ((res & 0x80) && --n);
  909. 800082c: f997 300d ldrsb.w r3, [r7, #13]
  910. 8000830: 2b00 cmp r3, #0
  911. 8000832: da05 bge.n 8000840 <SD_SendCmd+0x9e>
  912. 8000834: 7bbb ldrb r3, [r7, #14]
  913. 8000836: 3b01 subs r3, #1
  914. 8000838: 73bb strb r3, [r7, #14]
  915. 800083a: 7bbb ldrb r3, [r7, #14]
  916. 800083c: 2b00 cmp r3, #0
  917. 800083e: d1f1 bne.n 8000824 <SD_SendCmd+0x82>
  918. return res;
  919. 8000840: 7b7b ldrb r3, [r7, #13]
  920. }
  921. 8000842: 4618 mov r0, r3
  922. 8000844: 3710 adds r7, #16
  923. 8000846: 46bd mov sp, r7
  924. 8000848: bd80 pop {r7, pc}
  925. ...
  926. 0800084c <SD_disk_initialize>:
  927. * user_diskio.c functions
  928. **************************************/
  929. /* initialize SD */
  930. DSTATUS SD_disk_initialize(BYTE drv)
  931. {
  932. 800084c: b590 push {r4, r7, lr}
  933. 800084e: b085 sub sp, #20
  934. 8000850: af00 add r7, sp, #0
  935. 8000852: 4603 mov r3, r0
  936. 8000854: 71fb strb r3, [r7, #7]
  937. uint8_t n, type, ocr[4];
  938. /* single drive, drv should be 0 */
  939. if(drv) return STA_NOINIT;
  940. 8000856: 79fb ldrb r3, [r7, #7]
  941. 8000858: 2b00 cmp r3, #0
  942. 800085a: d001 beq.n 8000860 <SD_disk_initialize+0x14>
  943. 800085c: 2301 movs r3, #1
  944. 800085e: e0d1 b.n 8000a04 <SD_disk_initialize+0x1b8>
  945. /* no disk */
  946. if(Stat & STA_NODISK) return Stat;
  947. 8000860: 4b6a ldr r3, [pc, #424] ; (8000a0c <SD_disk_initialize+0x1c0>)
  948. 8000862: 781b ldrb r3, [r3, #0]
  949. 8000864: b2db uxtb r3, r3
  950. 8000866: f003 0302 and.w r3, r3, #2
  951. 800086a: 2b00 cmp r3, #0
  952. 800086c: d003 beq.n 8000876 <SD_disk_initialize+0x2a>
  953. 800086e: 4b67 ldr r3, [pc, #412] ; (8000a0c <SD_disk_initialize+0x1c0>)
  954. 8000870: 781b ldrb r3, [r3, #0]
  955. 8000872: b2db uxtb r3, r3
  956. 8000874: e0c6 b.n 8000a04 <SD_disk_initialize+0x1b8>
  957. /* power on */
  958. SD_PowerOn();
  959. 8000876: f7ff fec9 bl 800060c <SD_PowerOn>
  960. /* slave select */
  961. SELECT();
  962. 800087a: f7ff fe33 bl 80004e4 <SELECT>
  963. /* check disk type */
  964. type = 0;
  965. 800087e: 2300 movs r3, #0
  966. 8000880: 73bb strb r3, [r7, #14]
  967. /* send GO_IDLE_STATE command */
  968. if (SD_SendCmd(CMD0, 0) == 1)
  969. 8000882: 2100 movs r1, #0
  970. 8000884: 2040 movs r0, #64 ; 0x40
  971. 8000886: f7ff ff8c bl 80007a2 <SD_SendCmd>
  972. 800088a: 4603 mov r3, r0
  973. 800088c: 2b01 cmp r3, #1
  974. 800088e: f040 80a1 bne.w 80009d4 <SD_disk_initialize+0x188>
  975. {
  976. /* timeout 1 sec */
  977. Timer1 = 1000;
  978. 8000892: 4b5f ldr r3, [pc, #380] ; (8000a10 <SD_disk_initialize+0x1c4>)
  979. 8000894: f44f 727a mov.w r2, #1000 ; 0x3e8
  980. 8000898: 801a strh r2, [r3, #0]
  981. /* SDC V2+ accept CMD8 command, http://elm-chan.org/docs/mmc/mmc_e.html */
  982. if (SD_SendCmd(CMD8, 0x1AA) == 1)
  983. 800089a: f44f 71d5 mov.w r1, #426 ; 0x1aa
  984. 800089e: 2048 movs r0, #72 ; 0x48
  985. 80008a0: f7ff ff7f bl 80007a2 <SD_SendCmd>
  986. 80008a4: 4603 mov r3, r0
  987. 80008a6: 2b01 cmp r3, #1
  988. 80008a8: d155 bne.n 8000956 <SD_disk_initialize+0x10a>
  989. {
  990. /* operation condition register */
  991. for (n = 0; n < 4; n++)
  992. 80008aa: 2300 movs r3, #0
  993. 80008ac: 73fb strb r3, [r7, #15]
  994. 80008ae: e00c b.n 80008ca <SD_disk_initialize+0x7e>
  995. {
  996. ocr[n] = SPI_RxByte();
  997. 80008b0: 7bfc ldrb r4, [r7, #15]
  998. 80008b2: f7ff fe67 bl 8000584 <SPI_RxByte>
  999. 80008b6: 4603 mov r3, r0
  1000. 80008b8: 461a mov r2, r3
  1001. 80008ba: f107 0310 add.w r3, r7, #16
  1002. 80008be: 4423 add r3, r4
  1003. 80008c0: f803 2c08 strb.w r2, [r3, #-8]
  1004. for (n = 0; n < 4; n++)
  1005. 80008c4: 7bfb ldrb r3, [r7, #15]
  1006. 80008c6: 3301 adds r3, #1
  1007. 80008c8: 73fb strb r3, [r7, #15]
  1008. 80008ca: 7bfb ldrb r3, [r7, #15]
  1009. 80008cc: 2b03 cmp r3, #3
  1010. 80008ce: d9ef bls.n 80008b0 <SD_disk_initialize+0x64>
  1011. }
  1012. /* voltage range 2.7-3.6V */
  1013. if (ocr[2] == 0x01 && ocr[3] == 0xAA)
  1014. 80008d0: 7abb ldrb r3, [r7, #10]
  1015. 80008d2: 2b01 cmp r3, #1
  1016. 80008d4: d17e bne.n 80009d4 <SD_disk_initialize+0x188>
  1017. 80008d6: 7afb ldrb r3, [r7, #11]
  1018. 80008d8: 2baa cmp r3, #170 ; 0xaa
  1019. 80008da: d17b bne.n 80009d4 <SD_disk_initialize+0x188>
  1020. {
  1021. /* ACMD41 with HCS bit */
  1022. do {
  1023. if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 1UL << 30) == 0) break;
  1024. 80008dc: 2100 movs r1, #0
  1025. 80008de: 2077 movs r0, #119 ; 0x77
  1026. 80008e0: f7ff ff5f bl 80007a2 <SD_SendCmd>
  1027. 80008e4: 4603 mov r3, r0
  1028. 80008e6: 2b01 cmp r3, #1
  1029. 80008e8: d807 bhi.n 80008fa <SD_disk_initialize+0xae>
  1030. 80008ea: f04f 4180 mov.w r1, #1073741824 ; 0x40000000
  1031. 80008ee: 2069 movs r0, #105 ; 0x69
  1032. 80008f0: f7ff ff57 bl 80007a2 <SD_SendCmd>
  1033. 80008f4: 4603 mov r3, r0
  1034. 80008f6: 2b00 cmp r3, #0
  1035. 80008f8: d004 beq.n 8000904 <SD_disk_initialize+0xb8>
  1036. } while (Timer1);
  1037. 80008fa: 4b45 ldr r3, [pc, #276] ; (8000a10 <SD_disk_initialize+0x1c4>)
  1038. 80008fc: 881b ldrh r3, [r3, #0]
  1039. 80008fe: 2b00 cmp r3, #0
  1040. 8000900: d1ec bne.n 80008dc <SD_disk_initialize+0x90>
  1041. 8000902: e000 b.n 8000906 <SD_disk_initialize+0xba>
  1042. if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 1UL << 30) == 0) break;
  1043. 8000904: bf00 nop
  1044. /* READ_OCR */
  1045. if (Timer1 && SD_SendCmd(CMD58, 0) == 0)
  1046. 8000906: 4b42 ldr r3, [pc, #264] ; (8000a10 <SD_disk_initialize+0x1c4>)
  1047. 8000908: 881b ldrh r3, [r3, #0]
  1048. 800090a: 2b00 cmp r3, #0
  1049. 800090c: d062 beq.n 80009d4 <SD_disk_initialize+0x188>
  1050. 800090e: 2100 movs r1, #0
  1051. 8000910: 207a movs r0, #122 ; 0x7a
  1052. 8000912: f7ff ff46 bl 80007a2 <SD_SendCmd>
  1053. 8000916: 4603 mov r3, r0
  1054. 8000918: 2b00 cmp r3, #0
  1055. 800091a: d15b bne.n 80009d4 <SD_disk_initialize+0x188>
  1056. {
  1057. /* Check CCS bit */
  1058. for (n = 0; n < 4; n++)
  1059. 800091c: 2300 movs r3, #0
  1060. 800091e: 73fb strb r3, [r7, #15]
  1061. 8000920: e00c b.n 800093c <SD_disk_initialize+0xf0>
  1062. {
  1063. ocr[n] = SPI_RxByte();
  1064. 8000922: 7bfc ldrb r4, [r7, #15]
  1065. 8000924: f7ff fe2e bl 8000584 <SPI_RxByte>
  1066. 8000928: 4603 mov r3, r0
  1067. 800092a: 461a mov r2, r3
  1068. 800092c: f107 0310 add.w r3, r7, #16
  1069. 8000930: 4423 add r3, r4
  1070. 8000932: f803 2c08 strb.w r2, [r3, #-8]
  1071. for (n = 0; n < 4; n++)
  1072. 8000936: 7bfb ldrb r3, [r7, #15]
  1073. 8000938: 3301 adds r3, #1
  1074. 800093a: 73fb strb r3, [r7, #15]
  1075. 800093c: 7bfb ldrb r3, [r7, #15]
  1076. 800093e: 2b03 cmp r3, #3
  1077. 8000940: d9ef bls.n 8000922 <SD_disk_initialize+0xd6>
  1078. }
  1079. /* SDv2 (HC or SC) */
  1080. type = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2;
  1081. 8000942: 7a3b ldrb r3, [r7, #8]
  1082. 8000944: f003 0340 and.w r3, r3, #64 ; 0x40
  1083. 8000948: 2b00 cmp r3, #0
  1084. 800094a: d001 beq.n 8000950 <SD_disk_initialize+0x104>
  1085. 800094c: 230c movs r3, #12
  1086. 800094e: e000 b.n 8000952 <SD_disk_initialize+0x106>
  1087. 8000950: 2304 movs r3, #4
  1088. 8000952: 73bb strb r3, [r7, #14]
  1089. 8000954: e03e b.n 80009d4 <SD_disk_initialize+0x188>
  1090. }
  1091. }
  1092. else
  1093. {
  1094. /* SDC V1 or MMC */
  1095. type = (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 0) <= 1) ? CT_SD1 : CT_MMC;
  1096. 8000956: 2100 movs r1, #0
  1097. 8000958: 2077 movs r0, #119 ; 0x77
  1098. 800095a: f7ff ff22 bl 80007a2 <SD_SendCmd>
  1099. 800095e: 4603 mov r3, r0
  1100. 8000960: 2b01 cmp r3, #1
  1101. 8000962: d808 bhi.n 8000976 <SD_disk_initialize+0x12a>
  1102. 8000964: 2100 movs r1, #0
  1103. 8000966: 2069 movs r0, #105 ; 0x69
  1104. 8000968: f7ff ff1b bl 80007a2 <SD_SendCmd>
  1105. 800096c: 4603 mov r3, r0
  1106. 800096e: 2b01 cmp r3, #1
  1107. 8000970: d801 bhi.n 8000976 <SD_disk_initialize+0x12a>
  1108. 8000972: 2302 movs r3, #2
  1109. 8000974: e000 b.n 8000978 <SD_disk_initialize+0x12c>
  1110. 8000976: 2301 movs r3, #1
  1111. 8000978: 73bb strb r3, [r7, #14]
  1112. do
  1113. {
  1114. if (type == CT_SD1)
  1115. 800097a: 7bbb ldrb r3, [r7, #14]
  1116. 800097c: 2b02 cmp r3, #2
  1117. 800097e: d10e bne.n 800099e <SD_disk_initialize+0x152>
  1118. {
  1119. if (SD_SendCmd(CMD55, 0) <= 1 && SD_SendCmd(CMD41, 0) == 0) break; /* ACMD41 */
  1120. 8000980: 2100 movs r1, #0
  1121. 8000982: 2077 movs r0, #119 ; 0x77
  1122. 8000984: f7ff ff0d bl 80007a2 <SD_SendCmd>
  1123. 8000988: 4603 mov r3, r0
  1124. 800098a: 2b01 cmp r3, #1
  1125. 800098c: d80e bhi.n 80009ac <SD_disk_initialize+0x160>
  1126. 800098e: 2100 movs r1, #0
  1127. 8000990: 2069 movs r0, #105 ; 0x69
  1128. 8000992: f7ff ff06 bl 80007a2 <SD_SendCmd>
  1129. 8000996: 4603 mov r3, r0
  1130. 8000998: 2b00 cmp r3, #0
  1131. 800099a: d107 bne.n 80009ac <SD_disk_initialize+0x160>
  1132. 800099c: e00c b.n 80009b8 <SD_disk_initialize+0x16c>
  1133. }
  1134. else
  1135. {
  1136. if (SD_SendCmd(CMD1, 0) == 0) break; /* CMD1 */
  1137. 800099e: 2100 movs r1, #0
  1138. 80009a0: 2041 movs r0, #65 ; 0x41
  1139. 80009a2: f7ff fefe bl 80007a2 <SD_SendCmd>
  1140. 80009a6: 4603 mov r3, r0
  1141. 80009a8: 2b00 cmp r3, #0
  1142. 80009aa: d004 beq.n 80009b6 <SD_disk_initialize+0x16a>
  1143. }
  1144. } while (Timer1);
  1145. 80009ac: 4b18 ldr r3, [pc, #96] ; (8000a10 <SD_disk_initialize+0x1c4>)
  1146. 80009ae: 881b ldrh r3, [r3, #0]
  1147. 80009b0: 2b00 cmp r3, #0
  1148. 80009b2: d1e2 bne.n 800097a <SD_disk_initialize+0x12e>
  1149. 80009b4: e000 b.n 80009b8 <SD_disk_initialize+0x16c>
  1150. if (SD_SendCmd(CMD1, 0) == 0) break; /* CMD1 */
  1151. 80009b6: bf00 nop
  1152. /* SET_BLOCKLEN */
  1153. if (!Timer1 || SD_SendCmd(CMD16, 512) != 0) type = 0;
  1154. 80009b8: 4b15 ldr r3, [pc, #84] ; (8000a10 <SD_disk_initialize+0x1c4>)
  1155. 80009ba: 881b ldrh r3, [r3, #0]
  1156. 80009bc: 2b00 cmp r3, #0
  1157. 80009be: d007 beq.n 80009d0 <SD_disk_initialize+0x184>
  1158. 80009c0: f44f 7100 mov.w r1, #512 ; 0x200
  1159. 80009c4: 2050 movs r0, #80 ; 0x50
  1160. 80009c6: f7ff feec bl 80007a2 <SD_SendCmd>
  1161. 80009ca: 4603 mov r3, r0
  1162. 80009cc: 2b00 cmp r3, #0
  1163. 80009ce: d001 beq.n 80009d4 <SD_disk_initialize+0x188>
  1164. 80009d0: 2300 movs r3, #0
  1165. 80009d2: 73bb strb r3, [r7, #14]
  1166. }
  1167. }
  1168. CardType = type;
  1169. 80009d4: 4a0f ldr r2, [pc, #60] ; (8000a14 <SD_disk_initialize+0x1c8>)
  1170. 80009d6: 7bbb ldrb r3, [r7, #14]
  1171. 80009d8: 7013 strb r3, [r2, #0]
  1172. /* Idle */
  1173. DESELECT();
  1174. 80009da: f7ff fd91 bl 8000500 <DESELECT>
  1175. SPI_RxByte();
  1176. 80009de: f7ff fdd1 bl 8000584 <SPI_RxByte>
  1177. /* Clear STA_NOINIT */
  1178. if (type)
  1179. 80009e2: 7bbb ldrb r3, [r7, #14]
  1180. 80009e4: 2b00 cmp r3, #0
  1181. 80009e6: d008 beq.n 80009fa <SD_disk_initialize+0x1ae>
  1182. {
  1183. Stat &= ~STA_NOINIT;
  1184. 80009e8: 4b08 ldr r3, [pc, #32] ; (8000a0c <SD_disk_initialize+0x1c0>)
  1185. 80009ea: 781b ldrb r3, [r3, #0]
  1186. 80009ec: b2db uxtb r3, r3
  1187. 80009ee: f023 0301 bic.w r3, r3, #1
  1188. 80009f2: b2da uxtb r2, r3
  1189. 80009f4: 4b05 ldr r3, [pc, #20] ; (8000a0c <SD_disk_initialize+0x1c0>)
  1190. 80009f6: 701a strb r2, [r3, #0]
  1191. 80009f8: e001 b.n 80009fe <SD_disk_initialize+0x1b2>
  1192. }
  1193. else
  1194. {
  1195. /* Initialization failed */
  1196. SD_PowerOff();
  1197. 80009fa: f7ff fe49 bl 8000690 <SD_PowerOff>
  1198. }
  1199. return Stat;
  1200. 80009fe: 4b03 ldr r3, [pc, #12] ; (8000a0c <SD_disk_initialize+0x1c0>)
  1201. 8000a00: 781b ldrb r3, [r3, #0]
  1202. 8000a02: b2db uxtb r3, r3
  1203. }
  1204. 8000a04: 4618 mov r0, r3
  1205. 8000a06: 3714 adds r7, #20
  1206. 8000a08: 46bd mov sp, r7
  1207. 8000a0a: bd90 pop {r4, r7, pc}
  1208. 8000a0c: 20000000 .word 0x20000000
  1209. 8000a10: 2000027a .word 0x2000027a
  1210. 8000a14: 20000040 .word 0x20000040
  1211. 08000a18 <SD_disk_status>:
  1212. /* return disk status */
  1213. DSTATUS SD_disk_status(BYTE drv)
  1214. {
  1215. 8000a18: b480 push {r7}
  1216. 8000a1a: b083 sub sp, #12
  1217. 8000a1c: af00 add r7, sp, #0
  1218. 8000a1e: 4603 mov r3, r0
  1219. 8000a20: 71fb strb r3, [r7, #7]
  1220. if (drv) return STA_NOINIT;
  1221. 8000a22: 79fb ldrb r3, [r7, #7]
  1222. 8000a24: 2b00 cmp r3, #0
  1223. 8000a26: d001 beq.n 8000a2c <SD_disk_status+0x14>
  1224. 8000a28: 2301 movs r3, #1
  1225. 8000a2a: e002 b.n 8000a32 <SD_disk_status+0x1a>
  1226. return Stat;
  1227. 8000a2c: 4b04 ldr r3, [pc, #16] ; (8000a40 <SD_disk_status+0x28>)
  1228. 8000a2e: 781b ldrb r3, [r3, #0]
  1229. 8000a30: b2db uxtb r3, r3
  1230. }
  1231. 8000a32: 4618 mov r0, r3
  1232. 8000a34: 370c adds r7, #12
  1233. 8000a36: 46bd mov sp, r7
  1234. 8000a38: f85d 7b04 ldr.w r7, [sp], #4
  1235. 8000a3c: 4770 bx lr
  1236. 8000a3e: bf00 nop
  1237. 8000a40: 20000000 .word 0x20000000
  1238. 08000a44 <SD_disk_read>:
  1239. /* read sector */
  1240. DRESULT SD_disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count)
  1241. {
  1242. 8000a44: b580 push {r7, lr}
  1243. 8000a46: b084 sub sp, #16
  1244. 8000a48: af00 add r7, sp, #0
  1245. 8000a4a: 60b9 str r1, [r7, #8]
  1246. 8000a4c: 607a str r2, [r7, #4]
  1247. 8000a4e: 603b str r3, [r7, #0]
  1248. 8000a50: 4603 mov r3, r0
  1249. 8000a52: 73fb strb r3, [r7, #15]
  1250. /* pdrv should be 0 */
  1251. if (pdrv || !count) return RES_PARERR;
  1252. 8000a54: 7bfb ldrb r3, [r7, #15]
  1253. 8000a56: 2b00 cmp r3, #0
  1254. 8000a58: d102 bne.n 8000a60 <SD_disk_read+0x1c>
  1255. 8000a5a: 683b ldr r3, [r7, #0]
  1256. 8000a5c: 2b00 cmp r3, #0
  1257. 8000a5e: d101 bne.n 8000a64 <SD_disk_read+0x20>
  1258. 8000a60: 2304 movs r3, #4
  1259. 8000a62: e051 b.n 8000b08 <SD_disk_read+0xc4>
  1260. /* no disk */
  1261. if (Stat & STA_NOINIT) return RES_NOTRDY;
  1262. 8000a64: 4b2a ldr r3, [pc, #168] ; (8000b10 <SD_disk_read+0xcc>)
  1263. 8000a66: 781b ldrb r3, [r3, #0]
  1264. 8000a68: b2db uxtb r3, r3
  1265. 8000a6a: f003 0301 and.w r3, r3, #1
  1266. 8000a6e: 2b00 cmp r3, #0
  1267. 8000a70: d001 beq.n 8000a76 <SD_disk_read+0x32>
  1268. 8000a72: 2303 movs r3, #3
  1269. 8000a74: e048 b.n 8000b08 <SD_disk_read+0xc4>
  1270. /* convert to byte address */
  1271. if (!(CardType & CT_SD2)) sector *= 512;
  1272. 8000a76: 4b27 ldr r3, [pc, #156] ; (8000b14 <SD_disk_read+0xd0>)
  1273. 8000a78: 781b ldrb r3, [r3, #0]
  1274. 8000a7a: f003 0304 and.w r3, r3, #4
  1275. 8000a7e: 2b00 cmp r3, #0
  1276. 8000a80: d102 bne.n 8000a88 <SD_disk_read+0x44>
  1277. 8000a82: 687b ldr r3, [r7, #4]
  1278. 8000a84: 025b lsls r3, r3, #9
  1279. 8000a86: 607b str r3, [r7, #4]
  1280. SELECT();
  1281. 8000a88: f7ff fd2c bl 80004e4 <SELECT>
  1282. if (count == 1)
  1283. 8000a8c: 683b ldr r3, [r7, #0]
  1284. 8000a8e: 2b01 cmp r3, #1
  1285. 8000a90: d111 bne.n 8000ab6 <SD_disk_read+0x72>
  1286. {
  1287. /* READ_SINGLE_BLOCK */
  1288. if ((SD_SendCmd(CMD17, sector) == 0) && SD_RxDataBlock(buff, 512)) count = 0;
  1289. 8000a92: 6879 ldr r1, [r7, #4]
  1290. 8000a94: 2051 movs r0, #81 ; 0x51
  1291. 8000a96: f7ff fe84 bl 80007a2 <SD_SendCmd>
  1292. 8000a9a: 4603 mov r3, r0
  1293. 8000a9c: 2b00 cmp r3, #0
  1294. 8000a9e: d129 bne.n 8000af4 <SD_disk_read+0xb0>
  1295. 8000aa0: f44f 7100 mov.w r1, #512 ; 0x200
  1296. 8000aa4: 68b8 ldr r0, [r7, #8]
  1297. 8000aa6: f7ff fe0b bl 80006c0 <SD_RxDataBlock>
  1298. 8000aaa: 4603 mov r3, r0
  1299. 8000aac: 2b00 cmp r3, #0
  1300. 8000aae: d021 beq.n 8000af4 <SD_disk_read+0xb0>
  1301. 8000ab0: 2300 movs r3, #0
  1302. 8000ab2: 603b str r3, [r7, #0]
  1303. 8000ab4: e01e b.n 8000af4 <SD_disk_read+0xb0>
  1304. }
  1305. else
  1306. {
  1307. /* READ_MULTIPLE_BLOCK */
  1308. if (SD_SendCmd(CMD18, sector) == 0)
  1309. 8000ab6: 6879 ldr r1, [r7, #4]
  1310. 8000ab8: 2052 movs r0, #82 ; 0x52
  1311. 8000aba: f7ff fe72 bl 80007a2 <SD_SendCmd>
  1312. 8000abe: 4603 mov r3, r0
  1313. 8000ac0: 2b00 cmp r3, #0
  1314. 8000ac2: d117 bne.n 8000af4 <SD_disk_read+0xb0>
  1315. {
  1316. do {
  1317. if (!SD_RxDataBlock(buff, 512)) break;
  1318. 8000ac4: f44f 7100 mov.w r1, #512 ; 0x200
  1319. 8000ac8: 68b8 ldr r0, [r7, #8]
  1320. 8000aca: f7ff fdf9 bl 80006c0 <SD_RxDataBlock>
  1321. 8000ace: 4603 mov r3, r0
  1322. 8000ad0: 2b00 cmp r3, #0
  1323. 8000ad2: d00a beq.n 8000aea <SD_disk_read+0xa6>
  1324. buff += 512;
  1325. 8000ad4: 68bb ldr r3, [r7, #8]
  1326. 8000ad6: f503 7300 add.w r3, r3, #512 ; 0x200
  1327. 8000ada: 60bb str r3, [r7, #8]
  1328. } while (--count);
  1329. 8000adc: 683b ldr r3, [r7, #0]
  1330. 8000ade: 3b01 subs r3, #1
  1331. 8000ae0: 603b str r3, [r7, #0]
  1332. 8000ae2: 683b ldr r3, [r7, #0]
  1333. 8000ae4: 2b00 cmp r3, #0
  1334. 8000ae6: d1ed bne.n 8000ac4 <SD_disk_read+0x80>
  1335. 8000ae8: e000 b.n 8000aec <SD_disk_read+0xa8>
  1336. if (!SD_RxDataBlock(buff, 512)) break;
  1337. 8000aea: bf00 nop
  1338. /* STOP_TRANSMISSION */
  1339. SD_SendCmd(CMD12, 0);
  1340. 8000aec: 2100 movs r1, #0
  1341. 8000aee: 204c movs r0, #76 ; 0x4c
  1342. 8000af0: f7ff fe57 bl 80007a2 <SD_SendCmd>
  1343. }
  1344. }
  1345. /* Idle */
  1346. DESELECT();
  1347. 8000af4: f7ff fd04 bl 8000500 <DESELECT>
  1348. SPI_RxByte();
  1349. 8000af8: f7ff fd44 bl 8000584 <SPI_RxByte>
  1350. return count ? RES_ERROR : RES_OK;
  1351. 8000afc: 683b ldr r3, [r7, #0]
  1352. 8000afe: 2b00 cmp r3, #0
  1353. 8000b00: bf14 ite ne
  1354. 8000b02: 2301 movne r3, #1
  1355. 8000b04: 2300 moveq r3, #0
  1356. 8000b06: b2db uxtb r3, r3
  1357. }
  1358. 8000b08: 4618 mov r0, r3
  1359. 8000b0a: 3710 adds r7, #16
  1360. 8000b0c: 46bd mov sp, r7
  1361. 8000b0e: bd80 pop {r7, pc}
  1362. 8000b10: 20000000 .word 0x20000000
  1363. 8000b14: 20000040 .word 0x20000040
  1364. 08000b18 <SD_disk_write>:
  1365. /* write sector */
  1366. #if _USE_WRITE == 1
  1367. DRESULT SD_disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count)
  1368. {
  1369. 8000b18: b580 push {r7, lr}
  1370. 8000b1a: b084 sub sp, #16
  1371. 8000b1c: af00 add r7, sp, #0
  1372. 8000b1e: 60b9 str r1, [r7, #8]
  1373. 8000b20: 607a str r2, [r7, #4]
  1374. 8000b22: 603b str r3, [r7, #0]
  1375. 8000b24: 4603 mov r3, r0
  1376. 8000b26: 73fb strb r3, [r7, #15]
  1377. /* pdrv should be 0 */
  1378. if (pdrv || !count) return RES_PARERR;
  1379. 8000b28: 7bfb ldrb r3, [r7, #15]
  1380. 8000b2a: 2b00 cmp r3, #0
  1381. 8000b2c: d102 bne.n 8000b34 <SD_disk_write+0x1c>
  1382. 8000b2e: 683b ldr r3, [r7, #0]
  1383. 8000b30: 2b00 cmp r3, #0
  1384. 8000b32: d101 bne.n 8000b38 <SD_disk_write+0x20>
  1385. 8000b34: 2304 movs r3, #4
  1386. 8000b36: e06b b.n 8000c10 <SD_disk_write+0xf8>
  1387. /* no disk */
  1388. if (Stat & STA_NOINIT) return RES_NOTRDY;
  1389. 8000b38: 4b37 ldr r3, [pc, #220] ; (8000c18 <SD_disk_write+0x100>)
  1390. 8000b3a: 781b ldrb r3, [r3, #0]
  1391. 8000b3c: b2db uxtb r3, r3
  1392. 8000b3e: f003 0301 and.w r3, r3, #1
  1393. 8000b42: 2b00 cmp r3, #0
  1394. 8000b44: d001 beq.n 8000b4a <SD_disk_write+0x32>
  1395. 8000b46: 2303 movs r3, #3
  1396. 8000b48: e062 b.n 8000c10 <SD_disk_write+0xf8>
  1397. /* write protection */
  1398. if (Stat & STA_PROTECT) return RES_WRPRT;
  1399. 8000b4a: 4b33 ldr r3, [pc, #204] ; (8000c18 <SD_disk_write+0x100>)
  1400. 8000b4c: 781b ldrb r3, [r3, #0]
  1401. 8000b4e: b2db uxtb r3, r3
  1402. 8000b50: f003 0304 and.w r3, r3, #4
  1403. 8000b54: 2b00 cmp r3, #0
  1404. 8000b56: d001 beq.n 8000b5c <SD_disk_write+0x44>
  1405. 8000b58: 2302 movs r3, #2
  1406. 8000b5a: e059 b.n 8000c10 <SD_disk_write+0xf8>
  1407. /* convert to byte address */
  1408. if (!(CardType & CT_SD2)) sector *= 512;
  1409. 8000b5c: 4b2f ldr r3, [pc, #188] ; (8000c1c <SD_disk_write+0x104>)
  1410. 8000b5e: 781b ldrb r3, [r3, #0]
  1411. 8000b60: f003 0304 and.w r3, r3, #4
  1412. 8000b64: 2b00 cmp r3, #0
  1413. 8000b66: d102 bne.n 8000b6e <SD_disk_write+0x56>
  1414. 8000b68: 687b ldr r3, [r7, #4]
  1415. 8000b6a: 025b lsls r3, r3, #9
  1416. 8000b6c: 607b str r3, [r7, #4]
  1417. SELECT();
  1418. 8000b6e: f7ff fcb9 bl 80004e4 <SELECT>
  1419. if (count == 1)
  1420. 8000b72: 683b ldr r3, [r7, #0]
  1421. 8000b74: 2b01 cmp r3, #1
  1422. 8000b76: d110 bne.n 8000b9a <SD_disk_write+0x82>
  1423. {
  1424. /* WRITE_BLOCK */
  1425. if ((SD_SendCmd(CMD24, sector) == 0) && SD_TxDataBlock(buff, 0xFE))
  1426. 8000b78: 6879 ldr r1, [r7, #4]
  1427. 8000b7a: 2058 movs r0, #88 ; 0x58
  1428. 8000b7c: f7ff fe11 bl 80007a2 <SD_SendCmd>
  1429. 8000b80: 4603 mov r3, r0
  1430. 8000b82: 2b00 cmp r3, #0
  1431. 8000b84: d13a bne.n 8000bfc <SD_disk_write+0xe4>
  1432. 8000b86: 21fe movs r1, #254 ; 0xfe
  1433. 8000b88: 68b8 ldr r0, [r7, #8]
  1434. 8000b8a: f7ff fdc7 bl 800071c <SD_TxDataBlock>
  1435. 8000b8e: 4603 mov r3, r0
  1436. 8000b90: 2b00 cmp r3, #0
  1437. 8000b92: d033 beq.n 8000bfc <SD_disk_write+0xe4>
  1438. count = 0;
  1439. 8000b94: 2300 movs r3, #0
  1440. 8000b96: 603b str r3, [r7, #0]
  1441. 8000b98: e030 b.n 8000bfc <SD_disk_write+0xe4>
  1442. }
  1443. else
  1444. {
  1445. /* WRITE_MULTIPLE_BLOCK */
  1446. if (CardType & CT_SD1)
  1447. 8000b9a: 4b20 ldr r3, [pc, #128] ; (8000c1c <SD_disk_write+0x104>)
  1448. 8000b9c: 781b ldrb r3, [r3, #0]
  1449. 8000b9e: f003 0302 and.w r3, r3, #2
  1450. 8000ba2: 2b00 cmp r3, #0
  1451. 8000ba4: d007 beq.n 8000bb6 <SD_disk_write+0x9e>
  1452. {
  1453. SD_SendCmd(CMD55, 0);
  1454. 8000ba6: 2100 movs r1, #0
  1455. 8000ba8: 2077 movs r0, #119 ; 0x77
  1456. 8000baa: f7ff fdfa bl 80007a2 <SD_SendCmd>
  1457. SD_SendCmd(CMD23, count); /* ACMD23 */
  1458. 8000bae: 6839 ldr r1, [r7, #0]
  1459. 8000bb0: 2057 movs r0, #87 ; 0x57
  1460. 8000bb2: f7ff fdf6 bl 80007a2 <SD_SendCmd>
  1461. }
  1462. if (SD_SendCmd(CMD25, sector) == 0)
  1463. 8000bb6: 6879 ldr r1, [r7, #4]
  1464. 8000bb8: 2059 movs r0, #89 ; 0x59
  1465. 8000bba: f7ff fdf2 bl 80007a2 <SD_SendCmd>
  1466. 8000bbe: 4603 mov r3, r0
  1467. 8000bc0: 2b00 cmp r3, #0
  1468. 8000bc2: d11b bne.n 8000bfc <SD_disk_write+0xe4>
  1469. {
  1470. do {
  1471. if(!SD_TxDataBlock(buff, 0xFC)) break;
  1472. 8000bc4: 21fc movs r1, #252 ; 0xfc
  1473. 8000bc6: 68b8 ldr r0, [r7, #8]
  1474. 8000bc8: f7ff fda8 bl 800071c <SD_TxDataBlock>
  1475. 8000bcc: 4603 mov r3, r0
  1476. 8000bce: 2b00 cmp r3, #0
  1477. 8000bd0: d00a beq.n 8000be8 <SD_disk_write+0xd0>
  1478. buff += 512;
  1479. 8000bd2: 68bb ldr r3, [r7, #8]
  1480. 8000bd4: f503 7300 add.w r3, r3, #512 ; 0x200
  1481. 8000bd8: 60bb str r3, [r7, #8]
  1482. } while (--count);
  1483. 8000bda: 683b ldr r3, [r7, #0]
  1484. 8000bdc: 3b01 subs r3, #1
  1485. 8000bde: 603b str r3, [r7, #0]
  1486. 8000be0: 683b ldr r3, [r7, #0]
  1487. 8000be2: 2b00 cmp r3, #0
  1488. 8000be4: d1ee bne.n 8000bc4 <SD_disk_write+0xac>
  1489. 8000be6: e000 b.n 8000bea <SD_disk_write+0xd2>
  1490. if(!SD_TxDataBlock(buff, 0xFC)) break;
  1491. 8000be8: bf00 nop
  1492. /* STOP_TRAN token */
  1493. if(!SD_TxDataBlock(0, 0xFD))
  1494. 8000bea: 21fd movs r1, #253 ; 0xfd
  1495. 8000bec: 2000 movs r0, #0
  1496. 8000bee: f7ff fd95 bl 800071c <SD_TxDataBlock>
  1497. 8000bf2: 4603 mov r3, r0
  1498. 8000bf4: 2b00 cmp r3, #0
  1499. 8000bf6: d101 bne.n 8000bfc <SD_disk_write+0xe4>
  1500. {
  1501. count = 1;
  1502. 8000bf8: 2301 movs r3, #1
  1503. 8000bfa: 603b str r3, [r7, #0]
  1504. }
  1505. }
  1506. }
  1507. /* Idle */
  1508. DESELECT();
  1509. 8000bfc: f7ff fc80 bl 8000500 <DESELECT>
  1510. SPI_RxByte();
  1511. 8000c00: f7ff fcc0 bl 8000584 <SPI_RxByte>
  1512. return count ? RES_ERROR : RES_OK;
  1513. 8000c04: 683b ldr r3, [r7, #0]
  1514. 8000c06: 2b00 cmp r3, #0
  1515. 8000c08: bf14 ite ne
  1516. 8000c0a: 2301 movne r3, #1
  1517. 8000c0c: 2300 moveq r3, #0
  1518. 8000c0e: b2db uxtb r3, r3
  1519. }
  1520. 8000c10: 4618 mov r0, r3
  1521. 8000c12: 3710 adds r7, #16
  1522. 8000c14: 46bd mov sp, r7
  1523. 8000c16: bd80 pop {r7, pc}
  1524. 8000c18: 20000000 .word 0x20000000
  1525. 8000c1c: 20000040 .word 0x20000040
  1526. 08000c20 <SD_disk_ioctl>:
  1527. #endif /* _USE_WRITE */
  1528. /* ioctl */
  1529. DRESULT SD_disk_ioctl(BYTE drv, BYTE ctrl, void *buff)
  1530. {
  1531. 8000c20: b590 push {r4, r7, lr}
  1532. 8000c22: b08b sub sp, #44 ; 0x2c
  1533. 8000c24: af00 add r7, sp, #0
  1534. 8000c26: 4603 mov r3, r0
  1535. 8000c28: 603a str r2, [r7, #0]
  1536. 8000c2a: 71fb strb r3, [r7, #7]
  1537. 8000c2c: 460b mov r3, r1
  1538. 8000c2e: 71bb strb r3, [r7, #6]
  1539. DRESULT res;
  1540. uint8_t n, csd[16], *ptr = buff;
  1541. 8000c30: 683b ldr r3, [r7, #0]
  1542. 8000c32: 623b str r3, [r7, #32]
  1543. WORD csize;
  1544. /* pdrv should be 0 */
  1545. if (drv) return RES_PARERR;
  1546. 8000c34: 79fb ldrb r3, [r7, #7]
  1547. 8000c36: 2b00 cmp r3, #0
  1548. 8000c38: d001 beq.n 8000c3e <SD_disk_ioctl+0x1e>
  1549. 8000c3a: 2304 movs r3, #4
  1550. 8000c3c: e113 b.n 8000e66 <SD_disk_ioctl+0x246>
  1551. res = RES_ERROR;
  1552. 8000c3e: 2301 movs r3, #1
  1553. 8000c40: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1554. if (ctrl == CTRL_POWER)
  1555. 8000c44: 79bb ldrb r3, [r7, #6]
  1556. 8000c46: 2b05 cmp r3, #5
  1557. 8000c48: d121 bne.n 8000c8e <SD_disk_ioctl+0x6e>
  1558. {
  1559. switch (*ptr)
  1560. 8000c4a: 6a3b ldr r3, [r7, #32]
  1561. 8000c4c: 781b ldrb r3, [r3, #0]
  1562. 8000c4e: 2b01 cmp r3, #1
  1563. 8000c50: d009 beq.n 8000c66 <SD_disk_ioctl+0x46>
  1564. 8000c52: 2b02 cmp r3, #2
  1565. 8000c54: d00d beq.n 8000c72 <SD_disk_ioctl+0x52>
  1566. 8000c56: 2b00 cmp r3, #0
  1567. 8000c58: d115 bne.n 8000c86 <SD_disk_ioctl+0x66>
  1568. {
  1569. case 0:
  1570. SD_PowerOff(); /* Power Off */
  1571. 8000c5a: f7ff fd19 bl 8000690 <SD_PowerOff>
  1572. res = RES_OK;
  1573. 8000c5e: 2300 movs r3, #0
  1574. 8000c60: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1575. break;
  1576. 8000c64: e0fd b.n 8000e62 <SD_disk_ioctl+0x242>
  1577. case 1:
  1578. SD_PowerOn(); /* Power On */
  1579. 8000c66: f7ff fcd1 bl 800060c <SD_PowerOn>
  1580. res = RES_OK;
  1581. 8000c6a: 2300 movs r3, #0
  1582. 8000c6c: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1583. break;
  1584. 8000c70: e0f7 b.n 8000e62 <SD_disk_ioctl+0x242>
  1585. case 2:
  1586. *(ptr + 1) = SD_CheckPower();
  1587. 8000c72: 6a3b ldr r3, [r7, #32]
  1588. 8000c74: 1c5c adds r4, r3, #1
  1589. 8000c76: f7ff fd17 bl 80006a8 <SD_CheckPower>
  1590. 8000c7a: 4603 mov r3, r0
  1591. 8000c7c: 7023 strb r3, [r4, #0]
  1592. res = RES_OK; /* Power Check */
  1593. 8000c7e: 2300 movs r3, #0
  1594. 8000c80: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1595. break;
  1596. 8000c84: e0ed b.n 8000e62 <SD_disk_ioctl+0x242>
  1597. default:
  1598. res = RES_PARERR;
  1599. 8000c86: 2304 movs r3, #4
  1600. 8000c88: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1601. 8000c8c: e0e9 b.n 8000e62 <SD_disk_ioctl+0x242>
  1602. }
  1603. }
  1604. else
  1605. {
  1606. /* no disk */
  1607. if (Stat & STA_NOINIT) return RES_NOTRDY;
  1608. 8000c8e: 4b78 ldr r3, [pc, #480] ; (8000e70 <SD_disk_ioctl+0x250>)
  1609. 8000c90: 781b ldrb r3, [r3, #0]
  1610. 8000c92: b2db uxtb r3, r3
  1611. 8000c94: f003 0301 and.w r3, r3, #1
  1612. 8000c98: 2b00 cmp r3, #0
  1613. 8000c9a: d001 beq.n 8000ca0 <SD_disk_ioctl+0x80>
  1614. 8000c9c: 2303 movs r3, #3
  1615. 8000c9e: e0e2 b.n 8000e66 <SD_disk_ioctl+0x246>
  1616. SELECT();
  1617. 8000ca0: f7ff fc20 bl 80004e4 <SELECT>
  1618. switch (ctrl)
  1619. 8000ca4: 79bb ldrb r3, [r7, #6]
  1620. 8000ca6: 2b0d cmp r3, #13
  1621. 8000ca8: f200 80cc bhi.w 8000e44 <SD_disk_ioctl+0x224>
  1622. 8000cac: a201 add r2, pc, #4 ; (adr r2, 8000cb4 <SD_disk_ioctl+0x94>)
  1623. 8000cae: f852 f023 ldr.w pc, [r2, r3, lsl #2]
  1624. 8000cb2: bf00 nop
  1625. 8000cb4: 08000daf .word 0x08000daf
  1626. 8000cb8: 08000ced .word 0x08000ced
  1627. 8000cbc: 08000d9f .word 0x08000d9f
  1628. 8000cc0: 08000e45 .word 0x08000e45
  1629. 8000cc4: 08000e45 .word 0x08000e45
  1630. 8000cc8: 08000e45 .word 0x08000e45
  1631. 8000ccc: 08000e45 .word 0x08000e45
  1632. 8000cd0: 08000e45 .word 0x08000e45
  1633. 8000cd4: 08000e45 .word 0x08000e45
  1634. 8000cd8: 08000e45 .word 0x08000e45
  1635. 8000cdc: 08000e45 .word 0x08000e45
  1636. 8000ce0: 08000dc1 .word 0x08000dc1
  1637. 8000ce4: 08000de5 .word 0x08000de5
  1638. 8000ce8: 08000e09 .word 0x08000e09
  1639. {
  1640. case GET_SECTOR_COUNT:
  1641. /* SEND_CSD */
  1642. if ((SD_SendCmd(CMD9, 0) == 0) && SD_RxDataBlock(csd, 16))
  1643. 8000cec: 2100 movs r1, #0
  1644. 8000cee: 2049 movs r0, #73 ; 0x49
  1645. 8000cf0: f7ff fd57 bl 80007a2 <SD_SendCmd>
  1646. 8000cf4: 4603 mov r3, r0
  1647. 8000cf6: 2b00 cmp r3, #0
  1648. 8000cf8: f040 80a8 bne.w 8000e4c <SD_disk_ioctl+0x22c>
  1649. 8000cfc: f107 030c add.w r3, r7, #12
  1650. 8000d00: 2110 movs r1, #16
  1651. 8000d02: 4618 mov r0, r3
  1652. 8000d04: f7ff fcdc bl 80006c0 <SD_RxDataBlock>
  1653. 8000d08: 4603 mov r3, r0
  1654. 8000d0a: 2b00 cmp r3, #0
  1655. 8000d0c: f000 809e beq.w 8000e4c <SD_disk_ioctl+0x22c>
  1656. {
  1657. if ((csd[0] >> 6) == 1)
  1658. 8000d10: 7b3b ldrb r3, [r7, #12]
  1659. 8000d12: 099b lsrs r3, r3, #6
  1660. 8000d14: b2db uxtb r3, r3
  1661. 8000d16: 2b01 cmp r3, #1
  1662. 8000d18: d10e bne.n 8000d38 <SD_disk_ioctl+0x118>
  1663. {
  1664. /* SDC V2 */
  1665. csize = csd[9] + ((WORD) csd[8] << 8) + 1;
  1666. 8000d1a: 7d7b ldrb r3, [r7, #21]
  1667. 8000d1c: b29a uxth r2, r3
  1668. 8000d1e: 7d3b ldrb r3, [r7, #20]
  1669. 8000d20: b29b uxth r3, r3
  1670. 8000d22: 021b lsls r3, r3, #8
  1671. 8000d24: b29b uxth r3, r3
  1672. 8000d26: 4413 add r3, r2
  1673. 8000d28: b29b uxth r3, r3
  1674. 8000d2a: 3301 adds r3, #1
  1675. 8000d2c: 83fb strh r3, [r7, #30]
  1676. *(DWORD*) buff = (DWORD) csize << 10;
  1677. 8000d2e: 8bfb ldrh r3, [r7, #30]
  1678. 8000d30: 029a lsls r2, r3, #10
  1679. 8000d32: 683b ldr r3, [r7, #0]
  1680. 8000d34: 601a str r2, [r3, #0]
  1681. 8000d36: e02e b.n 8000d96 <SD_disk_ioctl+0x176>
  1682. }
  1683. else
  1684. {
  1685. /* MMC or SDC V1 */
  1686. n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2;
  1687. 8000d38: 7c7b ldrb r3, [r7, #17]
  1688. 8000d3a: f003 030f and.w r3, r3, #15
  1689. 8000d3e: b2da uxtb r2, r3
  1690. 8000d40: 7dbb ldrb r3, [r7, #22]
  1691. 8000d42: 09db lsrs r3, r3, #7
  1692. 8000d44: b2db uxtb r3, r3
  1693. 8000d46: 4413 add r3, r2
  1694. 8000d48: b2da uxtb r2, r3
  1695. 8000d4a: 7d7b ldrb r3, [r7, #21]
  1696. 8000d4c: 005b lsls r3, r3, #1
  1697. 8000d4e: b2db uxtb r3, r3
  1698. 8000d50: f003 0306 and.w r3, r3, #6
  1699. 8000d54: b2db uxtb r3, r3
  1700. 8000d56: 4413 add r3, r2
  1701. 8000d58: b2db uxtb r3, r3
  1702. 8000d5a: 3302 adds r3, #2
  1703. 8000d5c: f887 3026 strb.w r3, [r7, #38] ; 0x26
  1704. csize = (csd[8] >> 6) + ((WORD) csd[7] << 2) + ((WORD) (csd[6] & 3) << 10) + 1;
  1705. 8000d60: 7d3b ldrb r3, [r7, #20]
  1706. 8000d62: 099b lsrs r3, r3, #6
  1707. 8000d64: b2db uxtb r3, r3
  1708. 8000d66: b29a uxth r2, r3
  1709. 8000d68: 7cfb ldrb r3, [r7, #19]
  1710. 8000d6a: b29b uxth r3, r3
  1711. 8000d6c: 009b lsls r3, r3, #2
  1712. 8000d6e: b29b uxth r3, r3
  1713. 8000d70: 4413 add r3, r2
  1714. 8000d72: b29a uxth r2, r3
  1715. 8000d74: 7cbb ldrb r3, [r7, #18]
  1716. 8000d76: 029b lsls r3, r3, #10
  1717. 8000d78: b29b uxth r3, r3
  1718. 8000d7a: f403 6340 and.w r3, r3, #3072 ; 0xc00
  1719. 8000d7e: b29b uxth r3, r3
  1720. 8000d80: 4413 add r3, r2
  1721. 8000d82: b29b uxth r3, r3
  1722. 8000d84: 3301 adds r3, #1
  1723. 8000d86: 83fb strh r3, [r7, #30]
  1724. *(DWORD*) buff = (DWORD) csize << (n - 9);
  1725. 8000d88: 8bfa ldrh r2, [r7, #30]
  1726. 8000d8a: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  1727. 8000d8e: 3b09 subs r3, #9
  1728. 8000d90: 409a lsls r2, r3
  1729. 8000d92: 683b ldr r3, [r7, #0]
  1730. 8000d94: 601a str r2, [r3, #0]
  1731. }
  1732. res = RES_OK;
  1733. 8000d96: 2300 movs r3, #0
  1734. 8000d98: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1735. }
  1736. break;
  1737. 8000d9c: e056 b.n 8000e4c <SD_disk_ioctl+0x22c>
  1738. case GET_SECTOR_SIZE:
  1739. *(WORD*) buff = 512;
  1740. 8000d9e: 683b ldr r3, [r7, #0]
  1741. 8000da0: f44f 7200 mov.w r2, #512 ; 0x200
  1742. 8000da4: 801a strh r2, [r3, #0]
  1743. res = RES_OK;
  1744. 8000da6: 2300 movs r3, #0
  1745. 8000da8: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1746. break;
  1747. 8000dac: e055 b.n 8000e5a <SD_disk_ioctl+0x23a>
  1748. case CTRL_SYNC:
  1749. if (SD_ReadyWait() == 0xFF) res = RES_OK;
  1750. 8000dae: f7ff fc13 bl 80005d8 <SD_ReadyWait>
  1751. 8000db2: 4603 mov r3, r0
  1752. 8000db4: 2bff cmp r3, #255 ; 0xff
  1753. 8000db6: d14b bne.n 8000e50 <SD_disk_ioctl+0x230>
  1754. 8000db8: 2300 movs r3, #0
  1755. 8000dba: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1756. break;
  1757. 8000dbe: e047 b.n 8000e50 <SD_disk_ioctl+0x230>
  1758. case MMC_GET_CSD:
  1759. /* SEND_CSD */
  1760. if (SD_SendCmd(CMD9, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK;
  1761. 8000dc0: 2100 movs r1, #0
  1762. 8000dc2: 2049 movs r0, #73 ; 0x49
  1763. 8000dc4: f7ff fced bl 80007a2 <SD_SendCmd>
  1764. 8000dc8: 4603 mov r3, r0
  1765. 8000dca: 2b00 cmp r3, #0
  1766. 8000dcc: d142 bne.n 8000e54 <SD_disk_ioctl+0x234>
  1767. 8000dce: 2110 movs r1, #16
  1768. 8000dd0: 6a38 ldr r0, [r7, #32]
  1769. 8000dd2: f7ff fc75 bl 80006c0 <SD_RxDataBlock>
  1770. 8000dd6: 4603 mov r3, r0
  1771. 8000dd8: 2b00 cmp r3, #0
  1772. 8000dda: d03b beq.n 8000e54 <SD_disk_ioctl+0x234>
  1773. 8000ddc: 2300 movs r3, #0
  1774. 8000dde: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1775. break;
  1776. 8000de2: e037 b.n 8000e54 <SD_disk_ioctl+0x234>
  1777. case MMC_GET_CID:
  1778. /* SEND_CID */
  1779. if (SD_SendCmd(CMD10, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK;
  1780. 8000de4: 2100 movs r1, #0
  1781. 8000de6: 204a movs r0, #74 ; 0x4a
  1782. 8000de8: f7ff fcdb bl 80007a2 <SD_SendCmd>
  1783. 8000dec: 4603 mov r3, r0
  1784. 8000dee: 2b00 cmp r3, #0
  1785. 8000df0: d132 bne.n 8000e58 <SD_disk_ioctl+0x238>
  1786. 8000df2: 2110 movs r1, #16
  1787. 8000df4: 6a38 ldr r0, [r7, #32]
  1788. 8000df6: f7ff fc63 bl 80006c0 <SD_RxDataBlock>
  1789. 8000dfa: 4603 mov r3, r0
  1790. 8000dfc: 2b00 cmp r3, #0
  1791. 8000dfe: d02b beq.n 8000e58 <SD_disk_ioctl+0x238>
  1792. 8000e00: 2300 movs r3, #0
  1793. 8000e02: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1794. break;
  1795. 8000e06: e027 b.n 8000e58 <SD_disk_ioctl+0x238>
  1796. case MMC_GET_OCR:
  1797. /* READ_OCR */
  1798. if (SD_SendCmd(CMD58, 0) == 0)
  1799. 8000e08: 2100 movs r1, #0
  1800. 8000e0a: 207a movs r0, #122 ; 0x7a
  1801. 8000e0c: f7ff fcc9 bl 80007a2 <SD_SendCmd>
  1802. 8000e10: 4603 mov r3, r0
  1803. 8000e12: 2b00 cmp r3, #0
  1804. 8000e14: d116 bne.n 8000e44 <SD_disk_ioctl+0x224>
  1805. {
  1806. for (n = 0; n < 4; n++)
  1807. 8000e16: 2300 movs r3, #0
  1808. 8000e18: f887 3026 strb.w r3, [r7, #38] ; 0x26
  1809. 8000e1c: e00b b.n 8000e36 <SD_disk_ioctl+0x216>
  1810. {
  1811. *ptr++ = SPI_RxByte();
  1812. 8000e1e: 6a3c ldr r4, [r7, #32]
  1813. 8000e20: 1c63 adds r3, r4, #1
  1814. 8000e22: 623b str r3, [r7, #32]
  1815. 8000e24: f7ff fbae bl 8000584 <SPI_RxByte>
  1816. 8000e28: 4603 mov r3, r0
  1817. 8000e2a: 7023 strb r3, [r4, #0]
  1818. for (n = 0; n < 4; n++)
  1819. 8000e2c: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  1820. 8000e30: 3301 adds r3, #1
  1821. 8000e32: f887 3026 strb.w r3, [r7, #38] ; 0x26
  1822. 8000e36: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  1823. 8000e3a: 2b03 cmp r3, #3
  1824. 8000e3c: d9ef bls.n 8000e1e <SD_disk_ioctl+0x1fe>
  1825. }
  1826. res = RES_OK;
  1827. 8000e3e: 2300 movs r3, #0
  1828. 8000e40: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1829. }
  1830. default:
  1831. res = RES_PARERR;
  1832. 8000e44: 2304 movs r3, #4
  1833. 8000e46: f887 3027 strb.w r3, [r7, #39] ; 0x27
  1834. 8000e4a: e006 b.n 8000e5a <SD_disk_ioctl+0x23a>
  1835. break;
  1836. 8000e4c: bf00 nop
  1837. 8000e4e: e004 b.n 8000e5a <SD_disk_ioctl+0x23a>
  1838. break;
  1839. 8000e50: bf00 nop
  1840. 8000e52: e002 b.n 8000e5a <SD_disk_ioctl+0x23a>
  1841. break;
  1842. 8000e54: bf00 nop
  1843. 8000e56: e000 b.n 8000e5a <SD_disk_ioctl+0x23a>
  1844. break;
  1845. 8000e58: bf00 nop
  1846. }
  1847. DESELECT();
  1848. 8000e5a: f7ff fb51 bl 8000500 <DESELECT>
  1849. SPI_RxByte();
  1850. 8000e5e: f7ff fb91 bl 8000584 <SPI_RxByte>
  1851. }
  1852. return res;
  1853. 8000e62: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  1854. }
  1855. 8000e66: 4618 mov r0, r3
  1856. 8000e68: 372c adds r7, #44 ; 0x2c
  1857. 8000e6a: 46bd mov sp, r7
  1858. 8000e6c: bd90 pop {r4, r7, pc}
  1859. 8000e6e: bf00 nop
  1860. 8000e70: 20000000 .word 0x20000000
  1861. 08000e74 <transmit_uart>:
  1862. /* USER CODE END PFP */
  1863. /* Private user code ---------------------------------------------------------*/
  1864. /* USER CODE BEGIN 0 */
  1865. // sending to UART
  1866. void transmit_uart(char *string){
  1867. 8000e74: b580 push {r7, lr}
  1868. 8000e76: b084 sub sp, #16
  1869. 8000e78: af00 add r7, sp, #0
  1870. 8000e7a: 6078 str r0, [r7, #4]
  1871. uint8_t len = strlen(string);
  1872. 8000e7c: 6878 ldr r0, [r7, #4]
  1873. 8000e7e: f7ff f9a9 bl 80001d4 <strlen>
  1874. 8000e82: 4603 mov r3, r0
  1875. 8000e84: 73fb strb r3, [r7, #15]
  1876. HAL_UART_Transmit(&huart2, (uint8_t*) string, len, 200);
  1877. 8000e86: 7bfb ldrb r3, [r7, #15]
  1878. 8000e88: b29a uxth r2, r3
  1879. 8000e8a: 23c8 movs r3, #200 ; 0xc8
  1880. 8000e8c: 6879 ldr r1, [r7, #4]
  1881. 8000e8e: 4803 ldr r0, [pc, #12] ; (8000e9c <transmit_uart+0x28>)
  1882. 8000e90: f002 fbfd bl 800368e <HAL_UART_Transmit>
  1883. }
  1884. 8000e94: bf00 nop
  1885. 8000e96: 3710 adds r7, #16
  1886. 8000e98: 46bd mov sp, r7
  1887. 8000e9a: bd80 pop {r7, pc}
  1888. 8000e9c: 200013cc .word 0x200013cc
  1889. 08000ea0 <main>:
  1890. /**
  1891. * @brief The application entry point.
  1892. * @retval int
  1893. */
  1894. int main(void)
  1895. {
  1896. 8000ea0: b580 push {r7, lr}
  1897. 8000ea2: af00 add r7, sp, #0
  1898. /* USER CODE END 1 */
  1899. /* MCU Configuration--------------------------------------------------------*/
  1900. /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  1901. HAL_Init();
  1902. 8000ea4: f000 fba8 bl 80015f8 <HAL_Init>
  1903. /* USER CODE BEGIN Init */
  1904. /* USER CODE END Init */
  1905. /* Configure the system clock */
  1906. SystemClock_Config();
  1907. 8000ea8: f000 f856 bl 8000f58 <SystemClock_Config>
  1908. /* USER CODE BEGIN SysInit */
  1909. /* USER CODE END SysInit */
  1910. /* Initialize all configured peripherals */
  1911. MX_GPIO_Init();
  1912. 8000eac: f000 f972 bl 8001194 <MX_GPIO_Init>
  1913. MX_USART2_UART_Init();
  1914. 8000eb0: f000 f946 bl 8001140 <MX_USART2_UART_Init>
  1915. MX_SPI1_Init();
  1916. 8000eb4: f000 f90e bl 80010d4 <MX_SPI1_Init>
  1917. MX_FATFS_Init();
  1918. 8000eb8: f003 f848 bl 8003f4c <MX_FATFS_Init>
  1919. MX_ADC1_Init();
  1920. 8000ebc: f000 f8b8 bl 8001030 <MX_ADC1_Init>
  1921. /* USER CODE BEGIN 2 */
  1922. /* Waiting for the Micro SD module to initialize */
  1923. HAL_Delay(500);
  1924. 8000ec0: f44f 70fa mov.w r0, #500 ; 0x1f4
  1925. 8000ec4: f000 fc0a bl 80016dc <HAL_Delay>
  1926. fres = f_mount(&fs, "", 0);
  1927. 8000ec8: 2200 movs r2, #0
  1928. 8000eca: 4919 ldr r1, [pc, #100] ; (8000f30 <main+0x90>)
  1929. 8000ecc: 4819 ldr r0, [pc, #100] ; (8000f34 <main+0x94>)
  1930. 8000ece: f005 fa7f bl 80063d0 <f_mount>
  1931. 8000ed2: 4603 mov r3, r0
  1932. 8000ed4: 461a mov r2, r3
  1933. 8000ed6: 4b18 ldr r3, [pc, #96] ; (8000f38 <main+0x98>)
  1934. 8000ed8: 701a strb r2, [r3, #0]
  1935. if (fres == FR_OK) {
  1936. 8000eda: 4b17 ldr r3, [pc, #92] ; (8000f38 <main+0x98>)
  1937. 8000edc: 781b ldrb r3, [r3, #0]
  1938. 8000ede: 2b00 cmp r3, #0
  1939. 8000ee0: d103 bne.n 8000eea <main+0x4a>
  1940. transmit_uart("SD card is mounted successfully!\r\n");
  1941. 8000ee2: 4816 ldr r0, [pc, #88] ; (8000f3c <main+0x9c>)
  1942. 8000ee4: f7ff ffc6 bl 8000e74 <transmit_uart>
  1943. 8000ee8: e006 b.n 8000ef8 <main+0x58>
  1944. } else if (fres != FR_OK) {
  1945. 8000eea: 4b13 ldr r3, [pc, #76] ; (8000f38 <main+0x98>)
  1946. 8000eec: 781b ldrb r3, [r3, #0]
  1947. 8000eee: 2b00 cmp r3, #0
  1948. 8000ef0: d002 beq.n 8000ef8 <main+0x58>
  1949. transmit_uart("SD card is not mounted!\r\n");
  1950. 8000ef2: 4813 ldr r0, [pc, #76] ; (8000f40 <main+0xa0>)
  1951. 8000ef4: f7ff ffbe bl 8000e74 <transmit_uart>
  1952. }
  1953. // FA_OPEN_APPEND opens file if it exists and if not then creates it,
  1954. // the pointer is set at the end of the file for appending
  1955. fres = f_open(&fil, "log-file_test.txt", FA_OPEN_APPEND | FA_WRITE | FA_READ);
  1956. 8000ef8: 2233 movs r2, #51 ; 0x33
  1957. 8000efa: 4912 ldr r1, [pc, #72] ; (8000f44 <main+0xa4>)
  1958. 8000efc: 4812 ldr r0, [pc, #72] ; (8000f48 <main+0xa8>)
  1959. 8000efe: f005 faad bl 800645c <f_open>
  1960. 8000f02: 4603 mov r3, r0
  1961. 8000f04: 461a mov r2, r3
  1962. 8000f06: 4b0c ldr r3, [pc, #48] ; (8000f38 <main+0x98>)
  1963. 8000f08: 701a strb r2, [r3, #0]
  1964. if (fres == FR_OK) {
  1965. 8000f0a: 4b0b ldr r3, [pc, #44] ; (8000f38 <main+0x98>)
  1966. 8000f0c: 781b ldrb r3, [r3, #0]
  1967. 8000f0e: 2b00 cmp r3, #0
  1968. 8000f10: d103 bne.n 8000f1a <main+0x7a>
  1969. transmit_uart("File opened.\r\n");
  1970. 8000f12: 480e ldr r0, [pc, #56] ; (8000f4c <main+0xac>)
  1971. 8000f14: f7ff ffae bl 8000e74 <transmit_uart>
  1972. 8000f18: e006 b.n 8000f28 <main+0x88>
  1973. } else if (fres != FR_OK) {
  1974. 8000f1a: 4b07 ldr r3, [pc, #28] ; (8000f38 <main+0x98>)
  1975. 8000f1c: 781b ldrb r3, [r3, #0]
  1976. 8000f1e: 2b00 cmp r3, #0
  1977. 8000f20: d002 beq.n 8000f28 <main+0x88>
  1978. transmit_uart("File was not opened!\r\n");
  1979. 8000f22: 480b ldr r0, [pc, #44] ; (8000f50 <main+0xb0>)
  1980. 8000f24: f7ff ffa6 bl 8000e74 <transmit_uart>
  1981. transmit_uart("Free space could not be determined!\r\n");
  1982. }
  1983. */
  1984. // Start ADC Conversion
  1985. HAL_ADC_Start_IT(&hadc1);
  1986. 8000f28: 480a ldr r0, [pc, #40] ; (8000f54 <main+0xb4>)
  1987. 8000f2a: f000 fc3d bl 80017a8 <HAL_ADC_Start_IT>
  1988. /* USER CODE END 2 */
  1989. /* Infinite loop */
  1990. /* USER CODE BEGIN WHILE */
  1991. while (1)
  1992. 8000f2e: e7fe b.n 8000f2e <main+0x8e>
  1993. 8000f30: 08007058 .word 0x08007058
  1994. 8000f34: 20000284 .word 0x20000284
  1995. 8000f38: 2000140c .word 0x2000140c
  1996. 8000f3c: 0800705c .word 0x0800705c
  1997. 8000f40: 08007080 .word 0x08007080
  1998. 8000f44: 0800709c .word 0x0800709c
  1999. 8000f48: 20001410 .word 0x20001410
  2000. 8000f4c: 080070b0 .word 0x080070b0
  2001. 8000f50: 080070c0 .word 0x080070c0
  2002. 8000f54: 200012c0 .word 0x200012c0
  2003. 08000f58 <SystemClock_Config>:
  2004. /**
  2005. * @brief System Clock Configuration
  2006. * @retval None
  2007. */
  2008. void SystemClock_Config(void)
  2009. {
  2010. 8000f58: b580 push {r7, lr}
  2011. 8000f5a: b094 sub sp, #80 ; 0x50
  2012. 8000f5c: af00 add r7, sp, #0
  2013. RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  2014. 8000f5e: f107 0320 add.w r3, r7, #32
  2015. 8000f62: 2230 movs r2, #48 ; 0x30
  2016. 8000f64: 2100 movs r1, #0
  2017. 8000f66: 4618 mov r0, r3
  2018. 8000f68: f006 f862 bl 8007030 <memset>
  2019. RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
  2020. 8000f6c: f107 030c add.w r3, r7, #12
  2021. 8000f70: 2200 movs r2, #0
  2022. 8000f72: 601a str r2, [r3, #0]
  2023. 8000f74: 605a str r2, [r3, #4]
  2024. 8000f76: 609a str r2, [r3, #8]
  2025. 8000f78: 60da str r2, [r3, #12]
  2026. 8000f7a: 611a str r2, [r3, #16]
  2027. /** Configure the main internal regulator output voltage
  2028. */
  2029. __HAL_RCC_PWR_CLK_ENABLE();
  2030. 8000f7c: 2300 movs r3, #0
  2031. 8000f7e: 60bb str r3, [r7, #8]
  2032. 8000f80: 4b29 ldr r3, [pc, #164] ; (8001028 <SystemClock_Config+0xd0>)
  2033. 8000f82: 6c1b ldr r3, [r3, #64] ; 0x40
  2034. 8000f84: 4a28 ldr r2, [pc, #160] ; (8001028 <SystemClock_Config+0xd0>)
  2035. 8000f86: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
  2036. 8000f8a: 6413 str r3, [r2, #64] ; 0x40
  2037. 8000f8c: 4b26 ldr r3, [pc, #152] ; (8001028 <SystemClock_Config+0xd0>)
  2038. 8000f8e: 6c1b ldr r3, [r3, #64] ; 0x40
  2039. 8000f90: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
  2040. 8000f94: 60bb str r3, [r7, #8]
  2041. 8000f96: 68bb ldr r3, [r7, #8]
  2042. __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
  2043. 8000f98: 2300 movs r3, #0
  2044. 8000f9a: 607b str r3, [r7, #4]
  2045. 8000f9c: 4b23 ldr r3, [pc, #140] ; (800102c <SystemClock_Config+0xd4>)
  2046. 8000f9e: 681b ldr r3, [r3, #0]
  2047. 8000fa0: f423 4340 bic.w r3, r3, #49152 ; 0xc000
  2048. 8000fa4: 4a21 ldr r2, [pc, #132] ; (800102c <SystemClock_Config+0xd4>)
  2049. 8000fa6: f443 4300 orr.w r3, r3, #32768 ; 0x8000
  2050. 8000faa: 6013 str r3, [r2, #0]
  2051. 8000fac: 4b1f ldr r3, [pc, #124] ; (800102c <SystemClock_Config+0xd4>)
  2052. 8000fae: 681b ldr r3, [r3, #0]
  2053. 8000fb0: f403 4340 and.w r3, r3, #49152 ; 0xc000
  2054. 8000fb4: 607b str r3, [r7, #4]
  2055. 8000fb6: 687b ldr r3, [r7, #4]
  2056. /** Initializes the RCC Oscillators according to the specified parameters
  2057. * in the RCC_OscInitTypeDef structure.
  2058. */
  2059. RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
  2060. 8000fb8: 2302 movs r3, #2
  2061. 8000fba: 623b str r3, [r7, #32]
  2062. RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  2063. 8000fbc: 2301 movs r3, #1
  2064. 8000fbe: 62fb str r3, [r7, #44] ; 0x2c
  2065. RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
  2066. 8000fc0: 2310 movs r3, #16
  2067. 8000fc2: 633b str r3, [r7, #48] ; 0x30
  2068. RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  2069. 8000fc4: 2302 movs r3, #2
  2070. 8000fc6: 63bb str r3, [r7, #56] ; 0x38
  2071. RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
  2072. 8000fc8: 2300 movs r3, #0
  2073. 8000fca: 63fb str r3, [r7, #60] ; 0x3c
  2074. RCC_OscInitStruct.PLL.PLLM = 16;
  2075. 8000fcc: 2310 movs r3, #16
  2076. 8000fce: 643b str r3, [r7, #64] ; 0x40
  2077. RCC_OscInitStruct.PLL.PLLN = 336;
  2078. 8000fd0: f44f 73a8 mov.w r3, #336 ; 0x150
  2079. 8000fd4: 647b str r3, [r7, #68] ; 0x44
  2080. RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  2081. 8000fd6: 2304 movs r3, #4
  2082. 8000fd8: 64bb str r3, [r7, #72] ; 0x48
  2083. RCC_OscInitStruct.PLL.PLLQ = 7;
  2084. 8000fda: 2307 movs r3, #7
  2085. 8000fdc: 64fb str r3, [r7, #76] ; 0x4c
  2086. if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  2087. 8000fde: f107 0320 add.w r3, r7, #32
  2088. 8000fe2: 4618 mov r0, r3
  2089. 8000fe4: f001 fabe bl 8002564 <HAL_RCC_OscConfig>
  2090. 8000fe8: 4603 mov r3, r0
  2091. 8000fea: 2b00 cmp r3, #0
  2092. 8000fec: d001 beq.n 8000ff2 <SystemClock_Config+0x9a>
  2093. {
  2094. Error_Handler();
  2095. 8000fee: f000 f987 bl 8001300 <Error_Handler>
  2096. }
  2097. /** Initializes the CPU, AHB and APB buses clocks
  2098. */
  2099. RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
  2100. 8000ff2: 230f movs r3, #15
  2101. 8000ff4: 60fb str r3, [r7, #12]
  2102. |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  2103. RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  2104. 8000ff6: 2302 movs r3, #2
  2105. 8000ff8: 613b str r3, [r7, #16]
  2106. RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  2107. 8000ffa: 2300 movs r3, #0
  2108. 8000ffc: 617b str r3, [r7, #20]
  2109. RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  2110. 8000ffe: f44f 5380 mov.w r3, #4096 ; 0x1000
  2111. 8001002: 61bb str r3, [r7, #24]
  2112. RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
  2113. 8001004: 2300 movs r3, #0
  2114. 8001006: 61fb str r3, [r7, #28]
  2115. if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  2116. 8001008: f107 030c add.w r3, r7, #12
  2117. 800100c: 2102 movs r1, #2
  2118. 800100e: 4618 mov r0, r3
  2119. 8001010: f001 fd18 bl 8002a44 <HAL_RCC_ClockConfig>
  2120. 8001014: 4603 mov r3, r0
  2121. 8001016: 2b00 cmp r3, #0
  2122. 8001018: d001 beq.n 800101e <SystemClock_Config+0xc6>
  2123. {
  2124. Error_Handler();
  2125. 800101a: f000 f971 bl 8001300 <Error_Handler>
  2126. }
  2127. }
  2128. 800101e: bf00 nop
  2129. 8001020: 3750 adds r7, #80 ; 0x50
  2130. 8001022: 46bd mov sp, r7
  2131. 8001024: bd80 pop {r7, pc}
  2132. 8001026: bf00 nop
  2133. 8001028: 40023800 .word 0x40023800
  2134. 800102c: 40007000 .word 0x40007000
  2135. 08001030 <MX_ADC1_Init>:
  2136. * @brief ADC1 Initialization Function
  2137. * @param None
  2138. * @retval None
  2139. */
  2140. static void MX_ADC1_Init(void)
  2141. {
  2142. 8001030: b580 push {r7, lr}
  2143. 8001032: b084 sub sp, #16
  2144. 8001034: af00 add r7, sp, #0
  2145. /* USER CODE BEGIN ADC1_Init 0 */
  2146. /* USER CODE END ADC1_Init 0 */
  2147. ADC_ChannelConfTypeDef sConfig = {0};
  2148. 8001036: 463b mov r3, r7
  2149. 8001038: 2200 movs r2, #0
  2150. 800103a: 601a str r2, [r3, #0]
  2151. 800103c: 605a str r2, [r3, #4]
  2152. 800103e: 609a str r2, [r3, #8]
  2153. 8001040: 60da str r2, [r3, #12]
  2154. /* USER CODE BEGIN ADC1_Init 1 */
  2155. /* USER CODE END ADC1_Init 1 */
  2156. /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
  2157. */
  2158. hadc1.Instance = ADC1;
  2159. 8001042: 4b21 ldr r3, [pc, #132] ; (80010c8 <MX_ADC1_Init+0x98>)
  2160. 8001044: 4a21 ldr r2, [pc, #132] ; (80010cc <MX_ADC1_Init+0x9c>)
  2161. 8001046: 601a str r2, [r3, #0]
  2162. hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
  2163. 8001048: 4b1f ldr r3, [pc, #124] ; (80010c8 <MX_ADC1_Init+0x98>)
  2164. 800104a: f44f 3280 mov.w r2, #65536 ; 0x10000
  2165. 800104e: 605a str r2, [r3, #4]
  2166. hadc1.Init.Resolution = ADC_RESOLUTION_12B;
  2167. 8001050: 4b1d ldr r3, [pc, #116] ; (80010c8 <MX_ADC1_Init+0x98>)
  2168. 8001052: 2200 movs r2, #0
  2169. 8001054: 609a str r2, [r3, #8]
  2170. hadc1.Init.ScanConvMode = DISABLE;
  2171. 8001056: 4b1c ldr r3, [pc, #112] ; (80010c8 <MX_ADC1_Init+0x98>)
  2172. 8001058: 2200 movs r2, #0
  2173. 800105a: 611a str r2, [r3, #16]
  2174. hadc1.Init.ContinuousConvMode = ENABLE;
  2175. 800105c: 4b1a ldr r3, [pc, #104] ; (80010c8 <MX_ADC1_Init+0x98>)
  2176. 800105e: 2201 movs r2, #1
  2177. 8001060: 761a strb r2, [r3, #24]
  2178. hadc1.Init.DiscontinuousConvMode = DISABLE;
  2179. 8001062: 4b19 ldr r3, [pc, #100] ; (80010c8 <MX_ADC1_Init+0x98>)
  2180. 8001064: 2200 movs r2, #0
  2181. 8001066: f883 2020 strb.w r2, [r3, #32]
  2182. hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
  2183. 800106a: 4b17 ldr r3, [pc, #92] ; (80010c8 <MX_ADC1_Init+0x98>)
  2184. 800106c: 2200 movs r2, #0
  2185. 800106e: 62da str r2, [r3, #44] ; 0x2c
  2186. hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
  2187. 8001070: 4b15 ldr r3, [pc, #84] ; (80010c8 <MX_ADC1_Init+0x98>)
  2188. 8001072: 4a17 ldr r2, [pc, #92] ; (80010d0 <MX_ADC1_Init+0xa0>)
  2189. 8001074: 629a str r2, [r3, #40] ; 0x28
  2190. hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
  2191. 8001076: 4b14 ldr r3, [pc, #80] ; (80010c8 <MX_ADC1_Init+0x98>)
  2192. 8001078: 2200 movs r2, #0
  2193. 800107a: 60da str r2, [r3, #12]
  2194. hadc1.Init.NbrOfConversion = 1;
  2195. 800107c: 4b12 ldr r3, [pc, #72] ; (80010c8 <MX_ADC1_Init+0x98>)
  2196. 800107e: 2201 movs r2, #1
  2197. 8001080: 61da str r2, [r3, #28]
  2198. hadc1.Init.DMAContinuousRequests = DISABLE;
  2199. 8001082: 4b11 ldr r3, [pc, #68] ; (80010c8 <MX_ADC1_Init+0x98>)
  2200. 8001084: 2200 movs r2, #0
  2201. 8001086: f883 2030 strb.w r2, [r3, #48] ; 0x30
  2202. hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
  2203. 800108a: 4b0f ldr r3, [pc, #60] ; (80010c8 <MX_ADC1_Init+0x98>)
  2204. 800108c: 2201 movs r2, #1
  2205. 800108e: 615a str r2, [r3, #20]
  2206. if (HAL_ADC_Init(&hadc1) != HAL_OK)
  2207. 8001090: 480d ldr r0, [pc, #52] ; (80010c8 <MX_ADC1_Init+0x98>)
  2208. 8001092: f000 fb45 bl 8001720 <HAL_ADC_Init>
  2209. 8001096: 4603 mov r3, r0
  2210. 8001098: 2b00 cmp r3, #0
  2211. 800109a: d001 beq.n 80010a0 <MX_ADC1_Init+0x70>
  2212. {
  2213. Error_Handler();
  2214. 800109c: f000 f930 bl 8001300 <Error_Handler>
  2215. }
  2216. /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
  2217. */
  2218. sConfig.Channel = ADC_CHANNEL_0;
  2219. 80010a0: 2300 movs r3, #0
  2220. 80010a2: 603b str r3, [r7, #0]
  2221. sConfig.Rank = 1;
  2222. 80010a4: 2301 movs r3, #1
  2223. 80010a6: 607b str r3, [r7, #4]
  2224. sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES;
  2225. 80010a8: 2307 movs r3, #7
  2226. 80010aa: 60bb str r3, [r7, #8]
  2227. if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  2228. 80010ac: 463b mov r3, r7
  2229. 80010ae: 4619 mov r1, r3
  2230. 80010b0: 4805 ldr r0, [pc, #20] ; (80010c8 <MX_ADC1_Init+0x98>)
  2231. 80010b2: f000 fd81 bl 8001bb8 <HAL_ADC_ConfigChannel>
  2232. 80010b6: 4603 mov r3, r0
  2233. 80010b8: 2b00 cmp r3, #0
  2234. 80010ba: d001 beq.n 80010c0 <MX_ADC1_Init+0x90>
  2235. {
  2236. Error_Handler();
  2237. 80010bc: f000 f920 bl 8001300 <Error_Handler>
  2238. }
  2239. /* USER CODE BEGIN ADC1_Init 2 */
  2240. /* USER CODE END ADC1_Init 2 */
  2241. }
  2242. 80010c0: bf00 nop
  2243. 80010c2: 3710 adds r7, #16
  2244. 80010c4: 46bd mov sp, r7
  2245. 80010c6: bd80 pop {r7, pc}
  2246. 80010c8: 200012c0 .word 0x200012c0
  2247. 80010cc: 40012000 .word 0x40012000
  2248. 80010d0: 0f000001 .word 0x0f000001
  2249. 080010d4 <MX_SPI1_Init>:
  2250. * @brief SPI1 Initialization Function
  2251. * @param None
  2252. * @retval None
  2253. */
  2254. static void MX_SPI1_Init(void)
  2255. {
  2256. 80010d4: b580 push {r7, lr}
  2257. 80010d6: af00 add r7, sp, #0
  2258. /* USER CODE BEGIN SPI1_Init 1 */
  2259. /* USER CODE END SPI1_Init 1 */
  2260. /* SPI1 parameter configuration*/
  2261. hspi1.Instance = SPI1;
  2262. 80010d8: 4b17 ldr r3, [pc, #92] ; (8001138 <MX_SPI1_Init+0x64>)
  2263. 80010da: 4a18 ldr r2, [pc, #96] ; (800113c <MX_SPI1_Init+0x68>)
  2264. 80010dc: 601a str r2, [r3, #0]
  2265. hspi1.Init.Mode = SPI_MODE_MASTER;
  2266. 80010de: 4b16 ldr r3, [pc, #88] ; (8001138 <MX_SPI1_Init+0x64>)
  2267. 80010e0: f44f 7282 mov.w r2, #260 ; 0x104
  2268. 80010e4: 605a str r2, [r3, #4]
  2269. hspi1.Init.Direction = SPI_DIRECTION_2LINES;
  2270. 80010e6: 4b14 ldr r3, [pc, #80] ; (8001138 <MX_SPI1_Init+0x64>)
  2271. 80010e8: 2200 movs r2, #0
  2272. 80010ea: 609a str r2, [r3, #8]
  2273. hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
  2274. 80010ec: 4b12 ldr r3, [pc, #72] ; (8001138 <MX_SPI1_Init+0x64>)
  2275. 80010ee: 2200 movs r2, #0
  2276. 80010f0: 60da str r2, [r3, #12]
  2277. hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
  2278. 80010f2: 4b11 ldr r3, [pc, #68] ; (8001138 <MX_SPI1_Init+0x64>)
  2279. 80010f4: 2200 movs r2, #0
  2280. 80010f6: 611a str r2, [r3, #16]
  2281. hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
  2282. 80010f8: 4b0f ldr r3, [pc, #60] ; (8001138 <MX_SPI1_Init+0x64>)
  2283. 80010fa: 2200 movs r2, #0
  2284. 80010fc: 615a str r2, [r3, #20]
  2285. hspi1.Init.NSS = SPI_NSS_SOFT;
  2286. 80010fe: 4b0e ldr r3, [pc, #56] ; (8001138 <MX_SPI1_Init+0x64>)
  2287. 8001100: f44f 7200 mov.w r2, #512 ; 0x200
  2288. 8001104: 619a str r2, [r3, #24]
  2289. hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8;
  2290. 8001106: 4b0c ldr r3, [pc, #48] ; (8001138 <MX_SPI1_Init+0x64>)
  2291. 8001108: 2210 movs r2, #16
  2292. 800110a: 61da str r2, [r3, #28]
  2293. hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
  2294. 800110c: 4b0a ldr r3, [pc, #40] ; (8001138 <MX_SPI1_Init+0x64>)
  2295. 800110e: 2200 movs r2, #0
  2296. 8001110: 621a str r2, [r3, #32]
  2297. hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
  2298. 8001112: 4b09 ldr r3, [pc, #36] ; (8001138 <MX_SPI1_Init+0x64>)
  2299. 8001114: 2200 movs r2, #0
  2300. 8001116: 625a str r2, [r3, #36] ; 0x24
  2301. hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  2302. 8001118: 4b07 ldr r3, [pc, #28] ; (8001138 <MX_SPI1_Init+0x64>)
  2303. 800111a: 2200 movs r2, #0
  2304. 800111c: 629a str r2, [r3, #40] ; 0x28
  2305. hspi1.Init.CRCPolynomial = 10;
  2306. 800111e: 4b06 ldr r3, [pc, #24] ; (8001138 <MX_SPI1_Init+0x64>)
  2307. 8001120: 220a movs r2, #10
  2308. 8001122: 62da str r2, [r3, #44] ; 0x2c
  2309. if (HAL_SPI_Init(&hspi1) != HAL_OK)
  2310. 8001124: 4804 ldr r0, [pc, #16] ; (8001138 <MX_SPI1_Init+0x64>)
  2311. 8001126: f001 fe7f bl 8002e28 <HAL_SPI_Init>
  2312. 800112a: 4603 mov r3, r0
  2313. 800112c: 2b00 cmp r3, #0
  2314. 800112e: d001 beq.n 8001134 <MX_SPI1_Init+0x60>
  2315. {
  2316. Error_Handler();
  2317. 8001130: f000 f8e6 bl 8001300 <Error_Handler>
  2318. }
  2319. /* USER CODE BEGIN SPI1_Init 2 */
  2320. /* USER CODE END SPI1_Init 2 */
  2321. }
  2322. 8001134: bf00 nop
  2323. 8001136: bd80 pop {r7, pc}
  2324. 8001138: 20001374 .word 0x20001374
  2325. 800113c: 40013000 .word 0x40013000
  2326. 08001140 <MX_USART2_UART_Init>:
  2327. * @brief USART2 Initialization Function
  2328. * @param None
  2329. * @retval None
  2330. */
  2331. static void MX_USART2_UART_Init(void)
  2332. {
  2333. 8001140: b580 push {r7, lr}
  2334. 8001142: af00 add r7, sp, #0
  2335. /* USER CODE END USART2_Init 0 */
  2336. /* USER CODE BEGIN USART2_Init 1 */
  2337. /* USER CODE END USART2_Init 1 */
  2338. huart2.Instance = USART2;
  2339. 8001144: 4b11 ldr r3, [pc, #68] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2340. 8001146: 4a12 ldr r2, [pc, #72] ; (8001190 <MX_USART2_UART_Init+0x50>)
  2341. 8001148: 601a str r2, [r3, #0]
  2342. huart2.Init.BaudRate = 115200;
  2343. 800114a: 4b10 ldr r3, [pc, #64] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2344. 800114c: f44f 32e1 mov.w r2, #115200 ; 0x1c200
  2345. 8001150: 605a str r2, [r3, #4]
  2346. huart2.Init.WordLength = UART_WORDLENGTH_8B;
  2347. 8001152: 4b0e ldr r3, [pc, #56] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2348. 8001154: 2200 movs r2, #0
  2349. 8001156: 609a str r2, [r3, #8]
  2350. huart2.Init.StopBits = UART_STOPBITS_1;
  2351. 8001158: 4b0c ldr r3, [pc, #48] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2352. 800115a: 2200 movs r2, #0
  2353. 800115c: 60da str r2, [r3, #12]
  2354. huart2.Init.Parity = UART_PARITY_NONE;
  2355. 800115e: 4b0b ldr r3, [pc, #44] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2356. 8001160: 2200 movs r2, #0
  2357. 8001162: 611a str r2, [r3, #16]
  2358. huart2.Init.Mode = UART_MODE_TX_RX;
  2359. 8001164: 4b09 ldr r3, [pc, #36] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2360. 8001166: 220c movs r2, #12
  2361. 8001168: 615a str r2, [r3, #20]
  2362. huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  2363. 800116a: 4b08 ldr r3, [pc, #32] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2364. 800116c: 2200 movs r2, #0
  2365. 800116e: 619a str r2, [r3, #24]
  2366. huart2.Init.OverSampling = UART_OVERSAMPLING_16;
  2367. 8001170: 4b06 ldr r3, [pc, #24] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2368. 8001172: 2200 movs r2, #0
  2369. 8001174: 61da str r2, [r3, #28]
  2370. if (HAL_UART_Init(&huart2) != HAL_OK)
  2371. 8001176: 4805 ldr r0, [pc, #20] ; (800118c <MX_USART2_UART_Init+0x4c>)
  2372. 8001178: f002 fa3c bl 80035f4 <HAL_UART_Init>
  2373. 800117c: 4603 mov r3, r0
  2374. 800117e: 2b00 cmp r3, #0
  2375. 8001180: d001 beq.n 8001186 <MX_USART2_UART_Init+0x46>
  2376. {
  2377. Error_Handler();
  2378. 8001182: f000 f8bd bl 8001300 <Error_Handler>
  2379. }
  2380. /* USER CODE BEGIN USART2_Init 2 */
  2381. /* USER CODE END USART2_Init 2 */
  2382. }
  2383. 8001186: bf00 nop
  2384. 8001188: bd80 pop {r7, pc}
  2385. 800118a: bf00 nop
  2386. 800118c: 200013cc .word 0x200013cc
  2387. 8001190: 40004400 .word 0x40004400
  2388. 08001194 <MX_GPIO_Init>:
  2389. * @brief GPIO Initialization Function
  2390. * @param None
  2391. * @retval None
  2392. */
  2393. static void MX_GPIO_Init(void)
  2394. {
  2395. 8001194: b580 push {r7, lr}
  2396. 8001196: b08a sub sp, #40 ; 0x28
  2397. 8001198: af00 add r7, sp, #0
  2398. GPIO_InitTypeDef GPIO_InitStruct = {0};
  2399. 800119a: f107 0314 add.w r3, r7, #20
  2400. 800119e: 2200 movs r2, #0
  2401. 80011a0: 601a str r2, [r3, #0]
  2402. 80011a2: 605a str r2, [r3, #4]
  2403. 80011a4: 609a str r2, [r3, #8]
  2404. 80011a6: 60da str r2, [r3, #12]
  2405. 80011a8: 611a str r2, [r3, #16]
  2406. /* GPIO Ports Clock Enable */
  2407. __HAL_RCC_GPIOC_CLK_ENABLE();
  2408. 80011aa: 2300 movs r3, #0
  2409. 80011ac: 613b str r3, [r7, #16]
  2410. 80011ae: 4b2d ldr r3, [pc, #180] ; (8001264 <MX_GPIO_Init+0xd0>)
  2411. 80011b0: 6b1b ldr r3, [r3, #48] ; 0x30
  2412. 80011b2: 4a2c ldr r2, [pc, #176] ; (8001264 <MX_GPIO_Init+0xd0>)
  2413. 80011b4: f043 0304 orr.w r3, r3, #4
  2414. 80011b8: 6313 str r3, [r2, #48] ; 0x30
  2415. 80011ba: 4b2a ldr r3, [pc, #168] ; (8001264 <MX_GPIO_Init+0xd0>)
  2416. 80011bc: 6b1b ldr r3, [r3, #48] ; 0x30
  2417. 80011be: f003 0304 and.w r3, r3, #4
  2418. 80011c2: 613b str r3, [r7, #16]
  2419. 80011c4: 693b ldr r3, [r7, #16]
  2420. __HAL_RCC_GPIOH_CLK_ENABLE();
  2421. 80011c6: 2300 movs r3, #0
  2422. 80011c8: 60fb str r3, [r7, #12]
  2423. 80011ca: 4b26 ldr r3, [pc, #152] ; (8001264 <MX_GPIO_Init+0xd0>)
  2424. 80011cc: 6b1b ldr r3, [r3, #48] ; 0x30
  2425. 80011ce: 4a25 ldr r2, [pc, #148] ; (8001264 <MX_GPIO_Init+0xd0>)
  2426. 80011d0: f043 0380 orr.w r3, r3, #128 ; 0x80
  2427. 80011d4: 6313 str r3, [r2, #48] ; 0x30
  2428. 80011d6: 4b23 ldr r3, [pc, #140] ; (8001264 <MX_GPIO_Init+0xd0>)
  2429. 80011d8: 6b1b ldr r3, [r3, #48] ; 0x30
  2430. 80011da: f003 0380 and.w r3, r3, #128 ; 0x80
  2431. 80011de: 60fb str r3, [r7, #12]
  2432. 80011e0: 68fb ldr r3, [r7, #12]
  2433. __HAL_RCC_GPIOA_CLK_ENABLE();
  2434. 80011e2: 2300 movs r3, #0
  2435. 80011e4: 60bb str r3, [r7, #8]
  2436. 80011e6: 4b1f ldr r3, [pc, #124] ; (8001264 <MX_GPIO_Init+0xd0>)
  2437. 80011e8: 6b1b ldr r3, [r3, #48] ; 0x30
  2438. 80011ea: 4a1e ldr r2, [pc, #120] ; (8001264 <MX_GPIO_Init+0xd0>)
  2439. 80011ec: f043 0301 orr.w r3, r3, #1
  2440. 80011f0: 6313 str r3, [r2, #48] ; 0x30
  2441. 80011f2: 4b1c ldr r3, [pc, #112] ; (8001264 <MX_GPIO_Init+0xd0>)
  2442. 80011f4: 6b1b ldr r3, [r3, #48] ; 0x30
  2443. 80011f6: f003 0301 and.w r3, r3, #1
  2444. 80011fa: 60bb str r3, [r7, #8]
  2445. 80011fc: 68bb ldr r3, [r7, #8]
  2446. __HAL_RCC_GPIOB_CLK_ENABLE();
  2447. 80011fe: 2300 movs r3, #0
  2448. 8001200: 607b str r3, [r7, #4]
  2449. 8001202: 4b18 ldr r3, [pc, #96] ; (8001264 <MX_GPIO_Init+0xd0>)
  2450. 8001204: 6b1b ldr r3, [r3, #48] ; 0x30
  2451. 8001206: 4a17 ldr r2, [pc, #92] ; (8001264 <MX_GPIO_Init+0xd0>)
  2452. 8001208: f043 0302 orr.w r3, r3, #2
  2453. 800120c: 6313 str r3, [r2, #48] ; 0x30
  2454. 800120e: 4b15 ldr r3, [pc, #84] ; (8001264 <MX_GPIO_Init+0xd0>)
  2455. 8001210: 6b1b ldr r3, [r3, #48] ; 0x30
  2456. 8001212: f003 0302 and.w r3, r3, #2
  2457. 8001216: 607b str r3, [r7, #4]
  2458. 8001218: 687b ldr r3, [r7, #4]
  2459. /*Configure GPIO pin Output Level */
  2460. HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
  2461. 800121a: 2201 movs r2, #1
  2462. 800121c: 2140 movs r1, #64 ; 0x40
  2463. 800121e: 4812 ldr r0, [pc, #72] ; (8001268 <MX_GPIO_Init+0xd4>)
  2464. 8001220: f001 f986 bl 8002530 <HAL_GPIO_WritePin>
  2465. /*Configure GPIO pin : B1_Pin */
  2466. GPIO_InitStruct.Pin = B1_Pin;
  2467. 8001224: f44f 5300 mov.w r3, #8192 ; 0x2000
  2468. 8001228: 617b str r3, [r7, #20]
  2469. GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
  2470. 800122a: 4b10 ldr r3, [pc, #64] ; (800126c <MX_GPIO_Init+0xd8>)
  2471. 800122c: 61bb str r3, [r7, #24]
  2472. GPIO_InitStruct.Pull = GPIO_NOPULL;
  2473. 800122e: 2300 movs r3, #0
  2474. 8001230: 61fb str r3, [r7, #28]
  2475. HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
  2476. 8001232: f107 0314 add.w r3, r7, #20
  2477. 8001236: 4619 mov r1, r3
  2478. 8001238: 480d ldr r0, [pc, #52] ; (8001270 <MX_GPIO_Init+0xdc>)
  2479. 800123a: f000 fff7 bl 800222c <HAL_GPIO_Init>
  2480. /*Configure GPIO pin : PB6 */
  2481. GPIO_InitStruct.Pin = GPIO_PIN_6;
  2482. 800123e: 2340 movs r3, #64 ; 0x40
  2483. 8001240: 617b str r3, [r7, #20]
  2484. GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  2485. 8001242: 2301 movs r3, #1
  2486. 8001244: 61bb str r3, [r7, #24]
  2487. GPIO_InitStruct.Pull = GPIO_NOPULL;
  2488. 8001246: 2300 movs r3, #0
  2489. 8001248: 61fb str r3, [r7, #28]
  2490. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
  2491. 800124a: 2301 movs r3, #1
  2492. 800124c: 623b str r3, [r7, #32]
  2493. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  2494. 800124e: f107 0314 add.w r3, r7, #20
  2495. 8001252: 4619 mov r1, r3
  2496. 8001254: 4804 ldr r0, [pc, #16] ; (8001268 <MX_GPIO_Init+0xd4>)
  2497. 8001256: f000 ffe9 bl 800222c <HAL_GPIO_Init>
  2498. }
  2499. 800125a: bf00 nop
  2500. 800125c: 3728 adds r7, #40 ; 0x28
  2501. 800125e: 46bd mov sp, r7
  2502. 8001260: bd80 pop {r7, pc}
  2503. 8001262: bf00 nop
  2504. 8001264: 40023800 .word 0x40023800
  2505. 8001268: 40020400 .word 0x40020400
  2506. 800126c: 10210000 .word 0x10210000
  2507. 8001270: 40020800 .word 0x40020800
  2508. 08001274 <HAL_ADC_ConvCpltCallback>:
  2509. /* USER CODE BEGIN 4 */
  2510. void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
  2511. {
  2512. 8001274: b580 push {r7, lr}
  2513. 8001276: b082 sub sp, #8
  2514. 8001278: af00 add r7, sp, #0
  2515. 800127a: 6078 str r0, [r7, #4]
  2516. // Read & Update The ADC Result
  2517. AD_RES = HAL_ADC_GetValue(&hadc1);
  2518. 800127c: 4813 ldr r0, [pc, #76] ; (80012cc <HAL_ADC_ConvCpltCallback+0x58>)
  2519. 800127e: f000 fc84 bl 8001b8a <HAL_ADC_GetValue>
  2520. 8001282: 4603 mov r3, r0
  2521. 8001284: b29a uxth r2, r3
  2522. 8001286: 4b12 ldr r3, [pc, #72] ; (80012d0 <HAL_ADC_ConvCpltCallback+0x5c>)
  2523. 8001288: 801a strh r2, [r3, #0]
  2524. f_puts(AD_RES, &fil);
  2525. 800128a: 4b11 ldr r3, [pc, #68] ; (80012d0 <HAL_ADC_ConvCpltCallback+0x5c>)
  2526. 800128c: 881b ldrh r3, [r3, #0]
  2527. 800128e: 4911 ldr r1, [pc, #68] ; (80012d4 <HAL_ADC_ConvCpltCallback+0x60>)
  2528. 8001290: 4618 mov r0, r3
  2529. 8001292: f005 fd63 bl 8006d5c <f_puts>
  2530. fres = f_close(&fil);
  2531. 8001296: 480f ldr r0, [pc, #60] ; (80012d4 <HAL_ADC_ConvCpltCallback+0x60>)
  2532. 8001298: f005 fcbe bl 8006c18 <f_close>
  2533. 800129c: 4603 mov r3, r0
  2534. 800129e: 461a mov r2, r3
  2535. 80012a0: 4b0d ldr r3, [pc, #52] ; (80012d8 <HAL_ADC_ConvCpltCallback+0x64>)
  2536. 80012a2: 701a strb r2, [r3, #0]
  2537. if (fres == FR_OK) {
  2538. 80012a4: 4b0c ldr r3, [pc, #48] ; (80012d8 <HAL_ADC_ConvCpltCallback+0x64>)
  2539. 80012a6: 781b ldrb r3, [r3, #0]
  2540. 80012a8: 2b00 cmp r3, #0
  2541. 80012aa: d103 bne.n 80012b4 <HAL_ADC_ConvCpltCallback+0x40>
  2542. transmit_uart("File is closed.\r\n");
  2543. 80012ac: 480b ldr r0, [pc, #44] ; (80012dc <HAL_ADC_ConvCpltCallback+0x68>)
  2544. 80012ae: f7ff fde1 bl 8000e74 <transmit_uart>
  2545. } else if (fres != FR_OK) {
  2546. transmit_uart("File was not closed.\r\n");
  2547. }
  2548. }
  2549. 80012b2: e006 b.n 80012c2 <HAL_ADC_ConvCpltCallback+0x4e>
  2550. } else if (fres != FR_OK) {
  2551. 80012b4: 4b08 ldr r3, [pc, #32] ; (80012d8 <HAL_ADC_ConvCpltCallback+0x64>)
  2552. 80012b6: 781b ldrb r3, [r3, #0]
  2553. 80012b8: 2b00 cmp r3, #0
  2554. 80012ba: d002 beq.n 80012c2 <HAL_ADC_ConvCpltCallback+0x4e>
  2555. transmit_uart("File was not closed.\r\n");
  2556. 80012bc: 4808 ldr r0, [pc, #32] ; (80012e0 <HAL_ADC_ConvCpltCallback+0x6c>)
  2557. 80012be: f7ff fdd9 bl 8000e74 <transmit_uart>
  2558. }
  2559. 80012c2: bf00 nop
  2560. 80012c4: 3708 adds r7, #8
  2561. 80012c6: 46bd mov sp, r7
  2562. 80012c8: bd80 pop {r7, pc}
  2563. 80012ca: bf00 nop
  2564. 80012cc: 200012c0 .word 0x200012c0
  2565. 80012d0: 20000280 .word 0x20000280
  2566. 80012d4: 20001410 .word 0x20001410
  2567. 80012d8: 2000140c .word 0x2000140c
  2568. 80012dc: 080070d8 .word 0x080070d8
  2569. 80012e0: 080070ec .word 0x080070ec
  2570. 080012e4 <HAL_ADC_ErrorCallback>:
  2571. void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc)
  2572. {
  2573. 80012e4: b580 push {r7, lr}
  2574. 80012e6: b082 sub sp, #8
  2575. 80012e8: af00 add r7, sp, #0
  2576. 80012ea: 6078 str r0, [r7, #4]
  2577. transmit_uart("ADC Error!\r\n");
  2578. 80012ec: 4803 ldr r0, [pc, #12] ; (80012fc <HAL_ADC_ErrorCallback+0x18>)
  2579. 80012ee: f7ff fdc1 bl 8000e74 <transmit_uart>
  2580. }
  2581. 80012f2: bf00 nop
  2582. 80012f4: 3708 adds r7, #8
  2583. 80012f6: 46bd mov sp, r7
  2584. 80012f8: bd80 pop {r7, pc}
  2585. 80012fa: bf00 nop
  2586. 80012fc: 08007104 .word 0x08007104
  2587. 08001300 <Error_Handler>:
  2588. /**
  2589. * @brief This function is executed in case of error occurrence.
  2590. * @retval None
  2591. */
  2592. void Error_Handler(void)
  2593. {
  2594. 8001300: b480 push {r7}
  2595. 8001302: af00 add r7, sp, #0
  2596. \details Disables IRQ interrupts by setting the I-bit in the CPSR.
  2597. Can only be executed in Privileged modes.
  2598. */
  2599. __STATIC_FORCEINLINE void __disable_irq(void)
  2600. {
  2601. __ASM volatile ("cpsid i" : : : "memory");
  2602. 8001304: b672 cpsid i
  2603. /* USER CODE BEGIN Error_Handler_Debug */
  2604. /* User can add his own implementation to report the HAL error return state */
  2605. __disable_irq();
  2606. while (1)
  2607. 8001306: e7fe b.n 8001306 <Error_Handler+0x6>
  2608. 08001308 <HAL_MspInit>:
  2609. /* USER CODE END 0 */
  2610. /**
  2611. * Initializes the Global MSP.
  2612. */
  2613. void HAL_MspInit(void)
  2614. {
  2615. 8001308: b580 push {r7, lr}
  2616. 800130a: b082 sub sp, #8
  2617. 800130c: af00 add r7, sp, #0
  2618. /* USER CODE BEGIN MspInit 0 */
  2619. /* USER CODE END MspInit 0 */
  2620. __HAL_RCC_SYSCFG_CLK_ENABLE();
  2621. 800130e: 2300 movs r3, #0
  2622. 8001310: 607b str r3, [r7, #4]
  2623. 8001312: 4b10 ldr r3, [pc, #64] ; (8001354 <HAL_MspInit+0x4c>)
  2624. 8001314: 6c5b ldr r3, [r3, #68] ; 0x44
  2625. 8001316: 4a0f ldr r2, [pc, #60] ; (8001354 <HAL_MspInit+0x4c>)
  2626. 8001318: f443 4380 orr.w r3, r3, #16384 ; 0x4000
  2627. 800131c: 6453 str r3, [r2, #68] ; 0x44
  2628. 800131e: 4b0d ldr r3, [pc, #52] ; (8001354 <HAL_MspInit+0x4c>)
  2629. 8001320: 6c5b ldr r3, [r3, #68] ; 0x44
  2630. 8001322: f403 4380 and.w r3, r3, #16384 ; 0x4000
  2631. 8001326: 607b str r3, [r7, #4]
  2632. 8001328: 687b ldr r3, [r7, #4]
  2633. __HAL_RCC_PWR_CLK_ENABLE();
  2634. 800132a: 2300 movs r3, #0
  2635. 800132c: 603b str r3, [r7, #0]
  2636. 800132e: 4b09 ldr r3, [pc, #36] ; (8001354 <HAL_MspInit+0x4c>)
  2637. 8001330: 6c1b ldr r3, [r3, #64] ; 0x40
  2638. 8001332: 4a08 ldr r2, [pc, #32] ; (8001354 <HAL_MspInit+0x4c>)
  2639. 8001334: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
  2640. 8001338: 6413 str r3, [r2, #64] ; 0x40
  2641. 800133a: 4b06 ldr r3, [pc, #24] ; (8001354 <HAL_MspInit+0x4c>)
  2642. 800133c: 6c1b ldr r3, [r3, #64] ; 0x40
  2643. 800133e: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
  2644. 8001342: 603b str r3, [r7, #0]
  2645. 8001344: 683b ldr r3, [r7, #0]
  2646. HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
  2647. 8001346: 2007 movs r0, #7
  2648. 8001348: f000 ff2e bl 80021a8 <HAL_NVIC_SetPriorityGrouping>
  2649. /* System interrupt init*/
  2650. /* USER CODE BEGIN MspInit 1 */
  2651. /* USER CODE END MspInit 1 */
  2652. }
  2653. 800134c: bf00 nop
  2654. 800134e: 3708 adds r7, #8
  2655. 8001350: 46bd mov sp, r7
  2656. 8001352: bd80 pop {r7, pc}
  2657. 8001354: 40023800 .word 0x40023800
  2658. 08001358 <HAL_ADC_MspInit>:
  2659. * This function configures the hardware resources used in this example
  2660. * @param hadc: ADC handle pointer
  2661. * @retval None
  2662. */
  2663. void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
  2664. {
  2665. 8001358: b580 push {r7, lr}
  2666. 800135a: b08a sub sp, #40 ; 0x28
  2667. 800135c: af00 add r7, sp, #0
  2668. 800135e: 6078 str r0, [r7, #4]
  2669. GPIO_InitTypeDef GPIO_InitStruct = {0};
  2670. 8001360: f107 0314 add.w r3, r7, #20
  2671. 8001364: 2200 movs r2, #0
  2672. 8001366: 601a str r2, [r3, #0]
  2673. 8001368: 605a str r2, [r3, #4]
  2674. 800136a: 609a str r2, [r3, #8]
  2675. 800136c: 60da str r2, [r3, #12]
  2676. 800136e: 611a str r2, [r3, #16]
  2677. if(hadc->Instance==ADC1)
  2678. 8001370: 687b ldr r3, [r7, #4]
  2679. 8001372: 681b ldr r3, [r3, #0]
  2680. 8001374: 4a1b ldr r2, [pc, #108] ; (80013e4 <HAL_ADC_MspInit+0x8c>)
  2681. 8001376: 4293 cmp r3, r2
  2682. 8001378: d12f bne.n 80013da <HAL_ADC_MspInit+0x82>
  2683. {
  2684. /* USER CODE BEGIN ADC1_MspInit 0 */
  2685. /* USER CODE END ADC1_MspInit 0 */
  2686. /* Peripheral clock enable */
  2687. __HAL_RCC_ADC1_CLK_ENABLE();
  2688. 800137a: 2300 movs r3, #0
  2689. 800137c: 613b str r3, [r7, #16]
  2690. 800137e: 4b1a ldr r3, [pc, #104] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2691. 8001380: 6c5b ldr r3, [r3, #68] ; 0x44
  2692. 8001382: 4a19 ldr r2, [pc, #100] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2693. 8001384: f443 7380 orr.w r3, r3, #256 ; 0x100
  2694. 8001388: 6453 str r3, [r2, #68] ; 0x44
  2695. 800138a: 4b17 ldr r3, [pc, #92] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2696. 800138c: 6c5b ldr r3, [r3, #68] ; 0x44
  2697. 800138e: f403 7380 and.w r3, r3, #256 ; 0x100
  2698. 8001392: 613b str r3, [r7, #16]
  2699. 8001394: 693b ldr r3, [r7, #16]
  2700. __HAL_RCC_GPIOA_CLK_ENABLE();
  2701. 8001396: 2300 movs r3, #0
  2702. 8001398: 60fb str r3, [r7, #12]
  2703. 800139a: 4b13 ldr r3, [pc, #76] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2704. 800139c: 6b1b ldr r3, [r3, #48] ; 0x30
  2705. 800139e: 4a12 ldr r2, [pc, #72] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2706. 80013a0: f043 0301 orr.w r3, r3, #1
  2707. 80013a4: 6313 str r3, [r2, #48] ; 0x30
  2708. 80013a6: 4b10 ldr r3, [pc, #64] ; (80013e8 <HAL_ADC_MspInit+0x90>)
  2709. 80013a8: 6b1b ldr r3, [r3, #48] ; 0x30
  2710. 80013aa: f003 0301 and.w r3, r3, #1
  2711. 80013ae: 60fb str r3, [r7, #12]
  2712. 80013b0: 68fb ldr r3, [r7, #12]
  2713. /**ADC1 GPIO Configuration
  2714. PA0-WKUP ------> ADC1_IN0
  2715. */
  2716. GPIO_InitStruct.Pin = GPIO_PIN_0;
  2717. 80013b2: 2301 movs r3, #1
  2718. 80013b4: 617b str r3, [r7, #20]
  2719. GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
  2720. 80013b6: 2303 movs r3, #3
  2721. 80013b8: 61bb str r3, [r7, #24]
  2722. GPIO_InitStruct.Pull = GPIO_NOPULL;
  2723. 80013ba: 2300 movs r3, #0
  2724. 80013bc: 61fb str r3, [r7, #28]
  2725. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  2726. 80013be: f107 0314 add.w r3, r7, #20
  2727. 80013c2: 4619 mov r1, r3
  2728. 80013c4: 4809 ldr r0, [pc, #36] ; (80013ec <HAL_ADC_MspInit+0x94>)
  2729. 80013c6: f000 ff31 bl 800222c <HAL_GPIO_Init>
  2730. /* ADC1 interrupt Init */
  2731. HAL_NVIC_SetPriority(ADC_IRQn, 0, 0);
  2732. 80013ca: 2200 movs r2, #0
  2733. 80013cc: 2100 movs r1, #0
  2734. 80013ce: 2012 movs r0, #18
  2735. 80013d0: f000 fef5 bl 80021be <HAL_NVIC_SetPriority>
  2736. HAL_NVIC_EnableIRQ(ADC_IRQn);
  2737. 80013d4: 2012 movs r0, #18
  2738. 80013d6: f000 ff0e bl 80021f6 <HAL_NVIC_EnableIRQ>
  2739. /* USER CODE BEGIN ADC1_MspInit 1 */
  2740. /* USER CODE END ADC1_MspInit 1 */
  2741. }
  2742. }
  2743. 80013da: bf00 nop
  2744. 80013dc: 3728 adds r7, #40 ; 0x28
  2745. 80013de: 46bd mov sp, r7
  2746. 80013e0: bd80 pop {r7, pc}
  2747. 80013e2: bf00 nop
  2748. 80013e4: 40012000 .word 0x40012000
  2749. 80013e8: 40023800 .word 0x40023800
  2750. 80013ec: 40020000 .word 0x40020000
  2751. 080013f0 <HAL_SPI_MspInit>:
  2752. * This function configures the hardware resources used in this example
  2753. * @param hspi: SPI handle pointer
  2754. * @retval None
  2755. */
  2756. void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
  2757. {
  2758. 80013f0: b580 push {r7, lr}
  2759. 80013f2: b08a sub sp, #40 ; 0x28
  2760. 80013f4: af00 add r7, sp, #0
  2761. 80013f6: 6078 str r0, [r7, #4]
  2762. GPIO_InitTypeDef GPIO_InitStruct = {0};
  2763. 80013f8: f107 0314 add.w r3, r7, #20
  2764. 80013fc: 2200 movs r2, #0
  2765. 80013fe: 601a str r2, [r3, #0]
  2766. 8001400: 605a str r2, [r3, #4]
  2767. 8001402: 609a str r2, [r3, #8]
  2768. 8001404: 60da str r2, [r3, #12]
  2769. 8001406: 611a str r2, [r3, #16]
  2770. if(hspi->Instance==SPI1)
  2771. 8001408: 687b ldr r3, [r7, #4]
  2772. 800140a: 681b ldr r3, [r3, #0]
  2773. 800140c: 4a19 ldr r2, [pc, #100] ; (8001474 <HAL_SPI_MspInit+0x84>)
  2774. 800140e: 4293 cmp r3, r2
  2775. 8001410: d12b bne.n 800146a <HAL_SPI_MspInit+0x7a>
  2776. {
  2777. /* USER CODE BEGIN SPI1_MspInit 0 */
  2778. /* USER CODE END SPI1_MspInit 0 */
  2779. /* Peripheral clock enable */
  2780. __HAL_RCC_SPI1_CLK_ENABLE();
  2781. 8001412: 2300 movs r3, #0
  2782. 8001414: 613b str r3, [r7, #16]
  2783. 8001416: 4b18 ldr r3, [pc, #96] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2784. 8001418: 6c5b ldr r3, [r3, #68] ; 0x44
  2785. 800141a: 4a17 ldr r2, [pc, #92] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2786. 800141c: f443 5380 orr.w r3, r3, #4096 ; 0x1000
  2787. 8001420: 6453 str r3, [r2, #68] ; 0x44
  2788. 8001422: 4b15 ldr r3, [pc, #84] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2789. 8001424: 6c5b ldr r3, [r3, #68] ; 0x44
  2790. 8001426: f403 5380 and.w r3, r3, #4096 ; 0x1000
  2791. 800142a: 613b str r3, [r7, #16]
  2792. 800142c: 693b ldr r3, [r7, #16]
  2793. __HAL_RCC_GPIOA_CLK_ENABLE();
  2794. 800142e: 2300 movs r3, #0
  2795. 8001430: 60fb str r3, [r7, #12]
  2796. 8001432: 4b11 ldr r3, [pc, #68] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2797. 8001434: 6b1b ldr r3, [r3, #48] ; 0x30
  2798. 8001436: 4a10 ldr r2, [pc, #64] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2799. 8001438: f043 0301 orr.w r3, r3, #1
  2800. 800143c: 6313 str r3, [r2, #48] ; 0x30
  2801. 800143e: 4b0e ldr r3, [pc, #56] ; (8001478 <HAL_SPI_MspInit+0x88>)
  2802. 8001440: 6b1b ldr r3, [r3, #48] ; 0x30
  2803. 8001442: f003 0301 and.w r3, r3, #1
  2804. 8001446: 60fb str r3, [r7, #12]
  2805. 8001448: 68fb ldr r3, [r7, #12]
  2806. /**SPI1 GPIO Configuration
  2807. PA5 ------> SPI1_SCK
  2808. PA6 ------> SPI1_MISO
  2809. PA7 ------> SPI1_MOSI
  2810. */
  2811. GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
  2812. 800144a: 23e0 movs r3, #224 ; 0xe0
  2813. 800144c: 617b str r3, [r7, #20]
  2814. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  2815. 800144e: 2302 movs r3, #2
  2816. 8001450: 61bb str r3, [r7, #24]
  2817. GPIO_InitStruct.Pull = GPIO_NOPULL;
  2818. 8001452: 2300 movs r3, #0
  2819. 8001454: 61fb str r3, [r7, #28]
  2820. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  2821. 8001456: 2303 movs r3, #3
  2822. 8001458: 623b str r3, [r7, #32]
  2823. GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
  2824. 800145a: 2305 movs r3, #5
  2825. 800145c: 627b str r3, [r7, #36] ; 0x24
  2826. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  2827. 800145e: f107 0314 add.w r3, r7, #20
  2828. 8001462: 4619 mov r1, r3
  2829. 8001464: 4805 ldr r0, [pc, #20] ; (800147c <HAL_SPI_MspInit+0x8c>)
  2830. 8001466: f000 fee1 bl 800222c <HAL_GPIO_Init>
  2831. /* USER CODE BEGIN SPI1_MspInit 1 */
  2832. /* USER CODE END SPI1_MspInit 1 */
  2833. }
  2834. }
  2835. 800146a: bf00 nop
  2836. 800146c: 3728 adds r7, #40 ; 0x28
  2837. 800146e: 46bd mov sp, r7
  2838. 8001470: bd80 pop {r7, pc}
  2839. 8001472: bf00 nop
  2840. 8001474: 40013000 .word 0x40013000
  2841. 8001478: 40023800 .word 0x40023800
  2842. 800147c: 40020000 .word 0x40020000
  2843. 08001480 <HAL_UART_MspInit>:
  2844. * This function configures the hardware resources used in this example
  2845. * @param huart: UART handle pointer
  2846. * @retval None
  2847. */
  2848. void HAL_UART_MspInit(UART_HandleTypeDef* huart)
  2849. {
  2850. 8001480: b580 push {r7, lr}
  2851. 8001482: b08a sub sp, #40 ; 0x28
  2852. 8001484: af00 add r7, sp, #0
  2853. 8001486: 6078 str r0, [r7, #4]
  2854. GPIO_InitTypeDef GPIO_InitStruct = {0};
  2855. 8001488: f107 0314 add.w r3, r7, #20
  2856. 800148c: 2200 movs r2, #0
  2857. 800148e: 601a str r2, [r3, #0]
  2858. 8001490: 605a str r2, [r3, #4]
  2859. 8001492: 609a str r2, [r3, #8]
  2860. 8001494: 60da str r2, [r3, #12]
  2861. 8001496: 611a str r2, [r3, #16]
  2862. if(huart->Instance==USART2)
  2863. 8001498: 687b ldr r3, [r7, #4]
  2864. 800149a: 681b ldr r3, [r3, #0]
  2865. 800149c: 4a19 ldr r2, [pc, #100] ; (8001504 <HAL_UART_MspInit+0x84>)
  2866. 800149e: 4293 cmp r3, r2
  2867. 80014a0: d12b bne.n 80014fa <HAL_UART_MspInit+0x7a>
  2868. {
  2869. /* USER CODE BEGIN USART2_MspInit 0 */
  2870. /* USER CODE END USART2_MspInit 0 */
  2871. /* Peripheral clock enable */
  2872. __HAL_RCC_USART2_CLK_ENABLE();
  2873. 80014a2: 2300 movs r3, #0
  2874. 80014a4: 613b str r3, [r7, #16]
  2875. 80014a6: 4b18 ldr r3, [pc, #96] ; (8001508 <HAL_UART_MspInit+0x88>)
  2876. 80014a8: 6c1b ldr r3, [r3, #64] ; 0x40
  2877. 80014aa: 4a17 ldr r2, [pc, #92] ; (8001508 <HAL_UART_MspInit+0x88>)
  2878. 80014ac: f443 3300 orr.w r3, r3, #131072 ; 0x20000
  2879. 80014b0: 6413 str r3, [r2, #64] ; 0x40
  2880. 80014b2: 4b15 ldr r3, [pc, #84] ; (8001508 <HAL_UART_MspInit+0x88>)
  2881. 80014b4: 6c1b ldr r3, [r3, #64] ; 0x40
  2882. 80014b6: f403 3300 and.w r3, r3, #131072 ; 0x20000
  2883. 80014ba: 613b str r3, [r7, #16]
  2884. 80014bc: 693b ldr r3, [r7, #16]
  2885. __HAL_RCC_GPIOA_CLK_ENABLE();
  2886. 80014be: 2300 movs r3, #0
  2887. 80014c0: 60fb str r3, [r7, #12]
  2888. 80014c2: 4b11 ldr r3, [pc, #68] ; (8001508 <HAL_UART_MspInit+0x88>)
  2889. 80014c4: 6b1b ldr r3, [r3, #48] ; 0x30
  2890. 80014c6: 4a10 ldr r2, [pc, #64] ; (8001508 <HAL_UART_MspInit+0x88>)
  2891. 80014c8: f043 0301 orr.w r3, r3, #1
  2892. 80014cc: 6313 str r3, [r2, #48] ; 0x30
  2893. 80014ce: 4b0e ldr r3, [pc, #56] ; (8001508 <HAL_UART_MspInit+0x88>)
  2894. 80014d0: 6b1b ldr r3, [r3, #48] ; 0x30
  2895. 80014d2: f003 0301 and.w r3, r3, #1
  2896. 80014d6: 60fb str r3, [r7, #12]
  2897. 80014d8: 68fb ldr r3, [r7, #12]
  2898. /**USART2 GPIO Configuration
  2899. PA2 ------> USART2_TX
  2900. PA3 ------> USART2_RX
  2901. */
  2902. GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin;
  2903. 80014da: 230c movs r3, #12
  2904. 80014dc: 617b str r3, [r7, #20]
  2905. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  2906. 80014de: 2302 movs r3, #2
  2907. 80014e0: 61bb str r3, [r7, #24]
  2908. GPIO_InitStruct.Pull = GPIO_NOPULL;
  2909. 80014e2: 2300 movs r3, #0
  2910. 80014e4: 61fb str r3, [r7, #28]
  2911. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  2912. 80014e6: 2300 movs r3, #0
  2913. 80014e8: 623b str r3, [r7, #32]
  2914. GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
  2915. 80014ea: 2307 movs r3, #7
  2916. 80014ec: 627b str r3, [r7, #36] ; 0x24
  2917. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  2918. 80014ee: f107 0314 add.w r3, r7, #20
  2919. 80014f2: 4619 mov r1, r3
  2920. 80014f4: 4805 ldr r0, [pc, #20] ; (800150c <HAL_UART_MspInit+0x8c>)
  2921. 80014f6: f000 fe99 bl 800222c <HAL_GPIO_Init>
  2922. /* USER CODE BEGIN USART2_MspInit 1 */
  2923. /* USER CODE END USART2_MspInit 1 */
  2924. }
  2925. }
  2926. 80014fa: bf00 nop
  2927. 80014fc: 3728 adds r7, #40 ; 0x28
  2928. 80014fe: 46bd mov sp, r7
  2929. 8001500: bd80 pop {r7, pc}
  2930. 8001502: bf00 nop
  2931. 8001504: 40004400 .word 0x40004400
  2932. 8001508: 40023800 .word 0x40023800
  2933. 800150c: 40020000 .word 0x40020000
  2934. 08001510 <NMI_Handler>:
  2935. /******************************************************************************/
  2936. /**
  2937. * @brief This function handles Non maskable interrupt.
  2938. */
  2939. void NMI_Handler(void)
  2940. {
  2941. 8001510: b480 push {r7}
  2942. 8001512: af00 add r7, sp, #0
  2943. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  2944. /* USER CODE END NonMaskableInt_IRQn 0 */
  2945. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  2946. while (1)
  2947. 8001514: e7fe b.n 8001514 <NMI_Handler+0x4>
  2948. 08001516 <HardFault_Handler>:
  2949. /**
  2950. * @brief This function handles Hard fault interrupt.
  2951. */
  2952. void HardFault_Handler(void)
  2953. {
  2954. 8001516: b480 push {r7}
  2955. 8001518: af00 add r7, sp, #0
  2956. /* USER CODE BEGIN HardFault_IRQn 0 */
  2957. /* USER CODE END HardFault_IRQn 0 */
  2958. while (1)
  2959. 800151a: e7fe b.n 800151a <HardFault_Handler+0x4>
  2960. 0800151c <MemManage_Handler>:
  2961. /**
  2962. * @brief This function handles Memory management fault.
  2963. */
  2964. void MemManage_Handler(void)
  2965. {
  2966. 800151c: b480 push {r7}
  2967. 800151e: af00 add r7, sp, #0
  2968. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  2969. /* USER CODE END MemoryManagement_IRQn 0 */
  2970. while (1)
  2971. 8001520: e7fe b.n 8001520 <MemManage_Handler+0x4>
  2972. 08001522 <BusFault_Handler>:
  2973. /**
  2974. * @brief This function handles Pre-fetch fault, memory access fault.
  2975. */
  2976. void BusFault_Handler(void)
  2977. {
  2978. 8001522: b480 push {r7}
  2979. 8001524: af00 add r7, sp, #0
  2980. /* USER CODE BEGIN BusFault_IRQn 0 */
  2981. /* USER CODE END BusFault_IRQn 0 */
  2982. while (1)
  2983. 8001526: e7fe b.n 8001526 <BusFault_Handler+0x4>
  2984. 08001528 <UsageFault_Handler>:
  2985. /**
  2986. * @brief This function handles Undefined instruction or illegal state.
  2987. */
  2988. void UsageFault_Handler(void)
  2989. {
  2990. 8001528: b480 push {r7}
  2991. 800152a: af00 add r7, sp, #0
  2992. /* USER CODE BEGIN UsageFault_IRQn 0 */
  2993. /* USER CODE END UsageFault_IRQn 0 */
  2994. while (1)
  2995. 800152c: e7fe b.n 800152c <UsageFault_Handler+0x4>
  2996. 0800152e <SVC_Handler>:
  2997. /**
  2998. * @brief This function handles System service call via SWI instruction.
  2999. */
  3000. void SVC_Handler(void)
  3001. {
  3002. 800152e: b480 push {r7}
  3003. 8001530: af00 add r7, sp, #0
  3004. /* USER CODE END SVCall_IRQn 0 */
  3005. /* USER CODE BEGIN SVCall_IRQn 1 */
  3006. /* USER CODE END SVCall_IRQn 1 */
  3007. }
  3008. 8001532: bf00 nop
  3009. 8001534: 46bd mov sp, r7
  3010. 8001536: f85d 7b04 ldr.w r7, [sp], #4
  3011. 800153a: 4770 bx lr
  3012. 0800153c <DebugMon_Handler>:
  3013. /**
  3014. * @brief This function handles Debug monitor.
  3015. */
  3016. void DebugMon_Handler(void)
  3017. {
  3018. 800153c: b480 push {r7}
  3019. 800153e: af00 add r7, sp, #0
  3020. /* USER CODE END DebugMonitor_IRQn 0 */
  3021. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  3022. /* USER CODE END DebugMonitor_IRQn 1 */
  3023. }
  3024. 8001540: bf00 nop
  3025. 8001542: 46bd mov sp, r7
  3026. 8001544: f85d 7b04 ldr.w r7, [sp], #4
  3027. 8001548: 4770 bx lr
  3028. 0800154a <PendSV_Handler>:
  3029. /**
  3030. * @brief This function handles Pendable request for system service.
  3031. */
  3032. void PendSV_Handler(void)
  3033. {
  3034. 800154a: b480 push {r7}
  3035. 800154c: af00 add r7, sp, #0
  3036. /* USER CODE END PendSV_IRQn 0 */
  3037. /* USER CODE BEGIN PendSV_IRQn 1 */
  3038. /* USER CODE END PendSV_IRQn 1 */
  3039. }
  3040. 800154e: bf00 nop
  3041. 8001550: 46bd mov sp, r7
  3042. 8001552: f85d 7b04 ldr.w r7, [sp], #4
  3043. 8001556: 4770 bx lr
  3044. 08001558 <SysTick_Handler>:
  3045. /**
  3046. * @brief This function handles System tick timer.
  3047. */
  3048. void SysTick_Handler(void)
  3049. {
  3050. 8001558: b580 push {r7, lr}
  3051. 800155a: af00 add r7, sp, #0
  3052. /* USER CODE BEGIN SysTick_IRQn 0 */
  3053. /* USER CODE END SysTick_IRQn 0 */
  3054. HAL_IncTick();
  3055. 800155c: f000 f89e bl 800169c <HAL_IncTick>
  3056. /* USER CODE BEGIN SysTick_IRQn 1 */
  3057. /* USER CODE END SysTick_IRQn 1 */
  3058. }
  3059. 8001560: bf00 nop
  3060. 8001562: bd80 pop {r7, pc}
  3061. 08001564 <ADC_IRQHandler>:
  3062. /**
  3063. * @brief This function handles ADC1 global interrupt.
  3064. */
  3065. void ADC_IRQHandler(void)
  3066. {
  3067. 8001564: b580 push {r7, lr}
  3068. 8001566: af00 add r7, sp, #0
  3069. /* USER CODE BEGIN ADC_IRQn 0 */
  3070. /* USER CODE END ADC_IRQn 0 */
  3071. HAL_ADC_IRQHandler(&hadc1);
  3072. 8001568: 4802 ldr r0, [pc, #8] ; (8001574 <ADC_IRQHandler+0x10>)
  3073. 800156a: f000 f9cd bl 8001908 <HAL_ADC_IRQHandler>
  3074. /* USER CODE BEGIN ADC_IRQn 1 */
  3075. /* USER CODE END ADC_IRQn 1 */
  3076. }
  3077. 800156e: bf00 nop
  3078. 8001570: bd80 pop {r7, pc}
  3079. 8001572: bf00 nop
  3080. 8001574: 200012c0 .word 0x200012c0
  3081. 08001578 <SystemInit>:
  3082. * configuration.
  3083. * @param None
  3084. * @retval None
  3085. */
  3086. void SystemInit(void)
  3087. {
  3088. 8001578: b480 push {r7}
  3089. 800157a: af00 add r7, sp, #0
  3090. /* FPU settings ------------------------------------------------------------*/
  3091. #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
  3092. SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
  3093. 800157c: 4b08 ldr r3, [pc, #32] ; (80015a0 <SystemInit+0x28>)
  3094. 800157e: f8d3 3088 ldr.w r3, [r3, #136] ; 0x88
  3095. 8001582: 4a07 ldr r2, [pc, #28] ; (80015a0 <SystemInit+0x28>)
  3096. 8001584: f443 0370 orr.w r3, r3, #15728640 ; 0xf00000
  3097. 8001588: f8c2 3088 str.w r3, [r2, #136] ; 0x88
  3098. /* Configure the Vector Table location add offset address ------------------*/
  3099. #ifdef VECT_TAB_SRAM
  3100. SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
  3101. #else
  3102. SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
  3103. 800158c: 4b04 ldr r3, [pc, #16] ; (80015a0 <SystemInit+0x28>)
  3104. 800158e: f04f 6200 mov.w r2, #134217728 ; 0x8000000
  3105. 8001592: 609a str r2, [r3, #8]
  3106. #endif
  3107. }
  3108. 8001594: bf00 nop
  3109. 8001596: 46bd mov sp, r7
  3110. 8001598: f85d 7b04 ldr.w r7, [sp], #4
  3111. 800159c: 4770 bx lr
  3112. 800159e: bf00 nop
  3113. 80015a0: e000ed00 .word 0xe000ed00
  3114. 080015a4 <Reset_Handler>:
  3115. 80015a4: f8df d034 ldr.w sp, [pc, #52] ; 80015dc <LoopFillZerobss+0x14>
  3116. 80015a8: 2100 movs r1, #0
  3117. 80015aa: e003 b.n 80015b4 <LoopCopyDataInit>
  3118. 080015ac <CopyDataInit>:
  3119. 80015ac: 4b0c ldr r3, [pc, #48] ; (80015e0 <LoopFillZerobss+0x18>)
  3120. 80015ae: 585b ldr r3, [r3, r1]
  3121. 80015b0: 5043 str r3, [r0, r1]
  3122. 80015b2: 3104 adds r1, #4
  3123. 080015b4 <LoopCopyDataInit>:
  3124. 80015b4: 480b ldr r0, [pc, #44] ; (80015e4 <LoopFillZerobss+0x1c>)
  3125. 80015b6: 4b0c ldr r3, [pc, #48] ; (80015e8 <LoopFillZerobss+0x20>)
  3126. 80015b8: 1842 adds r2, r0, r1
  3127. 80015ba: 429a cmp r2, r3
  3128. 80015bc: d3f6 bcc.n 80015ac <CopyDataInit>
  3129. 80015be: 4a0b ldr r2, [pc, #44] ; (80015ec <LoopFillZerobss+0x24>)
  3130. 80015c0: e002 b.n 80015c8 <LoopFillZerobss>
  3131. 080015c2 <FillZerobss>:
  3132. 80015c2: 2300 movs r3, #0
  3133. 80015c4: f842 3b04 str.w r3, [r2], #4
  3134. 080015c8 <LoopFillZerobss>:
  3135. 80015c8: 4b09 ldr r3, [pc, #36] ; (80015f0 <LoopFillZerobss+0x28>)
  3136. 80015ca: 429a cmp r2, r3
  3137. 80015cc: d3f9 bcc.n 80015c2 <FillZerobss>
  3138. 80015ce: f7ff ffd3 bl 8001578 <SystemInit>
  3139. 80015d2: f005 fd09 bl 8006fe8 <__libc_init_array>
  3140. 80015d6: f7ff fc63 bl 8000ea0 <main>
  3141. 80015da: 4770 bx lr
  3142. 80015dc: 20018000 .word 0x20018000
  3143. 80015e0: 080075c4 .word 0x080075c4
  3144. 80015e4: 20000000 .word 0x20000000
  3145. 80015e8: 20000024 .word 0x20000024
  3146. 80015ec: 20000024 .word 0x20000024
  3147. 80015f0: 200044b4 .word 0x200044b4
  3148. 080015f4 <DMA1_Stream0_IRQHandler>:
  3149. 80015f4: e7fe b.n 80015f4 <DMA1_Stream0_IRQHandler>
  3150. ...
  3151. 080015f8 <HAL_Init>:
  3152. * need to ensure that the SysTick time base is always set to 1 millisecond
  3153. * to have correct HAL operation.
  3154. * @retval HAL status
  3155. */
  3156. HAL_StatusTypeDef HAL_Init(void)
  3157. {
  3158. 80015f8: b580 push {r7, lr}
  3159. 80015fa: af00 add r7, sp, #0
  3160. /* Configure Flash prefetch, Instruction cache, Data cache */
  3161. #if (INSTRUCTION_CACHE_ENABLE != 0U)
  3162. __HAL_FLASH_INSTRUCTION_CACHE_ENABLE();
  3163. 80015fc: 4b0e ldr r3, [pc, #56] ; (8001638 <HAL_Init+0x40>)
  3164. 80015fe: 681b ldr r3, [r3, #0]
  3165. 8001600: 4a0d ldr r2, [pc, #52] ; (8001638 <HAL_Init+0x40>)
  3166. 8001602: f443 7300 orr.w r3, r3, #512 ; 0x200
  3167. 8001606: 6013 str r3, [r2, #0]
  3168. #endif /* INSTRUCTION_CACHE_ENABLE */
  3169. #if (DATA_CACHE_ENABLE != 0U)
  3170. __HAL_FLASH_DATA_CACHE_ENABLE();
  3171. 8001608: 4b0b ldr r3, [pc, #44] ; (8001638 <HAL_Init+0x40>)
  3172. 800160a: 681b ldr r3, [r3, #0]
  3173. 800160c: 4a0a ldr r2, [pc, #40] ; (8001638 <HAL_Init+0x40>)
  3174. 800160e: f443 6380 orr.w r3, r3, #1024 ; 0x400
  3175. 8001612: 6013 str r3, [r2, #0]
  3176. #endif /* DATA_CACHE_ENABLE */
  3177. #if (PREFETCH_ENABLE != 0U)
  3178. __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
  3179. 8001614: 4b08 ldr r3, [pc, #32] ; (8001638 <HAL_Init+0x40>)
  3180. 8001616: 681b ldr r3, [r3, #0]
  3181. 8001618: 4a07 ldr r2, [pc, #28] ; (8001638 <HAL_Init+0x40>)
  3182. 800161a: f443 7380 orr.w r3, r3, #256 ; 0x100
  3183. 800161e: 6013 str r3, [r2, #0]
  3184. #endif /* PREFETCH_ENABLE */
  3185. /* Set Interrupt Group Priority */
  3186. HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
  3187. 8001620: 2003 movs r0, #3
  3188. 8001622: f000 fdc1 bl 80021a8 <HAL_NVIC_SetPriorityGrouping>
  3189. /* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
  3190. HAL_InitTick(TICK_INT_PRIORITY);
  3191. 8001626: 2000 movs r0, #0
  3192. 8001628: f000 f808 bl 800163c <HAL_InitTick>
  3193. /* Init the low level hardware */
  3194. HAL_MspInit();
  3195. 800162c: f7ff fe6c bl 8001308 <HAL_MspInit>
  3196. /* Return function status */
  3197. return HAL_OK;
  3198. 8001630: 2300 movs r3, #0
  3199. }
  3200. 8001632: 4618 mov r0, r3
  3201. 8001634: bd80 pop {r7, pc}
  3202. 8001636: bf00 nop
  3203. 8001638: 40023c00 .word 0x40023c00
  3204. 0800163c <HAL_InitTick>:
  3205. * implementation in user file.
  3206. * @param TickPriority Tick interrupt priority.
  3207. * @retval HAL status
  3208. */
  3209. __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
  3210. {
  3211. 800163c: b580 push {r7, lr}
  3212. 800163e: b082 sub sp, #8
  3213. 8001640: af00 add r7, sp, #0
  3214. 8001642: 6078 str r0, [r7, #4]
  3215. /* Configure the SysTick to have interrupt in 1ms time basis*/
  3216. if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U)
  3217. 8001644: 4b12 ldr r3, [pc, #72] ; (8001690 <HAL_InitTick+0x54>)
  3218. 8001646: 681a ldr r2, [r3, #0]
  3219. 8001648: 4b12 ldr r3, [pc, #72] ; (8001694 <HAL_InitTick+0x58>)
  3220. 800164a: 781b ldrb r3, [r3, #0]
  3221. 800164c: 4619 mov r1, r3
  3222. 800164e: f44f 737a mov.w r3, #1000 ; 0x3e8
  3223. 8001652: fbb3 f3f1 udiv r3, r3, r1
  3224. 8001656: fbb2 f3f3 udiv r3, r2, r3
  3225. 800165a: 4618 mov r0, r3
  3226. 800165c: f000 fdd9 bl 8002212 <HAL_SYSTICK_Config>
  3227. 8001660: 4603 mov r3, r0
  3228. 8001662: 2b00 cmp r3, #0
  3229. 8001664: d001 beq.n 800166a <HAL_InitTick+0x2e>
  3230. {
  3231. return HAL_ERROR;
  3232. 8001666: 2301 movs r3, #1
  3233. 8001668: e00e b.n 8001688 <HAL_InitTick+0x4c>
  3234. }
  3235. /* Configure the SysTick IRQ priority */
  3236. if (TickPriority < (1UL << __NVIC_PRIO_BITS))
  3237. 800166a: 687b ldr r3, [r7, #4]
  3238. 800166c: 2b0f cmp r3, #15
  3239. 800166e: d80a bhi.n 8001686 <HAL_InitTick+0x4a>
  3240. {
  3241. HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U);
  3242. 8001670: 2200 movs r2, #0
  3243. 8001672: 6879 ldr r1, [r7, #4]
  3244. 8001674: f04f 30ff mov.w r0, #4294967295
  3245. 8001678: f000 fda1 bl 80021be <HAL_NVIC_SetPriority>
  3246. uwTickPrio = TickPriority;
  3247. 800167c: 4a06 ldr r2, [pc, #24] ; (8001698 <HAL_InitTick+0x5c>)
  3248. 800167e: 687b ldr r3, [r7, #4]
  3249. 8001680: 6013 str r3, [r2, #0]
  3250. {
  3251. return HAL_ERROR;
  3252. }
  3253. /* Return function status */
  3254. return HAL_OK;
  3255. 8001682: 2300 movs r3, #0
  3256. 8001684: e000 b.n 8001688 <HAL_InitTick+0x4c>
  3257. return HAL_ERROR;
  3258. 8001686: 2301 movs r3, #1
  3259. }
  3260. 8001688: 4618 mov r0, r3
  3261. 800168a: 3708 adds r7, #8
  3262. 800168c: 46bd mov sp, r7
  3263. 800168e: bd80 pop {r7, pc}
  3264. 8001690: 20000004 .word 0x20000004
  3265. 8001694: 2000000c .word 0x2000000c
  3266. 8001698: 20000008 .word 0x20000008
  3267. 0800169c <HAL_IncTick>:
  3268. * @note This function is declared as __weak to be overwritten in case of other
  3269. * implementations in user file.
  3270. * @retval None
  3271. */
  3272. __weak void HAL_IncTick(void)
  3273. {
  3274. 800169c: b480 push {r7}
  3275. 800169e: af00 add r7, sp, #0
  3276. uwTick += uwTickFreq;
  3277. 80016a0: 4b06 ldr r3, [pc, #24] ; (80016bc <HAL_IncTick+0x20>)
  3278. 80016a2: 781b ldrb r3, [r3, #0]
  3279. 80016a4: 461a mov r2, r3
  3280. 80016a6: 4b06 ldr r3, [pc, #24] ; (80016c0 <HAL_IncTick+0x24>)
  3281. 80016a8: 681b ldr r3, [r3, #0]
  3282. 80016aa: 4413 add r3, r2
  3283. 80016ac: 4a04 ldr r2, [pc, #16] ; (80016c0 <HAL_IncTick+0x24>)
  3284. 80016ae: 6013 str r3, [r2, #0]
  3285. }
  3286. 80016b0: bf00 nop
  3287. 80016b2: 46bd mov sp, r7
  3288. 80016b4: f85d 7b04 ldr.w r7, [sp], #4
  3289. 80016b8: 4770 bx lr
  3290. 80016ba: bf00 nop
  3291. 80016bc: 2000000c .word 0x2000000c
  3292. 80016c0: 20002440 .word 0x20002440
  3293. 080016c4 <HAL_GetTick>:
  3294. * @note This function is declared as __weak to be overwritten in case of other
  3295. * implementations in user file.
  3296. * @retval tick value
  3297. */
  3298. __weak uint32_t HAL_GetTick(void)
  3299. {
  3300. 80016c4: b480 push {r7}
  3301. 80016c6: af00 add r7, sp, #0
  3302. return uwTick;
  3303. 80016c8: 4b03 ldr r3, [pc, #12] ; (80016d8 <HAL_GetTick+0x14>)
  3304. 80016ca: 681b ldr r3, [r3, #0]
  3305. }
  3306. 80016cc: 4618 mov r0, r3
  3307. 80016ce: 46bd mov sp, r7
  3308. 80016d0: f85d 7b04 ldr.w r7, [sp], #4
  3309. 80016d4: 4770 bx lr
  3310. 80016d6: bf00 nop
  3311. 80016d8: 20002440 .word 0x20002440
  3312. 080016dc <HAL_Delay>:
  3313. * implementations in user file.
  3314. * @param Delay specifies the delay time length, in milliseconds.
  3315. * @retval None
  3316. */
  3317. __weak void HAL_Delay(uint32_t Delay)
  3318. {
  3319. 80016dc: b580 push {r7, lr}
  3320. 80016de: b084 sub sp, #16
  3321. 80016e0: af00 add r7, sp, #0
  3322. 80016e2: 6078 str r0, [r7, #4]
  3323. uint32_t tickstart = HAL_GetTick();
  3324. 80016e4: f7ff ffee bl 80016c4 <HAL_GetTick>
  3325. 80016e8: 60b8 str r0, [r7, #8]
  3326. uint32_t wait = Delay;
  3327. 80016ea: 687b ldr r3, [r7, #4]
  3328. 80016ec: 60fb str r3, [r7, #12]
  3329. /* Add a freq to guarantee minimum wait */
  3330. if (wait < HAL_MAX_DELAY)
  3331. 80016ee: 68fb ldr r3, [r7, #12]
  3332. 80016f0: f1b3 3fff cmp.w r3, #4294967295
  3333. 80016f4: d005 beq.n 8001702 <HAL_Delay+0x26>
  3334. {
  3335. wait += (uint32_t)(uwTickFreq);
  3336. 80016f6: 4b09 ldr r3, [pc, #36] ; (800171c <HAL_Delay+0x40>)
  3337. 80016f8: 781b ldrb r3, [r3, #0]
  3338. 80016fa: 461a mov r2, r3
  3339. 80016fc: 68fb ldr r3, [r7, #12]
  3340. 80016fe: 4413 add r3, r2
  3341. 8001700: 60fb str r3, [r7, #12]
  3342. }
  3343. while((HAL_GetTick() - tickstart) < wait)
  3344. 8001702: bf00 nop
  3345. 8001704: f7ff ffde bl 80016c4 <HAL_GetTick>
  3346. 8001708: 4602 mov r2, r0
  3347. 800170a: 68bb ldr r3, [r7, #8]
  3348. 800170c: 1ad3 subs r3, r2, r3
  3349. 800170e: 68fa ldr r2, [r7, #12]
  3350. 8001710: 429a cmp r2, r3
  3351. 8001712: d8f7 bhi.n 8001704 <HAL_Delay+0x28>
  3352. {
  3353. }
  3354. }
  3355. 8001714: bf00 nop
  3356. 8001716: 3710 adds r7, #16
  3357. 8001718: 46bd mov sp, r7
  3358. 800171a: bd80 pop {r7, pc}
  3359. 800171c: 2000000c .word 0x2000000c
  3360. 08001720 <HAL_ADC_Init>:
  3361. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  3362. * the configuration information for the specified ADC.
  3363. * @retval HAL status
  3364. */
  3365. HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc)
  3366. {
  3367. 8001720: b580 push {r7, lr}
  3368. 8001722: b084 sub sp, #16
  3369. 8001724: af00 add r7, sp, #0
  3370. 8001726: 6078 str r0, [r7, #4]
  3371. HAL_StatusTypeDef tmp_hal_status = HAL_OK;
  3372. 8001728: 2300 movs r3, #0
  3373. 800172a: 73fb strb r3, [r7, #15]
  3374. /* Check ADC handle */
  3375. if(hadc == NULL)
  3376. 800172c: 687b ldr r3, [r7, #4]
  3377. 800172e: 2b00 cmp r3, #0
  3378. 8001730: d101 bne.n 8001736 <HAL_ADC_Init+0x16>
  3379. {
  3380. return HAL_ERROR;
  3381. 8001732: 2301 movs r3, #1
  3382. 8001734: e033 b.n 800179e <HAL_ADC_Init+0x7e>
  3383. if(hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START)
  3384. {
  3385. assert_param(IS_ADC_EXT_TRIG_EDGE(hadc->Init.ExternalTrigConvEdge));
  3386. }
  3387. if(hadc->State == HAL_ADC_STATE_RESET)
  3388. 8001736: 687b ldr r3, [r7, #4]
  3389. 8001738: 6c1b ldr r3, [r3, #64] ; 0x40
  3390. 800173a: 2b00 cmp r3, #0
  3391. 800173c: d109 bne.n 8001752 <HAL_ADC_Init+0x32>
  3392. /* Init the low level hardware */
  3393. hadc->MspInitCallback(hadc);
  3394. #else
  3395. /* Init the low level hardware */
  3396. HAL_ADC_MspInit(hadc);
  3397. 800173e: 6878 ldr r0, [r7, #4]
  3398. 8001740: f7ff fe0a bl 8001358 <HAL_ADC_MspInit>
  3399. #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
  3400. /* Initialize ADC error code */
  3401. ADC_CLEAR_ERRORCODE(hadc);
  3402. 8001744: 687b ldr r3, [r7, #4]
  3403. 8001746: 2200 movs r2, #0
  3404. 8001748: 645a str r2, [r3, #68] ; 0x44
  3405. /* Allocate lock resource and initialize it */
  3406. hadc->Lock = HAL_UNLOCKED;
  3407. 800174a: 687b ldr r3, [r7, #4]
  3408. 800174c: 2200 movs r2, #0
  3409. 800174e: f883 203c strb.w r2, [r3, #60] ; 0x3c
  3410. }
  3411. /* Configuration of ADC parameters if previous preliminary actions are */
  3412. /* correctly completed. */
  3413. if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL))
  3414. 8001752: 687b ldr r3, [r7, #4]
  3415. 8001754: 6c1b ldr r3, [r3, #64] ; 0x40
  3416. 8001756: f003 0310 and.w r3, r3, #16
  3417. 800175a: 2b00 cmp r3, #0
  3418. 800175c: d118 bne.n 8001790 <HAL_ADC_Init+0x70>
  3419. {
  3420. /* Set ADC state */
  3421. ADC_STATE_CLR_SET(hadc->State,
  3422. 800175e: 687b ldr r3, [r7, #4]
  3423. 8001760: 6c1b ldr r3, [r3, #64] ; 0x40
  3424. 8001762: f423 5388 bic.w r3, r3, #4352 ; 0x1100
  3425. 8001766: f023 0302 bic.w r3, r3, #2
  3426. 800176a: f043 0202 orr.w r2, r3, #2
  3427. 800176e: 687b ldr r3, [r7, #4]
  3428. 8001770: 641a str r2, [r3, #64] ; 0x40
  3429. HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY,
  3430. HAL_ADC_STATE_BUSY_INTERNAL);
  3431. /* Set ADC parameters */
  3432. ADC_Init(hadc);
  3433. 8001772: 6878 ldr r0, [r7, #4]
  3434. 8001774: f000 fb42 bl 8001dfc <ADC_Init>
  3435. /* Set ADC error code to none */
  3436. ADC_CLEAR_ERRORCODE(hadc);
  3437. 8001778: 687b ldr r3, [r7, #4]
  3438. 800177a: 2200 movs r2, #0
  3439. 800177c: 645a str r2, [r3, #68] ; 0x44
  3440. /* Set the ADC state */
  3441. ADC_STATE_CLR_SET(hadc->State,
  3442. 800177e: 687b ldr r3, [r7, #4]
  3443. 8001780: 6c1b ldr r3, [r3, #64] ; 0x40
  3444. 8001782: f023 0303 bic.w r3, r3, #3
  3445. 8001786: f043 0201 orr.w r2, r3, #1
  3446. 800178a: 687b ldr r3, [r7, #4]
  3447. 800178c: 641a str r2, [r3, #64] ; 0x40
  3448. 800178e: e001 b.n 8001794 <HAL_ADC_Init+0x74>
  3449. HAL_ADC_STATE_BUSY_INTERNAL,
  3450. HAL_ADC_STATE_READY);
  3451. }
  3452. else
  3453. {
  3454. tmp_hal_status = HAL_ERROR;
  3455. 8001790: 2301 movs r3, #1
  3456. 8001792: 73fb strb r3, [r7, #15]
  3457. }
  3458. /* Release Lock */
  3459. __HAL_UNLOCK(hadc);
  3460. 8001794: 687b ldr r3, [r7, #4]
  3461. 8001796: 2200 movs r2, #0
  3462. 8001798: f883 203c strb.w r2, [r3, #60] ; 0x3c
  3463. /* Return function status */
  3464. return tmp_hal_status;
  3465. 800179c: 7bfb ldrb r3, [r7, #15]
  3466. }
  3467. 800179e: 4618 mov r0, r3
  3468. 80017a0: 3710 adds r7, #16
  3469. 80017a2: 46bd mov sp, r7
  3470. 80017a4: bd80 pop {r7, pc}
  3471. ...
  3472. 080017a8 <HAL_ADC_Start_IT>:
  3473. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  3474. * the configuration information for the specified ADC.
  3475. * @retval HAL status.
  3476. */
  3477. HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc)
  3478. {
  3479. 80017a8: b480 push {r7}
  3480. 80017aa: b085 sub sp, #20
  3481. 80017ac: af00 add r7, sp, #0
  3482. 80017ae: 6078 str r0, [r7, #4]
  3483. __IO uint32_t counter = 0U;
  3484. 80017b0: 2300 movs r3, #0
  3485. 80017b2: 60bb str r3, [r7, #8]
  3486. /* Check the parameters */
  3487. assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode));
  3488. assert_param(IS_ADC_EXT_TRIG_EDGE(hadc->Init.ExternalTrigConvEdge));
  3489. /* Process locked */
  3490. __HAL_LOCK(hadc);
  3491. 80017b4: 687b ldr r3, [r7, #4]
  3492. 80017b6: f893 303c ldrb.w r3, [r3, #60] ; 0x3c
  3493. 80017ba: 2b01 cmp r3, #1
  3494. 80017bc: d101 bne.n 80017c2 <HAL_ADC_Start_IT+0x1a>
  3495. 80017be: 2302 movs r3, #2
  3496. 80017c0: e094 b.n 80018ec <HAL_ADC_Start_IT+0x144>
  3497. 80017c2: 687b ldr r3, [r7, #4]
  3498. 80017c4: 2201 movs r2, #1
  3499. 80017c6: f883 203c strb.w r2, [r3, #60] ; 0x3c
  3500. /* Enable the ADC peripheral */
  3501. /* Check if ADC peripheral is disabled in order to enable it and wait during
  3502. Tstab time the ADC's stabilization */
  3503. if((hadc->Instance->CR2 & ADC_CR2_ADON) != ADC_CR2_ADON)
  3504. 80017ca: 687b ldr r3, [r7, #4]
  3505. 80017cc: 681b ldr r3, [r3, #0]
  3506. 80017ce: 689b ldr r3, [r3, #8]
  3507. 80017d0: f003 0301 and.w r3, r3, #1
  3508. 80017d4: 2b01 cmp r3, #1
  3509. 80017d6: d018 beq.n 800180a <HAL_ADC_Start_IT+0x62>
  3510. {
  3511. /* Enable the Peripheral */
  3512. __HAL_ADC_ENABLE(hadc);
  3513. 80017d8: 687b ldr r3, [r7, #4]
  3514. 80017da: 681b ldr r3, [r3, #0]
  3515. 80017dc: 689a ldr r2, [r3, #8]
  3516. 80017de: 687b ldr r3, [r7, #4]
  3517. 80017e0: 681b ldr r3, [r3, #0]
  3518. 80017e2: f042 0201 orr.w r2, r2, #1
  3519. 80017e6: 609a str r2, [r3, #8]
  3520. /* Delay for ADC stabilization time */
  3521. /* Compute number of CPU cycles to wait for */
  3522. counter = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000U));
  3523. 80017e8: 4b43 ldr r3, [pc, #268] ; (80018f8 <HAL_ADC_Start_IT+0x150>)
  3524. 80017ea: 681b ldr r3, [r3, #0]
  3525. 80017ec: 4a43 ldr r2, [pc, #268] ; (80018fc <HAL_ADC_Start_IT+0x154>)
  3526. 80017ee: fba2 2303 umull r2, r3, r2, r3
  3527. 80017f2: 0c9a lsrs r2, r3, #18
  3528. 80017f4: 4613 mov r3, r2
  3529. 80017f6: 005b lsls r3, r3, #1
  3530. 80017f8: 4413 add r3, r2
  3531. 80017fa: 60bb str r3, [r7, #8]
  3532. while(counter != 0U)
  3533. 80017fc: e002 b.n 8001804 <HAL_ADC_Start_IT+0x5c>
  3534. {
  3535. counter--;
  3536. 80017fe: 68bb ldr r3, [r7, #8]
  3537. 8001800: 3b01 subs r3, #1
  3538. 8001802: 60bb str r3, [r7, #8]
  3539. while(counter != 0U)
  3540. 8001804: 68bb ldr r3, [r7, #8]
  3541. 8001806: 2b00 cmp r3, #0
  3542. 8001808: d1f9 bne.n 80017fe <HAL_ADC_Start_IT+0x56>
  3543. }
  3544. }
  3545. /* Start conversion if ADC is effectively enabled */
  3546. if(HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_ADON))
  3547. 800180a: 687b ldr r3, [r7, #4]
  3548. 800180c: 681b ldr r3, [r3, #0]
  3549. 800180e: 689b ldr r3, [r3, #8]
  3550. 8001810: f003 0301 and.w r3, r3, #1
  3551. 8001814: 2b01 cmp r3, #1
  3552. 8001816: d168 bne.n 80018ea <HAL_ADC_Start_IT+0x142>
  3553. {
  3554. /* Set ADC state */
  3555. /* - Clear state bitfield related to regular group conversion results */
  3556. /* - Set state bitfield related to regular group operation */
  3557. ADC_STATE_CLR_SET(hadc->State,
  3558. 8001818: 687b ldr r3, [r7, #4]
  3559. 800181a: 6c1b ldr r3, [r3, #64] ; 0x40
  3560. 800181c: f423 63e0 bic.w r3, r3, #1792 ; 0x700
  3561. 8001820: f023 0301 bic.w r3, r3, #1
  3562. 8001824: f443 7280 orr.w r2, r3, #256 ; 0x100
  3563. 8001828: 687b ldr r3, [r7, #4]
  3564. 800182a: 641a str r2, [r3, #64] ; 0x40
  3565. HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR,
  3566. HAL_ADC_STATE_REG_BUSY);
  3567. /* If conversions on group regular are also triggering group injected, */
  3568. /* update ADC state. */
  3569. if (READ_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO) != RESET)
  3570. 800182c: 687b ldr r3, [r7, #4]
  3571. 800182e: 681b ldr r3, [r3, #0]
  3572. 8001830: 685b ldr r3, [r3, #4]
  3573. 8001832: f403 6380 and.w r3, r3, #1024 ; 0x400
  3574. 8001836: 2b00 cmp r3, #0
  3575. 8001838: d007 beq.n 800184a <HAL_ADC_Start_IT+0xa2>
  3576. {
  3577. ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY);
  3578. 800183a: 687b ldr r3, [r7, #4]
  3579. 800183c: 6c1b ldr r3, [r3, #64] ; 0x40
  3580. 800183e: f423 5340 bic.w r3, r3, #12288 ; 0x3000
  3581. 8001842: f443 5280 orr.w r2, r3, #4096 ; 0x1000
  3582. 8001846: 687b ldr r3, [r7, #4]
  3583. 8001848: 641a str r2, [r3, #64] ; 0x40
  3584. }
  3585. /* State machine update: Check if an injected conversion is ongoing */
  3586. if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY))
  3587. 800184a: 687b ldr r3, [r7, #4]
  3588. 800184c: 6c1b ldr r3, [r3, #64] ; 0x40
  3589. 800184e: f403 5380 and.w r3, r3, #4096 ; 0x1000
  3590. 8001852: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
  3591. 8001856: d106 bne.n 8001866 <HAL_ADC_Start_IT+0xbe>
  3592. {
  3593. /* Reset ADC error code fields related to conversions on group regular */
  3594. CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA));
  3595. 8001858: 687b ldr r3, [r7, #4]
  3596. 800185a: 6c5b ldr r3, [r3, #68] ; 0x44
  3597. 800185c: f023 0206 bic.w r2, r3, #6
  3598. 8001860: 687b ldr r3, [r7, #4]
  3599. 8001862: 645a str r2, [r3, #68] ; 0x44
  3600. 8001864: e002 b.n 800186c <HAL_ADC_Start_IT+0xc4>
  3601. }
  3602. else
  3603. {
  3604. /* Reset ADC all error code fields */
  3605. ADC_CLEAR_ERRORCODE(hadc);
  3606. 8001866: 687b ldr r3, [r7, #4]
  3607. 8001868: 2200 movs r2, #0
  3608. 800186a: 645a str r2, [r3, #68] ; 0x44
  3609. }
  3610. /* Process unlocked */
  3611. /* Unlock before starting ADC conversions: in case of potential */
  3612. /* interruption, to let the process to ADC IRQ Handler. */
  3613. __HAL_UNLOCK(hadc);
  3614. 800186c: 687b ldr r3, [r7, #4]
  3615. 800186e: 2200 movs r2, #0
  3616. 8001870: f883 203c strb.w r2, [r3, #60] ; 0x3c
  3617. /* Pointer to the common control register to which is belonging hadc */
  3618. /* (Depending on STM32F4 product, there may be up to 3 ADCs and 1 common */
  3619. /* control register) */
  3620. tmpADC_Common = ADC_COMMON_REGISTER(hadc);
  3621. 8001874: 4b22 ldr r3, [pc, #136] ; (8001900 <HAL_ADC_Start_IT+0x158>)
  3622. 8001876: 60fb str r3, [r7, #12]
  3623. /* Clear regular group conversion flag and overrun flag */
  3624. /* (To ensure of no unknown state from potential previous ADC operations) */
  3625. __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_EOC | ADC_FLAG_OVR);
  3626. 8001878: 687b ldr r3, [r7, #4]
  3627. 800187a: 681b ldr r3, [r3, #0]
  3628. 800187c: f06f 0222 mvn.w r2, #34 ; 0x22
  3629. 8001880: 601a str r2, [r3, #0]
  3630. /* Enable end of conversion interrupt for regular group */
  3631. __HAL_ADC_ENABLE_IT(hadc, (ADC_IT_EOC | ADC_IT_OVR));
  3632. 8001882: 687b ldr r3, [r7, #4]
  3633. 8001884: 681b ldr r3, [r3, #0]
  3634. 8001886: 685b ldr r3, [r3, #4]
  3635. 8001888: 687a ldr r2, [r7, #4]
  3636. 800188a: 6812 ldr r2, [r2, #0]
  3637. 800188c: f043 6380 orr.w r3, r3, #67108864 ; 0x4000000
  3638. 8001890: f043 0320 orr.w r3, r3, #32
  3639. 8001894: 6053 str r3, [r2, #4]
  3640. /* Check if Multimode enabled */
  3641. if(HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_MULTI))
  3642. 8001896: 68fb ldr r3, [r7, #12]
  3643. 8001898: 685b ldr r3, [r3, #4]
  3644. 800189a: f003 031f and.w r3, r3, #31
  3645. 800189e: 2b00 cmp r3, #0
  3646. 80018a0: d10f bne.n 80018c2 <HAL_ADC_Start_IT+0x11a>
  3647. if((hadc->Instance == ADC1) || ((hadc->Instance == ADC2) && ((ADC->CCR & ADC_CCR_MULTI_Msk) < ADC_CCR_MULTI_0)) \
  3648. || ((hadc->Instance == ADC3) && ((ADC->CCR & ADC_CCR_MULTI_Msk) < ADC_CCR_MULTI_4)))
  3649. {
  3650. #endif /* ADC2 || ADC3 */
  3651. /* if no external trigger present enable software conversion of regular channels */
  3652. if((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET)
  3653. 80018a2: 687b ldr r3, [r7, #4]
  3654. 80018a4: 681b ldr r3, [r3, #0]
  3655. 80018a6: 689b ldr r3, [r3, #8]
  3656. 80018a8: f003 5340 and.w r3, r3, #805306368 ; 0x30000000
  3657. 80018ac: 2b00 cmp r3, #0
  3658. 80018ae: d11c bne.n 80018ea <HAL_ADC_Start_IT+0x142>
  3659. {
  3660. /* Enable the selected ADC software conversion for regular group */
  3661. hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART;
  3662. 80018b0: 687b ldr r3, [r7, #4]
  3663. 80018b2: 681b ldr r3, [r3, #0]
  3664. 80018b4: 689a ldr r2, [r3, #8]
  3665. 80018b6: 687b ldr r3, [r7, #4]
  3666. 80018b8: 681b ldr r3, [r3, #0]
  3667. 80018ba: f042 4280 orr.w r2, r2, #1073741824 ; 0x40000000
  3668. 80018be: 609a str r2, [r3, #8]
  3669. 80018c0: e013 b.n 80018ea <HAL_ADC_Start_IT+0x142>
  3670. #endif /* ADC2 || ADC3 */
  3671. }
  3672. else
  3673. {
  3674. /* if instance of handle correspond to ADC1 and no external trigger present enable software conversion of regular channels */
  3675. if((hadc->Instance == ADC1) && ((hadc->Instance->CR2 & ADC_CR2_EXTEN) == RESET))
  3676. 80018c2: 687b ldr r3, [r7, #4]
  3677. 80018c4: 681b ldr r3, [r3, #0]
  3678. 80018c6: 4a0f ldr r2, [pc, #60] ; (8001904 <HAL_ADC_Start_IT+0x15c>)
  3679. 80018c8: 4293 cmp r3, r2
  3680. 80018ca: d10e bne.n 80018ea <HAL_ADC_Start_IT+0x142>
  3681. 80018cc: 687b ldr r3, [r7, #4]
  3682. 80018ce: 681b ldr r3, [r3, #0]
  3683. 80018d0: 689b ldr r3, [r3, #8]
  3684. 80018d2: f003 5340 and.w r3, r3, #805306368 ; 0x30000000
  3685. 80018d6: 2b00 cmp r3, #0
  3686. 80018d8: d107 bne.n 80018ea <HAL_ADC_Start_IT+0x142>
  3687. {
  3688. /* Enable the selected ADC software conversion for regular group */
  3689. hadc->Instance->CR2 |= (uint32_t)ADC_CR2_SWSTART;
  3690. 80018da: 687b ldr r3, [r7, #4]
  3691. 80018dc: 681b ldr r3, [r3, #0]
  3692. 80018de: 689a ldr r2, [r3, #8]
  3693. 80018e0: 687b ldr r3, [r7, #4]
  3694. 80018e2: 681b ldr r3, [r3, #0]
  3695. 80018e4: f042 4280 orr.w r2, r2, #1073741824 ; 0x40000000
  3696. 80018e8: 609a str r2, [r3, #8]
  3697. }
  3698. }
  3699. }
  3700. /* Return function status */
  3701. return HAL_OK;
  3702. 80018ea: 2300 movs r3, #0
  3703. }
  3704. 80018ec: 4618 mov r0, r3
  3705. 80018ee: 3714 adds r7, #20
  3706. 80018f0: 46bd mov sp, r7
  3707. 80018f2: f85d 7b04 ldr.w r7, [sp], #4
  3708. 80018f6: 4770 bx lr
  3709. 80018f8: 20000004 .word 0x20000004
  3710. 80018fc: 431bde83 .word 0x431bde83
  3711. 8001900: 40012300 .word 0x40012300
  3712. 8001904: 40012000 .word 0x40012000
  3713. 08001908 <HAL_ADC_IRQHandler>:
  3714. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  3715. * the configuration information for the specified ADC.
  3716. * @retval None
  3717. */
  3718. void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc)
  3719. {
  3720. 8001908: b580 push {r7, lr}
  3721. 800190a: b084 sub sp, #16
  3722. 800190c: af00 add r7, sp, #0
  3723. 800190e: 6078 str r0, [r7, #4]
  3724. uint32_t tmp1 = 0U, tmp2 = 0U;
  3725. 8001910: 2300 movs r3, #0
  3726. 8001912: 60fb str r3, [r7, #12]
  3727. 8001914: 2300 movs r3, #0
  3728. 8001916: 60bb str r3, [r7, #8]
  3729. /* Check the parameters */
  3730. assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode));
  3731. assert_param(IS_ADC_REGULAR_LENGTH(hadc->Init.NbrOfConversion));
  3732. assert_param(IS_ADC_EOCSelection(hadc->Init.EOCSelection));
  3733. tmp1 = __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_EOC);
  3734. 8001918: 687b ldr r3, [r7, #4]
  3735. 800191a: 681b ldr r3, [r3, #0]
  3736. 800191c: 681b ldr r3, [r3, #0]
  3737. 800191e: f003 0302 and.w r3, r3, #2
  3738. 8001922: 2b02 cmp r3, #2
  3739. 8001924: bf0c ite eq
  3740. 8001926: 2301 moveq r3, #1
  3741. 8001928: 2300 movne r3, #0
  3742. 800192a: b2db uxtb r3, r3
  3743. 800192c: 60fb str r3, [r7, #12]
  3744. tmp2 = __HAL_ADC_GET_IT_SOURCE(hadc, ADC_IT_EOC);
  3745. 800192e: 687b ldr r3, [r7, #4]
  3746. 8001930: 681b ldr r3, [r3, #0]
  3747. 8001932: 685b ldr r3, [r3, #4]
  3748. 8001934: f003 0320 and.w r3, r3, #32
  3749. 8001938: 2b20 cmp r3, #32
  3750. 800193a: bf0c ite eq
  3751. 800193c: 2301 moveq r3, #1
  3752. 800193e: 2300 movne r3, #0
  3753. 8001940: b2db uxtb r3, r3
  3754. 8001942: 60bb str r3, [r7, #8]
  3755. /* Check End of conversion flag for regular channels */
  3756. if(tmp1 && tmp2)
  3757. 8001944: 68fb ldr r3, [r7, #12]
  3758. 8001946: 2b00 cmp r3, #0
  3759. 8001948: d049 beq.n 80019de <HAL_ADC_IRQHandler+0xd6>
  3760. 800194a: 68bb ldr r3, [r7, #8]
  3761. 800194c: 2b00 cmp r3, #0
  3762. 800194e: d046 beq.n 80019de <HAL_ADC_IRQHandler+0xd6>
  3763. {
  3764. /* Update state machine on conversion status if not in error state */
  3765. if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL))
  3766. 8001950: 687b ldr r3, [r7, #4]
  3767. 8001952: 6c1b ldr r3, [r3, #64] ; 0x40
  3768. 8001954: f003 0310 and.w r3, r3, #16
  3769. 8001958: 2b00 cmp r3, #0
  3770. 800195a: d105 bne.n 8001968 <HAL_ADC_IRQHandler+0x60>
  3771. {
  3772. /* Set ADC state */
  3773. SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC);
  3774. 800195c: 687b ldr r3, [r7, #4]
  3775. 800195e: 6c1b ldr r3, [r3, #64] ; 0x40
  3776. 8001960: f443 7200 orr.w r2, r3, #512 ; 0x200
  3777. 8001964: 687b ldr r3, [r7, #4]
  3778. 8001966: 641a str r2, [r3, #64] ; 0x40
  3779. /* by external trigger, continuous mode or scan sequence on going. */
  3780. /* Note: On STM32F4, there is no independent flag of end of sequence. */
  3781. /* The test of scan sequence on going is done either with scan */
  3782. /* sequence disabled or with end of conversion flag set to */
  3783. /* of end of sequence. */
  3784. if(ADC_IS_SOFTWARE_START_REGULAR(hadc) &&
  3785. 8001968: 687b ldr r3, [r7, #4]
  3786. 800196a: 681b ldr r3, [r3, #0]
  3787. 800196c: 689b ldr r3, [r3, #8]
  3788. 800196e: f003 5340 and.w r3, r3, #805306368 ; 0x30000000
  3789. 8001972: 2b00 cmp r3, #0
  3790. 8001974: d12b bne.n 80019ce <HAL_ADC_IRQHandler+0xc6>
  3791. (hadc->Init.ContinuousConvMode == DISABLE) &&
  3792. 8001976: 687b ldr r3, [r7, #4]
  3793. 8001978: 7e1b ldrb r3, [r3, #24]
  3794. if(ADC_IS_SOFTWARE_START_REGULAR(hadc) &&
  3795. 800197a: 2b00 cmp r3, #0
  3796. 800197c: d127 bne.n 80019ce <HAL_ADC_IRQHandler+0xc6>
  3797. (HAL_IS_BIT_CLR(hadc->Instance->SQR1, ADC_SQR1_L) ||
  3798. 800197e: 687b ldr r3, [r7, #4]
  3799. 8001980: 681b ldr r3, [r3, #0]
  3800. 8001982: 6adb ldr r3, [r3, #44] ; 0x2c
  3801. 8001984: f403 0370 and.w r3, r3, #15728640 ; 0xf00000
  3802. (hadc->Init.ContinuousConvMode == DISABLE) &&
  3803. 8001988: 2b00 cmp r3, #0
  3804. 800198a: d006 beq.n 800199a <HAL_ADC_IRQHandler+0x92>
  3805. HAL_IS_BIT_CLR(hadc->Instance->CR2, ADC_CR2_EOCS) ) )
  3806. 800198c: 687b ldr r3, [r7, #4]
  3807. 800198e: 681b ldr r3, [r3, #0]
  3808. 8001990: 689b ldr r3, [r3, #8]
  3809. 8001992: f403 6380 and.w r3, r3, #1024 ; 0x400
  3810. (HAL_IS_BIT_CLR(hadc->Instance->SQR1, ADC_SQR1_L) ||
  3811. 8001996: 2b00 cmp r3, #0
  3812. 8001998: d119 bne.n 80019ce <HAL_ADC_IRQHandler+0xc6>
  3813. {
  3814. /* Disable ADC end of single conversion interrupt on group regular */
  3815. /* Note: Overrun interrupt was enabled with EOC interrupt in */
  3816. /* HAL_ADC_Start_IT(), but is not disabled here because can be used */
  3817. /* by overrun IRQ process below. */
  3818. __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC);
  3819. 800199a: 687b ldr r3, [r7, #4]
  3820. 800199c: 681b ldr r3, [r3, #0]
  3821. 800199e: 685a ldr r2, [r3, #4]
  3822. 80019a0: 687b ldr r3, [r7, #4]
  3823. 80019a2: 681b ldr r3, [r3, #0]
  3824. 80019a4: f022 0220 bic.w r2, r2, #32
  3825. 80019a8: 605a str r2, [r3, #4]
  3826. /* Set ADC state */
  3827. CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY);
  3828. 80019aa: 687b ldr r3, [r7, #4]
  3829. 80019ac: 6c1b ldr r3, [r3, #64] ; 0x40
  3830. 80019ae: f423 7280 bic.w r2, r3, #256 ; 0x100
  3831. 80019b2: 687b ldr r3, [r7, #4]
  3832. 80019b4: 641a str r2, [r3, #64] ; 0x40
  3833. if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY))
  3834. 80019b6: 687b ldr r3, [r7, #4]
  3835. 80019b8: 6c1b ldr r3, [r3, #64] ; 0x40
  3836. 80019ba: f403 5380 and.w r3, r3, #4096 ; 0x1000
  3837. 80019be: 2b00 cmp r3, #0
  3838. 80019c0: d105 bne.n 80019ce <HAL_ADC_IRQHandler+0xc6>
  3839. {
  3840. SET_BIT(hadc->State, HAL_ADC_STATE_READY);
  3841. 80019c2: 687b ldr r3, [r7, #4]
  3842. 80019c4: 6c1b ldr r3, [r3, #64] ; 0x40
  3843. 80019c6: f043 0201 orr.w r2, r3, #1
  3844. 80019ca: 687b ldr r3, [r7, #4]
  3845. 80019cc: 641a str r2, [r3, #64] ; 0x40
  3846. /* Conversion complete callback */
  3847. #if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
  3848. hadc->ConvCpltCallback(hadc);
  3849. #else
  3850. HAL_ADC_ConvCpltCallback(hadc);
  3851. 80019ce: 6878 ldr r0, [r7, #4]
  3852. 80019d0: f7ff fc50 bl 8001274 <HAL_ADC_ConvCpltCallback>
  3853. #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
  3854. /* Clear regular group conversion flag */
  3855. __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_STRT | ADC_FLAG_EOC);
  3856. 80019d4: 687b ldr r3, [r7, #4]
  3857. 80019d6: 681b ldr r3, [r3, #0]
  3858. 80019d8: f06f 0212 mvn.w r2, #18
  3859. 80019dc: 601a str r2, [r3, #0]
  3860. }
  3861. tmp1 = __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_JEOC);
  3862. 80019de: 687b ldr r3, [r7, #4]
  3863. 80019e0: 681b ldr r3, [r3, #0]
  3864. 80019e2: 681b ldr r3, [r3, #0]
  3865. 80019e4: f003 0304 and.w r3, r3, #4
  3866. 80019e8: 2b04 cmp r3, #4
  3867. 80019ea: bf0c ite eq
  3868. 80019ec: 2301 moveq r3, #1
  3869. 80019ee: 2300 movne r3, #0
  3870. 80019f0: b2db uxtb r3, r3
  3871. 80019f2: 60fb str r3, [r7, #12]
  3872. tmp2 = __HAL_ADC_GET_IT_SOURCE(hadc, ADC_IT_JEOC);
  3873. 80019f4: 687b ldr r3, [r7, #4]
  3874. 80019f6: 681b ldr r3, [r3, #0]
  3875. 80019f8: 685b ldr r3, [r3, #4]
  3876. 80019fa: f003 0380 and.w r3, r3, #128 ; 0x80
  3877. 80019fe: 2b80 cmp r3, #128 ; 0x80
  3878. 8001a00: bf0c ite eq
  3879. 8001a02: 2301 moveq r3, #1
  3880. 8001a04: 2300 movne r3, #0
  3881. 8001a06: b2db uxtb r3, r3
  3882. 8001a08: 60bb str r3, [r7, #8]
  3883. /* Check End of conversion flag for injected channels */
  3884. if(tmp1 && tmp2)
  3885. 8001a0a: 68fb ldr r3, [r7, #12]
  3886. 8001a0c: 2b00 cmp r3, #0
  3887. 8001a0e: d057 beq.n 8001ac0 <HAL_ADC_IRQHandler+0x1b8>
  3888. 8001a10: 68bb ldr r3, [r7, #8]
  3889. 8001a12: 2b00 cmp r3, #0
  3890. 8001a14: d054 beq.n 8001ac0 <HAL_ADC_IRQHandler+0x1b8>
  3891. {
  3892. /* Update state machine on conversion status if not in error state */
  3893. if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL))
  3894. 8001a16: 687b ldr r3, [r7, #4]
  3895. 8001a18: 6c1b ldr r3, [r3, #64] ; 0x40
  3896. 8001a1a: f003 0310 and.w r3, r3, #16
  3897. 8001a1e: 2b00 cmp r3, #0
  3898. 8001a20: d105 bne.n 8001a2e <HAL_ADC_IRQHandler+0x126>
  3899. {
  3900. /* Set ADC state */
  3901. SET_BIT(hadc->State, HAL_ADC_STATE_INJ_EOC);
  3902. 8001a22: 687b ldr r3, [r7, #4]
  3903. 8001a24: 6c1b ldr r3, [r3, #64] ; 0x40
  3904. 8001a26: f443 5200 orr.w r2, r3, #8192 ; 0x2000
  3905. 8001a2a: 687b ldr r3, [r7, #4]
  3906. 8001a2c: 641a str r2, [r3, #64] ; 0x40
  3907. /* Determine whether any further conversion upcoming on group injected */
  3908. /* by external trigger, scan sequence on going or by automatic injected */
  3909. /* conversion from group regular (same conditions as group regular */
  3910. /* interruption disabling above). */
  3911. if(ADC_IS_SOFTWARE_START_INJECTED(hadc) &&
  3912. 8001a2e: 687b ldr r3, [r7, #4]
  3913. 8001a30: 681b ldr r3, [r3, #0]
  3914. 8001a32: 689b ldr r3, [r3, #8]
  3915. 8001a34: f403 1340 and.w r3, r3, #3145728 ; 0x300000
  3916. 8001a38: 2b00 cmp r3, #0
  3917. 8001a3a: d139 bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3918. (HAL_IS_BIT_CLR(hadc->Instance->JSQR, ADC_JSQR_JL) ||
  3919. 8001a3c: 687b ldr r3, [r7, #4]
  3920. 8001a3e: 681b ldr r3, [r3, #0]
  3921. 8001a40: 6b9b ldr r3, [r3, #56] ; 0x38
  3922. 8001a42: f403 1340 and.w r3, r3, #3145728 ; 0x300000
  3923. if(ADC_IS_SOFTWARE_START_INJECTED(hadc) &&
  3924. 8001a46: 2b00 cmp r3, #0
  3925. 8001a48: d006 beq.n 8001a58 <HAL_ADC_IRQHandler+0x150>
  3926. HAL_IS_BIT_CLR(hadc->Instance->CR2, ADC_CR2_EOCS) ) &&
  3927. 8001a4a: 687b ldr r3, [r7, #4]
  3928. 8001a4c: 681b ldr r3, [r3, #0]
  3929. 8001a4e: 689b ldr r3, [r3, #8]
  3930. 8001a50: f403 6380 and.w r3, r3, #1024 ; 0x400
  3931. (HAL_IS_BIT_CLR(hadc->Instance->JSQR, ADC_JSQR_JL) ||
  3932. 8001a54: 2b00 cmp r3, #0
  3933. 8001a56: d12b bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3934. (HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) &&
  3935. 8001a58: 687b ldr r3, [r7, #4]
  3936. 8001a5a: 681b ldr r3, [r3, #0]
  3937. 8001a5c: 685b ldr r3, [r3, #4]
  3938. 8001a5e: f403 6380 and.w r3, r3, #1024 ; 0x400
  3939. HAL_IS_BIT_CLR(hadc->Instance->CR2, ADC_CR2_EOCS) ) &&
  3940. 8001a62: 2b00 cmp r3, #0
  3941. 8001a64: d124 bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3942. (ADC_IS_SOFTWARE_START_REGULAR(hadc) &&
  3943. 8001a66: 687b ldr r3, [r7, #4]
  3944. 8001a68: 681b ldr r3, [r3, #0]
  3945. 8001a6a: 689b ldr r3, [r3, #8]
  3946. 8001a6c: f003 5340 and.w r3, r3, #805306368 ; 0x30000000
  3947. (HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) &&
  3948. 8001a70: 2b00 cmp r3, #0
  3949. 8001a72: d11d bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3950. (hadc->Init.ContinuousConvMode == DISABLE) ) ) )
  3951. 8001a74: 687b ldr r3, [r7, #4]
  3952. 8001a76: 7e1b ldrb r3, [r3, #24]
  3953. (ADC_IS_SOFTWARE_START_REGULAR(hadc) &&
  3954. 8001a78: 2b00 cmp r3, #0
  3955. 8001a7a: d119 bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3956. {
  3957. /* Disable ADC end of single conversion interrupt on group injected */
  3958. __HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC);
  3959. 8001a7c: 687b ldr r3, [r7, #4]
  3960. 8001a7e: 681b ldr r3, [r3, #0]
  3961. 8001a80: 685a ldr r2, [r3, #4]
  3962. 8001a82: 687b ldr r3, [r7, #4]
  3963. 8001a84: 681b ldr r3, [r3, #0]
  3964. 8001a86: f022 0280 bic.w r2, r2, #128 ; 0x80
  3965. 8001a8a: 605a str r2, [r3, #4]
  3966. /* Set ADC state */
  3967. CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY);
  3968. 8001a8c: 687b ldr r3, [r7, #4]
  3969. 8001a8e: 6c1b ldr r3, [r3, #64] ; 0x40
  3970. 8001a90: f423 5280 bic.w r2, r3, #4096 ; 0x1000
  3971. 8001a94: 687b ldr r3, [r7, #4]
  3972. 8001a96: 641a str r2, [r3, #64] ; 0x40
  3973. if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY))
  3974. 8001a98: 687b ldr r3, [r7, #4]
  3975. 8001a9a: 6c1b ldr r3, [r3, #64] ; 0x40
  3976. 8001a9c: f403 7380 and.w r3, r3, #256 ; 0x100
  3977. 8001aa0: 2b00 cmp r3, #0
  3978. 8001aa2: d105 bne.n 8001ab0 <HAL_ADC_IRQHandler+0x1a8>
  3979. {
  3980. SET_BIT(hadc->State, HAL_ADC_STATE_READY);
  3981. 8001aa4: 687b ldr r3, [r7, #4]
  3982. 8001aa6: 6c1b ldr r3, [r3, #64] ; 0x40
  3983. 8001aa8: f043 0201 orr.w r2, r3, #1
  3984. 8001aac: 687b ldr r3, [r7, #4]
  3985. 8001aae: 641a str r2, [r3, #64] ; 0x40
  3986. /* Conversion complete callback */
  3987. /* Conversion complete callback */
  3988. #if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
  3989. hadc->InjectedConvCpltCallback(hadc);
  3990. #else
  3991. HAL_ADCEx_InjectedConvCpltCallback(hadc);
  3992. 8001ab0: 6878 ldr r0, [r7, #4]
  3993. 8001ab2: f000 fa9f bl 8001ff4 <HAL_ADCEx_InjectedConvCpltCallback>
  3994. #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
  3995. /* Clear injected group conversion flag */
  3996. __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_JSTRT | ADC_FLAG_JEOC));
  3997. 8001ab6: 687b ldr r3, [r7, #4]
  3998. 8001ab8: 681b ldr r3, [r3, #0]
  3999. 8001aba: f06f 020c mvn.w r2, #12
  4000. 8001abe: 601a str r2, [r3, #0]
  4001. }
  4002. tmp1 = __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_AWD);
  4003. 8001ac0: 687b ldr r3, [r7, #4]
  4004. 8001ac2: 681b ldr r3, [r3, #0]
  4005. 8001ac4: 681b ldr r3, [r3, #0]
  4006. 8001ac6: f003 0301 and.w r3, r3, #1
  4007. 8001aca: 2b01 cmp r3, #1
  4008. 8001acc: bf0c ite eq
  4009. 8001ace: 2301 moveq r3, #1
  4010. 8001ad0: 2300 movne r3, #0
  4011. 8001ad2: b2db uxtb r3, r3
  4012. 8001ad4: 60fb str r3, [r7, #12]
  4013. tmp2 = __HAL_ADC_GET_IT_SOURCE(hadc, ADC_IT_AWD);
  4014. 8001ad6: 687b ldr r3, [r7, #4]
  4015. 8001ad8: 681b ldr r3, [r3, #0]
  4016. 8001ada: 685b ldr r3, [r3, #4]
  4017. 8001adc: f003 0340 and.w r3, r3, #64 ; 0x40
  4018. 8001ae0: 2b40 cmp r3, #64 ; 0x40
  4019. 8001ae2: bf0c ite eq
  4020. 8001ae4: 2301 moveq r3, #1
  4021. 8001ae6: 2300 movne r3, #0
  4022. 8001ae8: b2db uxtb r3, r3
  4023. 8001aea: 60bb str r3, [r7, #8]
  4024. /* Check Analog watchdog flag */
  4025. if(tmp1 && tmp2)
  4026. 8001aec: 68fb ldr r3, [r7, #12]
  4027. 8001aee: 2b00 cmp r3, #0
  4028. 8001af0: d017 beq.n 8001b22 <HAL_ADC_IRQHandler+0x21a>
  4029. 8001af2: 68bb ldr r3, [r7, #8]
  4030. 8001af4: 2b00 cmp r3, #0
  4031. 8001af6: d014 beq.n 8001b22 <HAL_ADC_IRQHandler+0x21a>
  4032. {
  4033. if(__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_AWD))
  4034. 8001af8: 687b ldr r3, [r7, #4]
  4035. 8001afa: 681b ldr r3, [r3, #0]
  4036. 8001afc: 681b ldr r3, [r3, #0]
  4037. 8001afe: f003 0301 and.w r3, r3, #1
  4038. 8001b02: 2b01 cmp r3, #1
  4039. 8001b04: d10d bne.n 8001b22 <HAL_ADC_IRQHandler+0x21a>
  4040. {
  4041. /* Set ADC state */
  4042. SET_BIT(hadc->State, HAL_ADC_STATE_AWD1);
  4043. 8001b06: 687b ldr r3, [r7, #4]
  4044. 8001b08: 6c1b ldr r3, [r3, #64] ; 0x40
  4045. 8001b0a: f443 3280 orr.w r2, r3, #65536 ; 0x10000
  4046. 8001b0e: 687b ldr r3, [r7, #4]
  4047. 8001b10: 641a str r2, [r3, #64] ; 0x40
  4048. /* Level out of window callback */
  4049. #if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
  4050. hadc->LevelOutOfWindowCallback(hadc);
  4051. #else
  4052. HAL_ADC_LevelOutOfWindowCallback(hadc);
  4053. 8001b12: 6878 ldr r0, [r7, #4]
  4054. 8001b14: f000 f846 bl 8001ba4 <HAL_ADC_LevelOutOfWindowCallback>
  4055. #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
  4056. /* Clear the ADC analog watchdog flag */
  4057. __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD);
  4058. 8001b18: 687b ldr r3, [r7, #4]
  4059. 8001b1a: 681b ldr r3, [r3, #0]
  4060. 8001b1c: f06f 0201 mvn.w r2, #1
  4061. 8001b20: 601a str r2, [r3, #0]
  4062. }
  4063. }
  4064. tmp1 = __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_OVR);
  4065. 8001b22: 687b ldr r3, [r7, #4]
  4066. 8001b24: 681b ldr r3, [r3, #0]
  4067. 8001b26: 681b ldr r3, [r3, #0]
  4068. 8001b28: f003 0320 and.w r3, r3, #32
  4069. 8001b2c: 2b20 cmp r3, #32
  4070. 8001b2e: bf0c ite eq
  4071. 8001b30: 2301 moveq r3, #1
  4072. 8001b32: 2300 movne r3, #0
  4073. 8001b34: b2db uxtb r3, r3
  4074. 8001b36: 60fb str r3, [r7, #12]
  4075. tmp2 = __HAL_ADC_GET_IT_SOURCE(hadc, ADC_IT_OVR);
  4076. 8001b38: 687b ldr r3, [r7, #4]
  4077. 8001b3a: 681b ldr r3, [r3, #0]
  4078. 8001b3c: 685b ldr r3, [r3, #4]
  4079. 8001b3e: f003 6380 and.w r3, r3, #67108864 ; 0x4000000
  4080. 8001b42: f1b3 6f80 cmp.w r3, #67108864 ; 0x4000000
  4081. 8001b46: bf0c ite eq
  4082. 8001b48: 2301 moveq r3, #1
  4083. 8001b4a: 2300 movne r3, #0
  4084. 8001b4c: b2db uxtb r3, r3
  4085. 8001b4e: 60bb str r3, [r7, #8]
  4086. /* Check Overrun flag */
  4087. if(tmp1 && tmp2)
  4088. 8001b50: 68fb ldr r3, [r7, #12]
  4089. 8001b52: 2b00 cmp r3, #0
  4090. 8001b54: d015 beq.n 8001b82 <HAL_ADC_IRQHandler+0x27a>
  4091. 8001b56: 68bb ldr r3, [r7, #8]
  4092. 8001b58: 2b00 cmp r3, #0
  4093. 8001b5a: d012 beq.n 8001b82 <HAL_ADC_IRQHandler+0x27a>
  4094. /* Note: On STM32F4, ADC overrun can be set through other parameters */
  4095. /* refer to description of parameter "EOCSelection" for more */
  4096. /* details. */
  4097. /* Set ADC error code to overrun */
  4098. SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_OVR);
  4099. 8001b5c: 687b ldr r3, [r7, #4]
  4100. 8001b5e: 6c5b ldr r3, [r3, #68] ; 0x44
  4101. 8001b60: f043 0202 orr.w r2, r3, #2
  4102. 8001b64: 687b ldr r3, [r7, #4]
  4103. 8001b66: 645a str r2, [r3, #68] ; 0x44
  4104. /* Clear ADC overrun flag */
  4105. __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_OVR);
  4106. 8001b68: 687b ldr r3, [r7, #4]
  4107. 8001b6a: 681b ldr r3, [r3, #0]
  4108. 8001b6c: f06f 0220 mvn.w r2, #32
  4109. 8001b70: 601a str r2, [r3, #0]
  4110. /* Error callback */
  4111. #if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
  4112. hadc->ErrorCallback(hadc);
  4113. #else
  4114. HAL_ADC_ErrorCallback(hadc);
  4115. 8001b72: 6878 ldr r0, [r7, #4]
  4116. 8001b74: f7ff fbb6 bl 80012e4 <HAL_ADC_ErrorCallback>
  4117. #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
  4118. /* Clear the Overrun flag */
  4119. __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_OVR);
  4120. 8001b78: 687b ldr r3, [r7, #4]
  4121. 8001b7a: 681b ldr r3, [r3, #0]
  4122. 8001b7c: f06f 0220 mvn.w r2, #32
  4123. 8001b80: 601a str r2, [r3, #0]
  4124. }
  4125. }
  4126. 8001b82: bf00 nop
  4127. 8001b84: 3710 adds r7, #16
  4128. 8001b86: 46bd mov sp, r7
  4129. 8001b88: bd80 pop {r7, pc}
  4130. 08001b8a <HAL_ADC_GetValue>:
  4131. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  4132. * the configuration information for the specified ADC.
  4133. * @retval Converted value
  4134. */
  4135. uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc)
  4136. {
  4137. 8001b8a: b480 push {r7}
  4138. 8001b8c: b083 sub sp, #12
  4139. 8001b8e: af00 add r7, sp, #0
  4140. 8001b90: 6078 str r0, [r7, #4]
  4141. /* Return the selected ADC converted value */
  4142. return hadc->Instance->DR;
  4143. 8001b92: 687b ldr r3, [r7, #4]
  4144. 8001b94: 681b ldr r3, [r3, #0]
  4145. 8001b96: 6cdb ldr r3, [r3, #76] ; 0x4c
  4146. }
  4147. 8001b98: 4618 mov r0, r3
  4148. 8001b9a: 370c adds r7, #12
  4149. 8001b9c: 46bd mov sp, r7
  4150. 8001b9e: f85d 7b04 ldr.w r7, [sp], #4
  4151. 8001ba2: 4770 bx lr
  4152. 08001ba4 <HAL_ADC_LevelOutOfWindowCallback>:
  4153. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  4154. * the configuration information for the specified ADC.
  4155. * @retval None
  4156. */
  4157. __weak void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc)
  4158. {
  4159. 8001ba4: b480 push {r7}
  4160. 8001ba6: b083 sub sp, #12
  4161. 8001ba8: af00 add r7, sp, #0
  4162. 8001baa: 6078 str r0, [r7, #4]
  4163. /* Prevent unused argument(s) compilation warning */
  4164. UNUSED(hadc);
  4165. /* NOTE : This function Should not be modified, when the callback is needed,
  4166. the HAL_ADC_LevelOoutOfWindowCallback could be implemented in the user file
  4167. */
  4168. }
  4169. 8001bac: bf00 nop
  4170. 8001bae: 370c adds r7, #12
  4171. 8001bb0: 46bd mov sp, r7
  4172. 8001bb2: f85d 7b04 ldr.w r7, [sp], #4
  4173. 8001bb6: 4770 bx lr
  4174. 08001bb8 <HAL_ADC_ConfigChannel>:
  4175. * the configuration information for the specified ADC.
  4176. * @param sConfig ADC configuration structure.
  4177. * @retval HAL status
  4178. */
  4179. HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig)
  4180. {
  4181. 8001bb8: b480 push {r7}
  4182. 8001bba: b085 sub sp, #20
  4183. 8001bbc: af00 add r7, sp, #0
  4184. 8001bbe: 6078 str r0, [r7, #4]
  4185. 8001bc0: 6039 str r1, [r7, #0]
  4186. __IO uint32_t counter = 0U;
  4187. 8001bc2: 2300 movs r3, #0
  4188. 8001bc4: 60bb str r3, [r7, #8]
  4189. assert_param(IS_ADC_CHANNEL(sConfig->Channel));
  4190. assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank));
  4191. assert_param(IS_ADC_SAMPLE_TIME(sConfig->SamplingTime));
  4192. /* Process locked */
  4193. __HAL_LOCK(hadc);
  4194. 8001bc6: 687b ldr r3, [r7, #4]
  4195. 8001bc8: f893 303c ldrb.w r3, [r3, #60] ; 0x3c
  4196. 8001bcc: 2b01 cmp r3, #1
  4197. 8001bce: d101 bne.n 8001bd4 <HAL_ADC_ConfigChannel+0x1c>
  4198. 8001bd0: 2302 movs r3, #2
  4199. 8001bd2: e105 b.n 8001de0 <HAL_ADC_ConfigChannel+0x228>
  4200. 8001bd4: 687b ldr r3, [r7, #4]
  4201. 8001bd6: 2201 movs r2, #1
  4202. 8001bd8: f883 203c strb.w r2, [r3, #60] ; 0x3c
  4203. /* if ADC_Channel_10 ... ADC_Channel_18 is selected */
  4204. if (sConfig->Channel > ADC_CHANNEL_9)
  4205. 8001bdc: 683b ldr r3, [r7, #0]
  4206. 8001bde: 681b ldr r3, [r3, #0]
  4207. 8001be0: 2b09 cmp r3, #9
  4208. 8001be2: d925 bls.n 8001c30 <HAL_ADC_ConfigChannel+0x78>
  4209. {
  4210. /* Clear the old sample time */
  4211. hadc->Instance->SMPR1 &= ~ADC_SMPR1(ADC_SMPR1_SMP10, sConfig->Channel);
  4212. 8001be4: 687b ldr r3, [r7, #4]
  4213. 8001be6: 681b ldr r3, [r3, #0]
  4214. 8001be8: 68d9 ldr r1, [r3, #12]
  4215. 8001bea: 683b ldr r3, [r7, #0]
  4216. 8001bec: 681b ldr r3, [r3, #0]
  4217. 8001bee: b29b uxth r3, r3
  4218. 8001bf0: 461a mov r2, r3
  4219. 8001bf2: 4613 mov r3, r2
  4220. 8001bf4: 005b lsls r3, r3, #1
  4221. 8001bf6: 4413 add r3, r2
  4222. 8001bf8: 3b1e subs r3, #30
  4223. 8001bfa: 2207 movs r2, #7
  4224. 8001bfc: fa02 f303 lsl.w r3, r2, r3
  4225. 8001c00: 43da mvns r2, r3
  4226. 8001c02: 687b ldr r3, [r7, #4]
  4227. 8001c04: 681b ldr r3, [r3, #0]
  4228. 8001c06: 400a ands r2, r1
  4229. 8001c08: 60da str r2, [r3, #12]
  4230. /* Set the new sample time */
  4231. hadc->Instance->SMPR1 |= ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel);
  4232. 8001c0a: 687b ldr r3, [r7, #4]
  4233. 8001c0c: 681b ldr r3, [r3, #0]
  4234. 8001c0e: 68d9 ldr r1, [r3, #12]
  4235. 8001c10: 683b ldr r3, [r7, #0]
  4236. 8001c12: 689a ldr r2, [r3, #8]
  4237. 8001c14: 683b ldr r3, [r7, #0]
  4238. 8001c16: 681b ldr r3, [r3, #0]
  4239. 8001c18: b29b uxth r3, r3
  4240. 8001c1a: 4618 mov r0, r3
  4241. 8001c1c: 4603 mov r3, r0
  4242. 8001c1e: 005b lsls r3, r3, #1
  4243. 8001c20: 4403 add r3, r0
  4244. 8001c22: 3b1e subs r3, #30
  4245. 8001c24: 409a lsls r2, r3
  4246. 8001c26: 687b ldr r3, [r7, #4]
  4247. 8001c28: 681b ldr r3, [r3, #0]
  4248. 8001c2a: 430a orrs r2, r1
  4249. 8001c2c: 60da str r2, [r3, #12]
  4250. 8001c2e: e022 b.n 8001c76 <HAL_ADC_ConfigChannel+0xbe>
  4251. }
  4252. else /* ADC_Channel include in ADC_Channel_[0..9] */
  4253. {
  4254. /* Clear the old sample time */
  4255. hadc->Instance->SMPR2 &= ~ADC_SMPR2(ADC_SMPR2_SMP0, sConfig->Channel);
  4256. 8001c30: 687b ldr r3, [r7, #4]
  4257. 8001c32: 681b ldr r3, [r3, #0]
  4258. 8001c34: 6919 ldr r1, [r3, #16]
  4259. 8001c36: 683b ldr r3, [r7, #0]
  4260. 8001c38: 681b ldr r3, [r3, #0]
  4261. 8001c3a: b29b uxth r3, r3
  4262. 8001c3c: 461a mov r2, r3
  4263. 8001c3e: 4613 mov r3, r2
  4264. 8001c40: 005b lsls r3, r3, #1
  4265. 8001c42: 4413 add r3, r2
  4266. 8001c44: 2207 movs r2, #7
  4267. 8001c46: fa02 f303 lsl.w r3, r2, r3
  4268. 8001c4a: 43da mvns r2, r3
  4269. 8001c4c: 687b ldr r3, [r7, #4]
  4270. 8001c4e: 681b ldr r3, [r3, #0]
  4271. 8001c50: 400a ands r2, r1
  4272. 8001c52: 611a str r2, [r3, #16]
  4273. /* Set the new sample time */
  4274. hadc->Instance->SMPR2 |= ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel);
  4275. 8001c54: 687b ldr r3, [r7, #4]
  4276. 8001c56: 681b ldr r3, [r3, #0]
  4277. 8001c58: 6919 ldr r1, [r3, #16]
  4278. 8001c5a: 683b ldr r3, [r7, #0]
  4279. 8001c5c: 689a ldr r2, [r3, #8]
  4280. 8001c5e: 683b ldr r3, [r7, #0]
  4281. 8001c60: 681b ldr r3, [r3, #0]
  4282. 8001c62: b29b uxth r3, r3
  4283. 8001c64: 4618 mov r0, r3
  4284. 8001c66: 4603 mov r3, r0
  4285. 8001c68: 005b lsls r3, r3, #1
  4286. 8001c6a: 4403 add r3, r0
  4287. 8001c6c: 409a lsls r2, r3
  4288. 8001c6e: 687b ldr r3, [r7, #4]
  4289. 8001c70: 681b ldr r3, [r3, #0]
  4290. 8001c72: 430a orrs r2, r1
  4291. 8001c74: 611a str r2, [r3, #16]
  4292. }
  4293. /* For Rank 1 to 6 */
  4294. if (sConfig->Rank < 7U)
  4295. 8001c76: 683b ldr r3, [r7, #0]
  4296. 8001c78: 685b ldr r3, [r3, #4]
  4297. 8001c7a: 2b06 cmp r3, #6
  4298. 8001c7c: d824 bhi.n 8001cc8 <HAL_ADC_ConfigChannel+0x110>
  4299. {
  4300. /* Clear the old SQx bits for the selected rank */
  4301. hadc->Instance->SQR3 &= ~ADC_SQR3_RK(ADC_SQR3_SQ1, sConfig->Rank);
  4302. 8001c7e: 687b ldr r3, [r7, #4]
  4303. 8001c80: 681b ldr r3, [r3, #0]
  4304. 8001c82: 6b59 ldr r1, [r3, #52] ; 0x34
  4305. 8001c84: 683b ldr r3, [r7, #0]
  4306. 8001c86: 685a ldr r2, [r3, #4]
  4307. 8001c88: 4613 mov r3, r2
  4308. 8001c8a: 009b lsls r3, r3, #2
  4309. 8001c8c: 4413 add r3, r2
  4310. 8001c8e: 3b05 subs r3, #5
  4311. 8001c90: 221f movs r2, #31
  4312. 8001c92: fa02 f303 lsl.w r3, r2, r3
  4313. 8001c96: 43da mvns r2, r3
  4314. 8001c98: 687b ldr r3, [r7, #4]
  4315. 8001c9a: 681b ldr r3, [r3, #0]
  4316. 8001c9c: 400a ands r2, r1
  4317. 8001c9e: 635a str r2, [r3, #52] ; 0x34
  4318. /* Set the SQx bits for the selected rank */
  4319. hadc->Instance->SQR3 |= ADC_SQR3_RK(sConfig->Channel, sConfig->Rank);
  4320. 8001ca0: 687b ldr r3, [r7, #4]
  4321. 8001ca2: 681b ldr r3, [r3, #0]
  4322. 8001ca4: 6b59 ldr r1, [r3, #52] ; 0x34
  4323. 8001ca6: 683b ldr r3, [r7, #0]
  4324. 8001ca8: 681b ldr r3, [r3, #0]
  4325. 8001caa: b29b uxth r3, r3
  4326. 8001cac: 4618 mov r0, r3
  4327. 8001cae: 683b ldr r3, [r7, #0]
  4328. 8001cb0: 685a ldr r2, [r3, #4]
  4329. 8001cb2: 4613 mov r3, r2
  4330. 8001cb4: 009b lsls r3, r3, #2
  4331. 8001cb6: 4413 add r3, r2
  4332. 8001cb8: 3b05 subs r3, #5
  4333. 8001cba: fa00 f203 lsl.w r2, r0, r3
  4334. 8001cbe: 687b ldr r3, [r7, #4]
  4335. 8001cc0: 681b ldr r3, [r3, #0]
  4336. 8001cc2: 430a orrs r2, r1
  4337. 8001cc4: 635a str r2, [r3, #52] ; 0x34
  4338. 8001cc6: e04c b.n 8001d62 <HAL_ADC_ConfigChannel+0x1aa>
  4339. }
  4340. /* For Rank 7 to 12 */
  4341. else if (sConfig->Rank < 13U)
  4342. 8001cc8: 683b ldr r3, [r7, #0]
  4343. 8001cca: 685b ldr r3, [r3, #4]
  4344. 8001ccc: 2b0c cmp r3, #12
  4345. 8001cce: d824 bhi.n 8001d1a <HAL_ADC_ConfigChannel+0x162>
  4346. {
  4347. /* Clear the old SQx bits for the selected rank */
  4348. hadc->Instance->SQR2 &= ~ADC_SQR2_RK(ADC_SQR2_SQ7, sConfig->Rank);
  4349. 8001cd0: 687b ldr r3, [r7, #4]
  4350. 8001cd2: 681b ldr r3, [r3, #0]
  4351. 8001cd4: 6b19 ldr r1, [r3, #48] ; 0x30
  4352. 8001cd6: 683b ldr r3, [r7, #0]
  4353. 8001cd8: 685a ldr r2, [r3, #4]
  4354. 8001cda: 4613 mov r3, r2
  4355. 8001cdc: 009b lsls r3, r3, #2
  4356. 8001cde: 4413 add r3, r2
  4357. 8001ce0: 3b23 subs r3, #35 ; 0x23
  4358. 8001ce2: 221f movs r2, #31
  4359. 8001ce4: fa02 f303 lsl.w r3, r2, r3
  4360. 8001ce8: 43da mvns r2, r3
  4361. 8001cea: 687b ldr r3, [r7, #4]
  4362. 8001cec: 681b ldr r3, [r3, #0]
  4363. 8001cee: 400a ands r2, r1
  4364. 8001cf0: 631a str r2, [r3, #48] ; 0x30
  4365. /* Set the SQx bits for the selected rank */
  4366. hadc->Instance->SQR2 |= ADC_SQR2_RK(sConfig->Channel, sConfig->Rank);
  4367. 8001cf2: 687b ldr r3, [r7, #4]
  4368. 8001cf4: 681b ldr r3, [r3, #0]
  4369. 8001cf6: 6b19 ldr r1, [r3, #48] ; 0x30
  4370. 8001cf8: 683b ldr r3, [r7, #0]
  4371. 8001cfa: 681b ldr r3, [r3, #0]
  4372. 8001cfc: b29b uxth r3, r3
  4373. 8001cfe: 4618 mov r0, r3
  4374. 8001d00: 683b ldr r3, [r7, #0]
  4375. 8001d02: 685a ldr r2, [r3, #4]
  4376. 8001d04: 4613 mov r3, r2
  4377. 8001d06: 009b lsls r3, r3, #2
  4378. 8001d08: 4413 add r3, r2
  4379. 8001d0a: 3b23 subs r3, #35 ; 0x23
  4380. 8001d0c: fa00 f203 lsl.w r2, r0, r3
  4381. 8001d10: 687b ldr r3, [r7, #4]
  4382. 8001d12: 681b ldr r3, [r3, #0]
  4383. 8001d14: 430a orrs r2, r1
  4384. 8001d16: 631a str r2, [r3, #48] ; 0x30
  4385. 8001d18: e023 b.n 8001d62 <HAL_ADC_ConfigChannel+0x1aa>
  4386. }
  4387. /* For Rank 13 to 16 */
  4388. else
  4389. {
  4390. /* Clear the old SQx bits for the selected rank */
  4391. hadc->Instance->SQR1 &= ~ADC_SQR1_RK(ADC_SQR1_SQ13, sConfig->Rank);
  4392. 8001d1a: 687b ldr r3, [r7, #4]
  4393. 8001d1c: 681b ldr r3, [r3, #0]
  4394. 8001d1e: 6ad9 ldr r1, [r3, #44] ; 0x2c
  4395. 8001d20: 683b ldr r3, [r7, #0]
  4396. 8001d22: 685a ldr r2, [r3, #4]
  4397. 8001d24: 4613 mov r3, r2
  4398. 8001d26: 009b lsls r3, r3, #2
  4399. 8001d28: 4413 add r3, r2
  4400. 8001d2a: 3b41 subs r3, #65 ; 0x41
  4401. 8001d2c: 221f movs r2, #31
  4402. 8001d2e: fa02 f303 lsl.w r3, r2, r3
  4403. 8001d32: 43da mvns r2, r3
  4404. 8001d34: 687b ldr r3, [r7, #4]
  4405. 8001d36: 681b ldr r3, [r3, #0]
  4406. 8001d38: 400a ands r2, r1
  4407. 8001d3a: 62da str r2, [r3, #44] ; 0x2c
  4408. /* Set the SQx bits for the selected rank */
  4409. hadc->Instance->SQR1 |= ADC_SQR1_RK(sConfig->Channel, sConfig->Rank);
  4410. 8001d3c: 687b ldr r3, [r7, #4]
  4411. 8001d3e: 681b ldr r3, [r3, #0]
  4412. 8001d40: 6ad9 ldr r1, [r3, #44] ; 0x2c
  4413. 8001d42: 683b ldr r3, [r7, #0]
  4414. 8001d44: 681b ldr r3, [r3, #0]
  4415. 8001d46: b29b uxth r3, r3
  4416. 8001d48: 4618 mov r0, r3
  4417. 8001d4a: 683b ldr r3, [r7, #0]
  4418. 8001d4c: 685a ldr r2, [r3, #4]
  4419. 8001d4e: 4613 mov r3, r2
  4420. 8001d50: 009b lsls r3, r3, #2
  4421. 8001d52: 4413 add r3, r2
  4422. 8001d54: 3b41 subs r3, #65 ; 0x41
  4423. 8001d56: fa00 f203 lsl.w r2, r0, r3
  4424. 8001d5a: 687b ldr r3, [r7, #4]
  4425. 8001d5c: 681b ldr r3, [r3, #0]
  4426. 8001d5e: 430a orrs r2, r1
  4427. 8001d60: 62da str r2, [r3, #44] ; 0x2c
  4428. }
  4429. /* Pointer to the common control register to which is belonging hadc */
  4430. /* (Depending on STM32F4 product, there may be up to 3 ADCs and 1 common */
  4431. /* control register) */
  4432. tmpADC_Common = ADC_COMMON_REGISTER(hadc);
  4433. 8001d62: 4b22 ldr r3, [pc, #136] ; (8001dec <HAL_ADC_ConfigChannel+0x234>)
  4434. 8001d64: 60fb str r3, [r7, #12]
  4435. /* if ADC1 Channel_18 is selected for VBAT Channel ennable VBATE */
  4436. if ((hadc->Instance == ADC1) && (sConfig->Channel == ADC_CHANNEL_VBAT))
  4437. 8001d66: 687b ldr r3, [r7, #4]
  4438. 8001d68: 681b ldr r3, [r3, #0]
  4439. 8001d6a: 4a21 ldr r2, [pc, #132] ; (8001df0 <HAL_ADC_ConfigChannel+0x238>)
  4440. 8001d6c: 4293 cmp r3, r2
  4441. 8001d6e: d109 bne.n 8001d84 <HAL_ADC_ConfigChannel+0x1cc>
  4442. 8001d70: 683b ldr r3, [r7, #0]
  4443. 8001d72: 681b ldr r3, [r3, #0]
  4444. 8001d74: 2b12 cmp r3, #18
  4445. 8001d76: d105 bne.n 8001d84 <HAL_ADC_ConfigChannel+0x1cc>
  4446. if ((uint16_t)ADC_CHANNEL_TEMPSENSOR == (uint16_t)ADC_CHANNEL_VBAT)
  4447. {
  4448. tmpADC_Common->CCR &= ~ADC_CCR_TSVREFE;
  4449. }
  4450. /* Enable the VBAT channel*/
  4451. tmpADC_Common->CCR |= ADC_CCR_VBATE;
  4452. 8001d78: 68fb ldr r3, [r7, #12]
  4453. 8001d7a: 685b ldr r3, [r3, #4]
  4454. 8001d7c: f443 0280 orr.w r2, r3, #4194304 ; 0x400000
  4455. 8001d80: 68fb ldr r3, [r7, #12]
  4456. 8001d82: 605a str r2, [r3, #4]
  4457. }
  4458. /* if ADC1 Channel_16 or Channel_18 is selected for Temperature sensor or
  4459. Channel_17 is selected for VREFINT enable TSVREFE */
  4460. if ((hadc->Instance == ADC1) && ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) || (sConfig->Channel == ADC_CHANNEL_VREFINT)))
  4461. 8001d84: 687b ldr r3, [r7, #4]
  4462. 8001d86: 681b ldr r3, [r3, #0]
  4463. 8001d88: 4a19 ldr r2, [pc, #100] ; (8001df0 <HAL_ADC_ConfigChannel+0x238>)
  4464. 8001d8a: 4293 cmp r3, r2
  4465. 8001d8c: d123 bne.n 8001dd6 <HAL_ADC_ConfigChannel+0x21e>
  4466. 8001d8e: 683b ldr r3, [r7, #0]
  4467. 8001d90: 681b ldr r3, [r3, #0]
  4468. 8001d92: 2b10 cmp r3, #16
  4469. 8001d94: d003 beq.n 8001d9e <HAL_ADC_ConfigChannel+0x1e6>
  4470. 8001d96: 683b ldr r3, [r7, #0]
  4471. 8001d98: 681b ldr r3, [r3, #0]
  4472. 8001d9a: 2b11 cmp r3, #17
  4473. 8001d9c: d11b bne.n 8001dd6 <HAL_ADC_ConfigChannel+0x21e>
  4474. if ((uint16_t)ADC_CHANNEL_TEMPSENSOR == (uint16_t)ADC_CHANNEL_VBAT)
  4475. {
  4476. tmpADC_Common->CCR &= ~ADC_CCR_VBATE;
  4477. }
  4478. /* Enable the Temperature sensor and VREFINT channel*/
  4479. tmpADC_Common->CCR |= ADC_CCR_TSVREFE;
  4480. 8001d9e: 68fb ldr r3, [r7, #12]
  4481. 8001da0: 685b ldr r3, [r3, #4]
  4482. 8001da2: f443 0200 orr.w r2, r3, #8388608 ; 0x800000
  4483. 8001da6: 68fb ldr r3, [r7, #12]
  4484. 8001da8: 605a str r2, [r3, #4]
  4485. if((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR))
  4486. 8001daa: 683b ldr r3, [r7, #0]
  4487. 8001dac: 681b ldr r3, [r3, #0]
  4488. 8001dae: 2b10 cmp r3, #16
  4489. 8001db0: d111 bne.n 8001dd6 <HAL_ADC_ConfigChannel+0x21e>
  4490. {
  4491. /* Delay for temperature sensor stabilization time */
  4492. /* Compute number of CPU cycles to wait for */
  4493. counter = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U));
  4494. 8001db2: 4b10 ldr r3, [pc, #64] ; (8001df4 <HAL_ADC_ConfigChannel+0x23c>)
  4495. 8001db4: 681b ldr r3, [r3, #0]
  4496. 8001db6: 4a10 ldr r2, [pc, #64] ; (8001df8 <HAL_ADC_ConfigChannel+0x240>)
  4497. 8001db8: fba2 2303 umull r2, r3, r2, r3
  4498. 8001dbc: 0c9a lsrs r2, r3, #18
  4499. 8001dbe: 4613 mov r3, r2
  4500. 8001dc0: 009b lsls r3, r3, #2
  4501. 8001dc2: 4413 add r3, r2
  4502. 8001dc4: 005b lsls r3, r3, #1
  4503. 8001dc6: 60bb str r3, [r7, #8]
  4504. while(counter != 0U)
  4505. 8001dc8: e002 b.n 8001dd0 <HAL_ADC_ConfigChannel+0x218>
  4506. {
  4507. counter--;
  4508. 8001dca: 68bb ldr r3, [r7, #8]
  4509. 8001dcc: 3b01 subs r3, #1
  4510. 8001dce: 60bb str r3, [r7, #8]
  4511. while(counter != 0U)
  4512. 8001dd0: 68bb ldr r3, [r7, #8]
  4513. 8001dd2: 2b00 cmp r3, #0
  4514. 8001dd4: d1f9 bne.n 8001dca <HAL_ADC_ConfigChannel+0x212>
  4515. }
  4516. }
  4517. }
  4518. /* Process unlocked */
  4519. __HAL_UNLOCK(hadc);
  4520. 8001dd6: 687b ldr r3, [r7, #4]
  4521. 8001dd8: 2200 movs r2, #0
  4522. 8001dda: f883 203c strb.w r2, [r3, #60] ; 0x3c
  4523. /* Return function status */
  4524. return HAL_OK;
  4525. 8001dde: 2300 movs r3, #0
  4526. }
  4527. 8001de0: 4618 mov r0, r3
  4528. 8001de2: 3714 adds r7, #20
  4529. 8001de4: 46bd mov sp, r7
  4530. 8001de6: f85d 7b04 ldr.w r7, [sp], #4
  4531. 8001dea: 4770 bx lr
  4532. 8001dec: 40012300 .word 0x40012300
  4533. 8001df0: 40012000 .word 0x40012000
  4534. 8001df4: 20000004 .word 0x20000004
  4535. 8001df8: 431bde83 .word 0x431bde83
  4536. 08001dfc <ADC_Init>:
  4537. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  4538. * the configuration information for the specified ADC.
  4539. * @retval None
  4540. */
  4541. static void ADC_Init(ADC_HandleTypeDef* hadc)
  4542. {
  4543. 8001dfc: b480 push {r7}
  4544. 8001dfe: b085 sub sp, #20
  4545. 8001e00: af00 add r7, sp, #0
  4546. 8001e02: 6078 str r0, [r7, #4]
  4547. /* Set ADC parameters */
  4548. /* Pointer to the common control register to which is belonging hadc */
  4549. /* (Depending on STM32F4 product, there may be up to 3 ADCs and 1 common */
  4550. /* control register) */
  4551. tmpADC_Common = ADC_COMMON_REGISTER(hadc);
  4552. 8001e04: 4b79 ldr r3, [pc, #484] ; (8001fec <ADC_Init+0x1f0>)
  4553. 8001e06: 60fb str r3, [r7, #12]
  4554. /* Set the ADC clock prescaler */
  4555. tmpADC_Common->CCR &= ~(ADC_CCR_ADCPRE);
  4556. 8001e08: 68fb ldr r3, [r7, #12]
  4557. 8001e0a: 685b ldr r3, [r3, #4]
  4558. 8001e0c: f423 3240 bic.w r2, r3, #196608 ; 0x30000
  4559. 8001e10: 68fb ldr r3, [r7, #12]
  4560. 8001e12: 605a str r2, [r3, #4]
  4561. tmpADC_Common->CCR |= hadc->Init.ClockPrescaler;
  4562. 8001e14: 68fb ldr r3, [r7, #12]
  4563. 8001e16: 685a ldr r2, [r3, #4]
  4564. 8001e18: 687b ldr r3, [r7, #4]
  4565. 8001e1a: 685b ldr r3, [r3, #4]
  4566. 8001e1c: 431a orrs r2, r3
  4567. 8001e1e: 68fb ldr r3, [r7, #12]
  4568. 8001e20: 605a str r2, [r3, #4]
  4569. /* Set ADC scan mode */
  4570. hadc->Instance->CR1 &= ~(ADC_CR1_SCAN);
  4571. 8001e22: 687b ldr r3, [r7, #4]
  4572. 8001e24: 681b ldr r3, [r3, #0]
  4573. 8001e26: 685a ldr r2, [r3, #4]
  4574. 8001e28: 687b ldr r3, [r7, #4]
  4575. 8001e2a: 681b ldr r3, [r3, #0]
  4576. 8001e2c: f422 7280 bic.w r2, r2, #256 ; 0x100
  4577. 8001e30: 605a str r2, [r3, #4]
  4578. hadc->Instance->CR1 |= ADC_CR1_SCANCONV(hadc->Init.ScanConvMode);
  4579. 8001e32: 687b ldr r3, [r7, #4]
  4580. 8001e34: 681b ldr r3, [r3, #0]
  4581. 8001e36: 6859 ldr r1, [r3, #4]
  4582. 8001e38: 687b ldr r3, [r7, #4]
  4583. 8001e3a: 691b ldr r3, [r3, #16]
  4584. 8001e3c: 021a lsls r2, r3, #8
  4585. 8001e3e: 687b ldr r3, [r7, #4]
  4586. 8001e40: 681b ldr r3, [r3, #0]
  4587. 8001e42: 430a orrs r2, r1
  4588. 8001e44: 605a str r2, [r3, #4]
  4589. /* Set ADC resolution */
  4590. hadc->Instance->CR1 &= ~(ADC_CR1_RES);
  4591. 8001e46: 687b ldr r3, [r7, #4]
  4592. 8001e48: 681b ldr r3, [r3, #0]
  4593. 8001e4a: 685a ldr r2, [r3, #4]
  4594. 8001e4c: 687b ldr r3, [r7, #4]
  4595. 8001e4e: 681b ldr r3, [r3, #0]
  4596. 8001e50: f022 7240 bic.w r2, r2, #50331648 ; 0x3000000
  4597. 8001e54: 605a str r2, [r3, #4]
  4598. hadc->Instance->CR1 |= hadc->Init.Resolution;
  4599. 8001e56: 687b ldr r3, [r7, #4]
  4600. 8001e58: 681b ldr r3, [r3, #0]
  4601. 8001e5a: 6859 ldr r1, [r3, #4]
  4602. 8001e5c: 687b ldr r3, [r7, #4]
  4603. 8001e5e: 689a ldr r2, [r3, #8]
  4604. 8001e60: 687b ldr r3, [r7, #4]
  4605. 8001e62: 681b ldr r3, [r3, #0]
  4606. 8001e64: 430a orrs r2, r1
  4607. 8001e66: 605a str r2, [r3, #4]
  4608. /* Set ADC data alignment */
  4609. hadc->Instance->CR2 &= ~(ADC_CR2_ALIGN);
  4610. 8001e68: 687b ldr r3, [r7, #4]
  4611. 8001e6a: 681b ldr r3, [r3, #0]
  4612. 8001e6c: 689a ldr r2, [r3, #8]
  4613. 8001e6e: 687b ldr r3, [r7, #4]
  4614. 8001e70: 681b ldr r3, [r3, #0]
  4615. 8001e72: f422 6200 bic.w r2, r2, #2048 ; 0x800
  4616. 8001e76: 609a str r2, [r3, #8]
  4617. hadc->Instance->CR2 |= hadc->Init.DataAlign;
  4618. 8001e78: 687b ldr r3, [r7, #4]
  4619. 8001e7a: 681b ldr r3, [r3, #0]
  4620. 8001e7c: 6899 ldr r1, [r3, #8]
  4621. 8001e7e: 687b ldr r3, [r7, #4]
  4622. 8001e80: 68da ldr r2, [r3, #12]
  4623. 8001e82: 687b ldr r3, [r7, #4]
  4624. 8001e84: 681b ldr r3, [r3, #0]
  4625. 8001e86: 430a orrs r2, r1
  4626. 8001e88: 609a str r2, [r3, #8]
  4627. /* Enable external trigger if trigger selection is different of software */
  4628. /* start. */
  4629. /* Note: This configuration keeps the hardware feature of parameter */
  4630. /* ExternalTrigConvEdge "trigger edge none" equivalent to */
  4631. /* software start. */
  4632. if(hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START)
  4633. 8001e8a: 687b ldr r3, [r7, #4]
  4634. 8001e8c: 6a9b ldr r3, [r3, #40] ; 0x28
  4635. 8001e8e: 4a58 ldr r2, [pc, #352] ; (8001ff0 <ADC_Init+0x1f4>)
  4636. 8001e90: 4293 cmp r3, r2
  4637. 8001e92: d022 beq.n 8001eda <ADC_Init+0xde>
  4638. {
  4639. /* Select external trigger to start conversion */
  4640. hadc->Instance->CR2 &= ~(ADC_CR2_EXTSEL);
  4641. 8001e94: 687b ldr r3, [r7, #4]
  4642. 8001e96: 681b ldr r3, [r3, #0]
  4643. 8001e98: 689a ldr r2, [r3, #8]
  4644. 8001e9a: 687b ldr r3, [r7, #4]
  4645. 8001e9c: 681b ldr r3, [r3, #0]
  4646. 8001e9e: f022 6270 bic.w r2, r2, #251658240 ; 0xf000000
  4647. 8001ea2: 609a str r2, [r3, #8]
  4648. hadc->Instance->CR2 |= hadc->Init.ExternalTrigConv;
  4649. 8001ea4: 687b ldr r3, [r7, #4]
  4650. 8001ea6: 681b ldr r3, [r3, #0]
  4651. 8001ea8: 6899 ldr r1, [r3, #8]
  4652. 8001eaa: 687b ldr r3, [r7, #4]
  4653. 8001eac: 6a9a ldr r2, [r3, #40] ; 0x28
  4654. 8001eae: 687b ldr r3, [r7, #4]
  4655. 8001eb0: 681b ldr r3, [r3, #0]
  4656. 8001eb2: 430a orrs r2, r1
  4657. 8001eb4: 609a str r2, [r3, #8]
  4658. /* Select external trigger polarity */
  4659. hadc->Instance->CR2 &= ~(ADC_CR2_EXTEN);
  4660. 8001eb6: 687b ldr r3, [r7, #4]
  4661. 8001eb8: 681b ldr r3, [r3, #0]
  4662. 8001eba: 689a ldr r2, [r3, #8]
  4663. 8001ebc: 687b ldr r3, [r7, #4]
  4664. 8001ebe: 681b ldr r3, [r3, #0]
  4665. 8001ec0: f022 5240 bic.w r2, r2, #805306368 ; 0x30000000
  4666. 8001ec4: 609a str r2, [r3, #8]
  4667. hadc->Instance->CR2 |= hadc->Init.ExternalTrigConvEdge;
  4668. 8001ec6: 687b ldr r3, [r7, #4]
  4669. 8001ec8: 681b ldr r3, [r3, #0]
  4670. 8001eca: 6899 ldr r1, [r3, #8]
  4671. 8001ecc: 687b ldr r3, [r7, #4]
  4672. 8001ece: 6ada ldr r2, [r3, #44] ; 0x2c
  4673. 8001ed0: 687b ldr r3, [r7, #4]
  4674. 8001ed2: 681b ldr r3, [r3, #0]
  4675. 8001ed4: 430a orrs r2, r1
  4676. 8001ed6: 609a str r2, [r3, #8]
  4677. 8001ed8: e00f b.n 8001efa <ADC_Init+0xfe>
  4678. }
  4679. else
  4680. {
  4681. /* Reset the external trigger */
  4682. hadc->Instance->CR2 &= ~(ADC_CR2_EXTSEL);
  4683. 8001eda: 687b ldr r3, [r7, #4]
  4684. 8001edc: 681b ldr r3, [r3, #0]
  4685. 8001ede: 689a ldr r2, [r3, #8]
  4686. 8001ee0: 687b ldr r3, [r7, #4]
  4687. 8001ee2: 681b ldr r3, [r3, #0]
  4688. 8001ee4: f022 6270 bic.w r2, r2, #251658240 ; 0xf000000
  4689. 8001ee8: 609a str r2, [r3, #8]
  4690. hadc->Instance->CR2 &= ~(ADC_CR2_EXTEN);
  4691. 8001eea: 687b ldr r3, [r7, #4]
  4692. 8001eec: 681b ldr r3, [r3, #0]
  4693. 8001eee: 689a ldr r2, [r3, #8]
  4694. 8001ef0: 687b ldr r3, [r7, #4]
  4695. 8001ef2: 681b ldr r3, [r3, #0]
  4696. 8001ef4: f022 5240 bic.w r2, r2, #805306368 ; 0x30000000
  4697. 8001ef8: 609a str r2, [r3, #8]
  4698. }
  4699. /* Enable or disable ADC continuous conversion mode */
  4700. hadc->Instance->CR2 &= ~(ADC_CR2_CONT);
  4701. 8001efa: 687b ldr r3, [r7, #4]
  4702. 8001efc: 681b ldr r3, [r3, #0]
  4703. 8001efe: 689a ldr r2, [r3, #8]
  4704. 8001f00: 687b ldr r3, [r7, #4]
  4705. 8001f02: 681b ldr r3, [r3, #0]
  4706. 8001f04: f022 0202 bic.w r2, r2, #2
  4707. 8001f08: 609a str r2, [r3, #8]
  4708. hadc->Instance->CR2 |= ADC_CR2_CONTINUOUS((uint32_t)hadc->Init.ContinuousConvMode);
  4709. 8001f0a: 687b ldr r3, [r7, #4]
  4710. 8001f0c: 681b ldr r3, [r3, #0]
  4711. 8001f0e: 6899 ldr r1, [r3, #8]
  4712. 8001f10: 687b ldr r3, [r7, #4]
  4713. 8001f12: 7e1b ldrb r3, [r3, #24]
  4714. 8001f14: 005a lsls r2, r3, #1
  4715. 8001f16: 687b ldr r3, [r7, #4]
  4716. 8001f18: 681b ldr r3, [r3, #0]
  4717. 8001f1a: 430a orrs r2, r1
  4718. 8001f1c: 609a str r2, [r3, #8]
  4719. if(hadc->Init.DiscontinuousConvMode != DISABLE)
  4720. 8001f1e: 687b ldr r3, [r7, #4]
  4721. 8001f20: f893 3020 ldrb.w r3, [r3, #32]
  4722. 8001f24: 2b00 cmp r3, #0
  4723. 8001f26: d01b beq.n 8001f60 <ADC_Init+0x164>
  4724. {
  4725. assert_param(IS_ADC_REGULAR_DISC_NUMBER(hadc->Init.NbrOfDiscConversion));
  4726. /* Enable the selected ADC regular discontinuous mode */
  4727. hadc->Instance->CR1 |= (uint32_t)ADC_CR1_DISCEN;
  4728. 8001f28: 687b ldr r3, [r7, #4]
  4729. 8001f2a: 681b ldr r3, [r3, #0]
  4730. 8001f2c: 685a ldr r2, [r3, #4]
  4731. 8001f2e: 687b ldr r3, [r7, #4]
  4732. 8001f30: 681b ldr r3, [r3, #0]
  4733. 8001f32: f442 6200 orr.w r2, r2, #2048 ; 0x800
  4734. 8001f36: 605a str r2, [r3, #4]
  4735. /* Set the number of channels to be converted in discontinuous mode */
  4736. hadc->Instance->CR1 &= ~(ADC_CR1_DISCNUM);
  4737. 8001f38: 687b ldr r3, [r7, #4]
  4738. 8001f3a: 681b ldr r3, [r3, #0]
  4739. 8001f3c: 685a ldr r2, [r3, #4]
  4740. 8001f3e: 687b ldr r3, [r7, #4]
  4741. 8001f40: 681b ldr r3, [r3, #0]
  4742. 8001f42: f422 4260 bic.w r2, r2, #57344 ; 0xe000
  4743. 8001f46: 605a str r2, [r3, #4]
  4744. hadc->Instance->CR1 |= ADC_CR1_DISCONTINUOUS(hadc->Init.NbrOfDiscConversion);
  4745. 8001f48: 687b ldr r3, [r7, #4]
  4746. 8001f4a: 681b ldr r3, [r3, #0]
  4747. 8001f4c: 6859 ldr r1, [r3, #4]
  4748. 8001f4e: 687b ldr r3, [r7, #4]
  4749. 8001f50: 6a5b ldr r3, [r3, #36] ; 0x24
  4750. 8001f52: 3b01 subs r3, #1
  4751. 8001f54: 035a lsls r2, r3, #13
  4752. 8001f56: 687b ldr r3, [r7, #4]
  4753. 8001f58: 681b ldr r3, [r3, #0]
  4754. 8001f5a: 430a orrs r2, r1
  4755. 8001f5c: 605a str r2, [r3, #4]
  4756. 8001f5e: e007 b.n 8001f70 <ADC_Init+0x174>
  4757. }
  4758. else
  4759. {
  4760. /* Disable the selected ADC regular discontinuous mode */
  4761. hadc->Instance->CR1 &= ~(ADC_CR1_DISCEN);
  4762. 8001f60: 687b ldr r3, [r7, #4]
  4763. 8001f62: 681b ldr r3, [r3, #0]
  4764. 8001f64: 685a ldr r2, [r3, #4]
  4765. 8001f66: 687b ldr r3, [r7, #4]
  4766. 8001f68: 681b ldr r3, [r3, #0]
  4767. 8001f6a: f422 6200 bic.w r2, r2, #2048 ; 0x800
  4768. 8001f6e: 605a str r2, [r3, #4]
  4769. }
  4770. /* Set ADC number of conversion */
  4771. hadc->Instance->SQR1 &= ~(ADC_SQR1_L);
  4772. 8001f70: 687b ldr r3, [r7, #4]
  4773. 8001f72: 681b ldr r3, [r3, #0]
  4774. 8001f74: 6ada ldr r2, [r3, #44] ; 0x2c
  4775. 8001f76: 687b ldr r3, [r7, #4]
  4776. 8001f78: 681b ldr r3, [r3, #0]
  4777. 8001f7a: f422 0270 bic.w r2, r2, #15728640 ; 0xf00000
  4778. 8001f7e: 62da str r2, [r3, #44] ; 0x2c
  4779. hadc->Instance->SQR1 |= ADC_SQR1(hadc->Init.NbrOfConversion);
  4780. 8001f80: 687b ldr r3, [r7, #4]
  4781. 8001f82: 681b ldr r3, [r3, #0]
  4782. 8001f84: 6ad9 ldr r1, [r3, #44] ; 0x2c
  4783. 8001f86: 687b ldr r3, [r7, #4]
  4784. 8001f88: 69db ldr r3, [r3, #28]
  4785. 8001f8a: 3b01 subs r3, #1
  4786. 8001f8c: 051a lsls r2, r3, #20
  4787. 8001f8e: 687b ldr r3, [r7, #4]
  4788. 8001f90: 681b ldr r3, [r3, #0]
  4789. 8001f92: 430a orrs r2, r1
  4790. 8001f94: 62da str r2, [r3, #44] ; 0x2c
  4791. /* Enable or disable ADC DMA continuous request */
  4792. hadc->Instance->CR2 &= ~(ADC_CR2_DDS);
  4793. 8001f96: 687b ldr r3, [r7, #4]
  4794. 8001f98: 681b ldr r3, [r3, #0]
  4795. 8001f9a: 689a ldr r2, [r3, #8]
  4796. 8001f9c: 687b ldr r3, [r7, #4]
  4797. 8001f9e: 681b ldr r3, [r3, #0]
  4798. 8001fa0: f422 7200 bic.w r2, r2, #512 ; 0x200
  4799. 8001fa4: 609a str r2, [r3, #8]
  4800. hadc->Instance->CR2 |= ADC_CR2_DMAContReq((uint32_t)hadc->Init.DMAContinuousRequests);
  4801. 8001fa6: 687b ldr r3, [r7, #4]
  4802. 8001fa8: 681b ldr r3, [r3, #0]
  4803. 8001faa: 6899 ldr r1, [r3, #8]
  4804. 8001fac: 687b ldr r3, [r7, #4]
  4805. 8001fae: f893 3030 ldrb.w r3, [r3, #48] ; 0x30
  4806. 8001fb2: 025a lsls r2, r3, #9
  4807. 8001fb4: 687b ldr r3, [r7, #4]
  4808. 8001fb6: 681b ldr r3, [r3, #0]
  4809. 8001fb8: 430a orrs r2, r1
  4810. 8001fba: 609a str r2, [r3, #8]
  4811. /* Enable or disable ADC end of conversion selection */
  4812. hadc->Instance->CR2 &= ~(ADC_CR2_EOCS);
  4813. 8001fbc: 687b ldr r3, [r7, #4]
  4814. 8001fbe: 681b ldr r3, [r3, #0]
  4815. 8001fc0: 689a ldr r2, [r3, #8]
  4816. 8001fc2: 687b ldr r3, [r7, #4]
  4817. 8001fc4: 681b ldr r3, [r3, #0]
  4818. 8001fc6: f422 6280 bic.w r2, r2, #1024 ; 0x400
  4819. 8001fca: 609a str r2, [r3, #8]
  4820. hadc->Instance->CR2 |= ADC_CR2_EOCSelection(hadc->Init.EOCSelection);
  4821. 8001fcc: 687b ldr r3, [r7, #4]
  4822. 8001fce: 681b ldr r3, [r3, #0]
  4823. 8001fd0: 6899 ldr r1, [r3, #8]
  4824. 8001fd2: 687b ldr r3, [r7, #4]
  4825. 8001fd4: 695b ldr r3, [r3, #20]
  4826. 8001fd6: 029a lsls r2, r3, #10
  4827. 8001fd8: 687b ldr r3, [r7, #4]
  4828. 8001fda: 681b ldr r3, [r3, #0]
  4829. 8001fdc: 430a orrs r2, r1
  4830. 8001fde: 609a str r2, [r3, #8]
  4831. }
  4832. 8001fe0: bf00 nop
  4833. 8001fe2: 3714 adds r7, #20
  4834. 8001fe4: 46bd mov sp, r7
  4835. 8001fe6: f85d 7b04 ldr.w r7, [sp], #4
  4836. 8001fea: 4770 bx lr
  4837. 8001fec: 40012300 .word 0x40012300
  4838. 8001ff0: 0f000001 .word 0x0f000001
  4839. 08001ff4 <HAL_ADCEx_InjectedConvCpltCallback>:
  4840. * @param hadc pointer to a ADC_HandleTypeDef structure that contains
  4841. * the configuration information for the specified ADC.
  4842. * @retval None
  4843. */
  4844. __weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc)
  4845. {
  4846. 8001ff4: b480 push {r7}
  4847. 8001ff6: b083 sub sp, #12
  4848. 8001ff8: af00 add r7, sp, #0
  4849. 8001ffa: 6078 str r0, [r7, #4]
  4850. /* Prevent unused argument(s) compilation warning */
  4851. UNUSED(hadc);
  4852. /* NOTE : This function Should not be modified, when the callback is needed,
  4853. the HAL_ADC_InjectedConvCpltCallback could be implemented in the user file
  4854. */
  4855. }
  4856. 8001ffc: bf00 nop
  4857. 8001ffe: 370c adds r7, #12
  4858. 8002000: 46bd mov sp, r7
  4859. 8002002: f85d 7b04 ldr.w r7, [sp], #4
  4860. 8002006: 4770 bx lr
  4861. 08002008 <__NVIC_SetPriorityGrouping>:
  4862. In case of a conflict between priority grouping and available
  4863. priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
  4864. \param [in] PriorityGroup Priority grouping field.
  4865. */
  4866. __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
  4867. {
  4868. 8002008: b480 push {r7}
  4869. 800200a: b085 sub sp, #20
  4870. 800200c: af00 add r7, sp, #0
  4871. 800200e: 6078 str r0, [r7, #4]
  4872. uint32_t reg_value;
  4873. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  4874. 8002010: 687b ldr r3, [r7, #4]
  4875. 8002012: f003 0307 and.w r3, r3, #7
  4876. 8002016: 60fb str r3, [r7, #12]
  4877. reg_value = SCB->AIRCR; /* read old register configuration */
  4878. 8002018: 4b0c ldr r3, [pc, #48] ; (800204c <__NVIC_SetPriorityGrouping+0x44>)
  4879. 800201a: 68db ldr r3, [r3, #12]
  4880. 800201c: 60bb str r3, [r7, #8]
  4881. reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
  4882. 800201e: 68ba ldr r2, [r7, #8]
  4883. 8002020: f64f 03ff movw r3, #63743 ; 0xf8ff
  4884. 8002024: 4013 ands r3, r2
  4885. 8002026: 60bb str r3, [r7, #8]
  4886. reg_value = (reg_value |
  4887. ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  4888. (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */
  4889. 8002028: 68fb ldr r3, [r7, #12]
  4890. 800202a: 021a lsls r2, r3, #8
  4891. ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
  4892. 800202c: 68bb ldr r3, [r7, #8]
  4893. 800202e: 4313 orrs r3, r2
  4894. reg_value = (reg_value |
  4895. 8002030: f043 63bf orr.w r3, r3, #100139008 ; 0x5f80000
  4896. 8002034: f443 3300 orr.w r3, r3, #131072 ; 0x20000
  4897. 8002038: 60bb str r3, [r7, #8]
  4898. SCB->AIRCR = reg_value;
  4899. 800203a: 4a04 ldr r2, [pc, #16] ; (800204c <__NVIC_SetPriorityGrouping+0x44>)
  4900. 800203c: 68bb ldr r3, [r7, #8]
  4901. 800203e: 60d3 str r3, [r2, #12]
  4902. }
  4903. 8002040: bf00 nop
  4904. 8002042: 3714 adds r7, #20
  4905. 8002044: 46bd mov sp, r7
  4906. 8002046: f85d 7b04 ldr.w r7, [sp], #4
  4907. 800204a: 4770 bx lr
  4908. 800204c: e000ed00 .word 0xe000ed00
  4909. 08002050 <__NVIC_GetPriorityGrouping>:
  4910. \brief Get Priority Grouping
  4911. \details Reads the priority grouping field from the NVIC Interrupt Controller.
  4912. \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
  4913. */
  4914. __STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
  4915. {
  4916. 8002050: b480 push {r7}
  4917. 8002052: af00 add r7, sp, #0
  4918. return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
  4919. 8002054: 4b04 ldr r3, [pc, #16] ; (8002068 <__NVIC_GetPriorityGrouping+0x18>)
  4920. 8002056: 68db ldr r3, [r3, #12]
  4921. 8002058: 0a1b lsrs r3, r3, #8
  4922. 800205a: f003 0307 and.w r3, r3, #7
  4923. }
  4924. 800205e: 4618 mov r0, r3
  4925. 8002060: 46bd mov sp, r7
  4926. 8002062: f85d 7b04 ldr.w r7, [sp], #4
  4927. 8002066: 4770 bx lr
  4928. 8002068: e000ed00 .word 0xe000ed00
  4929. 0800206c <__NVIC_EnableIRQ>:
  4930. \details Enables a device specific interrupt in the NVIC interrupt controller.
  4931. \param [in] IRQn Device specific interrupt number.
  4932. \note IRQn must not be negative.
  4933. */
  4934. __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
  4935. {
  4936. 800206c: b480 push {r7}
  4937. 800206e: b083 sub sp, #12
  4938. 8002070: af00 add r7, sp, #0
  4939. 8002072: 4603 mov r3, r0
  4940. 8002074: 71fb strb r3, [r7, #7]
  4941. if ((int32_t)(IRQn) >= 0)
  4942. 8002076: f997 3007 ldrsb.w r3, [r7, #7]
  4943. 800207a: 2b00 cmp r3, #0
  4944. 800207c: db0b blt.n 8002096 <__NVIC_EnableIRQ+0x2a>
  4945. {
  4946. NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  4947. 800207e: 79fb ldrb r3, [r7, #7]
  4948. 8002080: f003 021f and.w r2, r3, #31
  4949. 8002084: 4907 ldr r1, [pc, #28] ; (80020a4 <__NVIC_EnableIRQ+0x38>)
  4950. 8002086: f997 3007 ldrsb.w r3, [r7, #7]
  4951. 800208a: 095b lsrs r3, r3, #5
  4952. 800208c: 2001 movs r0, #1
  4953. 800208e: fa00 f202 lsl.w r2, r0, r2
  4954. 8002092: f841 2023 str.w r2, [r1, r3, lsl #2]
  4955. }
  4956. }
  4957. 8002096: bf00 nop
  4958. 8002098: 370c adds r7, #12
  4959. 800209a: 46bd mov sp, r7
  4960. 800209c: f85d 7b04 ldr.w r7, [sp], #4
  4961. 80020a0: 4770 bx lr
  4962. 80020a2: bf00 nop
  4963. 80020a4: e000e100 .word 0xe000e100
  4964. 080020a8 <__NVIC_SetPriority>:
  4965. \param [in] IRQn Interrupt number.
  4966. \param [in] priority Priority to set.
  4967. \note The priority cannot be set for every processor exception.
  4968. */
  4969. __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
  4970. {
  4971. 80020a8: b480 push {r7}
  4972. 80020aa: b083 sub sp, #12
  4973. 80020ac: af00 add r7, sp, #0
  4974. 80020ae: 4603 mov r3, r0
  4975. 80020b0: 6039 str r1, [r7, #0]
  4976. 80020b2: 71fb strb r3, [r7, #7]
  4977. if ((int32_t)(IRQn) >= 0)
  4978. 80020b4: f997 3007 ldrsb.w r3, [r7, #7]
  4979. 80020b8: 2b00 cmp r3, #0
  4980. 80020ba: db0a blt.n 80020d2 <__NVIC_SetPriority+0x2a>
  4981. {
  4982. NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  4983. 80020bc: 683b ldr r3, [r7, #0]
  4984. 80020be: b2da uxtb r2, r3
  4985. 80020c0: 490c ldr r1, [pc, #48] ; (80020f4 <__NVIC_SetPriority+0x4c>)
  4986. 80020c2: f997 3007 ldrsb.w r3, [r7, #7]
  4987. 80020c6: 0112 lsls r2, r2, #4
  4988. 80020c8: b2d2 uxtb r2, r2
  4989. 80020ca: 440b add r3, r1
  4990. 80020cc: f883 2300 strb.w r2, [r3, #768] ; 0x300
  4991. }
  4992. else
  4993. {
  4994. SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  4995. }
  4996. }
  4997. 80020d0: e00a b.n 80020e8 <__NVIC_SetPriority+0x40>
  4998. SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
  4999. 80020d2: 683b ldr r3, [r7, #0]
  5000. 80020d4: b2da uxtb r2, r3
  5001. 80020d6: 4908 ldr r1, [pc, #32] ; (80020f8 <__NVIC_SetPriority+0x50>)
  5002. 80020d8: 79fb ldrb r3, [r7, #7]
  5003. 80020da: f003 030f and.w r3, r3, #15
  5004. 80020de: 3b04 subs r3, #4
  5005. 80020e0: 0112 lsls r2, r2, #4
  5006. 80020e2: b2d2 uxtb r2, r2
  5007. 80020e4: 440b add r3, r1
  5008. 80020e6: 761a strb r2, [r3, #24]
  5009. }
  5010. 80020e8: bf00 nop
  5011. 80020ea: 370c adds r7, #12
  5012. 80020ec: 46bd mov sp, r7
  5013. 80020ee: f85d 7b04 ldr.w r7, [sp], #4
  5014. 80020f2: 4770 bx lr
  5015. 80020f4: e000e100 .word 0xe000e100
  5016. 80020f8: e000ed00 .word 0xe000ed00
  5017. 080020fc <NVIC_EncodePriority>:
  5018. \param [in] PreemptPriority Preemptive priority value (starting from 0).
  5019. \param [in] SubPriority Subpriority value (starting from 0).
  5020. \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
  5021. */
  5022. __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
  5023. {
  5024. 80020fc: b480 push {r7}
  5025. 80020fe: b089 sub sp, #36 ; 0x24
  5026. 8002100: af00 add r7, sp, #0
  5027. 8002102: 60f8 str r0, [r7, #12]
  5028. 8002104: 60b9 str r1, [r7, #8]
  5029. 8002106: 607a str r2, [r7, #4]
  5030. uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
  5031. 8002108: 68fb ldr r3, [r7, #12]
  5032. 800210a: f003 0307 and.w r3, r3, #7
  5033. 800210e: 61fb str r3, [r7, #28]
  5034. uint32_t PreemptPriorityBits;
  5035. uint32_t SubPriorityBits;
  5036. PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
  5037. 8002110: 69fb ldr r3, [r7, #28]
  5038. 8002112: f1c3 0307 rsb r3, r3, #7
  5039. 8002116: 2b04 cmp r3, #4
  5040. 8002118: bf28 it cs
  5041. 800211a: 2304 movcs r3, #4
  5042. 800211c: 61bb str r3, [r7, #24]
  5043. SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
  5044. 800211e: 69fb ldr r3, [r7, #28]
  5045. 8002120: 3304 adds r3, #4
  5046. 8002122: 2b06 cmp r3, #6
  5047. 8002124: d902 bls.n 800212c <NVIC_EncodePriority+0x30>
  5048. 8002126: 69fb ldr r3, [r7, #28]
  5049. 8002128: 3b03 subs r3, #3
  5050. 800212a: e000 b.n 800212e <NVIC_EncodePriority+0x32>
  5051. 800212c: 2300 movs r3, #0
  5052. 800212e: 617b str r3, [r7, #20]
  5053. return (
  5054. ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
  5055. 8002130: f04f 32ff mov.w r2, #4294967295
  5056. 8002134: 69bb ldr r3, [r7, #24]
  5057. 8002136: fa02 f303 lsl.w r3, r2, r3
  5058. 800213a: 43da mvns r2, r3
  5059. 800213c: 68bb ldr r3, [r7, #8]
  5060. 800213e: 401a ands r2, r3
  5061. 8002140: 697b ldr r3, [r7, #20]
  5062. 8002142: 409a lsls r2, r3
  5063. ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
  5064. 8002144: f04f 31ff mov.w r1, #4294967295
  5065. 8002148: 697b ldr r3, [r7, #20]
  5066. 800214a: fa01 f303 lsl.w r3, r1, r3
  5067. 800214e: 43d9 mvns r1, r3
  5068. 8002150: 687b ldr r3, [r7, #4]
  5069. 8002152: 400b ands r3, r1
  5070. ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
  5071. 8002154: 4313 orrs r3, r2
  5072. );
  5073. }
  5074. 8002156: 4618 mov r0, r3
  5075. 8002158: 3724 adds r7, #36 ; 0x24
  5076. 800215a: 46bd mov sp, r7
  5077. 800215c: f85d 7b04 ldr.w r7, [sp], #4
  5078. 8002160: 4770 bx lr
  5079. ...
  5080. 08002164 <SysTick_Config>:
  5081. \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
  5082. function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
  5083. must contain a vendor-specific implementation of this function.
  5084. */
  5085. __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
  5086. {
  5087. 8002164: b580 push {r7, lr}
  5088. 8002166: b082 sub sp, #8
  5089. 8002168: af00 add r7, sp, #0
  5090. 800216a: 6078 str r0, [r7, #4]
  5091. if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  5092. 800216c: 687b ldr r3, [r7, #4]
  5093. 800216e: 3b01 subs r3, #1
  5094. 8002170: f1b3 7f80 cmp.w r3, #16777216 ; 0x1000000
  5095. 8002174: d301 bcc.n 800217a <SysTick_Config+0x16>
  5096. {
  5097. return (1UL); /* Reload value impossible */
  5098. 8002176: 2301 movs r3, #1
  5099. 8002178: e00f b.n 800219a <SysTick_Config+0x36>
  5100. }
  5101. SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
  5102. 800217a: 4a0a ldr r2, [pc, #40] ; (80021a4 <SysTick_Config+0x40>)
  5103. 800217c: 687b ldr r3, [r7, #4]
  5104. 800217e: 3b01 subs r3, #1
  5105. 8002180: 6053 str r3, [r2, #4]
  5106. NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
  5107. 8002182: 210f movs r1, #15
  5108. 8002184: f04f 30ff mov.w r0, #4294967295
  5109. 8002188: f7ff ff8e bl 80020a8 <__NVIC_SetPriority>
  5110. SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
  5111. 800218c: 4b05 ldr r3, [pc, #20] ; (80021a4 <SysTick_Config+0x40>)
  5112. 800218e: 2200 movs r2, #0
  5113. 8002190: 609a str r2, [r3, #8]
  5114. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
  5115. 8002192: 4b04 ldr r3, [pc, #16] ; (80021a4 <SysTick_Config+0x40>)
  5116. 8002194: 2207 movs r2, #7
  5117. 8002196: 601a str r2, [r3, #0]
  5118. SysTick_CTRL_TICKINT_Msk |
  5119. SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
  5120. return (0UL); /* Function successful */
  5121. 8002198: 2300 movs r3, #0
  5122. }
  5123. 800219a: 4618 mov r0, r3
  5124. 800219c: 3708 adds r7, #8
  5125. 800219e: 46bd mov sp, r7
  5126. 80021a0: bd80 pop {r7, pc}
  5127. 80021a2: bf00 nop
  5128. 80021a4: e000e010 .word 0xe000e010
  5129. 080021a8 <HAL_NVIC_SetPriorityGrouping>:
  5130. * @note When the NVIC_PriorityGroup_0 is selected, IRQ preemption is no more possible.
  5131. * The pending IRQ priority will be managed only by the subpriority.
  5132. * @retval None
  5133. */
  5134. void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
  5135. {
  5136. 80021a8: b580 push {r7, lr}
  5137. 80021aa: b082 sub sp, #8
  5138. 80021ac: af00 add r7, sp, #0
  5139. 80021ae: 6078 str r0, [r7, #4]
  5140. /* Check the parameters */
  5141. assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
  5142. /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */
  5143. NVIC_SetPriorityGrouping(PriorityGroup);
  5144. 80021b0: 6878 ldr r0, [r7, #4]
  5145. 80021b2: f7ff ff29 bl 8002008 <__NVIC_SetPriorityGrouping>
  5146. }
  5147. 80021b6: bf00 nop
  5148. 80021b8: 3708 adds r7, #8
  5149. 80021ba: 46bd mov sp, r7
  5150. 80021bc: bd80 pop {r7, pc}
  5151. 080021be <HAL_NVIC_SetPriority>:
  5152. * This parameter can be a value between 0 and 15
  5153. * A lower priority value indicates a higher priority.
  5154. * @retval None
  5155. */
  5156. void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
  5157. {
  5158. 80021be: b580 push {r7, lr}
  5159. 80021c0: b086 sub sp, #24
  5160. 80021c2: af00 add r7, sp, #0
  5161. 80021c4: 4603 mov r3, r0
  5162. 80021c6: 60b9 str r1, [r7, #8]
  5163. 80021c8: 607a str r2, [r7, #4]
  5164. 80021ca: 73fb strb r3, [r7, #15]
  5165. uint32_t prioritygroup = 0x00U;
  5166. 80021cc: 2300 movs r3, #0
  5167. 80021ce: 617b str r3, [r7, #20]
  5168. /* Check the parameters */
  5169. assert_param(IS_NVIC_SUB_PRIORITY(SubPriority));
  5170. assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority));
  5171. prioritygroup = NVIC_GetPriorityGrouping();
  5172. 80021d0: f7ff ff3e bl 8002050 <__NVIC_GetPriorityGrouping>
  5173. 80021d4: 6178 str r0, [r7, #20]
  5174. NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority));
  5175. 80021d6: 687a ldr r2, [r7, #4]
  5176. 80021d8: 68b9 ldr r1, [r7, #8]
  5177. 80021da: 6978 ldr r0, [r7, #20]
  5178. 80021dc: f7ff ff8e bl 80020fc <NVIC_EncodePriority>
  5179. 80021e0: 4602 mov r2, r0
  5180. 80021e2: f997 300f ldrsb.w r3, [r7, #15]
  5181. 80021e6: 4611 mov r1, r2
  5182. 80021e8: 4618 mov r0, r3
  5183. 80021ea: f7ff ff5d bl 80020a8 <__NVIC_SetPriority>
  5184. }
  5185. 80021ee: bf00 nop
  5186. 80021f0: 3718 adds r7, #24
  5187. 80021f2: 46bd mov sp, r7
  5188. 80021f4: bd80 pop {r7, pc}
  5189. 080021f6 <HAL_NVIC_EnableIRQ>:
  5190. * This parameter can be an enumerator of IRQn_Type enumeration
  5191. * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f4xxxx.h))
  5192. * @retval None
  5193. */
  5194. void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
  5195. {
  5196. 80021f6: b580 push {r7, lr}
  5197. 80021f8: b082 sub sp, #8
  5198. 80021fa: af00 add r7, sp, #0
  5199. 80021fc: 4603 mov r3, r0
  5200. 80021fe: 71fb strb r3, [r7, #7]
  5201. /* Check the parameters */
  5202. assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
  5203. /* Enable interrupt */
  5204. NVIC_EnableIRQ(IRQn);
  5205. 8002200: f997 3007 ldrsb.w r3, [r7, #7]
  5206. 8002204: 4618 mov r0, r3
  5207. 8002206: f7ff ff31 bl 800206c <__NVIC_EnableIRQ>
  5208. }
  5209. 800220a: bf00 nop
  5210. 800220c: 3708 adds r7, #8
  5211. 800220e: 46bd mov sp, r7
  5212. 8002210: bd80 pop {r7, pc}
  5213. 08002212 <HAL_SYSTICK_Config>:
  5214. * @param TicksNumb Specifies the ticks Number of ticks between two interrupts.
  5215. * @retval status: - 0 Function succeeded.
  5216. * - 1 Function failed.
  5217. */
  5218. uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
  5219. {
  5220. 8002212: b580 push {r7, lr}
  5221. 8002214: b082 sub sp, #8
  5222. 8002216: af00 add r7, sp, #0
  5223. 8002218: 6078 str r0, [r7, #4]
  5224. return SysTick_Config(TicksNumb);
  5225. 800221a: 6878 ldr r0, [r7, #4]
  5226. 800221c: f7ff ffa2 bl 8002164 <SysTick_Config>
  5227. 8002220: 4603 mov r3, r0
  5228. }
  5229. 8002222: 4618 mov r0, r3
  5230. 8002224: 3708 adds r7, #8
  5231. 8002226: 46bd mov sp, r7
  5232. 8002228: bd80 pop {r7, pc}
  5233. ...
  5234. 0800222c <HAL_GPIO_Init>:
  5235. * @param GPIO_Init pointer to a GPIO_InitTypeDef structure that contains
  5236. * the configuration information for the specified GPIO peripheral.
  5237. * @retval None
  5238. */
  5239. void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
  5240. {
  5241. 800222c: b480 push {r7}
  5242. 800222e: b089 sub sp, #36 ; 0x24
  5243. 8002230: af00 add r7, sp, #0
  5244. 8002232: 6078 str r0, [r7, #4]
  5245. 8002234: 6039 str r1, [r7, #0]
  5246. uint32_t position;
  5247. uint32_t ioposition = 0x00U;
  5248. 8002236: 2300 movs r3, #0
  5249. 8002238: 617b str r3, [r7, #20]
  5250. uint32_t iocurrent = 0x00U;
  5251. 800223a: 2300 movs r3, #0
  5252. 800223c: 613b str r3, [r7, #16]
  5253. uint32_t temp = 0x00U;
  5254. 800223e: 2300 movs r3, #0
  5255. 8002240: 61bb str r3, [r7, #24]
  5256. assert_param(IS_GPIO_PIN(GPIO_Init->Pin));
  5257. assert_param(IS_GPIO_MODE(GPIO_Init->Mode));
  5258. assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
  5259. /* Configure the port pins */
  5260. for(position = 0U; position < GPIO_NUMBER; position++)
  5261. 8002242: 2300 movs r3, #0
  5262. 8002244: 61fb str r3, [r7, #28]
  5263. 8002246: e159 b.n 80024fc <HAL_GPIO_Init+0x2d0>
  5264. {
  5265. /* Get the IO position */
  5266. ioposition = 0x01U << position;
  5267. 8002248: 2201 movs r2, #1
  5268. 800224a: 69fb ldr r3, [r7, #28]
  5269. 800224c: fa02 f303 lsl.w r3, r2, r3
  5270. 8002250: 617b str r3, [r7, #20]
  5271. /* Get the current IO position */
  5272. iocurrent = (uint32_t)(GPIO_Init->Pin) & ioposition;
  5273. 8002252: 683b ldr r3, [r7, #0]
  5274. 8002254: 681b ldr r3, [r3, #0]
  5275. 8002256: 697a ldr r2, [r7, #20]
  5276. 8002258: 4013 ands r3, r2
  5277. 800225a: 613b str r3, [r7, #16]
  5278. if(iocurrent == ioposition)
  5279. 800225c: 693a ldr r2, [r7, #16]
  5280. 800225e: 697b ldr r3, [r7, #20]
  5281. 8002260: 429a cmp r2, r3
  5282. 8002262: f040 8148 bne.w 80024f6 <HAL_GPIO_Init+0x2ca>
  5283. {
  5284. /*--------------------- GPIO Mode Configuration ------------------------*/
  5285. /* In case of Output or Alternate function mode selection */
  5286. if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
  5287. 8002266: 683b ldr r3, [r7, #0]
  5288. 8002268: 685b ldr r3, [r3, #4]
  5289. 800226a: 2b01 cmp r3, #1
  5290. 800226c: d00b beq.n 8002286 <HAL_GPIO_Init+0x5a>
  5291. 800226e: 683b ldr r3, [r7, #0]
  5292. 8002270: 685b ldr r3, [r3, #4]
  5293. 8002272: 2b02 cmp r3, #2
  5294. 8002274: d007 beq.n 8002286 <HAL_GPIO_Init+0x5a>
  5295. (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
  5296. 8002276: 683b ldr r3, [r7, #0]
  5297. 8002278: 685b ldr r3, [r3, #4]
  5298. if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
  5299. 800227a: 2b11 cmp r3, #17
  5300. 800227c: d003 beq.n 8002286 <HAL_GPIO_Init+0x5a>
  5301. (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
  5302. 800227e: 683b ldr r3, [r7, #0]
  5303. 8002280: 685b ldr r3, [r3, #4]
  5304. 8002282: 2b12 cmp r3, #18
  5305. 8002284: d130 bne.n 80022e8 <HAL_GPIO_Init+0xbc>
  5306. {
  5307. /* Check the Speed parameter */
  5308. assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
  5309. /* Configure the IO Speed */
  5310. temp = GPIOx->OSPEEDR;
  5311. 8002286: 687b ldr r3, [r7, #4]
  5312. 8002288: 689b ldr r3, [r3, #8]
  5313. 800228a: 61bb str r3, [r7, #24]
  5314. temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2U));
  5315. 800228c: 69fb ldr r3, [r7, #28]
  5316. 800228e: 005b lsls r3, r3, #1
  5317. 8002290: 2203 movs r2, #3
  5318. 8002292: fa02 f303 lsl.w r3, r2, r3
  5319. 8002296: 43db mvns r3, r3
  5320. 8002298: 69ba ldr r2, [r7, #24]
  5321. 800229a: 4013 ands r3, r2
  5322. 800229c: 61bb str r3, [r7, #24]
  5323. temp |= (GPIO_Init->Speed << (position * 2U));
  5324. 800229e: 683b ldr r3, [r7, #0]
  5325. 80022a0: 68da ldr r2, [r3, #12]
  5326. 80022a2: 69fb ldr r3, [r7, #28]
  5327. 80022a4: 005b lsls r3, r3, #1
  5328. 80022a6: fa02 f303 lsl.w r3, r2, r3
  5329. 80022aa: 69ba ldr r2, [r7, #24]
  5330. 80022ac: 4313 orrs r3, r2
  5331. 80022ae: 61bb str r3, [r7, #24]
  5332. GPIOx->OSPEEDR = temp;
  5333. 80022b0: 687b ldr r3, [r7, #4]
  5334. 80022b2: 69ba ldr r2, [r7, #24]
  5335. 80022b4: 609a str r2, [r3, #8]
  5336. /* Configure the IO Output Type */
  5337. temp = GPIOx->OTYPER;
  5338. 80022b6: 687b ldr r3, [r7, #4]
  5339. 80022b8: 685b ldr r3, [r3, #4]
  5340. 80022ba: 61bb str r3, [r7, #24]
  5341. temp &= ~(GPIO_OTYPER_OT_0 << position) ;
  5342. 80022bc: 2201 movs r2, #1
  5343. 80022be: 69fb ldr r3, [r7, #28]
  5344. 80022c0: fa02 f303 lsl.w r3, r2, r3
  5345. 80022c4: 43db mvns r3, r3
  5346. 80022c6: 69ba ldr r2, [r7, #24]
  5347. 80022c8: 4013 ands r3, r2
  5348. 80022ca: 61bb str r3, [r7, #24]
  5349. temp |= (((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4U) << position);
  5350. 80022cc: 683b ldr r3, [r7, #0]
  5351. 80022ce: 685b ldr r3, [r3, #4]
  5352. 80022d0: 091b lsrs r3, r3, #4
  5353. 80022d2: f003 0201 and.w r2, r3, #1
  5354. 80022d6: 69fb ldr r3, [r7, #28]
  5355. 80022d8: fa02 f303 lsl.w r3, r2, r3
  5356. 80022dc: 69ba ldr r2, [r7, #24]
  5357. 80022de: 4313 orrs r3, r2
  5358. 80022e0: 61bb str r3, [r7, #24]
  5359. GPIOx->OTYPER = temp;
  5360. 80022e2: 687b ldr r3, [r7, #4]
  5361. 80022e4: 69ba ldr r2, [r7, #24]
  5362. 80022e6: 605a str r2, [r3, #4]
  5363. }
  5364. /* Activate the Pull-up or Pull down resistor for the current IO */
  5365. temp = GPIOx->PUPDR;
  5366. 80022e8: 687b ldr r3, [r7, #4]
  5367. 80022ea: 68db ldr r3, [r3, #12]
  5368. 80022ec: 61bb str r3, [r7, #24]
  5369. temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U));
  5370. 80022ee: 69fb ldr r3, [r7, #28]
  5371. 80022f0: 005b lsls r3, r3, #1
  5372. 80022f2: 2203 movs r2, #3
  5373. 80022f4: fa02 f303 lsl.w r3, r2, r3
  5374. 80022f8: 43db mvns r3, r3
  5375. 80022fa: 69ba ldr r2, [r7, #24]
  5376. 80022fc: 4013 ands r3, r2
  5377. 80022fe: 61bb str r3, [r7, #24]
  5378. temp |= ((GPIO_Init->Pull) << (position * 2U));
  5379. 8002300: 683b ldr r3, [r7, #0]
  5380. 8002302: 689a ldr r2, [r3, #8]
  5381. 8002304: 69fb ldr r3, [r7, #28]
  5382. 8002306: 005b lsls r3, r3, #1
  5383. 8002308: fa02 f303 lsl.w r3, r2, r3
  5384. 800230c: 69ba ldr r2, [r7, #24]
  5385. 800230e: 4313 orrs r3, r2
  5386. 8002310: 61bb str r3, [r7, #24]
  5387. GPIOx->PUPDR = temp;
  5388. 8002312: 687b ldr r3, [r7, #4]
  5389. 8002314: 69ba ldr r2, [r7, #24]
  5390. 8002316: 60da str r2, [r3, #12]
  5391. /* In case of Alternate function mode selection */
  5392. if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
  5393. 8002318: 683b ldr r3, [r7, #0]
  5394. 800231a: 685b ldr r3, [r3, #4]
  5395. 800231c: 2b02 cmp r3, #2
  5396. 800231e: d003 beq.n 8002328 <HAL_GPIO_Init+0xfc>
  5397. 8002320: 683b ldr r3, [r7, #0]
  5398. 8002322: 685b ldr r3, [r3, #4]
  5399. 8002324: 2b12 cmp r3, #18
  5400. 8002326: d123 bne.n 8002370 <HAL_GPIO_Init+0x144>
  5401. {
  5402. /* Check the Alternate function parameter */
  5403. assert_param(IS_GPIO_AF(GPIO_Init->Alternate));
  5404. /* Configure Alternate function mapped with the current IO */
  5405. temp = GPIOx->AFR[position >> 3U];
  5406. 8002328: 69fb ldr r3, [r7, #28]
  5407. 800232a: 08da lsrs r2, r3, #3
  5408. 800232c: 687b ldr r3, [r7, #4]
  5409. 800232e: 3208 adds r2, #8
  5410. 8002330: f853 3022 ldr.w r3, [r3, r2, lsl #2]
  5411. 8002334: 61bb str r3, [r7, #24]
  5412. temp &= ~(0xFU << ((uint32_t)(position & 0x07U) * 4U)) ;
  5413. 8002336: 69fb ldr r3, [r7, #28]
  5414. 8002338: f003 0307 and.w r3, r3, #7
  5415. 800233c: 009b lsls r3, r3, #2
  5416. 800233e: 220f movs r2, #15
  5417. 8002340: fa02 f303 lsl.w r3, r2, r3
  5418. 8002344: 43db mvns r3, r3
  5419. 8002346: 69ba ldr r2, [r7, #24]
  5420. 8002348: 4013 ands r3, r2
  5421. 800234a: 61bb str r3, [r7, #24]
  5422. temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & 0x07U) * 4U));
  5423. 800234c: 683b ldr r3, [r7, #0]
  5424. 800234e: 691a ldr r2, [r3, #16]
  5425. 8002350: 69fb ldr r3, [r7, #28]
  5426. 8002352: f003 0307 and.w r3, r3, #7
  5427. 8002356: 009b lsls r3, r3, #2
  5428. 8002358: fa02 f303 lsl.w r3, r2, r3
  5429. 800235c: 69ba ldr r2, [r7, #24]
  5430. 800235e: 4313 orrs r3, r2
  5431. 8002360: 61bb str r3, [r7, #24]
  5432. GPIOx->AFR[position >> 3U] = temp;
  5433. 8002362: 69fb ldr r3, [r7, #28]
  5434. 8002364: 08da lsrs r2, r3, #3
  5435. 8002366: 687b ldr r3, [r7, #4]
  5436. 8002368: 3208 adds r2, #8
  5437. 800236a: 69b9 ldr r1, [r7, #24]
  5438. 800236c: f843 1022 str.w r1, [r3, r2, lsl #2]
  5439. }
  5440. /* Configure IO Direction mode (Input, Output, Alternate or Analog) */
  5441. temp = GPIOx->MODER;
  5442. 8002370: 687b ldr r3, [r7, #4]
  5443. 8002372: 681b ldr r3, [r3, #0]
  5444. 8002374: 61bb str r3, [r7, #24]
  5445. temp &= ~(GPIO_MODER_MODER0 << (position * 2U));
  5446. 8002376: 69fb ldr r3, [r7, #28]
  5447. 8002378: 005b lsls r3, r3, #1
  5448. 800237a: 2203 movs r2, #3
  5449. 800237c: fa02 f303 lsl.w r3, r2, r3
  5450. 8002380: 43db mvns r3, r3
  5451. 8002382: 69ba ldr r2, [r7, #24]
  5452. 8002384: 4013 ands r3, r2
  5453. 8002386: 61bb str r3, [r7, #24]
  5454. temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U));
  5455. 8002388: 683b ldr r3, [r7, #0]
  5456. 800238a: 685b ldr r3, [r3, #4]
  5457. 800238c: f003 0203 and.w r2, r3, #3
  5458. 8002390: 69fb ldr r3, [r7, #28]
  5459. 8002392: 005b lsls r3, r3, #1
  5460. 8002394: fa02 f303 lsl.w r3, r2, r3
  5461. 8002398: 69ba ldr r2, [r7, #24]
  5462. 800239a: 4313 orrs r3, r2
  5463. 800239c: 61bb str r3, [r7, #24]
  5464. GPIOx->MODER = temp;
  5465. 800239e: 687b ldr r3, [r7, #4]
  5466. 80023a0: 69ba ldr r2, [r7, #24]
  5467. 80023a2: 601a str r2, [r3, #0]
  5468. /*--------------------- EXTI Mode Configuration ------------------------*/
  5469. /* Configure the External Interrupt or event for the current IO */
  5470. if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
  5471. 80023a4: 683b ldr r3, [r7, #0]
  5472. 80023a6: 685b ldr r3, [r3, #4]
  5473. 80023a8: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
  5474. 80023ac: 2b00 cmp r3, #0
  5475. 80023ae: f000 80a2 beq.w 80024f6 <HAL_GPIO_Init+0x2ca>
  5476. {
  5477. /* Enable SYSCFG Clock */
  5478. __HAL_RCC_SYSCFG_CLK_ENABLE();
  5479. 80023b2: 2300 movs r3, #0
  5480. 80023b4: 60fb str r3, [r7, #12]
  5481. 80023b6: 4b56 ldr r3, [pc, #344] ; (8002510 <HAL_GPIO_Init+0x2e4>)
  5482. 80023b8: 6c5b ldr r3, [r3, #68] ; 0x44
  5483. 80023ba: 4a55 ldr r2, [pc, #340] ; (8002510 <HAL_GPIO_Init+0x2e4>)
  5484. 80023bc: f443 4380 orr.w r3, r3, #16384 ; 0x4000
  5485. 80023c0: 6453 str r3, [r2, #68] ; 0x44
  5486. 80023c2: 4b53 ldr r3, [pc, #332] ; (8002510 <HAL_GPIO_Init+0x2e4>)
  5487. 80023c4: 6c5b ldr r3, [r3, #68] ; 0x44
  5488. 80023c6: f403 4380 and.w r3, r3, #16384 ; 0x4000
  5489. 80023ca: 60fb str r3, [r7, #12]
  5490. 80023cc: 68fb ldr r3, [r7, #12]
  5491. temp = SYSCFG->EXTICR[position >> 2U];
  5492. 80023ce: 4a51 ldr r2, [pc, #324] ; (8002514 <HAL_GPIO_Init+0x2e8>)
  5493. 80023d0: 69fb ldr r3, [r7, #28]
  5494. 80023d2: 089b lsrs r3, r3, #2
  5495. 80023d4: 3302 adds r3, #2
  5496. 80023d6: f852 3023 ldr.w r3, [r2, r3, lsl #2]
  5497. 80023da: 61bb str r3, [r7, #24]
  5498. temp &= ~(0x0FU << (4U * (position & 0x03U)));
  5499. 80023dc: 69fb ldr r3, [r7, #28]
  5500. 80023de: f003 0303 and.w r3, r3, #3
  5501. 80023e2: 009b lsls r3, r3, #2
  5502. 80023e4: 220f movs r2, #15
  5503. 80023e6: fa02 f303 lsl.w r3, r2, r3
  5504. 80023ea: 43db mvns r3, r3
  5505. 80023ec: 69ba ldr r2, [r7, #24]
  5506. 80023ee: 4013 ands r3, r2
  5507. 80023f0: 61bb str r3, [r7, #24]
  5508. temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U)));
  5509. 80023f2: 687b ldr r3, [r7, #4]
  5510. 80023f4: 4a48 ldr r2, [pc, #288] ; (8002518 <HAL_GPIO_Init+0x2ec>)
  5511. 80023f6: 4293 cmp r3, r2
  5512. 80023f8: d019 beq.n 800242e <HAL_GPIO_Init+0x202>
  5513. 80023fa: 687b ldr r3, [r7, #4]
  5514. 80023fc: 4a47 ldr r2, [pc, #284] ; (800251c <HAL_GPIO_Init+0x2f0>)
  5515. 80023fe: 4293 cmp r3, r2
  5516. 8002400: d013 beq.n 800242a <HAL_GPIO_Init+0x1fe>
  5517. 8002402: 687b ldr r3, [r7, #4]
  5518. 8002404: 4a46 ldr r2, [pc, #280] ; (8002520 <HAL_GPIO_Init+0x2f4>)
  5519. 8002406: 4293 cmp r3, r2
  5520. 8002408: d00d beq.n 8002426 <HAL_GPIO_Init+0x1fa>
  5521. 800240a: 687b ldr r3, [r7, #4]
  5522. 800240c: 4a45 ldr r2, [pc, #276] ; (8002524 <HAL_GPIO_Init+0x2f8>)
  5523. 800240e: 4293 cmp r3, r2
  5524. 8002410: d007 beq.n 8002422 <HAL_GPIO_Init+0x1f6>
  5525. 8002412: 687b ldr r3, [r7, #4]
  5526. 8002414: 4a44 ldr r2, [pc, #272] ; (8002528 <HAL_GPIO_Init+0x2fc>)
  5527. 8002416: 4293 cmp r3, r2
  5528. 8002418: d101 bne.n 800241e <HAL_GPIO_Init+0x1f2>
  5529. 800241a: 2304 movs r3, #4
  5530. 800241c: e008 b.n 8002430 <HAL_GPIO_Init+0x204>
  5531. 800241e: 2307 movs r3, #7
  5532. 8002420: e006 b.n 8002430 <HAL_GPIO_Init+0x204>
  5533. 8002422: 2303 movs r3, #3
  5534. 8002424: e004 b.n 8002430 <HAL_GPIO_Init+0x204>
  5535. 8002426: 2302 movs r3, #2
  5536. 8002428: e002 b.n 8002430 <HAL_GPIO_Init+0x204>
  5537. 800242a: 2301 movs r3, #1
  5538. 800242c: e000 b.n 8002430 <HAL_GPIO_Init+0x204>
  5539. 800242e: 2300 movs r3, #0
  5540. 8002430: 69fa ldr r2, [r7, #28]
  5541. 8002432: f002 0203 and.w r2, r2, #3
  5542. 8002436: 0092 lsls r2, r2, #2
  5543. 8002438: 4093 lsls r3, r2
  5544. 800243a: 69ba ldr r2, [r7, #24]
  5545. 800243c: 4313 orrs r3, r2
  5546. 800243e: 61bb str r3, [r7, #24]
  5547. SYSCFG->EXTICR[position >> 2U] = temp;
  5548. 8002440: 4934 ldr r1, [pc, #208] ; (8002514 <HAL_GPIO_Init+0x2e8>)
  5549. 8002442: 69fb ldr r3, [r7, #28]
  5550. 8002444: 089b lsrs r3, r3, #2
  5551. 8002446: 3302 adds r3, #2
  5552. 8002448: 69ba ldr r2, [r7, #24]
  5553. 800244a: f841 2023 str.w r2, [r1, r3, lsl #2]
  5554. /* Clear EXTI line configuration */
  5555. temp = EXTI->IMR;
  5556. 800244e: 4b37 ldr r3, [pc, #220] ; (800252c <HAL_GPIO_Init+0x300>)
  5557. 8002450: 681b ldr r3, [r3, #0]
  5558. 8002452: 61bb str r3, [r7, #24]
  5559. temp &= ~((uint32_t)iocurrent);
  5560. 8002454: 693b ldr r3, [r7, #16]
  5561. 8002456: 43db mvns r3, r3
  5562. 8002458: 69ba ldr r2, [r7, #24]
  5563. 800245a: 4013 ands r3, r2
  5564. 800245c: 61bb str r3, [r7, #24]
  5565. if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
  5566. 800245e: 683b ldr r3, [r7, #0]
  5567. 8002460: 685b ldr r3, [r3, #4]
  5568. 8002462: f403 3380 and.w r3, r3, #65536 ; 0x10000
  5569. 8002466: 2b00 cmp r3, #0
  5570. 8002468: d003 beq.n 8002472 <HAL_GPIO_Init+0x246>
  5571. {
  5572. temp |= iocurrent;
  5573. 800246a: 69ba ldr r2, [r7, #24]
  5574. 800246c: 693b ldr r3, [r7, #16]
  5575. 800246e: 4313 orrs r3, r2
  5576. 8002470: 61bb str r3, [r7, #24]
  5577. }
  5578. EXTI->IMR = temp;
  5579. 8002472: 4a2e ldr r2, [pc, #184] ; (800252c <HAL_GPIO_Init+0x300>)
  5580. 8002474: 69bb ldr r3, [r7, #24]
  5581. 8002476: 6013 str r3, [r2, #0]
  5582. temp = EXTI->EMR;
  5583. 8002478: 4b2c ldr r3, [pc, #176] ; (800252c <HAL_GPIO_Init+0x300>)
  5584. 800247a: 685b ldr r3, [r3, #4]
  5585. 800247c: 61bb str r3, [r7, #24]
  5586. temp &= ~((uint32_t)iocurrent);
  5587. 800247e: 693b ldr r3, [r7, #16]
  5588. 8002480: 43db mvns r3, r3
  5589. 8002482: 69ba ldr r2, [r7, #24]
  5590. 8002484: 4013 ands r3, r2
  5591. 8002486: 61bb str r3, [r7, #24]
  5592. if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
  5593. 8002488: 683b ldr r3, [r7, #0]
  5594. 800248a: 685b ldr r3, [r3, #4]
  5595. 800248c: f403 3300 and.w r3, r3, #131072 ; 0x20000
  5596. 8002490: 2b00 cmp r3, #0
  5597. 8002492: d003 beq.n 800249c <HAL_GPIO_Init+0x270>
  5598. {
  5599. temp |= iocurrent;
  5600. 8002494: 69ba ldr r2, [r7, #24]
  5601. 8002496: 693b ldr r3, [r7, #16]
  5602. 8002498: 4313 orrs r3, r2
  5603. 800249a: 61bb str r3, [r7, #24]
  5604. }
  5605. EXTI->EMR = temp;
  5606. 800249c: 4a23 ldr r2, [pc, #140] ; (800252c <HAL_GPIO_Init+0x300>)
  5607. 800249e: 69bb ldr r3, [r7, #24]
  5608. 80024a0: 6053 str r3, [r2, #4]
  5609. /* Clear Rising Falling edge configuration */
  5610. temp = EXTI->RTSR;
  5611. 80024a2: 4b22 ldr r3, [pc, #136] ; (800252c <HAL_GPIO_Init+0x300>)
  5612. 80024a4: 689b ldr r3, [r3, #8]
  5613. 80024a6: 61bb str r3, [r7, #24]
  5614. temp &= ~((uint32_t)iocurrent);
  5615. 80024a8: 693b ldr r3, [r7, #16]
  5616. 80024aa: 43db mvns r3, r3
  5617. 80024ac: 69ba ldr r2, [r7, #24]
  5618. 80024ae: 4013 ands r3, r2
  5619. 80024b0: 61bb str r3, [r7, #24]
  5620. if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
  5621. 80024b2: 683b ldr r3, [r7, #0]
  5622. 80024b4: 685b ldr r3, [r3, #4]
  5623. 80024b6: f403 1380 and.w r3, r3, #1048576 ; 0x100000
  5624. 80024ba: 2b00 cmp r3, #0
  5625. 80024bc: d003 beq.n 80024c6 <HAL_GPIO_Init+0x29a>
  5626. {
  5627. temp |= iocurrent;
  5628. 80024be: 69ba ldr r2, [r7, #24]
  5629. 80024c0: 693b ldr r3, [r7, #16]
  5630. 80024c2: 4313 orrs r3, r2
  5631. 80024c4: 61bb str r3, [r7, #24]
  5632. }
  5633. EXTI->RTSR = temp;
  5634. 80024c6: 4a19 ldr r2, [pc, #100] ; (800252c <HAL_GPIO_Init+0x300>)
  5635. 80024c8: 69bb ldr r3, [r7, #24]
  5636. 80024ca: 6093 str r3, [r2, #8]
  5637. temp = EXTI->FTSR;
  5638. 80024cc: 4b17 ldr r3, [pc, #92] ; (800252c <HAL_GPIO_Init+0x300>)
  5639. 80024ce: 68db ldr r3, [r3, #12]
  5640. 80024d0: 61bb str r3, [r7, #24]
  5641. temp &= ~((uint32_t)iocurrent);
  5642. 80024d2: 693b ldr r3, [r7, #16]
  5643. 80024d4: 43db mvns r3, r3
  5644. 80024d6: 69ba ldr r2, [r7, #24]
  5645. 80024d8: 4013 ands r3, r2
  5646. 80024da: 61bb str r3, [r7, #24]
  5647. if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
  5648. 80024dc: 683b ldr r3, [r7, #0]
  5649. 80024de: 685b ldr r3, [r3, #4]
  5650. 80024e0: f403 1300 and.w r3, r3, #2097152 ; 0x200000
  5651. 80024e4: 2b00 cmp r3, #0
  5652. 80024e6: d003 beq.n 80024f0 <HAL_GPIO_Init+0x2c4>
  5653. {
  5654. temp |= iocurrent;
  5655. 80024e8: 69ba ldr r2, [r7, #24]
  5656. 80024ea: 693b ldr r3, [r7, #16]
  5657. 80024ec: 4313 orrs r3, r2
  5658. 80024ee: 61bb str r3, [r7, #24]
  5659. }
  5660. EXTI->FTSR = temp;
  5661. 80024f0: 4a0e ldr r2, [pc, #56] ; (800252c <HAL_GPIO_Init+0x300>)
  5662. 80024f2: 69bb ldr r3, [r7, #24]
  5663. 80024f4: 60d3 str r3, [r2, #12]
  5664. for(position = 0U; position < GPIO_NUMBER; position++)
  5665. 80024f6: 69fb ldr r3, [r7, #28]
  5666. 80024f8: 3301 adds r3, #1
  5667. 80024fa: 61fb str r3, [r7, #28]
  5668. 80024fc: 69fb ldr r3, [r7, #28]
  5669. 80024fe: 2b0f cmp r3, #15
  5670. 8002500: f67f aea2 bls.w 8002248 <HAL_GPIO_Init+0x1c>
  5671. }
  5672. }
  5673. }
  5674. }
  5675. 8002504: bf00 nop
  5676. 8002506: 3724 adds r7, #36 ; 0x24
  5677. 8002508: 46bd mov sp, r7
  5678. 800250a: f85d 7b04 ldr.w r7, [sp], #4
  5679. 800250e: 4770 bx lr
  5680. 8002510: 40023800 .word 0x40023800
  5681. 8002514: 40013800 .word 0x40013800
  5682. 8002518: 40020000 .word 0x40020000
  5683. 800251c: 40020400 .word 0x40020400
  5684. 8002520: 40020800 .word 0x40020800
  5685. 8002524: 40020c00 .word 0x40020c00
  5686. 8002528: 40021000 .word 0x40021000
  5687. 800252c: 40013c00 .word 0x40013c00
  5688. 08002530 <HAL_GPIO_WritePin>:
  5689. * @arg GPIO_PIN_RESET: to clear the port pin
  5690. * @arg GPIO_PIN_SET: to set the port pin
  5691. * @retval None
  5692. */
  5693. void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
  5694. {
  5695. 8002530: b480 push {r7}
  5696. 8002532: b083 sub sp, #12
  5697. 8002534: af00 add r7, sp, #0
  5698. 8002536: 6078 str r0, [r7, #4]
  5699. 8002538: 460b mov r3, r1
  5700. 800253a: 807b strh r3, [r7, #2]
  5701. 800253c: 4613 mov r3, r2
  5702. 800253e: 707b strb r3, [r7, #1]
  5703. /* Check the parameters */
  5704. assert_param(IS_GPIO_PIN(GPIO_Pin));
  5705. assert_param(IS_GPIO_PIN_ACTION(PinState));
  5706. if(PinState != GPIO_PIN_RESET)
  5707. 8002540: 787b ldrb r3, [r7, #1]
  5708. 8002542: 2b00 cmp r3, #0
  5709. 8002544: d003 beq.n 800254e <HAL_GPIO_WritePin+0x1e>
  5710. {
  5711. GPIOx->BSRR = GPIO_Pin;
  5712. 8002546: 887a ldrh r2, [r7, #2]
  5713. 8002548: 687b ldr r3, [r7, #4]
  5714. 800254a: 619a str r2, [r3, #24]
  5715. }
  5716. else
  5717. {
  5718. GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
  5719. }
  5720. }
  5721. 800254c: e003 b.n 8002556 <HAL_GPIO_WritePin+0x26>
  5722. GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
  5723. 800254e: 887b ldrh r3, [r7, #2]
  5724. 8002550: 041a lsls r2, r3, #16
  5725. 8002552: 687b ldr r3, [r7, #4]
  5726. 8002554: 619a str r2, [r3, #24]
  5727. }
  5728. 8002556: bf00 nop
  5729. 8002558: 370c adds r7, #12
  5730. 800255a: 46bd mov sp, r7
  5731. 800255c: f85d 7b04 ldr.w r7, [sp], #4
  5732. 8002560: 4770 bx lr
  5733. ...
  5734. 08002564 <HAL_RCC_OscConfig>:
  5735. * supported by this API. User should request a transition to HSE Off
  5736. * first and then HSE On or HSE Bypass.
  5737. * @retval HAL status
  5738. */
  5739. __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
  5740. {
  5741. 8002564: b580 push {r7, lr}
  5742. 8002566: b086 sub sp, #24
  5743. 8002568: af00 add r7, sp, #0
  5744. 800256a: 6078 str r0, [r7, #4]
  5745. uint32_t tickstart, pll_config;
  5746. /* Check Null pointer */
  5747. if(RCC_OscInitStruct == NULL)
  5748. 800256c: 687b ldr r3, [r7, #4]
  5749. 800256e: 2b00 cmp r3, #0
  5750. 8002570: d101 bne.n 8002576 <HAL_RCC_OscConfig+0x12>
  5751. {
  5752. return HAL_ERROR;
  5753. 8002572: 2301 movs r3, #1
  5754. 8002574: e25b b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  5755. }
  5756. /* Check the parameters */
  5757. assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType));
  5758. /*------------------------------- HSE Configuration ------------------------*/
  5759. if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE)
  5760. 8002576: 687b ldr r3, [r7, #4]
  5761. 8002578: 681b ldr r3, [r3, #0]
  5762. 800257a: f003 0301 and.w r3, r3, #1
  5763. 800257e: 2b00 cmp r3, #0
  5764. 8002580: d075 beq.n 800266e <HAL_RCC_OscConfig+0x10a>
  5765. {
  5766. /* Check the parameters */
  5767. assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState));
  5768. /* When the HSE is used as system clock or clock source for PLL in these cases HSE will not disabled */
  5769. if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\
  5770. 8002582: 4ba3 ldr r3, [pc, #652] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5771. 8002584: 689b ldr r3, [r3, #8]
  5772. 8002586: f003 030c and.w r3, r3, #12
  5773. 800258a: 2b04 cmp r3, #4
  5774. 800258c: d00c beq.n 80025a8 <HAL_RCC_OscConfig+0x44>
  5775. ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE)))
  5776. 800258e: 4ba0 ldr r3, [pc, #640] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5777. 8002590: 689b ldr r3, [r3, #8]
  5778. 8002592: f003 030c and.w r3, r3, #12
  5779. if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSE) ||\
  5780. 8002596: 2b08 cmp r3, #8
  5781. 8002598: d112 bne.n 80025c0 <HAL_RCC_OscConfig+0x5c>
  5782. ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSE)))
  5783. 800259a: 4b9d ldr r3, [pc, #628] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5784. 800259c: 685b ldr r3, [r3, #4]
  5785. 800259e: f403 0380 and.w r3, r3, #4194304 ; 0x400000
  5786. 80025a2: f5b3 0f80 cmp.w r3, #4194304 ; 0x400000
  5787. 80025a6: d10b bne.n 80025c0 <HAL_RCC_OscConfig+0x5c>
  5788. {
  5789. if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF))
  5790. 80025a8: 4b99 ldr r3, [pc, #612] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5791. 80025aa: 681b ldr r3, [r3, #0]
  5792. 80025ac: f403 3300 and.w r3, r3, #131072 ; 0x20000
  5793. 80025b0: 2b00 cmp r3, #0
  5794. 80025b2: d05b beq.n 800266c <HAL_RCC_OscConfig+0x108>
  5795. 80025b4: 687b ldr r3, [r7, #4]
  5796. 80025b6: 685b ldr r3, [r3, #4]
  5797. 80025b8: 2b00 cmp r3, #0
  5798. 80025ba: d157 bne.n 800266c <HAL_RCC_OscConfig+0x108>
  5799. {
  5800. return HAL_ERROR;
  5801. 80025bc: 2301 movs r3, #1
  5802. 80025be: e236 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  5803. }
  5804. }
  5805. else
  5806. {
  5807. /* Set the new HSE configuration ---------------------------------------*/
  5808. __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState);
  5809. 80025c0: 687b ldr r3, [r7, #4]
  5810. 80025c2: 685b ldr r3, [r3, #4]
  5811. 80025c4: f5b3 3f80 cmp.w r3, #65536 ; 0x10000
  5812. 80025c8: d106 bne.n 80025d8 <HAL_RCC_OscConfig+0x74>
  5813. 80025ca: 4b91 ldr r3, [pc, #580] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5814. 80025cc: 681b ldr r3, [r3, #0]
  5815. 80025ce: 4a90 ldr r2, [pc, #576] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5816. 80025d0: f443 3380 orr.w r3, r3, #65536 ; 0x10000
  5817. 80025d4: 6013 str r3, [r2, #0]
  5818. 80025d6: e01d b.n 8002614 <HAL_RCC_OscConfig+0xb0>
  5819. 80025d8: 687b ldr r3, [r7, #4]
  5820. 80025da: 685b ldr r3, [r3, #4]
  5821. 80025dc: f5b3 2fa0 cmp.w r3, #327680 ; 0x50000
  5822. 80025e0: d10c bne.n 80025fc <HAL_RCC_OscConfig+0x98>
  5823. 80025e2: 4b8b ldr r3, [pc, #556] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5824. 80025e4: 681b ldr r3, [r3, #0]
  5825. 80025e6: 4a8a ldr r2, [pc, #552] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5826. 80025e8: f443 2380 orr.w r3, r3, #262144 ; 0x40000
  5827. 80025ec: 6013 str r3, [r2, #0]
  5828. 80025ee: 4b88 ldr r3, [pc, #544] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5829. 80025f0: 681b ldr r3, [r3, #0]
  5830. 80025f2: 4a87 ldr r2, [pc, #540] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5831. 80025f4: f443 3380 orr.w r3, r3, #65536 ; 0x10000
  5832. 80025f8: 6013 str r3, [r2, #0]
  5833. 80025fa: e00b b.n 8002614 <HAL_RCC_OscConfig+0xb0>
  5834. 80025fc: 4b84 ldr r3, [pc, #528] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5835. 80025fe: 681b ldr r3, [r3, #0]
  5836. 8002600: 4a83 ldr r2, [pc, #524] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5837. 8002602: f423 3380 bic.w r3, r3, #65536 ; 0x10000
  5838. 8002606: 6013 str r3, [r2, #0]
  5839. 8002608: 4b81 ldr r3, [pc, #516] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5840. 800260a: 681b ldr r3, [r3, #0]
  5841. 800260c: 4a80 ldr r2, [pc, #512] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5842. 800260e: f423 2380 bic.w r3, r3, #262144 ; 0x40000
  5843. 8002612: 6013 str r3, [r2, #0]
  5844. /* Check the HSE State */
  5845. if((RCC_OscInitStruct->HSEState) != RCC_HSE_OFF)
  5846. 8002614: 687b ldr r3, [r7, #4]
  5847. 8002616: 685b ldr r3, [r3, #4]
  5848. 8002618: 2b00 cmp r3, #0
  5849. 800261a: d013 beq.n 8002644 <HAL_RCC_OscConfig+0xe0>
  5850. {
  5851. /* Get Start Tick */
  5852. tickstart = HAL_GetTick();
  5853. 800261c: f7ff f852 bl 80016c4 <HAL_GetTick>
  5854. 8002620: 6138 str r0, [r7, #16]
  5855. /* Wait till HSE is ready */
  5856. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)
  5857. 8002622: e008 b.n 8002636 <HAL_RCC_OscConfig+0xd2>
  5858. {
  5859. if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
  5860. 8002624: f7ff f84e bl 80016c4 <HAL_GetTick>
  5861. 8002628: 4602 mov r2, r0
  5862. 800262a: 693b ldr r3, [r7, #16]
  5863. 800262c: 1ad3 subs r3, r2, r3
  5864. 800262e: 2b64 cmp r3, #100 ; 0x64
  5865. 8002630: d901 bls.n 8002636 <HAL_RCC_OscConfig+0xd2>
  5866. {
  5867. return HAL_TIMEOUT;
  5868. 8002632: 2303 movs r3, #3
  5869. 8002634: e1fb b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  5870. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)
  5871. 8002636: 4b76 ldr r3, [pc, #472] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5872. 8002638: 681b ldr r3, [r3, #0]
  5873. 800263a: f403 3300 and.w r3, r3, #131072 ; 0x20000
  5874. 800263e: 2b00 cmp r3, #0
  5875. 8002640: d0f0 beq.n 8002624 <HAL_RCC_OscConfig+0xc0>
  5876. 8002642: e014 b.n 800266e <HAL_RCC_OscConfig+0x10a>
  5877. }
  5878. }
  5879. else
  5880. {
  5881. /* Get Start Tick */
  5882. tickstart = HAL_GetTick();
  5883. 8002644: f7ff f83e bl 80016c4 <HAL_GetTick>
  5884. 8002648: 6138 str r0, [r7, #16]
  5885. /* Wait till HSE is bypassed or disabled */
  5886. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET)
  5887. 800264a: e008 b.n 800265e <HAL_RCC_OscConfig+0xfa>
  5888. {
  5889. if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
  5890. 800264c: f7ff f83a bl 80016c4 <HAL_GetTick>
  5891. 8002650: 4602 mov r2, r0
  5892. 8002652: 693b ldr r3, [r7, #16]
  5893. 8002654: 1ad3 subs r3, r2, r3
  5894. 8002656: 2b64 cmp r3, #100 ; 0x64
  5895. 8002658: d901 bls.n 800265e <HAL_RCC_OscConfig+0xfa>
  5896. {
  5897. return HAL_TIMEOUT;
  5898. 800265a: 2303 movs r3, #3
  5899. 800265c: e1e7 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  5900. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET)
  5901. 800265e: 4b6c ldr r3, [pc, #432] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5902. 8002660: 681b ldr r3, [r3, #0]
  5903. 8002662: f403 3300 and.w r3, r3, #131072 ; 0x20000
  5904. 8002666: 2b00 cmp r3, #0
  5905. 8002668: d1f0 bne.n 800264c <HAL_RCC_OscConfig+0xe8>
  5906. 800266a: e000 b.n 800266e <HAL_RCC_OscConfig+0x10a>
  5907. if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF))
  5908. 800266c: bf00 nop
  5909. }
  5910. }
  5911. }
  5912. }
  5913. /*----------------------------- HSI Configuration --------------------------*/
  5914. if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI)
  5915. 800266e: 687b ldr r3, [r7, #4]
  5916. 8002670: 681b ldr r3, [r3, #0]
  5917. 8002672: f003 0302 and.w r3, r3, #2
  5918. 8002676: 2b00 cmp r3, #0
  5919. 8002678: d063 beq.n 8002742 <HAL_RCC_OscConfig+0x1de>
  5920. /* Check the parameters */
  5921. assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState));
  5922. assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue));
  5923. /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */
  5924. if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\
  5925. 800267a: 4b65 ldr r3, [pc, #404] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5926. 800267c: 689b ldr r3, [r3, #8]
  5927. 800267e: f003 030c and.w r3, r3, #12
  5928. 8002682: 2b00 cmp r3, #0
  5929. 8002684: d00b beq.n 800269e <HAL_RCC_OscConfig+0x13a>
  5930. ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI)))
  5931. 8002686: 4b62 ldr r3, [pc, #392] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5932. 8002688: 689b ldr r3, [r3, #8]
  5933. 800268a: f003 030c and.w r3, r3, #12
  5934. if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_HSI) ||\
  5935. 800268e: 2b08 cmp r3, #8
  5936. 8002690: d11c bne.n 80026cc <HAL_RCC_OscConfig+0x168>
  5937. ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL) && ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLCFGR_PLLSRC_HSI)))
  5938. 8002692: 4b5f ldr r3, [pc, #380] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5939. 8002694: 685b ldr r3, [r3, #4]
  5940. 8002696: f403 0380 and.w r3, r3, #4194304 ; 0x400000
  5941. 800269a: 2b00 cmp r3, #0
  5942. 800269c: d116 bne.n 80026cc <HAL_RCC_OscConfig+0x168>
  5943. {
  5944. /* When HSI is used as system clock it will not disabled */
  5945. if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON))
  5946. 800269e: 4b5c ldr r3, [pc, #368] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5947. 80026a0: 681b ldr r3, [r3, #0]
  5948. 80026a2: f003 0302 and.w r3, r3, #2
  5949. 80026a6: 2b00 cmp r3, #0
  5950. 80026a8: d005 beq.n 80026b6 <HAL_RCC_OscConfig+0x152>
  5951. 80026aa: 687b ldr r3, [r7, #4]
  5952. 80026ac: 68db ldr r3, [r3, #12]
  5953. 80026ae: 2b01 cmp r3, #1
  5954. 80026b0: d001 beq.n 80026b6 <HAL_RCC_OscConfig+0x152>
  5955. {
  5956. return HAL_ERROR;
  5957. 80026b2: 2301 movs r3, #1
  5958. 80026b4: e1bb b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  5959. }
  5960. /* Otherwise, just the calibration is allowed */
  5961. else
  5962. {
  5963. /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/
  5964. __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue);
  5965. 80026b6: 4b56 ldr r3, [pc, #344] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5966. 80026b8: 681b ldr r3, [r3, #0]
  5967. 80026ba: f023 02f8 bic.w r2, r3, #248 ; 0xf8
  5968. 80026be: 687b ldr r3, [r7, #4]
  5969. 80026c0: 691b ldr r3, [r3, #16]
  5970. 80026c2: 00db lsls r3, r3, #3
  5971. 80026c4: 4952 ldr r1, [pc, #328] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  5972. 80026c6: 4313 orrs r3, r2
  5973. 80026c8: 600b str r3, [r1, #0]
  5974. if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON))
  5975. 80026ca: e03a b.n 8002742 <HAL_RCC_OscConfig+0x1de>
  5976. }
  5977. }
  5978. else
  5979. {
  5980. /* Check the HSI State */
  5981. if((RCC_OscInitStruct->HSIState)!= RCC_HSI_OFF)
  5982. 80026cc: 687b ldr r3, [r7, #4]
  5983. 80026ce: 68db ldr r3, [r3, #12]
  5984. 80026d0: 2b00 cmp r3, #0
  5985. 80026d2: d020 beq.n 8002716 <HAL_RCC_OscConfig+0x1b2>
  5986. {
  5987. /* Enable the Internal High Speed oscillator (HSI). */
  5988. __HAL_RCC_HSI_ENABLE();
  5989. 80026d4: 4b4f ldr r3, [pc, #316] ; (8002814 <HAL_RCC_OscConfig+0x2b0>)
  5990. 80026d6: 2201 movs r2, #1
  5991. 80026d8: 601a str r2, [r3, #0]
  5992. /* Get Start Tick*/
  5993. tickstart = HAL_GetTick();
  5994. 80026da: f7fe fff3 bl 80016c4 <HAL_GetTick>
  5995. 80026de: 6138 str r0, [r7, #16]
  5996. /* Wait till HSI is ready */
  5997. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET)
  5998. 80026e0: e008 b.n 80026f4 <HAL_RCC_OscConfig+0x190>
  5999. {
  6000. if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE)
  6001. 80026e2: f7fe ffef bl 80016c4 <HAL_GetTick>
  6002. 80026e6: 4602 mov r2, r0
  6003. 80026e8: 693b ldr r3, [r7, #16]
  6004. 80026ea: 1ad3 subs r3, r2, r3
  6005. 80026ec: 2b02 cmp r3, #2
  6006. 80026ee: d901 bls.n 80026f4 <HAL_RCC_OscConfig+0x190>
  6007. {
  6008. return HAL_TIMEOUT;
  6009. 80026f0: 2303 movs r3, #3
  6010. 80026f2: e19c b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6011. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET)
  6012. 80026f4: 4b46 ldr r3, [pc, #280] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6013. 80026f6: 681b ldr r3, [r3, #0]
  6014. 80026f8: f003 0302 and.w r3, r3, #2
  6015. 80026fc: 2b00 cmp r3, #0
  6016. 80026fe: d0f0 beq.n 80026e2 <HAL_RCC_OscConfig+0x17e>
  6017. }
  6018. }
  6019. /* Adjusts the Internal High Speed oscillator (HSI) calibration value. */
  6020. __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue);
  6021. 8002700: 4b43 ldr r3, [pc, #268] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6022. 8002702: 681b ldr r3, [r3, #0]
  6023. 8002704: f023 02f8 bic.w r2, r3, #248 ; 0xf8
  6024. 8002708: 687b ldr r3, [r7, #4]
  6025. 800270a: 691b ldr r3, [r3, #16]
  6026. 800270c: 00db lsls r3, r3, #3
  6027. 800270e: 4940 ldr r1, [pc, #256] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6028. 8002710: 4313 orrs r3, r2
  6029. 8002712: 600b str r3, [r1, #0]
  6030. 8002714: e015 b.n 8002742 <HAL_RCC_OscConfig+0x1de>
  6031. }
  6032. else
  6033. {
  6034. /* Disable the Internal High Speed oscillator (HSI). */
  6035. __HAL_RCC_HSI_DISABLE();
  6036. 8002716: 4b3f ldr r3, [pc, #252] ; (8002814 <HAL_RCC_OscConfig+0x2b0>)
  6037. 8002718: 2200 movs r2, #0
  6038. 800271a: 601a str r2, [r3, #0]
  6039. /* Get Start Tick*/
  6040. tickstart = HAL_GetTick();
  6041. 800271c: f7fe ffd2 bl 80016c4 <HAL_GetTick>
  6042. 8002720: 6138 str r0, [r7, #16]
  6043. /* Wait till HSI is ready */
  6044. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET)
  6045. 8002722: e008 b.n 8002736 <HAL_RCC_OscConfig+0x1d2>
  6046. {
  6047. if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE)
  6048. 8002724: f7fe ffce bl 80016c4 <HAL_GetTick>
  6049. 8002728: 4602 mov r2, r0
  6050. 800272a: 693b ldr r3, [r7, #16]
  6051. 800272c: 1ad3 subs r3, r2, r3
  6052. 800272e: 2b02 cmp r3, #2
  6053. 8002730: d901 bls.n 8002736 <HAL_RCC_OscConfig+0x1d2>
  6054. {
  6055. return HAL_TIMEOUT;
  6056. 8002732: 2303 movs r3, #3
  6057. 8002734: e17b b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6058. while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET)
  6059. 8002736: 4b36 ldr r3, [pc, #216] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6060. 8002738: 681b ldr r3, [r3, #0]
  6061. 800273a: f003 0302 and.w r3, r3, #2
  6062. 800273e: 2b00 cmp r3, #0
  6063. 8002740: d1f0 bne.n 8002724 <HAL_RCC_OscConfig+0x1c0>
  6064. }
  6065. }
  6066. }
  6067. }
  6068. /*------------------------------ LSI Configuration -------------------------*/
  6069. if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI)
  6070. 8002742: 687b ldr r3, [r7, #4]
  6071. 8002744: 681b ldr r3, [r3, #0]
  6072. 8002746: f003 0308 and.w r3, r3, #8
  6073. 800274a: 2b00 cmp r3, #0
  6074. 800274c: d030 beq.n 80027b0 <HAL_RCC_OscConfig+0x24c>
  6075. {
  6076. /* Check the parameters */
  6077. assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState));
  6078. /* Check the LSI State */
  6079. if((RCC_OscInitStruct->LSIState)!= RCC_LSI_OFF)
  6080. 800274e: 687b ldr r3, [r7, #4]
  6081. 8002750: 695b ldr r3, [r3, #20]
  6082. 8002752: 2b00 cmp r3, #0
  6083. 8002754: d016 beq.n 8002784 <HAL_RCC_OscConfig+0x220>
  6084. {
  6085. /* Enable the Internal Low Speed oscillator (LSI). */
  6086. __HAL_RCC_LSI_ENABLE();
  6087. 8002756: 4b30 ldr r3, [pc, #192] ; (8002818 <HAL_RCC_OscConfig+0x2b4>)
  6088. 8002758: 2201 movs r2, #1
  6089. 800275a: 601a str r2, [r3, #0]
  6090. /* Get Start Tick*/
  6091. tickstart = HAL_GetTick();
  6092. 800275c: f7fe ffb2 bl 80016c4 <HAL_GetTick>
  6093. 8002760: 6138 str r0, [r7, #16]
  6094. /* Wait till LSI is ready */
  6095. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET)
  6096. 8002762: e008 b.n 8002776 <HAL_RCC_OscConfig+0x212>
  6097. {
  6098. if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE)
  6099. 8002764: f7fe ffae bl 80016c4 <HAL_GetTick>
  6100. 8002768: 4602 mov r2, r0
  6101. 800276a: 693b ldr r3, [r7, #16]
  6102. 800276c: 1ad3 subs r3, r2, r3
  6103. 800276e: 2b02 cmp r3, #2
  6104. 8002770: d901 bls.n 8002776 <HAL_RCC_OscConfig+0x212>
  6105. {
  6106. return HAL_TIMEOUT;
  6107. 8002772: 2303 movs r3, #3
  6108. 8002774: e15b b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6109. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET)
  6110. 8002776: 4b26 ldr r3, [pc, #152] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6111. 8002778: 6f5b ldr r3, [r3, #116] ; 0x74
  6112. 800277a: f003 0302 and.w r3, r3, #2
  6113. 800277e: 2b00 cmp r3, #0
  6114. 8002780: d0f0 beq.n 8002764 <HAL_RCC_OscConfig+0x200>
  6115. 8002782: e015 b.n 80027b0 <HAL_RCC_OscConfig+0x24c>
  6116. }
  6117. }
  6118. else
  6119. {
  6120. /* Disable the Internal Low Speed oscillator (LSI). */
  6121. __HAL_RCC_LSI_DISABLE();
  6122. 8002784: 4b24 ldr r3, [pc, #144] ; (8002818 <HAL_RCC_OscConfig+0x2b4>)
  6123. 8002786: 2200 movs r2, #0
  6124. 8002788: 601a str r2, [r3, #0]
  6125. /* Get Start Tick */
  6126. tickstart = HAL_GetTick();
  6127. 800278a: f7fe ff9b bl 80016c4 <HAL_GetTick>
  6128. 800278e: 6138 str r0, [r7, #16]
  6129. /* Wait till LSI is ready */
  6130. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET)
  6131. 8002790: e008 b.n 80027a4 <HAL_RCC_OscConfig+0x240>
  6132. {
  6133. if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE)
  6134. 8002792: f7fe ff97 bl 80016c4 <HAL_GetTick>
  6135. 8002796: 4602 mov r2, r0
  6136. 8002798: 693b ldr r3, [r7, #16]
  6137. 800279a: 1ad3 subs r3, r2, r3
  6138. 800279c: 2b02 cmp r3, #2
  6139. 800279e: d901 bls.n 80027a4 <HAL_RCC_OscConfig+0x240>
  6140. {
  6141. return HAL_TIMEOUT;
  6142. 80027a0: 2303 movs r3, #3
  6143. 80027a2: e144 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6144. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET)
  6145. 80027a4: 4b1a ldr r3, [pc, #104] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6146. 80027a6: 6f5b ldr r3, [r3, #116] ; 0x74
  6147. 80027a8: f003 0302 and.w r3, r3, #2
  6148. 80027ac: 2b00 cmp r3, #0
  6149. 80027ae: d1f0 bne.n 8002792 <HAL_RCC_OscConfig+0x22e>
  6150. }
  6151. }
  6152. }
  6153. }
  6154. /*------------------------------ LSE Configuration -------------------------*/
  6155. if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE)
  6156. 80027b0: 687b ldr r3, [r7, #4]
  6157. 80027b2: 681b ldr r3, [r3, #0]
  6158. 80027b4: f003 0304 and.w r3, r3, #4
  6159. 80027b8: 2b00 cmp r3, #0
  6160. 80027ba: f000 80a0 beq.w 80028fe <HAL_RCC_OscConfig+0x39a>
  6161. {
  6162. FlagStatus pwrclkchanged = RESET;
  6163. 80027be: 2300 movs r3, #0
  6164. 80027c0: 75fb strb r3, [r7, #23]
  6165. /* Check the parameters */
  6166. assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState));
  6167. /* Update LSE configuration in Backup Domain control register */
  6168. /* Requires to enable write access to Backup Domain of necessary */
  6169. if(__HAL_RCC_PWR_IS_CLK_DISABLED())
  6170. 80027c2: 4b13 ldr r3, [pc, #76] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6171. 80027c4: 6c1b ldr r3, [r3, #64] ; 0x40
  6172. 80027c6: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
  6173. 80027ca: 2b00 cmp r3, #0
  6174. 80027cc: d10f bne.n 80027ee <HAL_RCC_OscConfig+0x28a>
  6175. {
  6176. __HAL_RCC_PWR_CLK_ENABLE();
  6177. 80027ce: 2300 movs r3, #0
  6178. 80027d0: 60bb str r3, [r7, #8]
  6179. 80027d2: 4b0f ldr r3, [pc, #60] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6180. 80027d4: 6c1b ldr r3, [r3, #64] ; 0x40
  6181. 80027d6: 4a0e ldr r2, [pc, #56] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6182. 80027d8: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000
  6183. 80027dc: 6413 str r3, [r2, #64] ; 0x40
  6184. 80027de: 4b0c ldr r3, [pc, #48] ; (8002810 <HAL_RCC_OscConfig+0x2ac>)
  6185. 80027e0: 6c1b ldr r3, [r3, #64] ; 0x40
  6186. 80027e2: f003 5380 and.w r3, r3, #268435456 ; 0x10000000
  6187. 80027e6: 60bb str r3, [r7, #8]
  6188. 80027e8: 68bb ldr r3, [r7, #8]
  6189. pwrclkchanged = SET;
  6190. 80027ea: 2301 movs r3, #1
  6191. 80027ec: 75fb strb r3, [r7, #23]
  6192. }
  6193. if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
  6194. 80027ee: 4b0b ldr r3, [pc, #44] ; (800281c <HAL_RCC_OscConfig+0x2b8>)
  6195. 80027f0: 681b ldr r3, [r3, #0]
  6196. 80027f2: f403 7380 and.w r3, r3, #256 ; 0x100
  6197. 80027f6: 2b00 cmp r3, #0
  6198. 80027f8: d121 bne.n 800283e <HAL_RCC_OscConfig+0x2da>
  6199. {
  6200. /* Enable write access to Backup domain */
  6201. SET_BIT(PWR->CR, PWR_CR_DBP);
  6202. 80027fa: 4b08 ldr r3, [pc, #32] ; (800281c <HAL_RCC_OscConfig+0x2b8>)
  6203. 80027fc: 681b ldr r3, [r3, #0]
  6204. 80027fe: 4a07 ldr r2, [pc, #28] ; (800281c <HAL_RCC_OscConfig+0x2b8>)
  6205. 8002800: f443 7380 orr.w r3, r3, #256 ; 0x100
  6206. 8002804: 6013 str r3, [r2, #0]
  6207. /* Wait for Backup domain Write protection disable */
  6208. tickstart = HAL_GetTick();
  6209. 8002806: f7fe ff5d bl 80016c4 <HAL_GetTick>
  6210. 800280a: 6138 str r0, [r7, #16]
  6211. while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
  6212. 800280c: e011 b.n 8002832 <HAL_RCC_OscConfig+0x2ce>
  6213. 800280e: bf00 nop
  6214. 8002810: 40023800 .word 0x40023800
  6215. 8002814: 42470000 .word 0x42470000
  6216. 8002818: 42470e80 .word 0x42470e80
  6217. 800281c: 40007000 .word 0x40007000
  6218. {
  6219. if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE)
  6220. 8002820: f7fe ff50 bl 80016c4 <HAL_GetTick>
  6221. 8002824: 4602 mov r2, r0
  6222. 8002826: 693b ldr r3, [r7, #16]
  6223. 8002828: 1ad3 subs r3, r2, r3
  6224. 800282a: 2b02 cmp r3, #2
  6225. 800282c: d901 bls.n 8002832 <HAL_RCC_OscConfig+0x2ce>
  6226. {
  6227. return HAL_TIMEOUT;
  6228. 800282e: 2303 movs r3, #3
  6229. 8002830: e0fd b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6230. while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
  6231. 8002832: 4b81 ldr r3, [pc, #516] ; (8002a38 <HAL_RCC_OscConfig+0x4d4>)
  6232. 8002834: 681b ldr r3, [r3, #0]
  6233. 8002836: f403 7380 and.w r3, r3, #256 ; 0x100
  6234. 800283a: 2b00 cmp r3, #0
  6235. 800283c: d0f0 beq.n 8002820 <HAL_RCC_OscConfig+0x2bc>
  6236. }
  6237. }
  6238. }
  6239. /* Set the new LSE configuration -----------------------------------------*/
  6240. __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);
  6241. 800283e: 687b ldr r3, [r7, #4]
  6242. 8002840: 689b ldr r3, [r3, #8]
  6243. 8002842: 2b01 cmp r3, #1
  6244. 8002844: d106 bne.n 8002854 <HAL_RCC_OscConfig+0x2f0>
  6245. 8002846: 4b7d ldr r3, [pc, #500] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6246. 8002848: 6f1b ldr r3, [r3, #112] ; 0x70
  6247. 800284a: 4a7c ldr r2, [pc, #496] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6248. 800284c: f043 0301 orr.w r3, r3, #1
  6249. 8002850: 6713 str r3, [r2, #112] ; 0x70
  6250. 8002852: e01c b.n 800288e <HAL_RCC_OscConfig+0x32a>
  6251. 8002854: 687b ldr r3, [r7, #4]
  6252. 8002856: 689b ldr r3, [r3, #8]
  6253. 8002858: 2b05 cmp r3, #5
  6254. 800285a: d10c bne.n 8002876 <HAL_RCC_OscConfig+0x312>
  6255. 800285c: 4b77 ldr r3, [pc, #476] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6256. 800285e: 6f1b ldr r3, [r3, #112] ; 0x70
  6257. 8002860: 4a76 ldr r2, [pc, #472] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6258. 8002862: f043 0304 orr.w r3, r3, #4
  6259. 8002866: 6713 str r3, [r2, #112] ; 0x70
  6260. 8002868: 4b74 ldr r3, [pc, #464] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6261. 800286a: 6f1b ldr r3, [r3, #112] ; 0x70
  6262. 800286c: 4a73 ldr r2, [pc, #460] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6263. 800286e: f043 0301 orr.w r3, r3, #1
  6264. 8002872: 6713 str r3, [r2, #112] ; 0x70
  6265. 8002874: e00b b.n 800288e <HAL_RCC_OscConfig+0x32a>
  6266. 8002876: 4b71 ldr r3, [pc, #452] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6267. 8002878: 6f1b ldr r3, [r3, #112] ; 0x70
  6268. 800287a: 4a70 ldr r2, [pc, #448] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6269. 800287c: f023 0301 bic.w r3, r3, #1
  6270. 8002880: 6713 str r3, [r2, #112] ; 0x70
  6271. 8002882: 4b6e ldr r3, [pc, #440] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6272. 8002884: 6f1b ldr r3, [r3, #112] ; 0x70
  6273. 8002886: 4a6d ldr r2, [pc, #436] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6274. 8002888: f023 0304 bic.w r3, r3, #4
  6275. 800288c: 6713 str r3, [r2, #112] ; 0x70
  6276. /* Check the LSE State */
  6277. if((RCC_OscInitStruct->LSEState) != RCC_LSE_OFF)
  6278. 800288e: 687b ldr r3, [r7, #4]
  6279. 8002890: 689b ldr r3, [r3, #8]
  6280. 8002892: 2b00 cmp r3, #0
  6281. 8002894: d015 beq.n 80028c2 <HAL_RCC_OscConfig+0x35e>
  6282. {
  6283. /* Get Start Tick*/
  6284. tickstart = HAL_GetTick();
  6285. 8002896: f7fe ff15 bl 80016c4 <HAL_GetTick>
  6286. 800289a: 6138 str r0, [r7, #16]
  6287. /* Wait till LSE is ready */
  6288. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET)
  6289. 800289c: e00a b.n 80028b4 <HAL_RCC_OscConfig+0x350>
  6290. {
  6291. if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
  6292. 800289e: f7fe ff11 bl 80016c4 <HAL_GetTick>
  6293. 80028a2: 4602 mov r2, r0
  6294. 80028a4: 693b ldr r3, [r7, #16]
  6295. 80028a6: 1ad3 subs r3, r2, r3
  6296. 80028a8: f241 3288 movw r2, #5000 ; 0x1388
  6297. 80028ac: 4293 cmp r3, r2
  6298. 80028ae: d901 bls.n 80028b4 <HAL_RCC_OscConfig+0x350>
  6299. {
  6300. return HAL_TIMEOUT;
  6301. 80028b0: 2303 movs r3, #3
  6302. 80028b2: e0bc b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6303. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET)
  6304. 80028b4: 4b61 ldr r3, [pc, #388] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6305. 80028b6: 6f1b ldr r3, [r3, #112] ; 0x70
  6306. 80028b8: f003 0302 and.w r3, r3, #2
  6307. 80028bc: 2b00 cmp r3, #0
  6308. 80028be: d0ee beq.n 800289e <HAL_RCC_OscConfig+0x33a>
  6309. 80028c0: e014 b.n 80028ec <HAL_RCC_OscConfig+0x388>
  6310. }
  6311. }
  6312. else
  6313. {
  6314. /* Get Start Tick */
  6315. tickstart = HAL_GetTick();
  6316. 80028c2: f7fe feff bl 80016c4 <HAL_GetTick>
  6317. 80028c6: 6138 str r0, [r7, #16]
  6318. /* Wait till LSE is ready */
  6319. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET)
  6320. 80028c8: e00a b.n 80028e0 <HAL_RCC_OscConfig+0x37c>
  6321. {
  6322. if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
  6323. 80028ca: f7fe fefb bl 80016c4 <HAL_GetTick>
  6324. 80028ce: 4602 mov r2, r0
  6325. 80028d0: 693b ldr r3, [r7, #16]
  6326. 80028d2: 1ad3 subs r3, r2, r3
  6327. 80028d4: f241 3288 movw r2, #5000 ; 0x1388
  6328. 80028d8: 4293 cmp r3, r2
  6329. 80028da: d901 bls.n 80028e0 <HAL_RCC_OscConfig+0x37c>
  6330. {
  6331. return HAL_TIMEOUT;
  6332. 80028dc: 2303 movs r3, #3
  6333. 80028de: e0a6 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6334. while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET)
  6335. 80028e0: 4b56 ldr r3, [pc, #344] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6336. 80028e2: 6f1b ldr r3, [r3, #112] ; 0x70
  6337. 80028e4: f003 0302 and.w r3, r3, #2
  6338. 80028e8: 2b00 cmp r3, #0
  6339. 80028ea: d1ee bne.n 80028ca <HAL_RCC_OscConfig+0x366>
  6340. }
  6341. }
  6342. }
  6343. /* Restore clock configuration if changed */
  6344. if(pwrclkchanged == SET)
  6345. 80028ec: 7dfb ldrb r3, [r7, #23]
  6346. 80028ee: 2b01 cmp r3, #1
  6347. 80028f0: d105 bne.n 80028fe <HAL_RCC_OscConfig+0x39a>
  6348. {
  6349. __HAL_RCC_PWR_CLK_DISABLE();
  6350. 80028f2: 4b52 ldr r3, [pc, #328] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6351. 80028f4: 6c1b ldr r3, [r3, #64] ; 0x40
  6352. 80028f6: 4a51 ldr r2, [pc, #324] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6353. 80028f8: f023 5380 bic.w r3, r3, #268435456 ; 0x10000000
  6354. 80028fc: 6413 str r3, [r2, #64] ; 0x40
  6355. }
  6356. }
  6357. /*-------------------------------- PLL Configuration -----------------------*/
  6358. /* Check the parameters */
  6359. assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState));
  6360. if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE)
  6361. 80028fe: 687b ldr r3, [r7, #4]
  6362. 8002900: 699b ldr r3, [r3, #24]
  6363. 8002902: 2b00 cmp r3, #0
  6364. 8002904: f000 8092 beq.w 8002a2c <HAL_RCC_OscConfig+0x4c8>
  6365. {
  6366. /* Check if the PLL is used as system clock or not */
  6367. if(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_CFGR_SWS_PLL)
  6368. 8002908: 4b4c ldr r3, [pc, #304] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6369. 800290a: 689b ldr r3, [r3, #8]
  6370. 800290c: f003 030c and.w r3, r3, #12
  6371. 8002910: 2b08 cmp r3, #8
  6372. 8002912: d05c beq.n 80029ce <HAL_RCC_OscConfig+0x46a>
  6373. {
  6374. if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON)
  6375. 8002914: 687b ldr r3, [r7, #4]
  6376. 8002916: 699b ldr r3, [r3, #24]
  6377. 8002918: 2b02 cmp r3, #2
  6378. 800291a: d141 bne.n 80029a0 <HAL_RCC_OscConfig+0x43c>
  6379. assert_param(IS_RCC_PLLN_VALUE(RCC_OscInitStruct->PLL.PLLN));
  6380. assert_param(IS_RCC_PLLP_VALUE(RCC_OscInitStruct->PLL.PLLP));
  6381. assert_param(IS_RCC_PLLQ_VALUE(RCC_OscInitStruct->PLL.PLLQ));
  6382. /* Disable the main PLL. */
  6383. __HAL_RCC_PLL_DISABLE();
  6384. 800291c: 4b48 ldr r3, [pc, #288] ; (8002a40 <HAL_RCC_OscConfig+0x4dc>)
  6385. 800291e: 2200 movs r2, #0
  6386. 8002920: 601a str r2, [r3, #0]
  6387. /* Get Start Tick */
  6388. tickstart = HAL_GetTick();
  6389. 8002922: f7fe fecf bl 80016c4 <HAL_GetTick>
  6390. 8002926: 6138 str r0, [r7, #16]
  6391. /* Wait till PLL is ready */
  6392. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET)
  6393. 8002928: e008 b.n 800293c <HAL_RCC_OscConfig+0x3d8>
  6394. {
  6395. if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
  6396. 800292a: f7fe fecb bl 80016c4 <HAL_GetTick>
  6397. 800292e: 4602 mov r2, r0
  6398. 8002930: 693b ldr r3, [r7, #16]
  6399. 8002932: 1ad3 subs r3, r2, r3
  6400. 8002934: 2b02 cmp r3, #2
  6401. 8002936: d901 bls.n 800293c <HAL_RCC_OscConfig+0x3d8>
  6402. {
  6403. return HAL_TIMEOUT;
  6404. 8002938: 2303 movs r3, #3
  6405. 800293a: e078 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6406. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET)
  6407. 800293c: 4b3f ldr r3, [pc, #252] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6408. 800293e: 681b ldr r3, [r3, #0]
  6409. 8002940: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
  6410. 8002944: 2b00 cmp r3, #0
  6411. 8002946: d1f0 bne.n 800292a <HAL_RCC_OscConfig+0x3c6>
  6412. }
  6413. }
  6414. /* Configure the main PLL clock source, multiplication and division factors. */
  6415. WRITE_REG(RCC->PLLCFGR, (RCC_OscInitStruct->PLL.PLLSource | \
  6416. 8002948: 687b ldr r3, [r7, #4]
  6417. 800294a: 69da ldr r2, [r3, #28]
  6418. 800294c: 687b ldr r3, [r7, #4]
  6419. 800294e: 6a1b ldr r3, [r3, #32]
  6420. 8002950: 431a orrs r2, r3
  6421. 8002952: 687b ldr r3, [r7, #4]
  6422. 8002954: 6a5b ldr r3, [r3, #36] ; 0x24
  6423. 8002956: 019b lsls r3, r3, #6
  6424. 8002958: 431a orrs r2, r3
  6425. 800295a: 687b ldr r3, [r7, #4]
  6426. 800295c: 6a9b ldr r3, [r3, #40] ; 0x28
  6427. 800295e: 085b lsrs r3, r3, #1
  6428. 8002960: 3b01 subs r3, #1
  6429. 8002962: 041b lsls r3, r3, #16
  6430. 8002964: 431a orrs r2, r3
  6431. 8002966: 687b ldr r3, [r7, #4]
  6432. 8002968: 6adb ldr r3, [r3, #44] ; 0x2c
  6433. 800296a: 061b lsls r3, r3, #24
  6434. 800296c: 4933 ldr r1, [pc, #204] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6435. 800296e: 4313 orrs r3, r2
  6436. 8002970: 604b str r3, [r1, #4]
  6437. RCC_OscInitStruct->PLL.PLLM | \
  6438. (RCC_OscInitStruct->PLL.PLLN << RCC_PLLCFGR_PLLN_Pos) | \
  6439. (((RCC_OscInitStruct->PLL.PLLP >> 1U) - 1U) << RCC_PLLCFGR_PLLP_Pos) | \
  6440. (RCC_OscInitStruct->PLL.PLLQ << RCC_PLLCFGR_PLLQ_Pos)));
  6441. /* Enable the main PLL. */
  6442. __HAL_RCC_PLL_ENABLE();
  6443. 8002972: 4b33 ldr r3, [pc, #204] ; (8002a40 <HAL_RCC_OscConfig+0x4dc>)
  6444. 8002974: 2201 movs r2, #1
  6445. 8002976: 601a str r2, [r3, #0]
  6446. /* Get Start Tick */
  6447. tickstart = HAL_GetTick();
  6448. 8002978: f7fe fea4 bl 80016c4 <HAL_GetTick>
  6449. 800297c: 6138 str r0, [r7, #16]
  6450. /* Wait till PLL is ready */
  6451. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
  6452. 800297e: e008 b.n 8002992 <HAL_RCC_OscConfig+0x42e>
  6453. {
  6454. if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
  6455. 8002980: f7fe fea0 bl 80016c4 <HAL_GetTick>
  6456. 8002984: 4602 mov r2, r0
  6457. 8002986: 693b ldr r3, [r7, #16]
  6458. 8002988: 1ad3 subs r3, r2, r3
  6459. 800298a: 2b02 cmp r3, #2
  6460. 800298c: d901 bls.n 8002992 <HAL_RCC_OscConfig+0x42e>
  6461. {
  6462. return HAL_TIMEOUT;
  6463. 800298e: 2303 movs r3, #3
  6464. 8002990: e04d b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6465. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
  6466. 8002992: 4b2a ldr r3, [pc, #168] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6467. 8002994: 681b ldr r3, [r3, #0]
  6468. 8002996: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
  6469. 800299a: 2b00 cmp r3, #0
  6470. 800299c: d0f0 beq.n 8002980 <HAL_RCC_OscConfig+0x41c>
  6471. 800299e: e045 b.n 8002a2c <HAL_RCC_OscConfig+0x4c8>
  6472. }
  6473. }
  6474. else
  6475. {
  6476. /* Disable the main PLL. */
  6477. __HAL_RCC_PLL_DISABLE();
  6478. 80029a0: 4b27 ldr r3, [pc, #156] ; (8002a40 <HAL_RCC_OscConfig+0x4dc>)
  6479. 80029a2: 2200 movs r2, #0
  6480. 80029a4: 601a str r2, [r3, #0]
  6481. /* Get Start Tick */
  6482. tickstart = HAL_GetTick();
  6483. 80029a6: f7fe fe8d bl 80016c4 <HAL_GetTick>
  6484. 80029aa: 6138 str r0, [r7, #16]
  6485. /* Wait till PLL is ready */
  6486. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET)
  6487. 80029ac: e008 b.n 80029c0 <HAL_RCC_OscConfig+0x45c>
  6488. {
  6489. if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE)
  6490. 80029ae: f7fe fe89 bl 80016c4 <HAL_GetTick>
  6491. 80029b2: 4602 mov r2, r0
  6492. 80029b4: 693b ldr r3, [r7, #16]
  6493. 80029b6: 1ad3 subs r3, r2, r3
  6494. 80029b8: 2b02 cmp r3, #2
  6495. 80029ba: d901 bls.n 80029c0 <HAL_RCC_OscConfig+0x45c>
  6496. {
  6497. return HAL_TIMEOUT;
  6498. 80029bc: 2303 movs r3, #3
  6499. 80029be: e036 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6500. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET)
  6501. 80029c0: 4b1e ldr r3, [pc, #120] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6502. 80029c2: 681b ldr r3, [r3, #0]
  6503. 80029c4: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
  6504. 80029c8: 2b00 cmp r3, #0
  6505. 80029ca: d1f0 bne.n 80029ae <HAL_RCC_OscConfig+0x44a>
  6506. 80029cc: e02e b.n 8002a2c <HAL_RCC_OscConfig+0x4c8>
  6507. }
  6508. }
  6509. else
  6510. {
  6511. /* Check if there is a request to disable the PLL used as System clock source */
  6512. if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF)
  6513. 80029ce: 687b ldr r3, [r7, #4]
  6514. 80029d0: 699b ldr r3, [r3, #24]
  6515. 80029d2: 2b01 cmp r3, #1
  6516. 80029d4: d101 bne.n 80029da <HAL_RCC_OscConfig+0x476>
  6517. {
  6518. return HAL_ERROR;
  6519. 80029d6: 2301 movs r3, #1
  6520. 80029d8: e029 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6521. }
  6522. else
  6523. {
  6524. /* Do not return HAL_ERROR if request repeats the current configuration */
  6525. pll_config = RCC->PLLCFGR;
  6526. 80029da: 4b18 ldr r3, [pc, #96] ; (8002a3c <HAL_RCC_OscConfig+0x4d8>)
  6527. 80029dc: 685b ldr r3, [r3, #4]
  6528. 80029de: 60fb str r3, [r7, #12]
  6529. if((READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) ||
  6530. 80029e0: 68fb ldr r3, [r7, #12]
  6531. 80029e2: f403 0280 and.w r2, r3, #4194304 ; 0x400000
  6532. 80029e6: 687b ldr r3, [r7, #4]
  6533. 80029e8: 69db ldr r3, [r3, #28]
  6534. 80029ea: 429a cmp r2, r3
  6535. 80029ec: d11c bne.n 8002a28 <HAL_RCC_OscConfig+0x4c4>
  6536. (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != RCC_OscInitStruct->PLL.PLLM) ||
  6537. 80029ee: 68fb ldr r3, [r7, #12]
  6538. 80029f0: f003 023f and.w r2, r3, #63 ; 0x3f
  6539. 80029f4: 687b ldr r3, [r7, #4]
  6540. 80029f6: 6a1b ldr r3, [r3, #32]
  6541. if((READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) ||
  6542. 80029f8: 429a cmp r2, r3
  6543. 80029fa: d115 bne.n 8002a28 <HAL_RCC_OscConfig+0x4c4>
  6544. (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != RCC_OscInitStruct->PLL.PLLN) ||
  6545. 80029fc: 68fa ldr r2, [r7, #12]
  6546. 80029fe: f647 73c0 movw r3, #32704 ; 0x7fc0
  6547. 8002a02: 4013 ands r3, r2
  6548. 8002a04: 687a ldr r2, [r7, #4]
  6549. 8002a06: 6a52 ldr r2, [r2, #36] ; 0x24
  6550. (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != RCC_OscInitStruct->PLL.PLLM) ||
  6551. 8002a08: 4293 cmp r3, r2
  6552. 8002a0a: d10d bne.n 8002a28 <HAL_RCC_OscConfig+0x4c4>
  6553. (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != RCC_OscInitStruct->PLL.PLLP) ||
  6554. 8002a0c: 68fb ldr r3, [r7, #12]
  6555. 8002a0e: f403 3240 and.w r2, r3, #196608 ; 0x30000
  6556. 8002a12: 687b ldr r3, [r7, #4]
  6557. 8002a14: 6a9b ldr r3, [r3, #40] ; 0x28
  6558. (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != RCC_OscInitStruct->PLL.PLLN) ||
  6559. 8002a16: 429a cmp r2, r3
  6560. 8002a18: d106 bne.n 8002a28 <HAL_RCC_OscConfig+0x4c4>
  6561. (READ_BIT(pll_config, RCC_PLLCFGR_PLLQ) != RCC_OscInitStruct->PLL.PLLQ))
  6562. 8002a1a: 68fb ldr r3, [r7, #12]
  6563. 8002a1c: f003 6270 and.w r2, r3, #251658240 ; 0xf000000
  6564. 8002a20: 687b ldr r3, [r7, #4]
  6565. 8002a22: 6adb ldr r3, [r3, #44] ; 0x2c
  6566. (READ_BIT(pll_config, RCC_PLLCFGR_PLLP) != RCC_OscInitStruct->PLL.PLLP) ||
  6567. 8002a24: 429a cmp r2, r3
  6568. 8002a26: d001 beq.n 8002a2c <HAL_RCC_OscConfig+0x4c8>
  6569. {
  6570. return HAL_ERROR;
  6571. 8002a28: 2301 movs r3, #1
  6572. 8002a2a: e000 b.n 8002a2e <HAL_RCC_OscConfig+0x4ca>
  6573. }
  6574. }
  6575. }
  6576. }
  6577. return HAL_OK;
  6578. 8002a2c: 2300 movs r3, #0
  6579. }
  6580. 8002a2e: 4618 mov r0, r3
  6581. 8002a30: 3718 adds r7, #24
  6582. 8002a32: 46bd mov sp, r7
  6583. 8002a34: bd80 pop {r7, pc}
  6584. 8002a36: bf00 nop
  6585. 8002a38: 40007000 .word 0x40007000
  6586. 8002a3c: 40023800 .word 0x40023800
  6587. 8002a40: 42470060 .word 0x42470060
  6588. 08002a44 <HAL_RCC_ClockConfig>:
  6589. * HPRE[3:0] bits to ensure that HCLK not exceed the maximum allowed frequency
  6590. * (for more details refer to section above "Initialization/de-initialization functions")
  6591. * @retval None
  6592. */
  6593. HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
  6594. {
  6595. 8002a44: b580 push {r7, lr}
  6596. 8002a46: b084 sub sp, #16
  6597. 8002a48: af00 add r7, sp, #0
  6598. 8002a4a: 6078 str r0, [r7, #4]
  6599. 8002a4c: 6039 str r1, [r7, #0]
  6600. uint32_t tickstart;
  6601. /* Check Null pointer */
  6602. if(RCC_ClkInitStruct == NULL)
  6603. 8002a4e: 687b ldr r3, [r7, #4]
  6604. 8002a50: 2b00 cmp r3, #0
  6605. 8002a52: d101 bne.n 8002a58 <HAL_RCC_ClockConfig+0x14>
  6606. {
  6607. return HAL_ERROR;
  6608. 8002a54: 2301 movs r3, #1
  6609. 8002a56: e0cc b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6610. /* To correctly read data from FLASH memory, the number of wait states (LATENCY)
  6611. must be correctly programmed according to the frequency of the CPU clock
  6612. (HCLK) and the supply voltage of the device. */
  6613. /* Increasing the number of wait states because of higher CPU frequency */
  6614. if(FLatency > __HAL_FLASH_GET_LATENCY())
  6615. 8002a58: 4b68 ldr r3, [pc, #416] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6616. 8002a5a: 681b ldr r3, [r3, #0]
  6617. 8002a5c: f003 030f and.w r3, r3, #15
  6618. 8002a60: 683a ldr r2, [r7, #0]
  6619. 8002a62: 429a cmp r2, r3
  6620. 8002a64: d90c bls.n 8002a80 <HAL_RCC_ClockConfig+0x3c>
  6621. {
  6622. /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
  6623. __HAL_FLASH_SET_LATENCY(FLatency);
  6624. 8002a66: 4b65 ldr r3, [pc, #404] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6625. 8002a68: 683a ldr r2, [r7, #0]
  6626. 8002a6a: b2d2 uxtb r2, r2
  6627. 8002a6c: 701a strb r2, [r3, #0]
  6628. /* Check that the new number of wait states is taken into account to access the Flash
  6629. memory by reading the FLASH_ACR register */
  6630. if(__HAL_FLASH_GET_LATENCY() != FLatency)
  6631. 8002a6e: 4b63 ldr r3, [pc, #396] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6632. 8002a70: 681b ldr r3, [r3, #0]
  6633. 8002a72: f003 030f and.w r3, r3, #15
  6634. 8002a76: 683a ldr r2, [r7, #0]
  6635. 8002a78: 429a cmp r2, r3
  6636. 8002a7a: d001 beq.n 8002a80 <HAL_RCC_ClockConfig+0x3c>
  6637. {
  6638. return HAL_ERROR;
  6639. 8002a7c: 2301 movs r3, #1
  6640. 8002a7e: e0b8 b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6641. }
  6642. }
  6643. /*-------------------------- HCLK Configuration --------------------------*/
  6644. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK)
  6645. 8002a80: 687b ldr r3, [r7, #4]
  6646. 8002a82: 681b ldr r3, [r3, #0]
  6647. 8002a84: f003 0302 and.w r3, r3, #2
  6648. 8002a88: 2b00 cmp r3, #0
  6649. 8002a8a: d020 beq.n 8002ace <HAL_RCC_ClockConfig+0x8a>
  6650. {
  6651. /* Set the highest APBx dividers in order to ensure that we do not go through
  6652. a non-spec phase whatever we decrease or increase HCLK. */
  6653. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1)
  6654. 8002a8c: 687b ldr r3, [r7, #4]
  6655. 8002a8e: 681b ldr r3, [r3, #0]
  6656. 8002a90: f003 0304 and.w r3, r3, #4
  6657. 8002a94: 2b00 cmp r3, #0
  6658. 8002a96: d005 beq.n 8002aa4 <HAL_RCC_ClockConfig+0x60>
  6659. {
  6660. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_HCLK_DIV16);
  6661. 8002a98: 4b59 ldr r3, [pc, #356] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6662. 8002a9a: 689b ldr r3, [r3, #8]
  6663. 8002a9c: 4a58 ldr r2, [pc, #352] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6664. 8002a9e: f443 53e0 orr.w r3, r3, #7168 ; 0x1c00
  6665. 8002aa2: 6093 str r3, [r2, #8]
  6666. }
  6667. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)
  6668. 8002aa4: 687b ldr r3, [r7, #4]
  6669. 8002aa6: 681b ldr r3, [r3, #0]
  6670. 8002aa8: f003 0308 and.w r3, r3, #8
  6671. 8002aac: 2b00 cmp r3, #0
  6672. 8002aae: d005 beq.n 8002abc <HAL_RCC_ClockConfig+0x78>
  6673. {
  6674. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, (RCC_HCLK_DIV16 << 3));
  6675. 8002ab0: 4b53 ldr r3, [pc, #332] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6676. 8002ab2: 689b ldr r3, [r3, #8]
  6677. 8002ab4: 4a52 ldr r2, [pc, #328] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6678. 8002ab6: f443 4360 orr.w r3, r3, #57344 ; 0xe000
  6679. 8002aba: 6093 str r3, [r2, #8]
  6680. }
  6681. assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider));
  6682. MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider);
  6683. 8002abc: 4b50 ldr r3, [pc, #320] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6684. 8002abe: 689b ldr r3, [r3, #8]
  6685. 8002ac0: f023 02f0 bic.w r2, r3, #240 ; 0xf0
  6686. 8002ac4: 687b ldr r3, [r7, #4]
  6687. 8002ac6: 689b ldr r3, [r3, #8]
  6688. 8002ac8: 494d ldr r1, [pc, #308] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6689. 8002aca: 4313 orrs r3, r2
  6690. 8002acc: 608b str r3, [r1, #8]
  6691. }
  6692. /*------------------------- SYSCLK Configuration ---------------------------*/
  6693. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK)
  6694. 8002ace: 687b ldr r3, [r7, #4]
  6695. 8002ad0: 681b ldr r3, [r3, #0]
  6696. 8002ad2: f003 0301 and.w r3, r3, #1
  6697. 8002ad6: 2b00 cmp r3, #0
  6698. 8002ad8: d044 beq.n 8002b64 <HAL_RCC_ClockConfig+0x120>
  6699. {
  6700. assert_param(IS_RCC_SYSCLKSOURCE(RCC_ClkInitStruct->SYSCLKSource));
  6701. /* HSE is selected as System Clock Source */
  6702. if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE)
  6703. 8002ada: 687b ldr r3, [r7, #4]
  6704. 8002adc: 685b ldr r3, [r3, #4]
  6705. 8002ade: 2b01 cmp r3, #1
  6706. 8002ae0: d107 bne.n 8002af2 <HAL_RCC_ClockConfig+0xae>
  6707. {
  6708. /* Check the HSE ready flag */
  6709. if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)
  6710. 8002ae2: 4b47 ldr r3, [pc, #284] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6711. 8002ae4: 681b ldr r3, [r3, #0]
  6712. 8002ae6: f403 3300 and.w r3, r3, #131072 ; 0x20000
  6713. 8002aea: 2b00 cmp r3, #0
  6714. 8002aec: d119 bne.n 8002b22 <HAL_RCC_ClockConfig+0xde>
  6715. {
  6716. return HAL_ERROR;
  6717. 8002aee: 2301 movs r3, #1
  6718. 8002af0: e07f b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6719. }
  6720. }
  6721. /* PLL is selected as System Clock Source */
  6722. else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) ||
  6723. 8002af2: 687b ldr r3, [r7, #4]
  6724. 8002af4: 685b ldr r3, [r3, #4]
  6725. 8002af6: 2b02 cmp r3, #2
  6726. 8002af8: d003 beq.n 8002b02 <HAL_RCC_ClockConfig+0xbe>
  6727. (RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLRCLK))
  6728. 8002afa: 687b ldr r3, [r7, #4]
  6729. 8002afc: 685b ldr r3, [r3, #4]
  6730. else if((RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) ||
  6731. 8002afe: 2b03 cmp r3, #3
  6732. 8002b00: d107 bne.n 8002b12 <HAL_RCC_ClockConfig+0xce>
  6733. {
  6734. /* Check the PLL ready flag */
  6735. if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
  6736. 8002b02: 4b3f ldr r3, [pc, #252] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6737. 8002b04: 681b ldr r3, [r3, #0]
  6738. 8002b06: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
  6739. 8002b0a: 2b00 cmp r3, #0
  6740. 8002b0c: d109 bne.n 8002b22 <HAL_RCC_ClockConfig+0xde>
  6741. {
  6742. return HAL_ERROR;
  6743. 8002b0e: 2301 movs r3, #1
  6744. 8002b10: e06f b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6745. }
  6746. /* HSI is selected as System Clock Source */
  6747. else
  6748. {
  6749. /* Check the HSI ready flag */
  6750. if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET)
  6751. 8002b12: 4b3b ldr r3, [pc, #236] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6752. 8002b14: 681b ldr r3, [r3, #0]
  6753. 8002b16: f003 0302 and.w r3, r3, #2
  6754. 8002b1a: 2b00 cmp r3, #0
  6755. 8002b1c: d101 bne.n 8002b22 <HAL_RCC_ClockConfig+0xde>
  6756. {
  6757. return HAL_ERROR;
  6758. 8002b1e: 2301 movs r3, #1
  6759. 8002b20: e067 b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6760. }
  6761. }
  6762. __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource);
  6763. 8002b22: 4b37 ldr r3, [pc, #220] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6764. 8002b24: 689b ldr r3, [r3, #8]
  6765. 8002b26: f023 0203 bic.w r2, r3, #3
  6766. 8002b2a: 687b ldr r3, [r7, #4]
  6767. 8002b2c: 685b ldr r3, [r3, #4]
  6768. 8002b2e: 4934 ldr r1, [pc, #208] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6769. 8002b30: 4313 orrs r3, r2
  6770. 8002b32: 608b str r3, [r1, #8]
  6771. /* Get Start Tick */
  6772. tickstart = HAL_GetTick();
  6773. 8002b34: f7fe fdc6 bl 80016c4 <HAL_GetTick>
  6774. 8002b38: 60f8 str r0, [r7, #12]
  6775. while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos))
  6776. 8002b3a: e00a b.n 8002b52 <HAL_RCC_ClockConfig+0x10e>
  6777. {
  6778. if ((HAL_GetTick() - tickstart) > CLOCKSWITCH_TIMEOUT_VALUE)
  6779. 8002b3c: f7fe fdc2 bl 80016c4 <HAL_GetTick>
  6780. 8002b40: 4602 mov r2, r0
  6781. 8002b42: 68fb ldr r3, [r7, #12]
  6782. 8002b44: 1ad3 subs r3, r2, r3
  6783. 8002b46: f241 3288 movw r2, #5000 ; 0x1388
  6784. 8002b4a: 4293 cmp r3, r2
  6785. 8002b4c: d901 bls.n 8002b52 <HAL_RCC_ClockConfig+0x10e>
  6786. {
  6787. return HAL_TIMEOUT;
  6788. 8002b4e: 2303 movs r3, #3
  6789. 8002b50: e04f b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6790. while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos))
  6791. 8002b52: 4b2b ldr r3, [pc, #172] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6792. 8002b54: 689b ldr r3, [r3, #8]
  6793. 8002b56: f003 020c and.w r2, r3, #12
  6794. 8002b5a: 687b ldr r3, [r7, #4]
  6795. 8002b5c: 685b ldr r3, [r3, #4]
  6796. 8002b5e: 009b lsls r3, r3, #2
  6797. 8002b60: 429a cmp r2, r3
  6798. 8002b62: d1eb bne.n 8002b3c <HAL_RCC_ClockConfig+0xf8>
  6799. }
  6800. }
  6801. }
  6802. /* Decreasing the number of wait states because of lower CPU frequency */
  6803. if(FLatency < __HAL_FLASH_GET_LATENCY())
  6804. 8002b64: 4b25 ldr r3, [pc, #148] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6805. 8002b66: 681b ldr r3, [r3, #0]
  6806. 8002b68: f003 030f and.w r3, r3, #15
  6807. 8002b6c: 683a ldr r2, [r7, #0]
  6808. 8002b6e: 429a cmp r2, r3
  6809. 8002b70: d20c bcs.n 8002b8c <HAL_RCC_ClockConfig+0x148>
  6810. {
  6811. /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */
  6812. __HAL_FLASH_SET_LATENCY(FLatency);
  6813. 8002b72: 4b22 ldr r3, [pc, #136] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6814. 8002b74: 683a ldr r2, [r7, #0]
  6815. 8002b76: b2d2 uxtb r2, r2
  6816. 8002b78: 701a strb r2, [r3, #0]
  6817. /* Check that the new number of wait states is taken into account to access the Flash
  6818. memory by reading the FLASH_ACR register */
  6819. if(__HAL_FLASH_GET_LATENCY() != FLatency)
  6820. 8002b7a: 4b20 ldr r3, [pc, #128] ; (8002bfc <HAL_RCC_ClockConfig+0x1b8>)
  6821. 8002b7c: 681b ldr r3, [r3, #0]
  6822. 8002b7e: f003 030f and.w r3, r3, #15
  6823. 8002b82: 683a ldr r2, [r7, #0]
  6824. 8002b84: 429a cmp r2, r3
  6825. 8002b86: d001 beq.n 8002b8c <HAL_RCC_ClockConfig+0x148>
  6826. {
  6827. return HAL_ERROR;
  6828. 8002b88: 2301 movs r3, #1
  6829. 8002b8a: e032 b.n 8002bf2 <HAL_RCC_ClockConfig+0x1ae>
  6830. }
  6831. }
  6832. /*-------------------------- PCLK1 Configuration ---------------------------*/
  6833. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1)
  6834. 8002b8c: 687b ldr r3, [r7, #4]
  6835. 8002b8e: 681b ldr r3, [r3, #0]
  6836. 8002b90: f003 0304 and.w r3, r3, #4
  6837. 8002b94: 2b00 cmp r3, #0
  6838. 8002b96: d008 beq.n 8002baa <HAL_RCC_ClockConfig+0x166>
  6839. {
  6840. assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB1CLKDivider));
  6841. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_ClkInitStruct->APB1CLKDivider);
  6842. 8002b98: 4b19 ldr r3, [pc, #100] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6843. 8002b9a: 689b ldr r3, [r3, #8]
  6844. 8002b9c: f423 52e0 bic.w r2, r3, #7168 ; 0x1c00
  6845. 8002ba0: 687b ldr r3, [r7, #4]
  6846. 8002ba2: 68db ldr r3, [r3, #12]
  6847. 8002ba4: 4916 ldr r1, [pc, #88] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6848. 8002ba6: 4313 orrs r3, r2
  6849. 8002ba8: 608b str r3, [r1, #8]
  6850. }
  6851. /*-------------------------- PCLK2 Configuration ---------------------------*/
  6852. if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)
  6853. 8002baa: 687b ldr r3, [r7, #4]
  6854. 8002bac: 681b ldr r3, [r3, #0]
  6855. 8002bae: f003 0308 and.w r3, r3, #8
  6856. 8002bb2: 2b00 cmp r3, #0
  6857. 8002bb4: d009 beq.n 8002bca <HAL_RCC_ClockConfig+0x186>
  6858. {
  6859. assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB2CLKDivider));
  6860. MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, ((RCC_ClkInitStruct->APB2CLKDivider) << 3U));
  6861. 8002bb6: 4b12 ldr r3, [pc, #72] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6862. 8002bb8: 689b ldr r3, [r3, #8]
  6863. 8002bba: f423 4260 bic.w r2, r3, #57344 ; 0xe000
  6864. 8002bbe: 687b ldr r3, [r7, #4]
  6865. 8002bc0: 691b ldr r3, [r3, #16]
  6866. 8002bc2: 00db lsls r3, r3, #3
  6867. 8002bc4: 490e ldr r1, [pc, #56] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6868. 8002bc6: 4313 orrs r3, r2
  6869. 8002bc8: 608b str r3, [r1, #8]
  6870. }
  6871. /* Update the SystemCoreClock global variable */
  6872. SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_Pos];
  6873. 8002bca: f000 f821 bl 8002c10 <HAL_RCC_GetSysClockFreq>
  6874. 8002bce: 4601 mov r1, r0
  6875. 8002bd0: 4b0b ldr r3, [pc, #44] ; (8002c00 <HAL_RCC_ClockConfig+0x1bc>)
  6876. 8002bd2: 689b ldr r3, [r3, #8]
  6877. 8002bd4: 091b lsrs r3, r3, #4
  6878. 8002bd6: f003 030f and.w r3, r3, #15
  6879. 8002bda: 4a0a ldr r2, [pc, #40] ; (8002c04 <HAL_RCC_ClockConfig+0x1c0>)
  6880. 8002bdc: 5cd3 ldrb r3, [r2, r3]
  6881. 8002bde: fa21 f303 lsr.w r3, r1, r3
  6882. 8002be2: 4a09 ldr r2, [pc, #36] ; (8002c08 <HAL_RCC_ClockConfig+0x1c4>)
  6883. 8002be4: 6013 str r3, [r2, #0]
  6884. /* Configure the source of time base considering new system clocks settings */
  6885. HAL_InitTick (uwTickPrio);
  6886. 8002be6: 4b09 ldr r3, [pc, #36] ; (8002c0c <HAL_RCC_ClockConfig+0x1c8>)
  6887. 8002be8: 681b ldr r3, [r3, #0]
  6888. 8002bea: 4618 mov r0, r3
  6889. 8002bec: f7fe fd26 bl 800163c <HAL_InitTick>
  6890. return HAL_OK;
  6891. 8002bf0: 2300 movs r3, #0
  6892. }
  6893. 8002bf2: 4618 mov r0, r3
  6894. 8002bf4: 3710 adds r7, #16
  6895. 8002bf6: 46bd mov sp, r7
  6896. 8002bf8: bd80 pop {r7, pc}
  6897. 8002bfa: bf00 nop
  6898. 8002bfc: 40023c00 .word 0x40023c00
  6899. 8002c00: 40023800 .word 0x40023800
  6900. 8002c04: 0800715c .word 0x0800715c
  6901. 8002c08: 20000004 .word 0x20000004
  6902. 8002c0c: 20000008 .word 0x20000008
  6903. 08002c10 <HAL_RCC_GetSysClockFreq>:
  6904. *
  6905. *
  6906. * @retval SYSCLK frequency
  6907. */
  6908. __weak uint32_t HAL_RCC_GetSysClockFreq(void)
  6909. {
  6910. 8002c10: b5f0 push {r4, r5, r6, r7, lr}
  6911. 8002c12: b085 sub sp, #20
  6912. 8002c14: af00 add r7, sp, #0
  6913. uint32_t pllm = 0U, pllvco = 0U, pllp = 0U;
  6914. 8002c16: 2300 movs r3, #0
  6915. 8002c18: 607b str r3, [r7, #4]
  6916. 8002c1a: 2300 movs r3, #0
  6917. 8002c1c: 60fb str r3, [r7, #12]
  6918. 8002c1e: 2300 movs r3, #0
  6919. 8002c20: 603b str r3, [r7, #0]
  6920. uint32_t sysclockfreq = 0U;
  6921. 8002c22: 2300 movs r3, #0
  6922. 8002c24: 60bb str r3, [r7, #8]
  6923. /* Get SYSCLK source -------------------------------------------------------*/
  6924. switch (RCC->CFGR & RCC_CFGR_SWS)
  6925. 8002c26: 4b63 ldr r3, [pc, #396] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  6926. 8002c28: 689b ldr r3, [r3, #8]
  6927. 8002c2a: f003 030c and.w r3, r3, #12
  6928. 8002c2e: 2b04 cmp r3, #4
  6929. 8002c30: d007 beq.n 8002c42 <HAL_RCC_GetSysClockFreq+0x32>
  6930. 8002c32: 2b08 cmp r3, #8
  6931. 8002c34: d008 beq.n 8002c48 <HAL_RCC_GetSysClockFreq+0x38>
  6932. 8002c36: 2b00 cmp r3, #0
  6933. 8002c38: f040 80b4 bne.w 8002da4 <HAL_RCC_GetSysClockFreq+0x194>
  6934. {
  6935. case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */
  6936. {
  6937. sysclockfreq = HSI_VALUE;
  6938. 8002c3c: 4b5e ldr r3, [pc, #376] ; (8002db8 <HAL_RCC_GetSysClockFreq+0x1a8>)
  6939. 8002c3e: 60bb str r3, [r7, #8]
  6940. break;
  6941. 8002c40: e0b3 b.n 8002daa <HAL_RCC_GetSysClockFreq+0x19a>
  6942. }
  6943. case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */
  6944. {
  6945. sysclockfreq = HSE_VALUE;
  6946. 8002c42: 4b5e ldr r3, [pc, #376] ; (8002dbc <HAL_RCC_GetSysClockFreq+0x1ac>)
  6947. 8002c44: 60bb str r3, [r7, #8]
  6948. break;
  6949. 8002c46: e0b0 b.n 8002daa <HAL_RCC_GetSysClockFreq+0x19a>
  6950. }
  6951. case RCC_CFGR_SWS_PLL: /* PLL used as system clock source */
  6952. {
  6953. /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN
  6954. SYSCLK = PLL_VCO / PLLP */
  6955. pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM;
  6956. 8002c48: 4b5a ldr r3, [pc, #360] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  6957. 8002c4a: 685b ldr r3, [r3, #4]
  6958. 8002c4c: f003 033f and.w r3, r3, #63 ; 0x3f
  6959. 8002c50: 607b str r3, [r7, #4]
  6960. if(__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI)
  6961. 8002c52: 4b58 ldr r3, [pc, #352] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  6962. 8002c54: 685b ldr r3, [r3, #4]
  6963. 8002c56: f403 0380 and.w r3, r3, #4194304 ; 0x400000
  6964. 8002c5a: 2b00 cmp r3, #0
  6965. 8002c5c: d04a beq.n 8002cf4 <HAL_RCC_GetSysClockFreq+0xe4>
  6966. {
  6967. /* HSE used as PLL clock source */
  6968. pllvco = (uint32_t) ((((uint64_t) HSE_VALUE * ((uint64_t) ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos)))) / (uint64_t)pllm);
  6969. 8002c5e: 4b55 ldr r3, [pc, #340] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  6970. 8002c60: 685b ldr r3, [r3, #4]
  6971. 8002c62: 099b lsrs r3, r3, #6
  6972. 8002c64: f04f 0400 mov.w r4, #0
  6973. 8002c68: f240 11ff movw r1, #511 ; 0x1ff
  6974. 8002c6c: f04f 0200 mov.w r2, #0
  6975. 8002c70: ea03 0501 and.w r5, r3, r1
  6976. 8002c74: ea04 0602 and.w r6, r4, r2
  6977. 8002c78: 4629 mov r1, r5
  6978. 8002c7a: 4632 mov r2, r6
  6979. 8002c7c: f04f 0300 mov.w r3, #0
  6980. 8002c80: f04f 0400 mov.w r4, #0
  6981. 8002c84: 0154 lsls r4, r2, #5
  6982. 8002c86: ea44 64d1 orr.w r4, r4, r1, lsr #27
  6983. 8002c8a: 014b lsls r3, r1, #5
  6984. 8002c8c: 4619 mov r1, r3
  6985. 8002c8e: 4622 mov r2, r4
  6986. 8002c90: 1b49 subs r1, r1, r5
  6987. 8002c92: eb62 0206 sbc.w r2, r2, r6
  6988. 8002c96: f04f 0300 mov.w r3, #0
  6989. 8002c9a: f04f 0400 mov.w r4, #0
  6990. 8002c9e: 0194 lsls r4, r2, #6
  6991. 8002ca0: ea44 6491 orr.w r4, r4, r1, lsr #26
  6992. 8002ca4: 018b lsls r3, r1, #6
  6993. 8002ca6: 1a5b subs r3, r3, r1
  6994. 8002ca8: eb64 0402 sbc.w r4, r4, r2
  6995. 8002cac: f04f 0100 mov.w r1, #0
  6996. 8002cb0: f04f 0200 mov.w r2, #0
  6997. 8002cb4: 00e2 lsls r2, r4, #3
  6998. 8002cb6: ea42 7253 orr.w r2, r2, r3, lsr #29
  6999. 8002cba: 00d9 lsls r1, r3, #3
  7000. 8002cbc: 460b mov r3, r1
  7001. 8002cbe: 4614 mov r4, r2
  7002. 8002cc0: 195b adds r3, r3, r5
  7003. 8002cc2: eb44 0406 adc.w r4, r4, r6
  7004. 8002cc6: f04f 0100 mov.w r1, #0
  7005. 8002cca: f04f 0200 mov.w r2, #0
  7006. 8002cce: 0262 lsls r2, r4, #9
  7007. 8002cd0: ea42 52d3 orr.w r2, r2, r3, lsr #23
  7008. 8002cd4: 0259 lsls r1, r3, #9
  7009. 8002cd6: 460b mov r3, r1
  7010. 8002cd8: 4614 mov r4, r2
  7011. 8002cda: 4618 mov r0, r3
  7012. 8002cdc: 4621 mov r1, r4
  7013. 8002cde: 687b ldr r3, [r7, #4]
  7014. 8002ce0: f04f 0400 mov.w r4, #0
  7015. 8002ce4: 461a mov r2, r3
  7016. 8002ce6: 4623 mov r3, r4
  7017. 8002ce8: f7fd fa7c bl 80001e4 <__aeabi_uldivmod>
  7018. 8002cec: 4603 mov r3, r0
  7019. 8002cee: 460c mov r4, r1
  7020. 8002cf0: 60fb str r3, [r7, #12]
  7021. 8002cf2: e049 b.n 8002d88 <HAL_RCC_GetSysClockFreq+0x178>
  7022. }
  7023. else
  7024. {
  7025. /* HSI used as PLL clock source */
  7026. pllvco = (uint32_t) ((((uint64_t) HSI_VALUE * ((uint64_t) ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos)))) / (uint64_t)pllm);
  7027. 8002cf4: 4b2f ldr r3, [pc, #188] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  7028. 8002cf6: 685b ldr r3, [r3, #4]
  7029. 8002cf8: 099b lsrs r3, r3, #6
  7030. 8002cfa: f04f 0400 mov.w r4, #0
  7031. 8002cfe: f240 11ff movw r1, #511 ; 0x1ff
  7032. 8002d02: f04f 0200 mov.w r2, #0
  7033. 8002d06: ea03 0501 and.w r5, r3, r1
  7034. 8002d0a: ea04 0602 and.w r6, r4, r2
  7035. 8002d0e: 4629 mov r1, r5
  7036. 8002d10: 4632 mov r2, r6
  7037. 8002d12: f04f 0300 mov.w r3, #0
  7038. 8002d16: f04f 0400 mov.w r4, #0
  7039. 8002d1a: 0154 lsls r4, r2, #5
  7040. 8002d1c: ea44 64d1 orr.w r4, r4, r1, lsr #27
  7041. 8002d20: 014b lsls r3, r1, #5
  7042. 8002d22: 4619 mov r1, r3
  7043. 8002d24: 4622 mov r2, r4
  7044. 8002d26: 1b49 subs r1, r1, r5
  7045. 8002d28: eb62 0206 sbc.w r2, r2, r6
  7046. 8002d2c: f04f 0300 mov.w r3, #0
  7047. 8002d30: f04f 0400 mov.w r4, #0
  7048. 8002d34: 0194 lsls r4, r2, #6
  7049. 8002d36: ea44 6491 orr.w r4, r4, r1, lsr #26
  7050. 8002d3a: 018b lsls r3, r1, #6
  7051. 8002d3c: 1a5b subs r3, r3, r1
  7052. 8002d3e: eb64 0402 sbc.w r4, r4, r2
  7053. 8002d42: f04f 0100 mov.w r1, #0
  7054. 8002d46: f04f 0200 mov.w r2, #0
  7055. 8002d4a: 00e2 lsls r2, r4, #3
  7056. 8002d4c: ea42 7253 orr.w r2, r2, r3, lsr #29
  7057. 8002d50: 00d9 lsls r1, r3, #3
  7058. 8002d52: 460b mov r3, r1
  7059. 8002d54: 4614 mov r4, r2
  7060. 8002d56: 195b adds r3, r3, r5
  7061. 8002d58: eb44 0406 adc.w r4, r4, r6
  7062. 8002d5c: f04f 0100 mov.w r1, #0
  7063. 8002d60: f04f 0200 mov.w r2, #0
  7064. 8002d64: 02a2 lsls r2, r4, #10
  7065. 8002d66: ea42 5293 orr.w r2, r2, r3, lsr #22
  7066. 8002d6a: 0299 lsls r1, r3, #10
  7067. 8002d6c: 460b mov r3, r1
  7068. 8002d6e: 4614 mov r4, r2
  7069. 8002d70: 4618 mov r0, r3
  7070. 8002d72: 4621 mov r1, r4
  7071. 8002d74: 687b ldr r3, [r7, #4]
  7072. 8002d76: f04f 0400 mov.w r4, #0
  7073. 8002d7a: 461a mov r2, r3
  7074. 8002d7c: 4623 mov r3, r4
  7075. 8002d7e: f7fd fa31 bl 80001e4 <__aeabi_uldivmod>
  7076. 8002d82: 4603 mov r3, r0
  7077. 8002d84: 460c mov r4, r1
  7078. 8002d86: 60fb str r3, [r7, #12]
  7079. }
  7080. pllp = ((((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> RCC_PLLCFGR_PLLP_Pos) + 1U) *2U);
  7081. 8002d88: 4b0a ldr r3, [pc, #40] ; (8002db4 <HAL_RCC_GetSysClockFreq+0x1a4>)
  7082. 8002d8a: 685b ldr r3, [r3, #4]
  7083. 8002d8c: 0c1b lsrs r3, r3, #16
  7084. 8002d8e: f003 0303 and.w r3, r3, #3
  7085. 8002d92: 3301 adds r3, #1
  7086. 8002d94: 005b lsls r3, r3, #1
  7087. 8002d96: 603b str r3, [r7, #0]
  7088. sysclockfreq = pllvco/pllp;
  7089. 8002d98: 68fa ldr r2, [r7, #12]
  7090. 8002d9a: 683b ldr r3, [r7, #0]
  7091. 8002d9c: fbb2 f3f3 udiv r3, r2, r3
  7092. 8002da0: 60bb str r3, [r7, #8]
  7093. break;
  7094. 8002da2: e002 b.n 8002daa <HAL_RCC_GetSysClockFreq+0x19a>
  7095. }
  7096. default:
  7097. {
  7098. sysclockfreq = HSI_VALUE;
  7099. 8002da4: 4b04 ldr r3, [pc, #16] ; (8002db8 <HAL_RCC_GetSysClockFreq+0x1a8>)
  7100. 8002da6: 60bb str r3, [r7, #8]
  7101. break;
  7102. 8002da8: bf00 nop
  7103. }
  7104. }
  7105. return sysclockfreq;
  7106. 8002daa: 68bb ldr r3, [r7, #8]
  7107. }
  7108. 8002dac: 4618 mov r0, r3
  7109. 8002dae: 3714 adds r7, #20
  7110. 8002db0: 46bd mov sp, r7
  7111. 8002db2: bdf0 pop {r4, r5, r6, r7, pc}
  7112. 8002db4: 40023800 .word 0x40023800
  7113. 8002db8: 00f42400 .word 0x00f42400
  7114. 8002dbc: 007a1200 .word 0x007a1200
  7115. 08002dc0 <HAL_RCC_GetHCLKFreq>:
  7116. * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency
  7117. * and updated within this function
  7118. * @retval HCLK frequency
  7119. */
  7120. uint32_t HAL_RCC_GetHCLKFreq(void)
  7121. {
  7122. 8002dc0: b480 push {r7}
  7123. 8002dc2: af00 add r7, sp, #0
  7124. return SystemCoreClock;
  7125. 8002dc4: 4b03 ldr r3, [pc, #12] ; (8002dd4 <HAL_RCC_GetHCLKFreq+0x14>)
  7126. 8002dc6: 681b ldr r3, [r3, #0]
  7127. }
  7128. 8002dc8: 4618 mov r0, r3
  7129. 8002dca: 46bd mov sp, r7
  7130. 8002dcc: f85d 7b04 ldr.w r7, [sp], #4
  7131. 8002dd0: 4770 bx lr
  7132. 8002dd2: bf00 nop
  7133. 8002dd4: 20000004 .word 0x20000004
  7134. 08002dd8 <HAL_RCC_GetPCLK1Freq>:
  7135. * @note Each time PCLK1 changes, this function must be called to update the
  7136. * right PCLK1 value. Otherwise, any configuration based on this function will be incorrect.
  7137. * @retval PCLK1 frequency
  7138. */
  7139. uint32_t HAL_RCC_GetPCLK1Freq(void)
  7140. {
  7141. 8002dd8: b580 push {r7, lr}
  7142. 8002dda: af00 add r7, sp, #0
  7143. /* Get HCLK source and Compute PCLK1 frequency ---------------------------*/
  7144. return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1)>> RCC_CFGR_PPRE1_Pos]);
  7145. 8002ddc: f7ff fff0 bl 8002dc0 <HAL_RCC_GetHCLKFreq>
  7146. 8002de0: 4601 mov r1, r0
  7147. 8002de2: 4b05 ldr r3, [pc, #20] ; (8002df8 <HAL_RCC_GetPCLK1Freq+0x20>)
  7148. 8002de4: 689b ldr r3, [r3, #8]
  7149. 8002de6: 0a9b lsrs r3, r3, #10
  7150. 8002de8: f003 0307 and.w r3, r3, #7
  7151. 8002dec: 4a03 ldr r2, [pc, #12] ; (8002dfc <HAL_RCC_GetPCLK1Freq+0x24>)
  7152. 8002dee: 5cd3 ldrb r3, [r2, r3]
  7153. 8002df0: fa21 f303 lsr.w r3, r1, r3
  7154. }
  7155. 8002df4: 4618 mov r0, r3
  7156. 8002df6: bd80 pop {r7, pc}
  7157. 8002df8: 40023800 .word 0x40023800
  7158. 8002dfc: 0800716c .word 0x0800716c
  7159. 08002e00 <HAL_RCC_GetPCLK2Freq>:
  7160. * @note Each time PCLK2 changes, this function must be called to update the
  7161. * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect.
  7162. * @retval PCLK2 frequency
  7163. */
  7164. uint32_t HAL_RCC_GetPCLK2Freq(void)
  7165. {
  7166. 8002e00: b580 push {r7, lr}
  7167. 8002e02: af00 add r7, sp, #0
  7168. /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/
  7169. return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2)>> RCC_CFGR_PPRE2_Pos]);
  7170. 8002e04: f7ff ffdc bl 8002dc0 <HAL_RCC_GetHCLKFreq>
  7171. 8002e08: 4601 mov r1, r0
  7172. 8002e0a: 4b05 ldr r3, [pc, #20] ; (8002e20 <HAL_RCC_GetPCLK2Freq+0x20>)
  7173. 8002e0c: 689b ldr r3, [r3, #8]
  7174. 8002e0e: 0b5b lsrs r3, r3, #13
  7175. 8002e10: f003 0307 and.w r3, r3, #7
  7176. 8002e14: 4a03 ldr r2, [pc, #12] ; (8002e24 <HAL_RCC_GetPCLK2Freq+0x24>)
  7177. 8002e16: 5cd3 ldrb r3, [r2, r3]
  7178. 8002e18: fa21 f303 lsr.w r3, r1, r3
  7179. }
  7180. 8002e1c: 4618 mov r0, r3
  7181. 8002e1e: bd80 pop {r7, pc}
  7182. 8002e20: 40023800 .word 0x40023800
  7183. 8002e24: 0800716c .word 0x0800716c
  7184. 08002e28 <HAL_SPI_Init>:
  7185. * @param hspi pointer to a SPI_HandleTypeDef structure that contains
  7186. * the configuration information for SPI module.
  7187. * @retval HAL status
  7188. */
  7189. HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
  7190. {
  7191. 8002e28: b580 push {r7, lr}
  7192. 8002e2a: b082 sub sp, #8
  7193. 8002e2c: af00 add r7, sp, #0
  7194. 8002e2e: 6078 str r0, [r7, #4]
  7195. /* Check the SPI handle allocation */
  7196. if (hspi == NULL)
  7197. 8002e30: 687b ldr r3, [r7, #4]
  7198. 8002e32: 2b00 cmp r3, #0
  7199. 8002e34: d101 bne.n 8002e3a <HAL_SPI_Init+0x12>
  7200. {
  7201. return HAL_ERROR;
  7202. 8002e36: 2301 movs r3, #1
  7203. 8002e38: e056 b.n 8002ee8 <HAL_SPI_Init+0xc0>
  7204. if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
  7205. {
  7206. assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial));
  7207. }
  7208. #else
  7209. hspi->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  7210. 8002e3a: 687b ldr r3, [r7, #4]
  7211. 8002e3c: 2200 movs r2, #0
  7212. 8002e3e: 629a str r2, [r3, #40] ; 0x28
  7213. #endif /* USE_SPI_CRC */
  7214. if (hspi->State == HAL_SPI_STATE_RESET)
  7215. 8002e40: 687b ldr r3, [r7, #4]
  7216. 8002e42: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
  7217. 8002e46: b2db uxtb r3, r3
  7218. 8002e48: 2b00 cmp r3, #0
  7219. 8002e4a: d106 bne.n 8002e5a <HAL_SPI_Init+0x32>
  7220. {
  7221. /* Allocate lock resource and initialize it */
  7222. hspi->Lock = HAL_UNLOCKED;
  7223. 8002e4c: 687b ldr r3, [r7, #4]
  7224. 8002e4e: 2200 movs r2, #0
  7225. 8002e50: f883 2050 strb.w r2, [r3, #80] ; 0x50
  7226. /* Init the low level hardware : GPIO, CLOCK, NVIC... */
  7227. hspi->MspInitCallback(hspi);
  7228. #else
  7229. /* Init the low level hardware : GPIO, CLOCK, NVIC... */
  7230. HAL_SPI_MspInit(hspi);
  7231. 8002e54: 6878 ldr r0, [r7, #4]
  7232. 8002e56: f7fe facb bl 80013f0 <HAL_SPI_MspInit>
  7233. #endif /* USE_HAL_SPI_REGISTER_CALLBACKS */
  7234. }
  7235. hspi->State = HAL_SPI_STATE_BUSY;
  7236. 8002e5a: 687b ldr r3, [r7, #4]
  7237. 8002e5c: 2202 movs r2, #2
  7238. 8002e5e: f883 2051 strb.w r2, [r3, #81] ; 0x51
  7239. /* Disable the selected SPI peripheral */
  7240. __HAL_SPI_DISABLE(hspi);
  7241. 8002e62: 687b ldr r3, [r7, #4]
  7242. 8002e64: 681b ldr r3, [r3, #0]
  7243. 8002e66: 681a ldr r2, [r3, #0]
  7244. 8002e68: 687b ldr r3, [r7, #4]
  7245. 8002e6a: 681b ldr r3, [r3, #0]
  7246. 8002e6c: f022 0240 bic.w r2, r2, #64 ; 0x40
  7247. 8002e70: 601a str r2, [r3, #0]
  7248. /*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/
  7249. /* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management,
  7250. Communication speed, First bit and CRC calculation state */
  7251. WRITE_REG(hspi->Instance->CR1, (hspi->Init.Mode | hspi->Init.Direction | hspi->Init.DataSize |
  7252. 8002e72: 687b ldr r3, [r7, #4]
  7253. 8002e74: 685a ldr r2, [r3, #4]
  7254. 8002e76: 687b ldr r3, [r7, #4]
  7255. 8002e78: 689b ldr r3, [r3, #8]
  7256. 8002e7a: 431a orrs r2, r3
  7257. 8002e7c: 687b ldr r3, [r7, #4]
  7258. 8002e7e: 68db ldr r3, [r3, #12]
  7259. 8002e80: 431a orrs r2, r3
  7260. 8002e82: 687b ldr r3, [r7, #4]
  7261. 8002e84: 691b ldr r3, [r3, #16]
  7262. 8002e86: 431a orrs r2, r3
  7263. 8002e88: 687b ldr r3, [r7, #4]
  7264. 8002e8a: 695b ldr r3, [r3, #20]
  7265. 8002e8c: 431a orrs r2, r3
  7266. 8002e8e: 687b ldr r3, [r7, #4]
  7267. 8002e90: 699b ldr r3, [r3, #24]
  7268. 8002e92: f403 7300 and.w r3, r3, #512 ; 0x200
  7269. 8002e96: 431a orrs r2, r3
  7270. 8002e98: 687b ldr r3, [r7, #4]
  7271. 8002e9a: 69db ldr r3, [r3, #28]
  7272. 8002e9c: 431a orrs r2, r3
  7273. 8002e9e: 687b ldr r3, [r7, #4]
  7274. 8002ea0: 6a1b ldr r3, [r3, #32]
  7275. 8002ea2: ea42 0103 orr.w r1, r2, r3
  7276. 8002ea6: 687b ldr r3, [r7, #4]
  7277. 8002ea8: 6a9a ldr r2, [r3, #40] ; 0x28
  7278. 8002eaa: 687b ldr r3, [r7, #4]
  7279. 8002eac: 681b ldr r3, [r3, #0]
  7280. 8002eae: 430a orrs r2, r1
  7281. 8002eb0: 601a str r2, [r3, #0]
  7282. hspi->Init.CLKPolarity | hspi->Init.CLKPhase | (hspi->Init.NSS & SPI_CR1_SSM) |
  7283. hspi->Init.BaudRatePrescaler | hspi->Init.FirstBit | hspi->Init.CRCCalculation));
  7284. /* Configure : NSS management, TI Mode */
  7285. WRITE_REG(hspi->Instance->CR2, (((hspi->Init.NSS >> 16U) & SPI_CR2_SSOE) | hspi->Init.TIMode));
  7286. 8002eb2: 687b ldr r3, [r7, #4]
  7287. 8002eb4: 699b ldr r3, [r3, #24]
  7288. 8002eb6: 0c1b lsrs r3, r3, #16
  7289. 8002eb8: f003 0104 and.w r1, r3, #4
  7290. 8002ebc: 687b ldr r3, [r7, #4]
  7291. 8002ebe: 6a5a ldr r2, [r3, #36] ; 0x24
  7292. 8002ec0: 687b ldr r3, [r7, #4]
  7293. 8002ec2: 681b ldr r3, [r3, #0]
  7294. 8002ec4: 430a orrs r2, r1
  7295. 8002ec6: 605a str r2, [r3, #4]
  7296. }
  7297. #endif /* USE_SPI_CRC */
  7298. #if defined(SPI_I2SCFGR_I2SMOD)
  7299. /* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */
  7300. CLEAR_BIT(hspi->Instance->I2SCFGR, SPI_I2SCFGR_I2SMOD);
  7301. 8002ec8: 687b ldr r3, [r7, #4]
  7302. 8002eca: 681b ldr r3, [r3, #0]
  7303. 8002ecc: 69da ldr r2, [r3, #28]
  7304. 8002ece: 687b ldr r3, [r7, #4]
  7305. 8002ed0: 681b ldr r3, [r3, #0]
  7306. 8002ed2: f422 6200 bic.w r2, r2, #2048 ; 0x800
  7307. 8002ed6: 61da str r2, [r3, #28]
  7308. #endif /* SPI_I2SCFGR_I2SMOD */
  7309. hspi->ErrorCode = HAL_SPI_ERROR_NONE;
  7310. 8002ed8: 687b ldr r3, [r7, #4]
  7311. 8002eda: 2200 movs r2, #0
  7312. 8002edc: 655a str r2, [r3, #84] ; 0x54
  7313. hspi->State = HAL_SPI_STATE_READY;
  7314. 8002ede: 687b ldr r3, [r7, #4]
  7315. 8002ee0: 2201 movs r2, #1
  7316. 8002ee2: f883 2051 strb.w r2, [r3, #81] ; 0x51
  7317. return HAL_OK;
  7318. 8002ee6: 2300 movs r3, #0
  7319. }
  7320. 8002ee8: 4618 mov r0, r3
  7321. 8002eea: 3708 adds r7, #8
  7322. 8002eec: 46bd mov sp, r7
  7323. 8002eee: bd80 pop {r7, pc}
  7324. 08002ef0 <HAL_SPI_Transmit>:
  7325. * @param Size amount of data to be sent
  7326. * @param Timeout Timeout duration
  7327. * @retval HAL status
  7328. */
  7329. HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
  7330. {
  7331. 8002ef0: b580 push {r7, lr}
  7332. 8002ef2: b088 sub sp, #32
  7333. 8002ef4: af00 add r7, sp, #0
  7334. 8002ef6: 60f8 str r0, [r7, #12]
  7335. 8002ef8: 60b9 str r1, [r7, #8]
  7336. 8002efa: 603b str r3, [r7, #0]
  7337. 8002efc: 4613 mov r3, r2
  7338. 8002efe: 80fb strh r3, [r7, #6]
  7339. uint32_t tickstart;
  7340. HAL_StatusTypeDef errorcode = HAL_OK;
  7341. 8002f00: 2300 movs r3, #0
  7342. 8002f02: 77fb strb r3, [r7, #31]
  7343. /* Check Direction parameter */
  7344. assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));
  7345. /* Process Locked */
  7346. __HAL_LOCK(hspi);
  7347. 8002f04: 68fb ldr r3, [r7, #12]
  7348. 8002f06: f893 3050 ldrb.w r3, [r3, #80] ; 0x50
  7349. 8002f0a: 2b01 cmp r3, #1
  7350. 8002f0c: d101 bne.n 8002f12 <HAL_SPI_Transmit+0x22>
  7351. 8002f0e: 2302 movs r3, #2
  7352. 8002f10: e11e b.n 8003150 <HAL_SPI_Transmit+0x260>
  7353. 8002f12: 68fb ldr r3, [r7, #12]
  7354. 8002f14: 2201 movs r2, #1
  7355. 8002f16: f883 2050 strb.w r2, [r3, #80] ; 0x50
  7356. /* Init tickstart for timeout management*/
  7357. tickstart = HAL_GetTick();
  7358. 8002f1a: f7fe fbd3 bl 80016c4 <HAL_GetTick>
  7359. 8002f1e: 61b8 str r0, [r7, #24]
  7360. initial_TxXferCount = Size;
  7361. 8002f20: 88fb ldrh r3, [r7, #6]
  7362. 8002f22: 82fb strh r3, [r7, #22]
  7363. if (hspi->State != HAL_SPI_STATE_READY)
  7364. 8002f24: 68fb ldr r3, [r7, #12]
  7365. 8002f26: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
  7366. 8002f2a: b2db uxtb r3, r3
  7367. 8002f2c: 2b01 cmp r3, #1
  7368. 8002f2e: d002 beq.n 8002f36 <HAL_SPI_Transmit+0x46>
  7369. {
  7370. errorcode = HAL_BUSY;
  7371. 8002f30: 2302 movs r3, #2
  7372. 8002f32: 77fb strb r3, [r7, #31]
  7373. goto error;
  7374. 8002f34: e103 b.n 800313e <HAL_SPI_Transmit+0x24e>
  7375. }
  7376. if ((pData == NULL) || (Size == 0U))
  7377. 8002f36: 68bb ldr r3, [r7, #8]
  7378. 8002f38: 2b00 cmp r3, #0
  7379. 8002f3a: d002 beq.n 8002f42 <HAL_SPI_Transmit+0x52>
  7380. 8002f3c: 88fb ldrh r3, [r7, #6]
  7381. 8002f3e: 2b00 cmp r3, #0
  7382. 8002f40: d102 bne.n 8002f48 <HAL_SPI_Transmit+0x58>
  7383. {
  7384. errorcode = HAL_ERROR;
  7385. 8002f42: 2301 movs r3, #1
  7386. 8002f44: 77fb strb r3, [r7, #31]
  7387. goto error;
  7388. 8002f46: e0fa b.n 800313e <HAL_SPI_Transmit+0x24e>
  7389. }
  7390. /* Set the transaction information */
  7391. hspi->State = HAL_SPI_STATE_BUSY_TX;
  7392. 8002f48: 68fb ldr r3, [r7, #12]
  7393. 8002f4a: 2203 movs r2, #3
  7394. 8002f4c: f883 2051 strb.w r2, [r3, #81] ; 0x51
  7395. hspi->ErrorCode = HAL_SPI_ERROR_NONE;
  7396. 8002f50: 68fb ldr r3, [r7, #12]
  7397. 8002f52: 2200 movs r2, #0
  7398. 8002f54: 655a str r2, [r3, #84] ; 0x54
  7399. hspi->pTxBuffPtr = (uint8_t *)pData;
  7400. 8002f56: 68fb ldr r3, [r7, #12]
  7401. 8002f58: 68ba ldr r2, [r7, #8]
  7402. 8002f5a: 631a str r2, [r3, #48] ; 0x30
  7403. hspi->TxXferSize = Size;
  7404. 8002f5c: 68fb ldr r3, [r7, #12]
  7405. 8002f5e: 88fa ldrh r2, [r7, #6]
  7406. 8002f60: 869a strh r2, [r3, #52] ; 0x34
  7407. hspi->TxXferCount = Size;
  7408. 8002f62: 68fb ldr r3, [r7, #12]
  7409. 8002f64: 88fa ldrh r2, [r7, #6]
  7410. 8002f66: 86da strh r2, [r3, #54] ; 0x36
  7411. /*Init field not used in handle to zero */
  7412. hspi->pRxBuffPtr = (uint8_t *)NULL;
  7413. 8002f68: 68fb ldr r3, [r7, #12]
  7414. 8002f6a: 2200 movs r2, #0
  7415. 8002f6c: 639a str r2, [r3, #56] ; 0x38
  7416. hspi->RxXferSize = 0U;
  7417. 8002f6e: 68fb ldr r3, [r7, #12]
  7418. 8002f70: 2200 movs r2, #0
  7419. 8002f72: 879a strh r2, [r3, #60] ; 0x3c
  7420. hspi->RxXferCount = 0U;
  7421. 8002f74: 68fb ldr r3, [r7, #12]
  7422. 8002f76: 2200 movs r2, #0
  7423. 8002f78: 87da strh r2, [r3, #62] ; 0x3e
  7424. hspi->TxISR = NULL;
  7425. 8002f7a: 68fb ldr r3, [r7, #12]
  7426. 8002f7c: 2200 movs r2, #0
  7427. 8002f7e: 645a str r2, [r3, #68] ; 0x44
  7428. hspi->RxISR = NULL;
  7429. 8002f80: 68fb ldr r3, [r7, #12]
  7430. 8002f82: 2200 movs r2, #0
  7431. 8002f84: 641a str r2, [r3, #64] ; 0x40
  7432. /* Configure communication direction : 1Line */
  7433. if (hspi->Init.Direction == SPI_DIRECTION_1LINE)
  7434. 8002f86: 68fb ldr r3, [r7, #12]
  7435. 8002f88: 689b ldr r3, [r3, #8]
  7436. 8002f8a: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
  7437. 8002f8e: d107 bne.n 8002fa0 <HAL_SPI_Transmit+0xb0>
  7438. {
  7439. SPI_1LINE_TX(hspi);
  7440. 8002f90: 68fb ldr r3, [r7, #12]
  7441. 8002f92: 681b ldr r3, [r3, #0]
  7442. 8002f94: 681a ldr r2, [r3, #0]
  7443. 8002f96: 68fb ldr r3, [r7, #12]
  7444. 8002f98: 681b ldr r3, [r3, #0]
  7445. 8002f9a: f442 4280 orr.w r2, r2, #16384 ; 0x4000
  7446. 8002f9e: 601a str r2, [r3, #0]
  7447. SPI_RESET_CRC(hspi);
  7448. }
  7449. #endif /* USE_SPI_CRC */
  7450. /* Check if the SPI is already enabled */
  7451. if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
  7452. 8002fa0: 68fb ldr r3, [r7, #12]
  7453. 8002fa2: 681b ldr r3, [r3, #0]
  7454. 8002fa4: 681b ldr r3, [r3, #0]
  7455. 8002fa6: f003 0340 and.w r3, r3, #64 ; 0x40
  7456. 8002faa: 2b40 cmp r3, #64 ; 0x40
  7457. 8002fac: d007 beq.n 8002fbe <HAL_SPI_Transmit+0xce>
  7458. {
  7459. /* Enable SPI peripheral */
  7460. __HAL_SPI_ENABLE(hspi);
  7461. 8002fae: 68fb ldr r3, [r7, #12]
  7462. 8002fb0: 681b ldr r3, [r3, #0]
  7463. 8002fb2: 681a ldr r2, [r3, #0]
  7464. 8002fb4: 68fb ldr r3, [r7, #12]
  7465. 8002fb6: 681b ldr r3, [r3, #0]
  7466. 8002fb8: f042 0240 orr.w r2, r2, #64 ; 0x40
  7467. 8002fbc: 601a str r2, [r3, #0]
  7468. }
  7469. /* Transmit data in 16 Bit mode */
  7470. if (hspi->Init.DataSize == SPI_DATASIZE_16BIT)
  7471. 8002fbe: 68fb ldr r3, [r7, #12]
  7472. 8002fc0: 68db ldr r3, [r3, #12]
  7473. 8002fc2: f5b3 6f00 cmp.w r3, #2048 ; 0x800
  7474. 8002fc6: d14b bne.n 8003060 <HAL_SPI_Transmit+0x170>
  7475. {
  7476. if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
  7477. 8002fc8: 68fb ldr r3, [r7, #12]
  7478. 8002fca: 685b ldr r3, [r3, #4]
  7479. 8002fcc: 2b00 cmp r3, #0
  7480. 8002fce: d002 beq.n 8002fd6 <HAL_SPI_Transmit+0xe6>
  7481. 8002fd0: 8afb ldrh r3, [r7, #22]
  7482. 8002fd2: 2b01 cmp r3, #1
  7483. 8002fd4: d13e bne.n 8003054 <HAL_SPI_Transmit+0x164>
  7484. {
  7485. hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
  7486. 8002fd6: 68fb ldr r3, [r7, #12]
  7487. 8002fd8: 6b1b ldr r3, [r3, #48] ; 0x30
  7488. 8002fda: 881a ldrh r2, [r3, #0]
  7489. 8002fdc: 68fb ldr r3, [r7, #12]
  7490. 8002fde: 681b ldr r3, [r3, #0]
  7491. 8002fe0: 60da str r2, [r3, #12]
  7492. hspi->pTxBuffPtr += sizeof(uint16_t);
  7493. 8002fe2: 68fb ldr r3, [r7, #12]
  7494. 8002fe4: 6b1b ldr r3, [r3, #48] ; 0x30
  7495. 8002fe6: 1c9a adds r2, r3, #2
  7496. 8002fe8: 68fb ldr r3, [r7, #12]
  7497. 8002fea: 631a str r2, [r3, #48] ; 0x30
  7498. hspi->TxXferCount--;
  7499. 8002fec: 68fb ldr r3, [r7, #12]
  7500. 8002fee: 8edb ldrh r3, [r3, #54] ; 0x36
  7501. 8002ff0: b29b uxth r3, r3
  7502. 8002ff2: 3b01 subs r3, #1
  7503. 8002ff4: b29a uxth r2, r3
  7504. 8002ff6: 68fb ldr r3, [r7, #12]
  7505. 8002ff8: 86da strh r2, [r3, #54] ; 0x36
  7506. }
  7507. /* Transmit data in 16 Bit mode */
  7508. while (hspi->TxXferCount > 0U)
  7509. 8002ffa: e02b b.n 8003054 <HAL_SPI_Transmit+0x164>
  7510. {
  7511. /* Wait until TXE flag is set to send data */
  7512. if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE))
  7513. 8002ffc: 68fb ldr r3, [r7, #12]
  7514. 8002ffe: 681b ldr r3, [r3, #0]
  7515. 8003000: 689b ldr r3, [r3, #8]
  7516. 8003002: f003 0302 and.w r3, r3, #2
  7517. 8003006: 2b02 cmp r3, #2
  7518. 8003008: d112 bne.n 8003030 <HAL_SPI_Transmit+0x140>
  7519. {
  7520. hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
  7521. 800300a: 68fb ldr r3, [r7, #12]
  7522. 800300c: 6b1b ldr r3, [r3, #48] ; 0x30
  7523. 800300e: 881a ldrh r2, [r3, #0]
  7524. 8003010: 68fb ldr r3, [r7, #12]
  7525. 8003012: 681b ldr r3, [r3, #0]
  7526. 8003014: 60da str r2, [r3, #12]
  7527. hspi->pTxBuffPtr += sizeof(uint16_t);
  7528. 8003016: 68fb ldr r3, [r7, #12]
  7529. 8003018: 6b1b ldr r3, [r3, #48] ; 0x30
  7530. 800301a: 1c9a adds r2, r3, #2
  7531. 800301c: 68fb ldr r3, [r7, #12]
  7532. 800301e: 631a str r2, [r3, #48] ; 0x30
  7533. hspi->TxXferCount--;
  7534. 8003020: 68fb ldr r3, [r7, #12]
  7535. 8003022: 8edb ldrh r3, [r3, #54] ; 0x36
  7536. 8003024: b29b uxth r3, r3
  7537. 8003026: 3b01 subs r3, #1
  7538. 8003028: b29a uxth r2, r3
  7539. 800302a: 68fb ldr r3, [r7, #12]
  7540. 800302c: 86da strh r2, [r3, #54] ; 0x36
  7541. 800302e: e011 b.n 8003054 <HAL_SPI_Transmit+0x164>
  7542. }
  7543. else
  7544. {
  7545. /* Timeout management */
  7546. if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U))
  7547. 8003030: f7fe fb48 bl 80016c4 <HAL_GetTick>
  7548. 8003034: 4602 mov r2, r0
  7549. 8003036: 69bb ldr r3, [r7, #24]
  7550. 8003038: 1ad3 subs r3, r2, r3
  7551. 800303a: 683a ldr r2, [r7, #0]
  7552. 800303c: 429a cmp r2, r3
  7553. 800303e: d803 bhi.n 8003048 <HAL_SPI_Transmit+0x158>
  7554. 8003040: 683b ldr r3, [r7, #0]
  7555. 8003042: f1b3 3fff cmp.w r3, #4294967295
  7556. 8003046: d102 bne.n 800304e <HAL_SPI_Transmit+0x15e>
  7557. 8003048: 683b ldr r3, [r7, #0]
  7558. 800304a: 2b00 cmp r3, #0
  7559. 800304c: d102 bne.n 8003054 <HAL_SPI_Transmit+0x164>
  7560. {
  7561. errorcode = HAL_TIMEOUT;
  7562. 800304e: 2303 movs r3, #3
  7563. 8003050: 77fb strb r3, [r7, #31]
  7564. goto error;
  7565. 8003052: e074 b.n 800313e <HAL_SPI_Transmit+0x24e>
  7566. while (hspi->TxXferCount > 0U)
  7567. 8003054: 68fb ldr r3, [r7, #12]
  7568. 8003056: 8edb ldrh r3, [r3, #54] ; 0x36
  7569. 8003058: b29b uxth r3, r3
  7570. 800305a: 2b00 cmp r3, #0
  7571. 800305c: d1ce bne.n 8002ffc <HAL_SPI_Transmit+0x10c>
  7572. 800305e: e04c b.n 80030fa <HAL_SPI_Transmit+0x20a>
  7573. }
  7574. }
  7575. /* Transmit data in 8 Bit mode */
  7576. else
  7577. {
  7578. if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
  7579. 8003060: 68fb ldr r3, [r7, #12]
  7580. 8003062: 685b ldr r3, [r3, #4]
  7581. 8003064: 2b00 cmp r3, #0
  7582. 8003066: d002 beq.n 800306e <HAL_SPI_Transmit+0x17e>
  7583. 8003068: 8afb ldrh r3, [r7, #22]
  7584. 800306a: 2b01 cmp r3, #1
  7585. 800306c: d140 bne.n 80030f0 <HAL_SPI_Transmit+0x200>
  7586. {
  7587. *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
  7588. 800306e: 68fb ldr r3, [r7, #12]
  7589. 8003070: 6b1a ldr r2, [r3, #48] ; 0x30
  7590. 8003072: 68fb ldr r3, [r7, #12]
  7591. 8003074: 681b ldr r3, [r3, #0]
  7592. 8003076: 330c adds r3, #12
  7593. 8003078: 7812 ldrb r2, [r2, #0]
  7594. 800307a: 701a strb r2, [r3, #0]
  7595. hspi->pTxBuffPtr += sizeof(uint8_t);
  7596. 800307c: 68fb ldr r3, [r7, #12]
  7597. 800307e: 6b1b ldr r3, [r3, #48] ; 0x30
  7598. 8003080: 1c5a adds r2, r3, #1
  7599. 8003082: 68fb ldr r3, [r7, #12]
  7600. 8003084: 631a str r2, [r3, #48] ; 0x30
  7601. hspi->TxXferCount--;
  7602. 8003086: 68fb ldr r3, [r7, #12]
  7603. 8003088: 8edb ldrh r3, [r3, #54] ; 0x36
  7604. 800308a: b29b uxth r3, r3
  7605. 800308c: 3b01 subs r3, #1
  7606. 800308e: b29a uxth r2, r3
  7607. 8003090: 68fb ldr r3, [r7, #12]
  7608. 8003092: 86da strh r2, [r3, #54] ; 0x36
  7609. }
  7610. while (hspi->TxXferCount > 0U)
  7611. 8003094: e02c b.n 80030f0 <HAL_SPI_Transmit+0x200>
  7612. {
  7613. /* Wait until TXE flag is set to send data */
  7614. if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE))
  7615. 8003096: 68fb ldr r3, [r7, #12]
  7616. 8003098: 681b ldr r3, [r3, #0]
  7617. 800309a: 689b ldr r3, [r3, #8]
  7618. 800309c: f003 0302 and.w r3, r3, #2
  7619. 80030a0: 2b02 cmp r3, #2
  7620. 80030a2: d113 bne.n 80030cc <HAL_SPI_Transmit+0x1dc>
  7621. {
  7622. *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
  7623. 80030a4: 68fb ldr r3, [r7, #12]
  7624. 80030a6: 6b1a ldr r2, [r3, #48] ; 0x30
  7625. 80030a8: 68fb ldr r3, [r7, #12]
  7626. 80030aa: 681b ldr r3, [r3, #0]
  7627. 80030ac: 330c adds r3, #12
  7628. 80030ae: 7812 ldrb r2, [r2, #0]
  7629. 80030b0: 701a strb r2, [r3, #0]
  7630. hspi->pTxBuffPtr += sizeof(uint8_t);
  7631. 80030b2: 68fb ldr r3, [r7, #12]
  7632. 80030b4: 6b1b ldr r3, [r3, #48] ; 0x30
  7633. 80030b6: 1c5a adds r2, r3, #1
  7634. 80030b8: 68fb ldr r3, [r7, #12]
  7635. 80030ba: 631a str r2, [r3, #48] ; 0x30
  7636. hspi->TxXferCount--;
  7637. 80030bc: 68fb ldr r3, [r7, #12]
  7638. 80030be: 8edb ldrh r3, [r3, #54] ; 0x36
  7639. 80030c0: b29b uxth r3, r3
  7640. 80030c2: 3b01 subs r3, #1
  7641. 80030c4: b29a uxth r2, r3
  7642. 80030c6: 68fb ldr r3, [r7, #12]
  7643. 80030c8: 86da strh r2, [r3, #54] ; 0x36
  7644. 80030ca: e011 b.n 80030f0 <HAL_SPI_Transmit+0x200>
  7645. }
  7646. else
  7647. {
  7648. /* Timeout management */
  7649. if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U))
  7650. 80030cc: f7fe fafa bl 80016c4 <HAL_GetTick>
  7651. 80030d0: 4602 mov r2, r0
  7652. 80030d2: 69bb ldr r3, [r7, #24]
  7653. 80030d4: 1ad3 subs r3, r2, r3
  7654. 80030d6: 683a ldr r2, [r7, #0]
  7655. 80030d8: 429a cmp r2, r3
  7656. 80030da: d803 bhi.n 80030e4 <HAL_SPI_Transmit+0x1f4>
  7657. 80030dc: 683b ldr r3, [r7, #0]
  7658. 80030de: f1b3 3fff cmp.w r3, #4294967295
  7659. 80030e2: d102 bne.n 80030ea <HAL_SPI_Transmit+0x1fa>
  7660. 80030e4: 683b ldr r3, [r7, #0]
  7661. 80030e6: 2b00 cmp r3, #0
  7662. 80030e8: d102 bne.n 80030f0 <HAL_SPI_Transmit+0x200>
  7663. {
  7664. errorcode = HAL_TIMEOUT;
  7665. 80030ea: 2303 movs r3, #3
  7666. 80030ec: 77fb strb r3, [r7, #31]
  7667. goto error;
  7668. 80030ee: e026 b.n 800313e <HAL_SPI_Transmit+0x24e>
  7669. while (hspi->TxXferCount > 0U)
  7670. 80030f0: 68fb ldr r3, [r7, #12]
  7671. 80030f2: 8edb ldrh r3, [r3, #54] ; 0x36
  7672. 80030f4: b29b uxth r3, r3
  7673. 80030f6: 2b00 cmp r3, #0
  7674. 80030f8: d1cd bne.n 8003096 <HAL_SPI_Transmit+0x1a6>
  7675. SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
  7676. }
  7677. #endif /* USE_SPI_CRC */
  7678. /* Check the end of the transaction */
  7679. if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
  7680. 80030fa: 69ba ldr r2, [r7, #24]
  7681. 80030fc: 6839 ldr r1, [r7, #0]
  7682. 80030fe: 68f8 ldr r0, [r7, #12]
  7683. 8003100: f000 fa36 bl 8003570 <SPI_EndRxTxTransaction>
  7684. 8003104: 4603 mov r3, r0
  7685. 8003106: 2b00 cmp r3, #0
  7686. 8003108: d002 beq.n 8003110 <HAL_SPI_Transmit+0x220>
  7687. {
  7688. hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
  7689. 800310a: 68fb ldr r3, [r7, #12]
  7690. 800310c: 2220 movs r2, #32
  7691. 800310e: 655a str r2, [r3, #84] ; 0x54
  7692. }
  7693. /* Clear overrun flag in 2 Lines communication mode because received is not read */
  7694. if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
  7695. 8003110: 68fb ldr r3, [r7, #12]
  7696. 8003112: 689b ldr r3, [r3, #8]
  7697. 8003114: 2b00 cmp r3, #0
  7698. 8003116: d10a bne.n 800312e <HAL_SPI_Transmit+0x23e>
  7699. {
  7700. __HAL_SPI_CLEAR_OVRFLAG(hspi);
  7701. 8003118: 2300 movs r3, #0
  7702. 800311a: 613b str r3, [r7, #16]
  7703. 800311c: 68fb ldr r3, [r7, #12]
  7704. 800311e: 681b ldr r3, [r3, #0]
  7705. 8003120: 68db ldr r3, [r3, #12]
  7706. 8003122: 613b str r3, [r7, #16]
  7707. 8003124: 68fb ldr r3, [r7, #12]
  7708. 8003126: 681b ldr r3, [r3, #0]
  7709. 8003128: 689b ldr r3, [r3, #8]
  7710. 800312a: 613b str r3, [r7, #16]
  7711. 800312c: 693b ldr r3, [r7, #16]
  7712. }
  7713. if (hspi->ErrorCode != HAL_SPI_ERROR_NONE)
  7714. 800312e: 68fb ldr r3, [r7, #12]
  7715. 8003130: 6d5b ldr r3, [r3, #84] ; 0x54
  7716. 8003132: 2b00 cmp r3, #0
  7717. 8003134: d002 beq.n 800313c <HAL_SPI_Transmit+0x24c>
  7718. {
  7719. errorcode = HAL_ERROR;
  7720. 8003136: 2301 movs r3, #1
  7721. 8003138: 77fb strb r3, [r7, #31]
  7722. 800313a: e000 b.n 800313e <HAL_SPI_Transmit+0x24e>
  7723. }
  7724. error:
  7725. 800313c: bf00 nop
  7726. hspi->State = HAL_SPI_STATE_READY;
  7727. 800313e: 68fb ldr r3, [r7, #12]
  7728. 8003140: 2201 movs r2, #1
  7729. 8003142: f883 2051 strb.w r2, [r3, #81] ; 0x51
  7730. /* Process Unlocked */
  7731. __HAL_UNLOCK(hspi);
  7732. 8003146: 68fb ldr r3, [r7, #12]
  7733. 8003148: 2200 movs r2, #0
  7734. 800314a: f883 2050 strb.w r2, [r3, #80] ; 0x50
  7735. return errorcode;
  7736. 800314e: 7ffb ldrb r3, [r7, #31]
  7737. }
  7738. 8003150: 4618 mov r0, r3
  7739. 8003152: 3720 adds r7, #32
  7740. 8003154: 46bd mov sp, r7
  7741. 8003156: bd80 pop {r7, pc}
  7742. 08003158 <HAL_SPI_TransmitReceive>:
  7743. * @param Timeout Timeout duration
  7744. * @retval HAL status
  7745. */
  7746. HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size,
  7747. uint32_t Timeout)
  7748. {
  7749. 8003158: b580 push {r7, lr}
  7750. 800315a: b08c sub sp, #48 ; 0x30
  7751. 800315c: af00 add r7, sp, #0
  7752. 800315e: 60f8 str r0, [r7, #12]
  7753. 8003160: 60b9 str r1, [r7, #8]
  7754. 8003162: 607a str r2, [r7, #4]
  7755. 8003164: 807b strh r3, [r7, #2]
  7756. uint32_t tmp_mode;
  7757. HAL_SPI_StateTypeDef tmp_state;
  7758. uint32_t tickstart;
  7759. /* Variable used to alternate Rx and Tx during transfer */
  7760. uint32_t txallowed = 1U;
  7761. 8003166: 2301 movs r3, #1
  7762. 8003168: 62fb str r3, [r7, #44] ; 0x2c
  7763. HAL_StatusTypeDef errorcode = HAL_OK;
  7764. 800316a: 2300 movs r3, #0
  7765. 800316c: f887 302b strb.w r3, [r7, #43] ; 0x2b
  7766. /* Check Direction parameter */
  7767. assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));
  7768. /* Process Locked */
  7769. __HAL_LOCK(hspi);
  7770. 8003170: 68fb ldr r3, [r7, #12]
  7771. 8003172: f893 3050 ldrb.w r3, [r3, #80] ; 0x50
  7772. 8003176: 2b01 cmp r3, #1
  7773. 8003178: d101 bne.n 800317e <HAL_SPI_TransmitReceive+0x26>
  7774. 800317a: 2302 movs r3, #2
  7775. 800317c: e18a b.n 8003494 <HAL_SPI_TransmitReceive+0x33c>
  7776. 800317e: 68fb ldr r3, [r7, #12]
  7777. 8003180: 2201 movs r2, #1
  7778. 8003182: f883 2050 strb.w r2, [r3, #80] ; 0x50
  7779. /* Init tickstart for timeout management*/
  7780. tickstart = HAL_GetTick();
  7781. 8003186: f7fe fa9d bl 80016c4 <HAL_GetTick>
  7782. 800318a: 6278 str r0, [r7, #36] ; 0x24
  7783. /* Init temporary variables */
  7784. tmp_state = hspi->State;
  7785. 800318c: 68fb ldr r3, [r7, #12]
  7786. 800318e: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
  7787. 8003192: f887 3023 strb.w r3, [r7, #35] ; 0x23
  7788. tmp_mode = hspi->Init.Mode;
  7789. 8003196: 68fb ldr r3, [r7, #12]
  7790. 8003198: 685b ldr r3, [r3, #4]
  7791. 800319a: 61fb str r3, [r7, #28]
  7792. initial_TxXferCount = Size;
  7793. 800319c: 887b ldrh r3, [r7, #2]
  7794. 800319e: 837b strh r3, [r7, #26]
  7795. if (!((tmp_state == HAL_SPI_STATE_READY) || \
  7796. 80031a0: f897 3023 ldrb.w r3, [r7, #35] ; 0x23
  7797. 80031a4: 2b01 cmp r3, #1
  7798. 80031a6: d00f beq.n 80031c8 <HAL_SPI_TransmitReceive+0x70>
  7799. 80031a8: 69fb ldr r3, [r7, #28]
  7800. 80031aa: f5b3 7f82 cmp.w r3, #260 ; 0x104
  7801. 80031ae: d107 bne.n 80031c0 <HAL_SPI_TransmitReceive+0x68>
  7802. ((tmp_mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (tmp_state == HAL_SPI_STATE_BUSY_RX))))
  7803. 80031b0: 68fb ldr r3, [r7, #12]
  7804. 80031b2: 689b ldr r3, [r3, #8]
  7805. 80031b4: 2b00 cmp r3, #0
  7806. 80031b6: d103 bne.n 80031c0 <HAL_SPI_TransmitReceive+0x68>
  7807. 80031b8: f897 3023 ldrb.w r3, [r7, #35] ; 0x23
  7808. 80031bc: 2b04 cmp r3, #4
  7809. 80031be: d003 beq.n 80031c8 <HAL_SPI_TransmitReceive+0x70>
  7810. {
  7811. errorcode = HAL_BUSY;
  7812. 80031c0: 2302 movs r3, #2
  7813. 80031c2: f887 302b strb.w r3, [r7, #43] ; 0x2b
  7814. goto error;
  7815. 80031c6: e15b b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  7816. }
  7817. if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
  7818. 80031c8: 68bb ldr r3, [r7, #8]
  7819. 80031ca: 2b00 cmp r3, #0
  7820. 80031cc: d005 beq.n 80031da <HAL_SPI_TransmitReceive+0x82>
  7821. 80031ce: 687b ldr r3, [r7, #4]
  7822. 80031d0: 2b00 cmp r3, #0
  7823. 80031d2: d002 beq.n 80031da <HAL_SPI_TransmitReceive+0x82>
  7824. 80031d4: 887b ldrh r3, [r7, #2]
  7825. 80031d6: 2b00 cmp r3, #0
  7826. 80031d8: d103 bne.n 80031e2 <HAL_SPI_TransmitReceive+0x8a>
  7827. {
  7828. errorcode = HAL_ERROR;
  7829. 80031da: 2301 movs r3, #1
  7830. 80031dc: f887 302b strb.w r3, [r7, #43] ; 0x2b
  7831. goto error;
  7832. 80031e0: e14e b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  7833. }
  7834. /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
  7835. if (hspi->State != HAL_SPI_STATE_BUSY_RX)
  7836. 80031e2: 68fb ldr r3, [r7, #12]
  7837. 80031e4: f893 3051 ldrb.w r3, [r3, #81] ; 0x51
  7838. 80031e8: b2db uxtb r3, r3
  7839. 80031ea: 2b04 cmp r3, #4
  7840. 80031ec: d003 beq.n 80031f6 <HAL_SPI_TransmitReceive+0x9e>
  7841. {
  7842. hspi->State = HAL_SPI_STATE_BUSY_TX_RX;
  7843. 80031ee: 68fb ldr r3, [r7, #12]
  7844. 80031f0: 2205 movs r2, #5
  7845. 80031f2: f883 2051 strb.w r2, [r3, #81] ; 0x51
  7846. }
  7847. /* Set the transaction information */
  7848. hspi->ErrorCode = HAL_SPI_ERROR_NONE;
  7849. 80031f6: 68fb ldr r3, [r7, #12]
  7850. 80031f8: 2200 movs r2, #0
  7851. 80031fa: 655a str r2, [r3, #84] ; 0x54
  7852. hspi->pRxBuffPtr = (uint8_t *)pRxData;
  7853. 80031fc: 68fb ldr r3, [r7, #12]
  7854. 80031fe: 687a ldr r2, [r7, #4]
  7855. 8003200: 639a str r2, [r3, #56] ; 0x38
  7856. hspi->RxXferCount = Size;
  7857. 8003202: 68fb ldr r3, [r7, #12]
  7858. 8003204: 887a ldrh r2, [r7, #2]
  7859. 8003206: 87da strh r2, [r3, #62] ; 0x3e
  7860. hspi->RxXferSize = Size;
  7861. 8003208: 68fb ldr r3, [r7, #12]
  7862. 800320a: 887a ldrh r2, [r7, #2]
  7863. 800320c: 879a strh r2, [r3, #60] ; 0x3c
  7864. hspi->pTxBuffPtr = (uint8_t *)pTxData;
  7865. 800320e: 68fb ldr r3, [r7, #12]
  7866. 8003210: 68ba ldr r2, [r7, #8]
  7867. 8003212: 631a str r2, [r3, #48] ; 0x30
  7868. hspi->TxXferCount = Size;
  7869. 8003214: 68fb ldr r3, [r7, #12]
  7870. 8003216: 887a ldrh r2, [r7, #2]
  7871. 8003218: 86da strh r2, [r3, #54] ; 0x36
  7872. hspi->TxXferSize = Size;
  7873. 800321a: 68fb ldr r3, [r7, #12]
  7874. 800321c: 887a ldrh r2, [r7, #2]
  7875. 800321e: 869a strh r2, [r3, #52] ; 0x34
  7876. /*Init field not used in handle to zero */
  7877. hspi->RxISR = NULL;
  7878. 8003220: 68fb ldr r3, [r7, #12]
  7879. 8003222: 2200 movs r2, #0
  7880. 8003224: 641a str r2, [r3, #64] ; 0x40
  7881. hspi->TxISR = NULL;
  7882. 8003226: 68fb ldr r3, [r7, #12]
  7883. 8003228: 2200 movs r2, #0
  7884. 800322a: 645a str r2, [r3, #68] ; 0x44
  7885. SPI_RESET_CRC(hspi);
  7886. }
  7887. #endif /* USE_SPI_CRC */
  7888. /* Check if the SPI is already enabled */
  7889. if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE)
  7890. 800322c: 68fb ldr r3, [r7, #12]
  7891. 800322e: 681b ldr r3, [r3, #0]
  7892. 8003230: 681b ldr r3, [r3, #0]
  7893. 8003232: f003 0340 and.w r3, r3, #64 ; 0x40
  7894. 8003236: 2b40 cmp r3, #64 ; 0x40
  7895. 8003238: d007 beq.n 800324a <HAL_SPI_TransmitReceive+0xf2>
  7896. {
  7897. /* Enable SPI peripheral */
  7898. __HAL_SPI_ENABLE(hspi);
  7899. 800323a: 68fb ldr r3, [r7, #12]
  7900. 800323c: 681b ldr r3, [r3, #0]
  7901. 800323e: 681a ldr r2, [r3, #0]
  7902. 8003240: 68fb ldr r3, [r7, #12]
  7903. 8003242: 681b ldr r3, [r3, #0]
  7904. 8003244: f042 0240 orr.w r2, r2, #64 ; 0x40
  7905. 8003248: 601a str r2, [r3, #0]
  7906. }
  7907. /* Transmit and Receive data in 16 Bit mode */
  7908. if (hspi->Init.DataSize == SPI_DATASIZE_16BIT)
  7909. 800324a: 68fb ldr r3, [r7, #12]
  7910. 800324c: 68db ldr r3, [r3, #12]
  7911. 800324e: f5b3 6f00 cmp.w r3, #2048 ; 0x800
  7912. 8003252: d178 bne.n 8003346 <HAL_SPI_TransmitReceive+0x1ee>
  7913. {
  7914. if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
  7915. 8003254: 68fb ldr r3, [r7, #12]
  7916. 8003256: 685b ldr r3, [r3, #4]
  7917. 8003258: 2b00 cmp r3, #0
  7918. 800325a: d002 beq.n 8003262 <HAL_SPI_TransmitReceive+0x10a>
  7919. 800325c: 8b7b ldrh r3, [r7, #26]
  7920. 800325e: 2b01 cmp r3, #1
  7921. 8003260: d166 bne.n 8003330 <HAL_SPI_TransmitReceive+0x1d8>
  7922. {
  7923. hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
  7924. 8003262: 68fb ldr r3, [r7, #12]
  7925. 8003264: 6b1b ldr r3, [r3, #48] ; 0x30
  7926. 8003266: 881a ldrh r2, [r3, #0]
  7927. 8003268: 68fb ldr r3, [r7, #12]
  7928. 800326a: 681b ldr r3, [r3, #0]
  7929. 800326c: 60da str r2, [r3, #12]
  7930. hspi->pTxBuffPtr += sizeof(uint16_t);
  7931. 800326e: 68fb ldr r3, [r7, #12]
  7932. 8003270: 6b1b ldr r3, [r3, #48] ; 0x30
  7933. 8003272: 1c9a adds r2, r3, #2
  7934. 8003274: 68fb ldr r3, [r7, #12]
  7935. 8003276: 631a str r2, [r3, #48] ; 0x30
  7936. hspi->TxXferCount--;
  7937. 8003278: 68fb ldr r3, [r7, #12]
  7938. 800327a: 8edb ldrh r3, [r3, #54] ; 0x36
  7939. 800327c: b29b uxth r3, r3
  7940. 800327e: 3b01 subs r3, #1
  7941. 8003280: b29a uxth r2, r3
  7942. 8003282: 68fb ldr r3, [r7, #12]
  7943. 8003284: 86da strh r2, [r3, #54] ; 0x36
  7944. }
  7945. while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
  7946. 8003286: e053 b.n 8003330 <HAL_SPI_TransmitReceive+0x1d8>
  7947. {
  7948. /* Check TXE flag */
  7949. if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U))
  7950. 8003288: 68fb ldr r3, [r7, #12]
  7951. 800328a: 681b ldr r3, [r3, #0]
  7952. 800328c: 689b ldr r3, [r3, #8]
  7953. 800328e: f003 0302 and.w r3, r3, #2
  7954. 8003292: 2b02 cmp r3, #2
  7955. 8003294: d11b bne.n 80032ce <HAL_SPI_TransmitReceive+0x176>
  7956. 8003296: 68fb ldr r3, [r7, #12]
  7957. 8003298: 8edb ldrh r3, [r3, #54] ; 0x36
  7958. 800329a: b29b uxth r3, r3
  7959. 800329c: 2b00 cmp r3, #0
  7960. 800329e: d016 beq.n 80032ce <HAL_SPI_TransmitReceive+0x176>
  7961. 80032a0: 6afb ldr r3, [r7, #44] ; 0x2c
  7962. 80032a2: 2b01 cmp r3, #1
  7963. 80032a4: d113 bne.n 80032ce <HAL_SPI_TransmitReceive+0x176>
  7964. {
  7965. hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr);
  7966. 80032a6: 68fb ldr r3, [r7, #12]
  7967. 80032a8: 6b1b ldr r3, [r3, #48] ; 0x30
  7968. 80032aa: 881a ldrh r2, [r3, #0]
  7969. 80032ac: 68fb ldr r3, [r7, #12]
  7970. 80032ae: 681b ldr r3, [r3, #0]
  7971. 80032b0: 60da str r2, [r3, #12]
  7972. hspi->pTxBuffPtr += sizeof(uint16_t);
  7973. 80032b2: 68fb ldr r3, [r7, #12]
  7974. 80032b4: 6b1b ldr r3, [r3, #48] ; 0x30
  7975. 80032b6: 1c9a adds r2, r3, #2
  7976. 80032b8: 68fb ldr r3, [r7, #12]
  7977. 80032ba: 631a str r2, [r3, #48] ; 0x30
  7978. hspi->TxXferCount--;
  7979. 80032bc: 68fb ldr r3, [r7, #12]
  7980. 80032be: 8edb ldrh r3, [r3, #54] ; 0x36
  7981. 80032c0: b29b uxth r3, r3
  7982. 80032c2: 3b01 subs r3, #1
  7983. 80032c4: b29a uxth r2, r3
  7984. 80032c6: 68fb ldr r3, [r7, #12]
  7985. 80032c8: 86da strh r2, [r3, #54] ; 0x36
  7986. /* Next Data is a reception (Rx). Tx not allowed */
  7987. txallowed = 0U;
  7988. 80032ca: 2300 movs r3, #0
  7989. 80032cc: 62fb str r3, [r7, #44] ; 0x2c
  7990. }
  7991. #endif /* USE_SPI_CRC */
  7992. }
  7993. /* Check RXNE flag */
  7994. if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U))
  7995. 80032ce: 68fb ldr r3, [r7, #12]
  7996. 80032d0: 681b ldr r3, [r3, #0]
  7997. 80032d2: 689b ldr r3, [r3, #8]
  7998. 80032d4: f003 0301 and.w r3, r3, #1
  7999. 80032d8: 2b01 cmp r3, #1
  8000. 80032da: d119 bne.n 8003310 <HAL_SPI_TransmitReceive+0x1b8>
  8001. 80032dc: 68fb ldr r3, [r7, #12]
  8002. 80032de: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8003. 80032e0: b29b uxth r3, r3
  8004. 80032e2: 2b00 cmp r3, #0
  8005. 80032e4: d014 beq.n 8003310 <HAL_SPI_TransmitReceive+0x1b8>
  8006. {
  8007. *((uint16_t *)hspi->pRxBuffPtr) = (uint16_t)hspi->Instance->DR;
  8008. 80032e6: 68fb ldr r3, [r7, #12]
  8009. 80032e8: 681b ldr r3, [r3, #0]
  8010. 80032ea: 68da ldr r2, [r3, #12]
  8011. 80032ec: 68fb ldr r3, [r7, #12]
  8012. 80032ee: 6b9b ldr r3, [r3, #56] ; 0x38
  8013. 80032f0: b292 uxth r2, r2
  8014. 80032f2: 801a strh r2, [r3, #0]
  8015. hspi->pRxBuffPtr += sizeof(uint16_t);
  8016. 80032f4: 68fb ldr r3, [r7, #12]
  8017. 80032f6: 6b9b ldr r3, [r3, #56] ; 0x38
  8018. 80032f8: 1c9a adds r2, r3, #2
  8019. 80032fa: 68fb ldr r3, [r7, #12]
  8020. 80032fc: 639a str r2, [r3, #56] ; 0x38
  8021. hspi->RxXferCount--;
  8022. 80032fe: 68fb ldr r3, [r7, #12]
  8023. 8003300: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8024. 8003302: b29b uxth r3, r3
  8025. 8003304: 3b01 subs r3, #1
  8026. 8003306: b29a uxth r2, r3
  8027. 8003308: 68fb ldr r3, [r7, #12]
  8028. 800330a: 87da strh r2, [r3, #62] ; 0x3e
  8029. /* Next Data is a Transmission (Tx). Tx is allowed */
  8030. txallowed = 1U;
  8031. 800330c: 2301 movs r3, #1
  8032. 800330e: 62fb str r3, [r7, #44] ; 0x2c
  8033. }
  8034. if (((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY))
  8035. 8003310: f7fe f9d8 bl 80016c4 <HAL_GetTick>
  8036. 8003314: 4602 mov r2, r0
  8037. 8003316: 6a7b ldr r3, [r7, #36] ; 0x24
  8038. 8003318: 1ad3 subs r3, r2, r3
  8039. 800331a: 6bba ldr r2, [r7, #56] ; 0x38
  8040. 800331c: 429a cmp r2, r3
  8041. 800331e: d807 bhi.n 8003330 <HAL_SPI_TransmitReceive+0x1d8>
  8042. 8003320: 6bbb ldr r3, [r7, #56] ; 0x38
  8043. 8003322: f1b3 3fff cmp.w r3, #4294967295
  8044. 8003326: d003 beq.n 8003330 <HAL_SPI_TransmitReceive+0x1d8>
  8045. {
  8046. errorcode = HAL_TIMEOUT;
  8047. 8003328: 2303 movs r3, #3
  8048. 800332a: f887 302b strb.w r3, [r7, #43] ; 0x2b
  8049. goto error;
  8050. 800332e: e0a7 b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  8051. while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
  8052. 8003330: 68fb ldr r3, [r7, #12]
  8053. 8003332: 8edb ldrh r3, [r3, #54] ; 0x36
  8054. 8003334: b29b uxth r3, r3
  8055. 8003336: 2b00 cmp r3, #0
  8056. 8003338: d1a6 bne.n 8003288 <HAL_SPI_TransmitReceive+0x130>
  8057. 800333a: 68fb ldr r3, [r7, #12]
  8058. 800333c: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8059. 800333e: b29b uxth r3, r3
  8060. 8003340: 2b00 cmp r3, #0
  8061. 8003342: d1a1 bne.n 8003288 <HAL_SPI_TransmitReceive+0x130>
  8062. 8003344: e07c b.n 8003440 <HAL_SPI_TransmitReceive+0x2e8>
  8063. }
  8064. }
  8065. /* Transmit and Receive data in 8 Bit mode */
  8066. else
  8067. {
  8068. if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U))
  8069. 8003346: 68fb ldr r3, [r7, #12]
  8070. 8003348: 685b ldr r3, [r3, #4]
  8071. 800334a: 2b00 cmp r3, #0
  8072. 800334c: d002 beq.n 8003354 <HAL_SPI_TransmitReceive+0x1fc>
  8073. 800334e: 8b7b ldrh r3, [r7, #26]
  8074. 8003350: 2b01 cmp r3, #1
  8075. 8003352: d16b bne.n 800342c <HAL_SPI_TransmitReceive+0x2d4>
  8076. {
  8077. *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr);
  8078. 8003354: 68fb ldr r3, [r7, #12]
  8079. 8003356: 6b1a ldr r2, [r3, #48] ; 0x30
  8080. 8003358: 68fb ldr r3, [r7, #12]
  8081. 800335a: 681b ldr r3, [r3, #0]
  8082. 800335c: 330c adds r3, #12
  8083. 800335e: 7812 ldrb r2, [r2, #0]
  8084. 8003360: 701a strb r2, [r3, #0]
  8085. hspi->pTxBuffPtr += sizeof(uint8_t);
  8086. 8003362: 68fb ldr r3, [r7, #12]
  8087. 8003364: 6b1b ldr r3, [r3, #48] ; 0x30
  8088. 8003366: 1c5a adds r2, r3, #1
  8089. 8003368: 68fb ldr r3, [r7, #12]
  8090. 800336a: 631a str r2, [r3, #48] ; 0x30
  8091. hspi->TxXferCount--;
  8092. 800336c: 68fb ldr r3, [r7, #12]
  8093. 800336e: 8edb ldrh r3, [r3, #54] ; 0x36
  8094. 8003370: b29b uxth r3, r3
  8095. 8003372: 3b01 subs r3, #1
  8096. 8003374: b29a uxth r2, r3
  8097. 8003376: 68fb ldr r3, [r7, #12]
  8098. 8003378: 86da strh r2, [r3, #54] ; 0x36
  8099. }
  8100. while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
  8101. 800337a: e057 b.n 800342c <HAL_SPI_TransmitReceive+0x2d4>
  8102. {
  8103. /* Check TXE flag */
  8104. if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U))
  8105. 800337c: 68fb ldr r3, [r7, #12]
  8106. 800337e: 681b ldr r3, [r3, #0]
  8107. 8003380: 689b ldr r3, [r3, #8]
  8108. 8003382: f003 0302 and.w r3, r3, #2
  8109. 8003386: 2b02 cmp r3, #2
  8110. 8003388: d11c bne.n 80033c4 <HAL_SPI_TransmitReceive+0x26c>
  8111. 800338a: 68fb ldr r3, [r7, #12]
  8112. 800338c: 8edb ldrh r3, [r3, #54] ; 0x36
  8113. 800338e: b29b uxth r3, r3
  8114. 8003390: 2b00 cmp r3, #0
  8115. 8003392: d017 beq.n 80033c4 <HAL_SPI_TransmitReceive+0x26c>
  8116. 8003394: 6afb ldr r3, [r7, #44] ; 0x2c
  8117. 8003396: 2b01 cmp r3, #1
  8118. 8003398: d114 bne.n 80033c4 <HAL_SPI_TransmitReceive+0x26c>
  8119. {
  8120. *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr);
  8121. 800339a: 68fb ldr r3, [r7, #12]
  8122. 800339c: 6b1a ldr r2, [r3, #48] ; 0x30
  8123. 800339e: 68fb ldr r3, [r7, #12]
  8124. 80033a0: 681b ldr r3, [r3, #0]
  8125. 80033a2: 330c adds r3, #12
  8126. 80033a4: 7812 ldrb r2, [r2, #0]
  8127. 80033a6: 701a strb r2, [r3, #0]
  8128. hspi->pTxBuffPtr++;
  8129. 80033a8: 68fb ldr r3, [r7, #12]
  8130. 80033aa: 6b1b ldr r3, [r3, #48] ; 0x30
  8131. 80033ac: 1c5a adds r2, r3, #1
  8132. 80033ae: 68fb ldr r3, [r7, #12]
  8133. 80033b0: 631a str r2, [r3, #48] ; 0x30
  8134. hspi->TxXferCount--;
  8135. 80033b2: 68fb ldr r3, [r7, #12]
  8136. 80033b4: 8edb ldrh r3, [r3, #54] ; 0x36
  8137. 80033b6: b29b uxth r3, r3
  8138. 80033b8: 3b01 subs r3, #1
  8139. 80033ba: b29a uxth r2, r3
  8140. 80033bc: 68fb ldr r3, [r7, #12]
  8141. 80033be: 86da strh r2, [r3, #54] ; 0x36
  8142. /* Next Data is a reception (Rx). Tx not allowed */
  8143. txallowed = 0U;
  8144. 80033c0: 2300 movs r3, #0
  8145. 80033c2: 62fb str r3, [r7, #44] ; 0x2c
  8146. }
  8147. #endif /* USE_SPI_CRC */
  8148. }
  8149. /* Wait until RXNE flag is reset */
  8150. if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U))
  8151. 80033c4: 68fb ldr r3, [r7, #12]
  8152. 80033c6: 681b ldr r3, [r3, #0]
  8153. 80033c8: 689b ldr r3, [r3, #8]
  8154. 80033ca: f003 0301 and.w r3, r3, #1
  8155. 80033ce: 2b01 cmp r3, #1
  8156. 80033d0: d119 bne.n 8003406 <HAL_SPI_TransmitReceive+0x2ae>
  8157. 80033d2: 68fb ldr r3, [r7, #12]
  8158. 80033d4: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8159. 80033d6: b29b uxth r3, r3
  8160. 80033d8: 2b00 cmp r3, #0
  8161. 80033da: d014 beq.n 8003406 <HAL_SPI_TransmitReceive+0x2ae>
  8162. {
  8163. (*(uint8_t *)hspi->pRxBuffPtr) = hspi->Instance->DR;
  8164. 80033dc: 68fb ldr r3, [r7, #12]
  8165. 80033de: 681b ldr r3, [r3, #0]
  8166. 80033e0: 68da ldr r2, [r3, #12]
  8167. 80033e2: 68fb ldr r3, [r7, #12]
  8168. 80033e4: 6b9b ldr r3, [r3, #56] ; 0x38
  8169. 80033e6: b2d2 uxtb r2, r2
  8170. 80033e8: 701a strb r2, [r3, #0]
  8171. hspi->pRxBuffPtr++;
  8172. 80033ea: 68fb ldr r3, [r7, #12]
  8173. 80033ec: 6b9b ldr r3, [r3, #56] ; 0x38
  8174. 80033ee: 1c5a adds r2, r3, #1
  8175. 80033f0: 68fb ldr r3, [r7, #12]
  8176. 80033f2: 639a str r2, [r3, #56] ; 0x38
  8177. hspi->RxXferCount--;
  8178. 80033f4: 68fb ldr r3, [r7, #12]
  8179. 80033f6: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8180. 80033f8: b29b uxth r3, r3
  8181. 80033fa: 3b01 subs r3, #1
  8182. 80033fc: b29a uxth r2, r3
  8183. 80033fe: 68fb ldr r3, [r7, #12]
  8184. 8003400: 87da strh r2, [r3, #62] ; 0x3e
  8185. /* Next Data is a Transmission (Tx). Tx is allowed */
  8186. txallowed = 1U;
  8187. 8003402: 2301 movs r3, #1
  8188. 8003404: 62fb str r3, [r7, #44] ; 0x2c
  8189. }
  8190. if ((((HAL_GetTick() - tickstart) >= Timeout) && ((Timeout != HAL_MAX_DELAY))) || (Timeout == 0U))
  8191. 8003406: f7fe f95d bl 80016c4 <HAL_GetTick>
  8192. 800340a: 4602 mov r2, r0
  8193. 800340c: 6a7b ldr r3, [r7, #36] ; 0x24
  8194. 800340e: 1ad3 subs r3, r2, r3
  8195. 8003410: 6bba ldr r2, [r7, #56] ; 0x38
  8196. 8003412: 429a cmp r2, r3
  8197. 8003414: d803 bhi.n 800341e <HAL_SPI_TransmitReceive+0x2c6>
  8198. 8003416: 6bbb ldr r3, [r7, #56] ; 0x38
  8199. 8003418: f1b3 3fff cmp.w r3, #4294967295
  8200. 800341c: d102 bne.n 8003424 <HAL_SPI_TransmitReceive+0x2cc>
  8201. 800341e: 6bbb ldr r3, [r7, #56] ; 0x38
  8202. 8003420: 2b00 cmp r3, #0
  8203. 8003422: d103 bne.n 800342c <HAL_SPI_TransmitReceive+0x2d4>
  8204. {
  8205. errorcode = HAL_TIMEOUT;
  8206. 8003424: 2303 movs r3, #3
  8207. 8003426: f887 302b strb.w r3, [r7, #43] ; 0x2b
  8208. goto error;
  8209. 800342a: e029 b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  8210. while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U))
  8211. 800342c: 68fb ldr r3, [r7, #12]
  8212. 800342e: 8edb ldrh r3, [r3, #54] ; 0x36
  8213. 8003430: b29b uxth r3, r3
  8214. 8003432: 2b00 cmp r3, #0
  8215. 8003434: d1a2 bne.n 800337c <HAL_SPI_TransmitReceive+0x224>
  8216. 8003436: 68fb ldr r3, [r7, #12]
  8217. 8003438: 8fdb ldrh r3, [r3, #62] ; 0x3e
  8218. 800343a: b29b uxth r3, r3
  8219. 800343c: 2b00 cmp r3, #0
  8220. 800343e: d19d bne.n 800337c <HAL_SPI_TransmitReceive+0x224>
  8221. errorcode = HAL_ERROR;
  8222. }
  8223. #endif /* USE_SPI_CRC */
  8224. /* Check the end of the transaction */
  8225. if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK)
  8226. 8003440: 6a7a ldr r2, [r7, #36] ; 0x24
  8227. 8003442: 6bb9 ldr r1, [r7, #56] ; 0x38
  8228. 8003444: 68f8 ldr r0, [r7, #12]
  8229. 8003446: f000 f893 bl 8003570 <SPI_EndRxTxTransaction>
  8230. 800344a: 4603 mov r3, r0
  8231. 800344c: 2b00 cmp r3, #0
  8232. 800344e: d006 beq.n 800345e <HAL_SPI_TransmitReceive+0x306>
  8233. {
  8234. errorcode = HAL_ERROR;
  8235. 8003450: 2301 movs r3, #1
  8236. 8003452: f887 302b strb.w r3, [r7, #43] ; 0x2b
  8237. hspi->ErrorCode = HAL_SPI_ERROR_FLAG;
  8238. 8003456: 68fb ldr r3, [r7, #12]
  8239. 8003458: 2220 movs r2, #32
  8240. 800345a: 655a str r2, [r3, #84] ; 0x54
  8241. goto error;
  8242. 800345c: e010 b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  8243. }
  8244. /* Clear overrun flag in 2 Lines communication mode because received is not read */
  8245. if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
  8246. 800345e: 68fb ldr r3, [r7, #12]
  8247. 8003460: 689b ldr r3, [r3, #8]
  8248. 8003462: 2b00 cmp r3, #0
  8249. 8003464: d10b bne.n 800347e <HAL_SPI_TransmitReceive+0x326>
  8250. {
  8251. __HAL_SPI_CLEAR_OVRFLAG(hspi);
  8252. 8003466: 2300 movs r3, #0
  8253. 8003468: 617b str r3, [r7, #20]
  8254. 800346a: 68fb ldr r3, [r7, #12]
  8255. 800346c: 681b ldr r3, [r3, #0]
  8256. 800346e: 68db ldr r3, [r3, #12]
  8257. 8003470: 617b str r3, [r7, #20]
  8258. 8003472: 68fb ldr r3, [r7, #12]
  8259. 8003474: 681b ldr r3, [r3, #0]
  8260. 8003476: 689b ldr r3, [r3, #8]
  8261. 8003478: 617b str r3, [r7, #20]
  8262. 800347a: 697b ldr r3, [r7, #20]
  8263. 800347c: e000 b.n 8003480 <HAL_SPI_TransmitReceive+0x328>
  8264. }
  8265. error :
  8266. 800347e: bf00 nop
  8267. hspi->State = HAL_SPI_STATE_READY;
  8268. 8003480: 68fb ldr r3, [r7, #12]
  8269. 8003482: 2201 movs r2, #1
  8270. 8003484: f883 2051 strb.w r2, [r3, #81] ; 0x51
  8271. __HAL_UNLOCK(hspi);
  8272. 8003488: 68fb ldr r3, [r7, #12]
  8273. 800348a: 2200 movs r2, #0
  8274. 800348c: f883 2050 strb.w r2, [r3, #80] ; 0x50
  8275. return errorcode;
  8276. 8003490: f897 302b ldrb.w r3, [r7, #43] ; 0x2b
  8277. }
  8278. 8003494: 4618 mov r0, r3
  8279. 8003496: 3730 adds r7, #48 ; 0x30
  8280. 8003498: 46bd mov sp, r7
  8281. 800349a: bd80 pop {r7, pc}
  8282. 0800349c <SPI_WaitFlagStateUntilTimeout>:
  8283. * @param Tickstart tick start value
  8284. * @retval HAL status
  8285. */
  8286. static HAL_StatusTypeDef SPI_WaitFlagStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus State,
  8287. uint32_t Timeout, uint32_t Tickstart)
  8288. {
  8289. 800349c: b580 push {r7, lr}
  8290. 800349e: b084 sub sp, #16
  8291. 80034a0: af00 add r7, sp, #0
  8292. 80034a2: 60f8 str r0, [r7, #12]
  8293. 80034a4: 60b9 str r1, [r7, #8]
  8294. 80034a6: 603b str r3, [r7, #0]
  8295. 80034a8: 4613 mov r3, r2
  8296. 80034aa: 71fb strb r3, [r7, #7]
  8297. while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State)
  8298. 80034ac: e04c b.n 8003548 <SPI_WaitFlagStateUntilTimeout+0xac>
  8299. {
  8300. if (Timeout != HAL_MAX_DELAY)
  8301. 80034ae: 683b ldr r3, [r7, #0]
  8302. 80034b0: f1b3 3fff cmp.w r3, #4294967295
  8303. 80034b4: d048 beq.n 8003548 <SPI_WaitFlagStateUntilTimeout+0xac>
  8304. {
  8305. if (((HAL_GetTick() - Tickstart) >= Timeout) || (Timeout == 0U))
  8306. 80034b6: f7fe f905 bl 80016c4 <HAL_GetTick>
  8307. 80034ba: 4602 mov r2, r0
  8308. 80034bc: 69bb ldr r3, [r7, #24]
  8309. 80034be: 1ad3 subs r3, r2, r3
  8310. 80034c0: 683a ldr r2, [r7, #0]
  8311. 80034c2: 429a cmp r2, r3
  8312. 80034c4: d902 bls.n 80034cc <SPI_WaitFlagStateUntilTimeout+0x30>
  8313. 80034c6: 683b ldr r3, [r7, #0]
  8314. 80034c8: 2b00 cmp r3, #0
  8315. 80034ca: d13d bne.n 8003548 <SPI_WaitFlagStateUntilTimeout+0xac>
  8316. /* Disable the SPI and reset the CRC: the CRC value should be cleared
  8317. on both master and slave sides in order to resynchronize the master
  8318. and slave for their respective CRC calculation */
  8319. /* Disable TXE, RXNE and ERR interrupts for the interrupt process */
  8320. __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));
  8321. 80034cc: 68fb ldr r3, [r7, #12]
  8322. 80034ce: 681b ldr r3, [r3, #0]
  8323. 80034d0: 685a ldr r2, [r3, #4]
  8324. 80034d2: 68fb ldr r3, [r7, #12]
  8325. 80034d4: 681b ldr r3, [r3, #0]
  8326. 80034d6: f022 02e0 bic.w r2, r2, #224 ; 0xe0
  8327. 80034da: 605a str r2, [r3, #4]
  8328. if ((hspi->Init.Mode == SPI_MODE_MASTER) && ((hspi->Init.Direction == SPI_DIRECTION_1LINE)
  8329. 80034dc: 68fb ldr r3, [r7, #12]
  8330. 80034de: 685b ldr r3, [r3, #4]
  8331. 80034e0: f5b3 7f82 cmp.w r3, #260 ; 0x104
  8332. 80034e4: d111 bne.n 800350a <SPI_WaitFlagStateUntilTimeout+0x6e>
  8333. 80034e6: 68fb ldr r3, [r7, #12]
  8334. 80034e8: 689b ldr r3, [r3, #8]
  8335. 80034ea: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
  8336. 80034ee: d004 beq.n 80034fa <SPI_WaitFlagStateUntilTimeout+0x5e>
  8337. || (hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
  8338. 80034f0: 68fb ldr r3, [r7, #12]
  8339. 80034f2: 689b ldr r3, [r3, #8]
  8340. 80034f4: f5b3 6f80 cmp.w r3, #1024 ; 0x400
  8341. 80034f8: d107 bne.n 800350a <SPI_WaitFlagStateUntilTimeout+0x6e>
  8342. {
  8343. /* Disable SPI peripheral */
  8344. __HAL_SPI_DISABLE(hspi);
  8345. 80034fa: 68fb ldr r3, [r7, #12]
  8346. 80034fc: 681b ldr r3, [r3, #0]
  8347. 80034fe: 681a ldr r2, [r3, #0]
  8348. 8003500: 68fb ldr r3, [r7, #12]
  8349. 8003502: 681b ldr r3, [r3, #0]
  8350. 8003504: f022 0240 bic.w r2, r2, #64 ; 0x40
  8351. 8003508: 601a str r2, [r3, #0]
  8352. }
  8353. /* Reset CRC Calculation */
  8354. if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
  8355. 800350a: 68fb ldr r3, [r7, #12]
  8356. 800350c: 6a9b ldr r3, [r3, #40] ; 0x28
  8357. 800350e: f5b3 5f00 cmp.w r3, #8192 ; 0x2000
  8358. 8003512: d10f bne.n 8003534 <SPI_WaitFlagStateUntilTimeout+0x98>
  8359. {
  8360. SPI_RESET_CRC(hspi);
  8361. 8003514: 68fb ldr r3, [r7, #12]
  8362. 8003516: 681b ldr r3, [r3, #0]
  8363. 8003518: 681a ldr r2, [r3, #0]
  8364. 800351a: 68fb ldr r3, [r7, #12]
  8365. 800351c: 681b ldr r3, [r3, #0]
  8366. 800351e: f422 5200 bic.w r2, r2, #8192 ; 0x2000
  8367. 8003522: 601a str r2, [r3, #0]
  8368. 8003524: 68fb ldr r3, [r7, #12]
  8369. 8003526: 681b ldr r3, [r3, #0]
  8370. 8003528: 681a ldr r2, [r3, #0]
  8371. 800352a: 68fb ldr r3, [r7, #12]
  8372. 800352c: 681b ldr r3, [r3, #0]
  8373. 800352e: f442 5200 orr.w r2, r2, #8192 ; 0x2000
  8374. 8003532: 601a str r2, [r3, #0]
  8375. }
  8376. hspi->State = HAL_SPI_STATE_READY;
  8377. 8003534: 68fb ldr r3, [r7, #12]
  8378. 8003536: 2201 movs r2, #1
  8379. 8003538: f883 2051 strb.w r2, [r3, #81] ; 0x51
  8380. /* Process Unlocked */
  8381. __HAL_UNLOCK(hspi);
  8382. 800353c: 68fb ldr r3, [r7, #12]
  8383. 800353e: 2200 movs r2, #0
  8384. 8003540: f883 2050 strb.w r2, [r3, #80] ; 0x50
  8385. return HAL_TIMEOUT;
  8386. 8003544: 2303 movs r3, #3
  8387. 8003546: e00f b.n 8003568 <SPI_WaitFlagStateUntilTimeout+0xcc>
  8388. while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State)
  8389. 8003548: 68fb ldr r3, [r7, #12]
  8390. 800354a: 681b ldr r3, [r3, #0]
  8391. 800354c: 689a ldr r2, [r3, #8]
  8392. 800354e: 68bb ldr r3, [r7, #8]
  8393. 8003550: 4013 ands r3, r2
  8394. 8003552: 68ba ldr r2, [r7, #8]
  8395. 8003554: 429a cmp r2, r3
  8396. 8003556: bf0c ite eq
  8397. 8003558: 2301 moveq r3, #1
  8398. 800355a: 2300 movne r3, #0
  8399. 800355c: b2db uxtb r3, r3
  8400. 800355e: 461a mov r2, r3
  8401. 8003560: 79fb ldrb r3, [r7, #7]
  8402. 8003562: 429a cmp r2, r3
  8403. 8003564: d1a3 bne.n 80034ae <SPI_WaitFlagStateUntilTimeout+0x12>
  8404. }
  8405. }
  8406. }
  8407. return HAL_OK;
  8408. 8003566: 2300 movs r3, #0
  8409. }
  8410. 8003568: 4618 mov r0, r3
  8411. 800356a: 3710 adds r7, #16
  8412. 800356c: 46bd mov sp, r7
  8413. 800356e: bd80 pop {r7, pc}
  8414. 08003570 <SPI_EndRxTxTransaction>:
  8415. * @param Timeout Timeout duration
  8416. * @param Tickstart tick start value
  8417. * @retval HAL status
  8418. */
  8419. static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout, uint32_t Tickstart)
  8420. {
  8421. 8003570: b580 push {r7, lr}
  8422. 8003572: b088 sub sp, #32
  8423. 8003574: af02 add r7, sp, #8
  8424. 8003576: 60f8 str r0, [r7, #12]
  8425. 8003578: 60b9 str r1, [r7, #8]
  8426. 800357a: 607a str r2, [r7, #4]
  8427. /* Timeout in µs */
  8428. __IO uint32_t count = SPI_BSY_FLAG_WORKAROUND_TIMEOUT * (SystemCoreClock / 24U / 1000000U);
  8429. 800357c: 4b1b ldr r3, [pc, #108] ; (80035ec <SPI_EndRxTxTransaction+0x7c>)
  8430. 800357e: 681b ldr r3, [r3, #0]
  8431. 8003580: 4a1b ldr r2, [pc, #108] ; (80035f0 <SPI_EndRxTxTransaction+0x80>)
  8432. 8003582: fba2 2303 umull r2, r3, r2, r3
  8433. 8003586: 0d5b lsrs r3, r3, #21
  8434. 8003588: f44f 727a mov.w r2, #1000 ; 0x3e8
  8435. 800358c: fb02 f303 mul.w r3, r2, r3
  8436. 8003590: 617b str r3, [r7, #20]
  8437. /* Erratasheet: BSY bit may stay high at the end of a data transfer in Slave mode */
  8438. if (hspi->Init.Mode == SPI_MODE_MASTER)
  8439. 8003592: 68fb ldr r3, [r7, #12]
  8440. 8003594: 685b ldr r3, [r3, #4]
  8441. 8003596: f5b3 7f82 cmp.w r3, #260 ; 0x104
  8442. 800359a: d112 bne.n 80035c2 <SPI_EndRxTxTransaction+0x52>
  8443. {
  8444. /* Control the BSY flag */
  8445. if (SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout, Tickstart) != HAL_OK)
  8446. 800359c: 687b ldr r3, [r7, #4]
  8447. 800359e: 9300 str r3, [sp, #0]
  8448. 80035a0: 68bb ldr r3, [r7, #8]
  8449. 80035a2: 2200 movs r2, #0
  8450. 80035a4: 2180 movs r1, #128 ; 0x80
  8451. 80035a6: 68f8 ldr r0, [r7, #12]
  8452. 80035a8: f7ff ff78 bl 800349c <SPI_WaitFlagStateUntilTimeout>
  8453. 80035ac: 4603 mov r3, r0
  8454. 80035ae: 2b00 cmp r3, #0
  8455. 80035b0: d016 beq.n 80035e0 <SPI_EndRxTxTransaction+0x70>
  8456. {
  8457. SET_BIT(hspi->ErrorCode, HAL_SPI_ERROR_FLAG);
  8458. 80035b2: 68fb ldr r3, [r7, #12]
  8459. 80035b4: 6d5b ldr r3, [r3, #84] ; 0x54
  8460. 80035b6: f043 0220 orr.w r2, r3, #32
  8461. 80035ba: 68fb ldr r3, [r7, #12]
  8462. 80035bc: 655a str r2, [r3, #84] ; 0x54
  8463. return HAL_TIMEOUT;
  8464. 80035be: 2303 movs r3, #3
  8465. 80035c0: e00f b.n 80035e2 <SPI_EndRxTxTransaction+0x72>
  8466. * User have to calculate the timeout value to fit with the time of 1 byte transfer.
  8467. * This time is directly link with the SPI clock from Master device.
  8468. */
  8469. do
  8470. {
  8471. if (count == 0U)
  8472. 80035c2: 697b ldr r3, [r7, #20]
  8473. 80035c4: 2b00 cmp r3, #0
  8474. 80035c6: d00a beq.n 80035de <SPI_EndRxTxTransaction+0x6e>
  8475. {
  8476. break;
  8477. }
  8478. count--;
  8479. 80035c8: 697b ldr r3, [r7, #20]
  8480. 80035ca: 3b01 subs r3, #1
  8481. 80035cc: 617b str r3, [r7, #20]
  8482. } while (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_BSY) != RESET);
  8483. 80035ce: 68fb ldr r3, [r7, #12]
  8484. 80035d0: 681b ldr r3, [r3, #0]
  8485. 80035d2: 689b ldr r3, [r3, #8]
  8486. 80035d4: f003 0380 and.w r3, r3, #128 ; 0x80
  8487. 80035d8: 2b80 cmp r3, #128 ; 0x80
  8488. 80035da: d0f2 beq.n 80035c2 <SPI_EndRxTxTransaction+0x52>
  8489. 80035dc: e000 b.n 80035e0 <SPI_EndRxTxTransaction+0x70>
  8490. break;
  8491. 80035de: bf00 nop
  8492. }
  8493. return HAL_OK;
  8494. 80035e0: 2300 movs r3, #0
  8495. }
  8496. 80035e2: 4618 mov r0, r3
  8497. 80035e4: 3718 adds r7, #24
  8498. 80035e6: 46bd mov sp, r7
  8499. 80035e8: bd80 pop {r7, pc}
  8500. 80035ea: bf00 nop
  8501. 80035ec: 20000004 .word 0x20000004
  8502. 80035f0: 165e9f81 .word 0x165e9f81
  8503. 080035f4 <HAL_UART_Init>:
  8504. * @param huart Pointer to a UART_HandleTypeDef structure that contains
  8505. * the configuration information for the specified UART module.
  8506. * @retval HAL status
  8507. */
  8508. HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
  8509. {
  8510. 80035f4: b580 push {r7, lr}
  8511. 80035f6: b082 sub sp, #8
  8512. 80035f8: af00 add r7, sp, #0
  8513. 80035fa: 6078 str r0, [r7, #4]
  8514. /* Check the UART handle allocation */
  8515. if (huart == NULL)
  8516. 80035fc: 687b ldr r3, [r7, #4]
  8517. 80035fe: 2b00 cmp r3, #0
  8518. 8003600: d101 bne.n 8003606 <HAL_UART_Init+0x12>
  8519. {
  8520. return HAL_ERROR;
  8521. 8003602: 2301 movs r3, #1
  8522. 8003604: e03f b.n 8003686 <HAL_UART_Init+0x92>
  8523. assert_param(IS_UART_INSTANCE(huart->Instance));
  8524. }
  8525. assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength));
  8526. assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling));
  8527. if (huart->gState == HAL_UART_STATE_RESET)
  8528. 8003606: 687b ldr r3, [r7, #4]
  8529. 8003608: f893 3039 ldrb.w r3, [r3, #57] ; 0x39
  8530. 800360c: b2db uxtb r3, r3
  8531. 800360e: 2b00 cmp r3, #0
  8532. 8003610: d106 bne.n 8003620 <HAL_UART_Init+0x2c>
  8533. {
  8534. /* Allocate lock resource and initialize it */
  8535. huart->Lock = HAL_UNLOCKED;
  8536. 8003612: 687b ldr r3, [r7, #4]
  8537. 8003614: 2200 movs r2, #0
  8538. 8003616: f883 2038 strb.w r2, [r3, #56] ; 0x38
  8539. /* Init the low level hardware */
  8540. huart->MspInitCallback(huart);
  8541. #else
  8542. /* Init the low level hardware : GPIO, CLOCK */
  8543. HAL_UART_MspInit(huart);
  8544. 800361a: 6878 ldr r0, [r7, #4]
  8545. 800361c: f7fd ff30 bl 8001480 <HAL_UART_MspInit>
  8546. #endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */
  8547. }
  8548. huart->gState = HAL_UART_STATE_BUSY;
  8549. 8003620: 687b ldr r3, [r7, #4]
  8550. 8003622: 2224 movs r2, #36 ; 0x24
  8551. 8003624: f883 2039 strb.w r2, [r3, #57] ; 0x39
  8552. /* Disable the peripheral */
  8553. __HAL_UART_DISABLE(huart);
  8554. 8003628: 687b ldr r3, [r7, #4]
  8555. 800362a: 681b ldr r3, [r3, #0]
  8556. 800362c: 68da ldr r2, [r3, #12]
  8557. 800362e: 687b ldr r3, [r7, #4]
  8558. 8003630: 681b ldr r3, [r3, #0]
  8559. 8003632: f422 5200 bic.w r2, r2, #8192 ; 0x2000
  8560. 8003636: 60da str r2, [r3, #12]
  8561. /* Set the UART Communication parameters */
  8562. UART_SetConfig(huart);
  8563. 8003638: 6878 ldr r0, [r7, #4]
  8564. 800363a: f000 f90b bl 8003854 <UART_SetConfig>
  8565. /* In asynchronous mode, the following bits must be kept cleared:
  8566. - LINEN and CLKEN bits in the USART_CR2 register,
  8567. - SCEN, HDSEL and IREN bits in the USART_CR3 register.*/
  8568. CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));
  8569. 800363e: 687b ldr r3, [r7, #4]
  8570. 8003640: 681b ldr r3, [r3, #0]
  8571. 8003642: 691a ldr r2, [r3, #16]
  8572. 8003644: 687b ldr r3, [r7, #4]
  8573. 8003646: 681b ldr r3, [r3, #0]
  8574. 8003648: f422 4290 bic.w r2, r2, #18432 ; 0x4800
  8575. 800364c: 611a str r2, [r3, #16]
  8576. CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN));
  8577. 800364e: 687b ldr r3, [r7, #4]
  8578. 8003650: 681b ldr r3, [r3, #0]
  8579. 8003652: 695a ldr r2, [r3, #20]
  8580. 8003654: 687b ldr r3, [r7, #4]
  8581. 8003656: 681b ldr r3, [r3, #0]
  8582. 8003658: f022 022a bic.w r2, r2, #42 ; 0x2a
  8583. 800365c: 615a str r2, [r3, #20]
  8584. /* Enable the peripheral */
  8585. __HAL_UART_ENABLE(huart);
  8586. 800365e: 687b ldr r3, [r7, #4]
  8587. 8003660: 681b ldr r3, [r3, #0]
  8588. 8003662: 68da ldr r2, [r3, #12]
  8589. 8003664: 687b ldr r3, [r7, #4]
  8590. 8003666: 681b ldr r3, [r3, #0]
  8591. 8003668: f442 5200 orr.w r2, r2, #8192 ; 0x2000
  8592. 800366c: 60da str r2, [r3, #12]
  8593. /* Initialize the UART state */
  8594. huart->ErrorCode = HAL_UART_ERROR_NONE;
  8595. 800366e: 687b ldr r3, [r7, #4]
  8596. 8003670: 2200 movs r2, #0
  8597. 8003672: 63da str r2, [r3, #60] ; 0x3c
  8598. huart->gState = HAL_UART_STATE_READY;
  8599. 8003674: 687b ldr r3, [r7, #4]
  8600. 8003676: 2220 movs r2, #32
  8601. 8003678: f883 2039 strb.w r2, [r3, #57] ; 0x39
  8602. huart->RxState = HAL_UART_STATE_READY;
  8603. 800367c: 687b ldr r3, [r7, #4]
  8604. 800367e: 2220 movs r2, #32
  8605. 8003680: f883 203a strb.w r2, [r3, #58] ; 0x3a
  8606. return HAL_OK;
  8607. 8003684: 2300 movs r3, #0
  8608. }
  8609. 8003686: 4618 mov r0, r3
  8610. 8003688: 3708 adds r7, #8
  8611. 800368a: 46bd mov sp, r7
  8612. 800368c: bd80 pop {r7, pc}
  8613. 0800368e <HAL_UART_Transmit>:
  8614. * @param Size Amount of data elements (u8 or u16) to be sent
  8615. * @param Timeout Timeout duration
  8616. * @retval HAL status
  8617. */
  8618. HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
  8619. {
  8620. 800368e: b580 push {r7, lr}
  8621. 8003690: b088 sub sp, #32
  8622. 8003692: af02 add r7, sp, #8
  8623. 8003694: 60f8 str r0, [r7, #12]
  8624. 8003696: 60b9 str r1, [r7, #8]
  8625. 8003698: 603b str r3, [r7, #0]
  8626. 800369a: 4613 mov r3, r2
  8627. 800369c: 80fb strh r3, [r7, #6]
  8628. uint16_t *tmp;
  8629. uint32_t tickstart = 0U;
  8630. 800369e: 2300 movs r3, #0
  8631. 80036a0: 617b str r3, [r7, #20]
  8632. /* Check that a Tx process is not already ongoing */
  8633. if (huart->gState == HAL_UART_STATE_READY)
  8634. 80036a2: 68fb ldr r3, [r7, #12]
  8635. 80036a4: f893 3039 ldrb.w r3, [r3, #57] ; 0x39
  8636. 80036a8: b2db uxtb r3, r3
  8637. 80036aa: 2b20 cmp r3, #32
  8638. 80036ac: f040 8083 bne.w 80037b6 <HAL_UART_Transmit+0x128>
  8639. {
  8640. if ((pData == NULL) || (Size == 0U))
  8641. 80036b0: 68bb ldr r3, [r7, #8]
  8642. 80036b2: 2b00 cmp r3, #0
  8643. 80036b4: d002 beq.n 80036bc <HAL_UART_Transmit+0x2e>
  8644. 80036b6: 88fb ldrh r3, [r7, #6]
  8645. 80036b8: 2b00 cmp r3, #0
  8646. 80036ba: d101 bne.n 80036c0 <HAL_UART_Transmit+0x32>
  8647. {
  8648. return HAL_ERROR;
  8649. 80036bc: 2301 movs r3, #1
  8650. 80036be: e07b b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8651. }
  8652. /* Process Locked */
  8653. __HAL_LOCK(huart);
  8654. 80036c0: 68fb ldr r3, [r7, #12]
  8655. 80036c2: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
  8656. 80036c6: 2b01 cmp r3, #1
  8657. 80036c8: d101 bne.n 80036ce <HAL_UART_Transmit+0x40>
  8658. 80036ca: 2302 movs r3, #2
  8659. 80036cc: e074 b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8660. 80036ce: 68fb ldr r3, [r7, #12]
  8661. 80036d0: 2201 movs r2, #1
  8662. 80036d2: f883 2038 strb.w r2, [r3, #56] ; 0x38
  8663. huart->ErrorCode = HAL_UART_ERROR_NONE;
  8664. 80036d6: 68fb ldr r3, [r7, #12]
  8665. 80036d8: 2200 movs r2, #0
  8666. 80036da: 63da str r2, [r3, #60] ; 0x3c
  8667. huart->gState = HAL_UART_STATE_BUSY_TX;
  8668. 80036dc: 68fb ldr r3, [r7, #12]
  8669. 80036de: 2221 movs r2, #33 ; 0x21
  8670. 80036e0: f883 2039 strb.w r2, [r3, #57] ; 0x39
  8671. /* Init tickstart for timeout managment */
  8672. tickstart = HAL_GetTick();
  8673. 80036e4: f7fd ffee bl 80016c4 <HAL_GetTick>
  8674. 80036e8: 6178 str r0, [r7, #20]
  8675. huart->TxXferSize = Size;
  8676. 80036ea: 68fb ldr r3, [r7, #12]
  8677. 80036ec: 88fa ldrh r2, [r7, #6]
  8678. 80036ee: 849a strh r2, [r3, #36] ; 0x24
  8679. huart->TxXferCount = Size;
  8680. 80036f0: 68fb ldr r3, [r7, #12]
  8681. 80036f2: 88fa ldrh r2, [r7, #6]
  8682. 80036f4: 84da strh r2, [r3, #38] ; 0x26
  8683. /* Process Unlocked */
  8684. __HAL_UNLOCK(huart);
  8685. 80036f6: 68fb ldr r3, [r7, #12]
  8686. 80036f8: 2200 movs r2, #0
  8687. 80036fa: f883 2038 strb.w r2, [r3, #56] ; 0x38
  8688. while (huart->TxXferCount > 0U)
  8689. 80036fe: e042 b.n 8003786 <HAL_UART_Transmit+0xf8>
  8690. {
  8691. huart->TxXferCount--;
  8692. 8003700: 68fb ldr r3, [r7, #12]
  8693. 8003702: 8cdb ldrh r3, [r3, #38] ; 0x26
  8694. 8003704: b29b uxth r3, r3
  8695. 8003706: 3b01 subs r3, #1
  8696. 8003708: b29a uxth r2, r3
  8697. 800370a: 68fb ldr r3, [r7, #12]
  8698. 800370c: 84da strh r2, [r3, #38] ; 0x26
  8699. if (huart->Init.WordLength == UART_WORDLENGTH_9B)
  8700. 800370e: 68fb ldr r3, [r7, #12]
  8701. 8003710: 689b ldr r3, [r3, #8]
  8702. 8003712: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
  8703. 8003716: d122 bne.n 800375e <HAL_UART_Transmit+0xd0>
  8704. {
  8705. if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK)
  8706. 8003718: 683b ldr r3, [r7, #0]
  8707. 800371a: 9300 str r3, [sp, #0]
  8708. 800371c: 697b ldr r3, [r7, #20]
  8709. 800371e: 2200 movs r2, #0
  8710. 8003720: 2180 movs r1, #128 ; 0x80
  8711. 8003722: 68f8 ldr r0, [r7, #12]
  8712. 8003724: f000 f84c bl 80037c0 <UART_WaitOnFlagUntilTimeout>
  8713. 8003728: 4603 mov r3, r0
  8714. 800372a: 2b00 cmp r3, #0
  8715. 800372c: d001 beq.n 8003732 <HAL_UART_Transmit+0xa4>
  8716. {
  8717. return HAL_TIMEOUT;
  8718. 800372e: 2303 movs r3, #3
  8719. 8003730: e042 b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8720. }
  8721. tmp = (uint16_t *) pData;
  8722. 8003732: 68bb ldr r3, [r7, #8]
  8723. 8003734: 613b str r3, [r7, #16]
  8724. huart->Instance->DR = (*tmp & (uint16_t)0x01FF);
  8725. 8003736: 693b ldr r3, [r7, #16]
  8726. 8003738: 881b ldrh r3, [r3, #0]
  8727. 800373a: 461a mov r2, r3
  8728. 800373c: 68fb ldr r3, [r7, #12]
  8729. 800373e: 681b ldr r3, [r3, #0]
  8730. 8003740: f3c2 0208 ubfx r2, r2, #0, #9
  8731. 8003744: 605a str r2, [r3, #4]
  8732. if (huart->Init.Parity == UART_PARITY_NONE)
  8733. 8003746: 68fb ldr r3, [r7, #12]
  8734. 8003748: 691b ldr r3, [r3, #16]
  8735. 800374a: 2b00 cmp r3, #0
  8736. 800374c: d103 bne.n 8003756 <HAL_UART_Transmit+0xc8>
  8737. {
  8738. pData += 2U;
  8739. 800374e: 68bb ldr r3, [r7, #8]
  8740. 8003750: 3302 adds r3, #2
  8741. 8003752: 60bb str r3, [r7, #8]
  8742. 8003754: e017 b.n 8003786 <HAL_UART_Transmit+0xf8>
  8743. }
  8744. else
  8745. {
  8746. pData += 1U;
  8747. 8003756: 68bb ldr r3, [r7, #8]
  8748. 8003758: 3301 adds r3, #1
  8749. 800375a: 60bb str r3, [r7, #8]
  8750. 800375c: e013 b.n 8003786 <HAL_UART_Transmit+0xf8>
  8751. }
  8752. }
  8753. else
  8754. {
  8755. if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK)
  8756. 800375e: 683b ldr r3, [r7, #0]
  8757. 8003760: 9300 str r3, [sp, #0]
  8758. 8003762: 697b ldr r3, [r7, #20]
  8759. 8003764: 2200 movs r2, #0
  8760. 8003766: 2180 movs r1, #128 ; 0x80
  8761. 8003768: 68f8 ldr r0, [r7, #12]
  8762. 800376a: f000 f829 bl 80037c0 <UART_WaitOnFlagUntilTimeout>
  8763. 800376e: 4603 mov r3, r0
  8764. 8003770: 2b00 cmp r3, #0
  8765. 8003772: d001 beq.n 8003778 <HAL_UART_Transmit+0xea>
  8766. {
  8767. return HAL_TIMEOUT;
  8768. 8003774: 2303 movs r3, #3
  8769. 8003776: e01f b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8770. }
  8771. huart->Instance->DR = (*pData++ & (uint8_t)0xFF);
  8772. 8003778: 68bb ldr r3, [r7, #8]
  8773. 800377a: 1c5a adds r2, r3, #1
  8774. 800377c: 60ba str r2, [r7, #8]
  8775. 800377e: 781a ldrb r2, [r3, #0]
  8776. 8003780: 68fb ldr r3, [r7, #12]
  8777. 8003782: 681b ldr r3, [r3, #0]
  8778. 8003784: 605a str r2, [r3, #4]
  8779. while (huart->TxXferCount > 0U)
  8780. 8003786: 68fb ldr r3, [r7, #12]
  8781. 8003788: 8cdb ldrh r3, [r3, #38] ; 0x26
  8782. 800378a: b29b uxth r3, r3
  8783. 800378c: 2b00 cmp r3, #0
  8784. 800378e: d1b7 bne.n 8003700 <HAL_UART_Transmit+0x72>
  8785. }
  8786. }
  8787. if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, tickstart, Timeout) != HAL_OK)
  8788. 8003790: 683b ldr r3, [r7, #0]
  8789. 8003792: 9300 str r3, [sp, #0]
  8790. 8003794: 697b ldr r3, [r7, #20]
  8791. 8003796: 2200 movs r2, #0
  8792. 8003798: 2140 movs r1, #64 ; 0x40
  8793. 800379a: 68f8 ldr r0, [r7, #12]
  8794. 800379c: f000 f810 bl 80037c0 <UART_WaitOnFlagUntilTimeout>
  8795. 80037a0: 4603 mov r3, r0
  8796. 80037a2: 2b00 cmp r3, #0
  8797. 80037a4: d001 beq.n 80037aa <HAL_UART_Transmit+0x11c>
  8798. {
  8799. return HAL_TIMEOUT;
  8800. 80037a6: 2303 movs r3, #3
  8801. 80037a8: e006 b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8802. }
  8803. /* At end of Tx process, restore huart->gState to Ready */
  8804. huart->gState = HAL_UART_STATE_READY;
  8805. 80037aa: 68fb ldr r3, [r7, #12]
  8806. 80037ac: 2220 movs r2, #32
  8807. 80037ae: f883 2039 strb.w r2, [r3, #57] ; 0x39
  8808. return HAL_OK;
  8809. 80037b2: 2300 movs r3, #0
  8810. 80037b4: e000 b.n 80037b8 <HAL_UART_Transmit+0x12a>
  8811. }
  8812. else
  8813. {
  8814. return HAL_BUSY;
  8815. 80037b6: 2302 movs r3, #2
  8816. }
  8817. }
  8818. 80037b8: 4618 mov r0, r3
  8819. 80037ba: 3718 adds r7, #24
  8820. 80037bc: 46bd mov sp, r7
  8821. 80037be: bd80 pop {r7, pc}
  8822. 080037c0 <UART_WaitOnFlagUntilTimeout>:
  8823. * @param Tickstart Tick start value
  8824. * @param Timeout Timeout duration
  8825. * @retval HAL status
  8826. */
  8827. static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout)
  8828. {
  8829. 80037c0: b580 push {r7, lr}
  8830. 80037c2: b084 sub sp, #16
  8831. 80037c4: af00 add r7, sp, #0
  8832. 80037c6: 60f8 str r0, [r7, #12]
  8833. 80037c8: 60b9 str r1, [r7, #8]
  8834. 80037ca: 603b str r3, [r7, #0]
  8835. 80037cc: 4613 mov r3, r2
  8836. 80037ce: 71fb strb r3, [r7, #7]
  8837. /* Wait until flag is set */
  8838. while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)
  8839. 80037d0: e02c b.n 800382c <UART_WaitOnFlagUntilTimeout+0x6c>
  8840. {
  8841. /* Check for the Timeout */
  8842. if (Timeout != HAL_MAX_DELAY)
  8843. 80037d2: 69bb ldr r3, [r7, #24]
  8844. 80037d4: f1b3 3fff cmp.w r3, #4294967295
  8845. 80037d8: d028 beq.n 800382c <UART_WaitOnFlagUntilTimeout+0x6c>
  8846. {
  8847. if ((Timeout == 0U) || ((HAL_GetTick() - Tickstart) > Timeout))
  8848. 80037da: 69bb ldr r3, [r7, #24]
  8849. 80037dc: 2b00 cmp r3, #0
  8850. 80037de: d007 beq.n 80037f0 <UART_WaitOnFlagUntilTimeout+0x30>
  8851. 80037e0: f7fd ff70 bl 80016c4 <HAL_GetTick>
  8852. 80037e4: 4602 mov r2, r0
  8853. 80037e6: 683b ldr r3, [r7, #0]
  8854. 80037e8: 1ad3 subs r3, r2, r3
  8855. 80037ea: 69ba ldr r2, [r7, #24]
  8856. 80037ec: 429a cmp r2, r3
  8857. 80037ee: d21d bcs.n 800382c <UART_WaitOnFlagUntilTimeout+0x6c>
  8858. {
  8859. /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */
  8860. CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE));
  8861. 80037f0: 68fb ldr r3, [r7, #12]
  8862. 80037f2: 681b ldr r3, [r3, #0]
  8863. 80037f4: 68da ldr r2, [r3, #12]
  8864. 80037f6: 68fb ldr r3, [r7, #12]
  8865. 80037f8: 681b ldr r3, [r3, #0]
  8866. 80037fa: f422 72d0 bic.w r2, r2, #416 ; 0x1a0
  8867. 80037fe: 60da str r2, [r3, #12]
  8868. CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE);
  8869. 8003800: 68fb ldr r3, [r7, #12]
  8870. 8003802: 681b ldr r3, [r3, #0]
  8871. 8003804: 695a ldr r2, [r3, #20]
  8872. 8003806: 68fb ldr r3, [r7, #12]
  8873. 8003808: 681b ldr r3, [r3, #0]
  8874. 800380a: f022 0201 bic.w r2, r2, #1
  8875. 800380e: 615a str r2, [r3, #20]
  8876. huart->gState = HAL_UART_STATE_READY;
  8877. 8003810: 68fb ldr r3, [r7, #12]
  8878. 8003812: 2220 movs r2, #32
  8879. 8003814: f883 2039 strb.w r2, [r3, #57] ; 0x39
  8880. huart->RxState = HAL_UART_STATE_READY;
  8881. 8003818: 68fb ldr r3, [r7, #12]
  8882. 800381a: 2220 movs r2, #32
  8883. 800381c: f883 203a strb.w r2, [r3, #58] ; 0x3a
  8884. /* Process Unlocked */
  8885. __HAL_UNLOCK(huart);
  8886. 8003820: 68fb ldr r3, [r7, #12]
  8887. 8003822: 2200 movs r2, #0
  8888. 8003824: f883 2038 strb.w r2, [r3, #56] ; 0x38
  8889. return HAL_TIMEOUT;
  8890. 8003828: 2303 movs r3, #3
  8891. 800382a: e00f b.n 800384c <UART_WaitOnFlagUntilTimeout+0x8c>
  8892. while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)
  8893. 800382c: 68fb ldr r3, [r7, #12]
  8894. 800382e: 681b ldr r3, [r3, #0]
  8895. 8003830: 681a ldr r2, [r3, #0]
  8896. 8003832: 68bb ldr r3, [r7, #8]
  8897. 8003834: 4013 ands r3, r2
  8898. 8003836: 68ba ldr r2, [r7, #8]
  8899. 8003838: 429a cmp r2, r3
  8900. 800383a: bf0c ite eq
  8901. 800383c: 2301 moveq r3, #1
  8902. 800383e: 2300 movne r3, #0
  8903. 8003840: b2db uxtb r3, r3
  8904. 8003842: 461a mov r2, r3
  8905. 8003844: 79fb ldrb r3, [r7, #7]
  8906. 8003846: 429a cmp r2, r3
  8907. 8003848: d0c3 beq.n 80037d2 <UART_WaitOnFlagUntilTimeout+0x12>
  8908. }
  8909. }
  8910. }
  8911. return HAL_OK;
  8912. 800384a: 2300 movs r3, #0
  8913. }
  8914. 800384c: 4618 mov r0, r3
  8915. 800384e: 3710 adds r7, #16
  8916. 8003850: 46bd mov sp, r7
  8917. 8003852: bd80 pop {r7, pc}
  8918. 08003854 <UART_SetConfig>:
  8919. * @param huart Pointer to a UART_HandleTypeDef structure that contains
  8920. * the configuration information for the specified UART module.
  8921. * @retval None
  8922. */
  8923. static void UART_SetConfig(UART_HandleTypeDef *huart)
  8924. {
  8925. 8003854: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
  8926. 8003858: b085 sub sp, #20
  8927. 800385a: af00 add r7, sp, #0
  8928. 800385c: 6078 str r0, [r7, #4]
  8929. assert_param(IS_UART_MODE(huart->Init.Mode));
  8930. /*-------------------------- USART CR2 Configuration -----------------------*/
  8931. /* Configure the UART Stop Bits: Set STOP[13:12] bits
  8932. according to huart->Init.StopBits value */
  8933. MODIFY_REG(huart->Instance->CR2, USART_CR2_STOP, huart->Init.StopBits);
  8934. 800385e: 687b ldr r3, [r7, #4]
  8935. 8003860: 681b ldr r3, [r3, #0]
  8936. 8003862: 691b ldr r3, [r3, #16]
  8937. 8003864: f423 5140 bic.w r1, r3, #12288 ; 0x3000
  8938. 8003868: 687b ldr r3, [r7, #4]
  8939. 800386a: 68da ldr r2, [r3, #12]
  8940. 800386c: 687b ldr r3, [r7, #4]
  8941. 800386e: 681b ldr r3, [r3, #0]
  8942. 8003870: 430a orrs r2, r1
  8943. 8003872: 611a str r2, [r3, #16]
  8944. Set the M bits according to huart->Init.WordLength value
  8945. Set PCE and PS bits according to huart->Init.Parity value
  8946. Set TE and RE bits according to huart->Init.Mode value
  8947. Set OVER8 bit according to huart->Init.OverSampling value */
  8948. tmpreg = (uint32_t)huart->Init.WordLength | huart->Init.Parity | huart->Init.Mode | huart->Init.OverSampling;
  8949. 8003874: 687b ldr r3, [r7, #4]
  8950. 8003876: 689a ldr r2, [r3, #8]
  8951. 8003878: 687b ldr r3, [r7, #4]
  8952. 800387a: 691b ldr r3, [r3, #16]
  8953. 800387c: 431a orrs r2, r3
  8954. 800387e: 687b ldr r3, [r7, #4]
  8955. 8003880: 695b ldr r3, [r3, #20]
  8956. 8003882: 431a orrs r2, r3
  8957. 8003884: 687b ldr r3, [r7, #4]
  8958. 8003886: 69db ldr r3, [r3, #28]
  8959. 8003888: 4313 orrs r3, r2
  8960. 800388a: 60fb str r3, [r7, #12]
  8961. MODIFY_REG(huart->Instance->CR1,
  8962. 800388c: 687b ldr r3, [r7, #4]
  8963. 800388e: 681b ldr r3, [r3, #0]
  8964. 8003890: 68db ldr r3, [r3, #12]
  8965. 8003892: f423 4316 bic.w r3, r3, #38400 ; 0x9600
  8966. 8003896: f023 030c bic.w r3, r3, #12
  8967. 800389a: 687a ldr r2, [r7, #4]
  8968. 800389c: 6812 ldr r2, [r2, #0]
  8969. 800389e: 68f9 ldr r1, [r7, #12]
  8970. 80038a0: 430b orrs r3, r1
  8971. 80038a2: 60d3 str r3, [r2, #12]
  8972. (uint32_t)(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8),
  8973. tmpreg);
  8974. /*-------------------------- USART CR3 Configuration -----------------------*/
  8975. /* Configure the UART HFC: Set CTSE and RTSE bits according to huart->Init.HwFlowCtl value */
  8976. MODIFY_REG(huart->Instance->CR3, (USART_CR3_RTSE | USART_CR3_CTSE), huart->Init.HwFlowCtl);
  8977. 80038a4: 687b ldr r3, [r7, #4]
  8978. 80038a6: 681b ldr r3, [r3, #0]
  8979. 80038a8: 695b ldr r3, [r3, #20]
  8980. 80038aa: f423 7140 bic.w r1, r3, #768 ; 0x300
  8981. 80038ae: 687b ldr r3, [r7, #4]
  8982. 80038b0: 699a ldr r2, [r3, #24]
  8983. 80038b2: 687b ldr r3, [r7, #4]
  8984. 80038b4: 681b ldr r3, [r3, #0]
  8985. 80038b6: 430a orrs r2, r1
  8986. 80038b8: 615a str r2, [r3, #20]
  8987. /* Check the Over Sampling */
  8988. if (huart->Init.OverSampling == UART_OVERSAMPLING_8)
  8989. 80038ba: 687b ldr r3, [r7, #4]
  8990. 80038bc: 69db ldr r3, [r3, #28]
  8991. 80038be: f5b3 4f00 cmp.w r3, #32768 ; 0x8000
  8992. 80038c2: f040 818b bne.w 8003bdc <UART_SetConfig+0x388>
  8993. {
  8994. pclk = HAL_RCC_GetPCLK2Freq();
  8995. huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate);
  8996. }
  8997. #elif defined(USART6)
  8998. if ((huart->Instance == USART1) || (huart->Instance == USART6))
  8999. 80038c6: 687b ldr r3, [r7, #4]
  9000. 80038c8: 681b ldr r3, [r3, #0]
  9001. 80038ca: 4ac1 ldr r2, [pc, #772] ; (8003bd0 <UART_SetConfig+0x37c>)
  9002. 80038cc: 4293 cmp r3, r2
  9003. 80038ce: d005 beq.n 80038dc <UART_SetConfig+0x88>
  9004. 80038d0: 687b ldr r3, [r7, #4]
  9005. 80038d2: 681b ldr r3, [r3, #0]
  9006. 80038d4: 4abf ldr r2, [pc, #764] ; (8003bd4 <UART_SetConfig+0x380>)
  9007. 80038d6: 4293 cmp r3, r2
  9008. 80038d8: f040 80bd bne.w 8003a56 <UART_SetConfig+0x202>
  9009. {
  9010. pclk = HAL_RCC_GetPCLK2Freq();
  9011. 80038dc: f7ff fa90 bl 8002e00 <HAL_RCC_GetPCLK2Freq>
  9012. 80038e0: 60b8 str r0, [r7, #8]
  9013. huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate);
  9014. 80038e2: 68bb ldr r3, [r7, #8]
  9015. 80038e4: 461d mov r5, r3
  9016. 80038e6: f04f 0600 mov.w r6, #0
  9017. 80038ea: 46a8 mov r8, r5
  9018. 80038ec: 46b1 mov r9, r6
  9019. 80038ee: eb18 0308 adds.w r3, r8, r8
  9020. 80038f2: eb49 0409 adc.w r4, r9, r9
  9021. 80038f6: 4698 mov r8, r3
  9022. 80038f8: 46a1 mov r9, r4
  9023. 80038fa: eb18 0805 adds.w r8, r8, r5
  9024. 80038fe: eb49 0906 adc.w r9, r9, r6
  9025. 8003902: f04f 0100 mov.w r1, #0
  9026. 8003906: f04f 0200 mov.w r2, #0
  9027. 800390a: ea4f 02c9 mov.w r2, r9, lsl #3
  9028. 800390e: ea42 7258 orr.w r2, r2, r8, lsr #29
  9029. 8003912: ea4f 01c8 mov.w r1, r8, lsl #3
  9030. 8003916: 4688 mov r8, r1
  9031. 8003918: 4691 mov r9, r2
  9032. 800391a: eb18 0005 adds.w r0, r8, r5
  9033. 800391e: eb49 0106 adc.w r1, r9, r6
  9034. 8003922: 687b ldr r3, [r7, #4]
  9035. 8003924: 685b ldr r3, [r3, #4]
  9036. 8003926: 461d mov r5, r3
  9037. 8003928: f04f 0600 mov.w r6, #0
  9038. 800392c: 196b adds r3, r5, r5
  9039. 800392e: eb46 0406 adc.w r4, r6, r6
  9040. 8003932: 461a mov r2, r3
  9041. 8003934: 4623 mov r3, r4
  9042. 8003936: f7fc fc55 bl 80001e4 <__aeabi_uldivmod>
  9043. 800393a: 4603 mov r3, r0
  9044. 800393c: 460c mov r4, r1
  9045. 800393e: 461a mov r2, r3
  9046. 8003940: 4ba5 ldr r3, [pc, #660] ; (8003bd8 <UART_SetConfig+0x384>)
  9047. 8003942: fba3 2302 umull r2, r3, r3, r2
  9048. 8003946: 095b lsrs r3, r3, #5
  9049. 8003948: ea4f 1803 mov.w r8, r3, lsl #4
  9050. 800394c: 68bb ldr r3, [r7, #8]
  9051. 800394e: 461d mov r5, r3
  9052. 8003950: f04f 0600 mov.w r6, #0
  9053. 8003954: 46a9 mov r9, r5
  9054. 8003956: 46b2 mov sl, r6
  9055. 8003958: eb19 0309 adds.w r3, r9, r9
  9056. 800395c: eb4a 040a adc.w r4, sl, sl
  9057. 8003960: 4699 mov r9, r3
  9058. 8003962: 46a2 mov sl, r4
  9059. 8003964: eb19 0905 adds.w r9, r9, r5
  9060. 8003968: eb4a 0a06 adc.w sl, sl, r6
  9061. 800396c: f04f 0100 mov.w r1, #0
  9062. 8003970: f04f 0200 mov.w r2, #0
  9063. 8003974: ea4f 02ca mov.w r2, sl, lsl #3
  9064. 8003978: ea42 7259 orr.w r2, r2, r9, lsr #29
  9065. 800397c: ea4f 01c9 mov.w r1, r9, lsl #3
  9066. 8003980: 4689 mov r9, r1
  9067. 8003982: 4692 mov sl, r2
  9068. 8003984: eb19 0005 adds.w r0, r9, r5
  9069. 8003988: eb4a 0106 adc.w r1, sl, r6
  9070. 800398c: 687b ldr r3, [r7, #4]
  9071. 800398e: 685b ldr r3, [r3, #4]
  9072. 8003990: 461d mov r5, r3
  9073. 8003992: f04f 0600 mov.w r6, #0
  9074. 8003996: 196b adds r3, r5, r5
  9075. 8003998: eb46 0406 adc.w r4, r6, r6
  9076. 800399c: 461a mov r2, r3
  9077. 800399e: 4623 mov r3, r4
  9078. 80039a0: f7fc fc20 bl 80001e4 <__aeabi_uldivmod>
  9079. 80039a4: 4603 mov r3, r0
  9080. 80039a6: 460c mov r4, r1
  9081. 80039a8: 461a mov r2, r3
  9082. 80039aa: 4b8b ldr r3, [pc, #556] ; (8003bd8 <UART_SetConfig+0x384>)
  9083. 80039ac: fba3 1302 umull r1, r3, r3, r2
  9084. 80039b0: 095b lsrs r3, r3, #5
  9085. 80039b2: 2164 movs r1, #100 ; 0x64
  9086. 80039b4: fb01 f303 mul.w r3, r1, r3
  9087. 80039b8: 1ad3 subs r3, r2, r3
  9088. 80039ba: 00db lsls r3, r3, #3
  9089. 80039bc: 3332 adds r3, #50 ; 0x32
  9090. 80039be: 4a86 ldr r2, [pc, #536] ; (8003bd8 <UART_SetConfig+0x384>)
  9091. 80039c0: fba2 2303 umull r2, r3, r2, r3
  9092. 80039c4: 095b lsrs r3, r3, #5
  9093. 80039c6: 005b lsls r3, r3, #1
  9094. 80039c8: f403 73f8 and.w r3, r3, #496 ; 0x1f0
  9095. 80039cc: 4498 add r8, r3
  9096. 80039ce: 68bb ldr r3, [r7, #8]
  9097. 80039d0: 461d mov r5, r3
  9098. 80039d2: f04f 0600 mov.w r6, #0
  9099. 80039d6: 46a9 mov r9, r5
  9100. 80039d8: 46b2 mov sl, r6
  9101. 80039da: eb19 0309 adds.w r3, r9, r9
  9102. 80039de: eb4a 040a adc.w r4, sl, sl
  9103. 80039e2: 4699 mov r9, r3
  9104. 80039e4: 46a2 mov sl, r4
  9105. 80039e6: eb19 0905 adds.w r9, r9, r5
  9106. 80039ea: eb4a 0a06 adc.w sl, sl, r6
  9107. 80039ee: f04f 0100 mov.w r1, #0
  9108. 80039f2: f04f 0200 mov.w r2, #0
  9109. 80039f6: ea4f 02ca mov.w r2, sl, lsl #3
  9110. 80039fa: ea42 7259 orr.w r2, r2, r9, lsr #29
  9111. 80039fe: ea4f 01c9 mov.w r1, r9, lsl #3
  9112. 8003a02: 4689 mov r9, r1
  9113. 8003a04: 4692 mov sl, r2
  9114. 8003a06: eb19 0005 adds.w r0, r9, r5
  9115. 8003a0a: eb4a 0106 adc.w r1, sl, r6
  9116. 8003a0e: 687b ldr r3, [r7, #4]
  9117. 8003a10: 685b ldr r3, [r3, #4]
  9118. 8003a12: 461d mov r5, r3
  9119. 8003a14: f04f 0600 mov.w r6, #0
  9120. 8003a18: 196b adds r3, r5, r5
  9121. 8003a1a: eb46 0406 adc.w r4, r6, r6
  9122. 8003a1e: 461a mov r2, r3
  9123. 8003a20: 4623 mov r3, r4
  9124. 8003a22: f7fc fbdf bl 80001e4 <__aeabi_uldivmod>
  9125. 8003a26: 4603 mov r3, r0
  9126. 8003a28: 460c mov r4, r1
  9127. 8003a2a: 461a mov r2, r3
  9128. 8003a2c: 4b6a ldr r3, [pc, #424] ; (8003bd8 <UART_SetConfig+0x384>)
  9129. 8003a2e: fba3 1302 umull r1, r3, r3, r2
  9130. 8003a32: 095b lsrs r3, r3, #5
  9131. 8003a34: 2164 movs r1, #100 ; 0x64
  9132. 8003a36: fb01 f303 mul.w r3, r1, r3
  9133. 8003a3a: 1ad3 subs r3, r2, r3
  9134. 8003a3c: 00db lsls r3, r3, #3
  9135. 8003a3e: 3332 adds r3, #50 ; 0x32
  9136. 8003a40: 4a65 ldr r2, [pc, #404] ; (8003bd8 <UART_SetConfig+0x384>)
  9137. 8003a42: fba2 2303 umull r2, r3, r2, r3
  9138. 8003a46: 095b lsrs r3, r3, #5
  9139. 8003a48: f003 0207 and.w r2, r3, #7
  9140. 8003a4c: 687b ldr r3, [r7, #4]
  9141. 8003a4e: 681b ldr r3, [r3, #0]
  9142. 8003a50: 4442 add r2, r8
  9143. 8003a52: 609a str r2, [r3, #8]
  9144. 8003a54: e26f b.n 8003f36 <UART_SetConfig+0x6e2>
  9145. huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate);
  9146. }
  9147. #endif /* USART6 */
  9148. else
  9149. {
  9150. pclk = HAL_RCC_GetPCLK1Freq();
  9151. 8003a56: f7ff f9bf bl 8002dd8 <HAL_RCC_GetPCLK1Freq>
  9152. 8003a5a: 60b8 str r0, [r7, #8]
  9153. huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate);
  9154. 8003a5c: 68bb ldr r3, [r7, #8]
  9155. 8003a5e: 461d mov r5, r3
  9156. 8003a60: f04f 0600 mov.w r6, #0
  9157. 8003a64: 46a8 mov r8, r5
  9158. 8003a66: 46b1 mov r9, r6
  9159. 8003a68: eb18 0308 adds.w r3, r8, r8
  9160. 8003a6c: eb49 0409 adc.w r4, r9, r9
  9161. 8003a70: 4698 mov r8, r3
  9162. 8003a72: 46a1 mov r9, r4
  9163. 8003a74: eb18 0805 adds.w r8, r8, r5
  9164. 8003a78: eb49 0906 adc.w r9, r9, r6
  9165. 8003a7c: f04f 0100 mov.w r1, #0
  9166. 8003a80: f04f 0200 mov.w r2, #0
  9167. 8003a84: ea4f 02c9 mov.w r2, r9, lsl #3
  9168. 8003a88: ea42 7258 orr.w r2, r2, r8, lsr #29
  9169. 8003a8c: ea4f 01c8 mov.w r1, r8, lsl #3
  9170. 8003a90: 4688 mov r8, r1
  9171. 8003a92: 4691 mov r9, r2
  9172. 8003a94: eb18 0005 adds.w r0, r8, r5
  9173. 8003a98: eb49 0106 adc.w r1, r9, r6
  9174. 8003a9c: 687b ldr r3, [r7, #4]
  9175. 8003a9e: 685b ldr r3, [r3, #4]
  9176. 8003aa0: 461d mov r5, r3
  9177. 8003aa2: f04f 0600 mov.w r6, #0
  9178. 8003aa6: 196b adds r3, r5, r5
  9179. 8003aa8: eb46 0406 adc.w r4, r6, r6
  9180. 8003aac: 461a mov r2, r3
  9181. 8003aae: 4623 mov r3, r4
  9182. 8003ab0: f7fc fb98 bl 80001e4 <__aeabi_uldivmod>
  9183. 8003ab4: 4603 mov r3, r0
  9184. 8003ab6: 460c mov r4, r1
  9185. 8003ab8: 461a mov r2, r3
  9186. 8003aba: 4b47 ldr r3, [pc, #284] ; (8003bd8 <UART_SetConfig+0x384>)
  9187. 8003abc: fba3 2302 umull r2, r3, r3, r2
  9188. 8003ac0: 095b lsrs r3, r3, #5
  9189. 8003ac2: ea4f 1803 mov.w r8, r3, lsl #4
  9190. 8003ac6: 68bb ldr r3, [r7, #8]
  9191. 8003ac8: 461d mov r5, r3
  9192. 8003aca: f04f 0600 mov.w r6, #0
  9193. 8003ace: 46a9 mov r9, r5
  9194. 8003ad0: 46b2 mov sl, r6
  9195. 8003ad2: eb19 0309 adds.w r3, r9, r9
  9196. 8003ad6: eb4a 040a adc.w r4, sl, sl
  9197. 8003ada: 4699 mov r9, r3
  9198. 8003adc: 46a2 mov sl, r4
  9199. 8003ade: eb19 0905 adds.w r9, r9, r5
  9200. 8003ae2: eb4a 0a06 adc.w sl, sl, r6
  9201. 8003ae6: f04f 0100 mov.w r1, #0
  9202. 8003aea: f04f 0200 mov.w r2, #0
  9203. 8003aee: ea4f 02ca mov.w r2, sl, lsl #3
  9204. 8003af2: ea42 7259 orr.w r2, r2, r9, lsr #29
  9205. 8003af6: ea4f 01c9 mov.w r1, r9, lsl #3
  9206. 8003afa: 4689 mov r9, r1
  9207. 8003afc: 4692 mov sl, r2
  9208. 8003afe: eb19 0005 adds.w r0, r9, r5
  9209. 8003b02: eb4a 0106 adc.w r1, sl, r6
  9210. 8003b06: 687b ldr r3, [r7, #4]
  9211. 8003b08: 685b ldr r3, [r3, #4]
  9212. 8003b0a: 461d mov r5, r3
  9213. 8003b0c: f04f 0600 mov.w r6, #0
  9214. 8003b10: 196b adds r3, r5, r5
  9215. 8003b12: eb46 0406 adc.w r4, r6, r6
  9216. 8003b16: 461a mov r2, r3
  9217. 8003b18: 4623 mov r3, r4
  9218. 8003b1a: f7fc fb63 bl 80001e4 <__aeabi_uldivmod>
  9219. 8003b1e: 4603 mov r3, r0
  9220. 8003b20: 460c mov r4, r1
  9221. 8003b22: 461a mov r2, r3
  9222. 8003b24: 4b2c ldr r3, [pc, #176] ; (8003bd8 <UART_SetConfig+0x384>)
  9223. 8003b26: fba3 1302 umull r1, r3, r3, r2
  9224. 8003b2a: 095b lsrs r3, r3, #5
  9225. 8003b2c: 2164 movs r1, #100 ; 0x64
  9226. 8003b2e: fb01 f303 mul.w r3, r1, r3
  9227. 8003b32: 1ad3 subs r3, r2, r3
  9228. 8003b34: 00db lsls r3, r3, #3
  9229. 8003b36: 3332 adds r3, #50 ; 0x32
  9230. 8003b38: 4a27 ldr r2, [pc, #156] ; (8003bd8 <UART_SetConfig+0x384>)
  9231. 8003b3a: fba2 2303 umull r2, r3, r2, r3
  9232. 8003b3e: 095b lsrs r3, r3, #5
  9233. 8003b40: 005b lsls r3, r3, #1
  9234. 8003b42: f403 73f8 and.w r3, r3, #496 ; 0x1f0
  9235. 8003b46: 4498 add r8, r3
  9236. 8003b48: 68bb ldr r3, [r7, #8]
  9237. 8003b4a: 461d mov r5, r3
  9238. 8003b4c: f04f 0600 mov.w r6, #0
  9239. 8003b50: 46a9 mov r9, r5
  9240. 8003b52: 46b2 mov sl, r6
  9241. 8003b54: eb19 0309 adds.w r3, r9, r9
  9242. 8003b58: eb4a 040a adc.w r4, sl, sl
  9243. 8003b5c: 4699 mov r9, r3
  9244. 8003b5e: 46a2 mov sl, r4
  9245. 8003b60: eb19 0905 adds.w r9, r9, r5
  9246. 8003b64: eb4a 0a06 adc.w sl, sl, r6
  9247. 8003b68: f04f 0100 mov.w r1, #0
  9248. 8003b6c: f04f 0200 mov.w r2, #0
  9249. 8003b70: ea4f 02ca mov.w r2, sl, lsl #3
  9250. 8003b74: ea42 7259 orr.w r2, r2, r9, lsr #29
  9251. 8003b78: ea4f 01c9 mov.w r1, r9, lsl #3
  9252. 8003b7c: 4689 mov r9, r1
  9253. 8003b7e: 4692 mov sl, r2
  9254. 8003b80: eb19 0005 adds.w r0, r9, r5
  9255. 8003b84: eb4a 0106 adc.w r1, sl, r6
  9256. 8003b88: 687b ldr r3, [r7, #4]
  9257. 8003b8a: 685b ldr r3, [r3, #4]
  9258. 8003b8c: 461d mov r5, r3
  9259. 8003b8e: f04f 0600 mov.w r6, #0
  9260. 8003b92: 196b adds r3, r5, r5
  9261. 8003b94: eb46 0406 adc.w r4, r6, r6
  9262. 8003b98: 461a mov r2, r3
  9263. 8003b9a: 4623 mov r3, r4
  9264. 8003b9c: f7fc fb22 bl 80001e4 <__aeabi_uldivmod>
  9265. 8003ba0: 4603 mov r3, r0
  9266. 8003ba2: 460c mov r4, r1
  9267. 8003ba4: 461a mov r2, r3
  9268. 8003ba6: 4b0c ldr r3, [pc, #48] ; (8003bd8 <UART_SetConfig+0x384>)
  9269. 8003ba8: fba3 1302 umull r1, r3, r3, r2
  9270. 8003bac: 095b lsrs r3, r3, #5
  9271. 8003bae: 2164 movs r1, #100 ; 0x64
  9272. 8003bb0: fb01 f303 mul.w r3, r1, r3
  9273. 8003bb4: 1ad3 subs r3, r2, r3
  9274. 8003bb6: 00db lsls r3, r3, #3
  9275. 8003bb8: 3332 adds r3, #50 ; 0x32
  9276. 8003bba: 4a07 ldr r2, [pc, #28] ; (8003bd8 <UART_SetConfig+0x384>)
  9277. 8003bbc: fba2 2303 umull r2, r3, r2, r3
  9278. 8003bc0: 095b lsrs r3, r3, #5
  9279. 8003bc2: f003 0207 and.w r2, r3, #7
  9280. 8003bc6: 687b ldr r3, [r7, #4]
  9281. 8003bc8: 681b ldr r3, [r3, #0]
  9282. 8003bca: 4442 add r2, r8
  9283. 8003bcc: 609a str r2, [r3, #8]
  9284. {
  9285. pclk = HAL_RCC_GetPCLK1Freq();
  9286. huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate);
  9287. }
  9288. }
  9289. }
  9290. 8003bce: e1b2 b.n 8003f36 <UART_SetConfig+0x6e2>
  9291. 8003bd0: 40011000 .word 0x40011000
  9292. 8003bd4: 40011400 .word 0x40011400
  9293. 8003bd8: 51eb851f .word 0x51eb851f
  9294. if ((huart->Instance == USART1) || (huart->Instance == USART6))
  9295. 8003bdc: 687b ldr r3, [r7, #4]
  9296. 8003bde: 681b ldr r3, [r3, #0]
  9297. 8003be0: 4ad7 ldr r2, [pc, #860] ; (8003f40 <UART_SetConfig+0x6ec>)
  9298. 8003be2: 4293 cmp r3, r2
  9299. 8003be4: d005 beq.n 8003bf2 <UART_SetConfig+0x39e>
  9300. 8003be6: 687b ldr r3, [r7, #4]
  9301. 8003be8: 681b ldr r3, [r3, #0]
  9302. 8003bea: 4ad6 ldr r2, [pc, #856] ; (8003f44 <UART_SetConfig+0x6f0>)
  9303. 8003bec: 4293 cmp r3, r2
  9304. 8003bee: f040 80d1 bne.w 8003d94 <UART_SetConfig+0x540>
  9305. pclk = HAL_RCC_GetPCLK2Freq();
  9306. 8003bf2: f7ff f905 bl 8002e00 <HAL_RCC_GetPCLK2Freq>
  9307. 8003bf6: 60b8 str r0, [r7, #8]
  9308. huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate);
  9309. 8003bf8: 68bb ldr r3, [r7, #8]
  9310. 8003bfa: 469a mov sl, r3
  9311. 8003bfc: f04f 0b00 mov.w fp, #0
  9312. 8003c00: 46d0 mov r8, sl
  9313. 8003c02: 46d9 mov r9, fp
  9314. 8003c04: eb18 0308 adds.w r3, r8, r8
  9315. 8003c08: eb49 0409 adc.w r4, r9, r9
  9316. 8003c0c: 4698 mov r8, r3
  9317. 8003c0e: 46a1 mov r9, r4
  9318. 8003c10: eb18 080a adds.w r8, r8, sl
  9319. 8003c14: eb49 090b adc.w r9, r9, fp
  9320. 8003c18: f04f 0100 mov.w r1, #0
  9321. 8003c1c: f04f 0200 mov.w r2, #0
  9322. 8003c20: ea4f 02c9 mov.w r2, r9, lsl #3
  9323. 8003c24: ea42 7258 orr.w r2, r2, r8, lsr #29
  9324. 8003c28: ea4f 01c8 mov.w r1, r8, lsl #3
  9325. 8003c2c: 4688 mov r8, r1
  9326. 8003c2e: 4691 mov r9, r2
  9327. 8003c30: eb1a 0508 adds.w r5, sl, r8
  9328. 8003c34: eb4b 0609 adc.w r6, fp, r9
  9329. 8003c38: 687b ldr r3, [r7, #4]
  9330. 8003c3a: 685b ldr r3, [r3, #4]
  9331. 8003c3c: 4619 mov r1, r3
  9332. 8003c3e: f04f 0200 mov.w r2, #0
  9333. 8003c42: f04f 0300 mov.w r3, #0
  9334. 8003c46: f04f 0400 mov.w r4, #0
  9335. 8003c4a: 0094 lsls r4, r2, #2
  9336. 8003c4c: ea44 7491 orr.w r4, r4, r1, lsr #30
  9337. 8003c50: 008b lsls r3, r1, #2
  9338. 8003c52: 461a mov r2, r3
  9339. 8003c54: 4623 mov r3, r4
  9340. 8003c56: 4628 mov r0, r5
  9341. 8003c58: 4631 mov r1, r6
  9342. 8003c5a: f7fc fac3 bl 80001e4 <__aeabi_uldivmod>
  9343. 8003c5e: 4603 mov r3, r0
  9344. 8003c60: 460c mov r4, r1
  9345. 8003c62: 461a mov r2, r3
  9346. 8003c64: 4bb8 ldr r3, [pc, #736] ; (8003f48 <UART_SetConfig+0x6f4>)
  9347. 8003c66: fba3 2302 umull r2, r3, r3, r2
  9348. 8003c6a: 095b lsrs r3, r3, #5
  9349. 8003c6c: ea4f 1803 mov.w r8, r3, lsl #4
  9350. 8003c70: 68bb ldr r3, [r7, #8]
  9351. 8003c72: 469b mov fp, r3
  9352. 8003c74: f04f 0c00 mov.w ip, #0
  9353. 8003c78: 46d9 mov r9, fp
  9354. 8003c7a: 46e2 mov sl, ip
  9355. 8003c7c: eb19 0309 adds.w r3, r9, r9
  9356. 8003c80: eb4a 040a adc.w r4, sl, sl
  9357. 8003c84: 4699 mov r9, r3
  9358. 8003c86: 46a2 mov sl, r4
  9359. 8003c88: eb19 090b adds.w r9, r9, fp
  9360. 8003c8c: eb4a 0a0c adc.w sl, sl, ip
  9361. 8003c90: f04f 0100 mov.w r1, #0
  9362. 8003c94: f04f 0200 mov.w r2, #0
  9363. 8003c98: ea4f 02ca mov.w r2, sl, lsl #3
  9364. 8003c9c: ea42 7259 orr.w r2, r2, r9, lsr #29
  9365. 8003ca0: ea4f 01c9 mov.w r1, r9, lsl #3
  9366. 8003ca4: 4689 mov r9, r1
  9367. 8003ca6: 4692 mov sl, r2
  9368. 8003ca8: eb1b 0509 adds.w r5, fp, r9
  9369. 8003cac: eb4c 060a adc.w r6, ip, sl
  9370. 8003cb0: 687b ldr r3, [r7, #4]
  9371. 8003cb2: 685b ldr r3, [r3, #4]
  9372. 8003cb4: 4619 mov r1, r3
  9373. 8003cb6: f04f 0200 mov.w r2, #0
  9374. 8003cba: f04f 0300 mov.w r3, #0
  9375. 8003cbe: f04f 0400 mov.w r4, #0
  9376. 8003cc2: 0094 lsls r4, r2, #2
  9377. 8003cc4: ea44 7491 orr.w r4, r4, r1, lsr #30
  9378. 8003cc8: 008b lsls r3, r1, #2
  9379. 8003cca: 461a mov r2, r3
  9380. 8003ccc: 4623 mov r3, r4
  9381. 8003cce: 4628 mov r0, r5
  9382. 8003cd0: 4631 mov r1, r6
  9383. 8003cd2: f7fc fa87 bl 80001e4 <__aeabi_uldivmod>
  9384. 8003cd6: 4603 mov r3, r0
  9385. 8003cd8: 460c mov r4, r1
  9386. 8003cda: 461a mov r2, r3
  9387. 8003cdc: 4b9a ldr r3, [pc, #616] ; (8003f48 <UART_SetConfig+0x6f4>)
  9388. 8003cde: fba3 1302 umull r1, r3, r3, r2
  9389. 8003ce2: 095b lsrs r3, r3, #5
  9390. 8003ce4: 2164 movs r1, #100 ; 0x64
  9391. 8003ce6: fb01 f303 mul.w r3, r1, r3
  9392. 8003cea: 1ad3 subs r3, r2, r3
  9393. 8003cec: 011b lsls r3, r3, #4
  9394. 8003cee: 3332 adds r3, #50 ; 0x32
  9395. 8003cf0: 4a95 ldr r2, [pc, #596] ; (8003f48 <UART_SetConfig+0x6f4>)
  9396. 8003cf2: fba2 2303 umull r2, r3, r2, r3
  9397. 8003cf6: 095b lsrs r3, r3, #5
  9398. 8003cf8: f003 03f0 and.w r3, r3, #240 ; 0xf0
  9399. 8003cfc: 4498 add r8, r3
  9400. 8003cfe: 68bb ldr r3, [r7, #8]
  9401. 8003d00: 469b mov fp, r3
  9402. 8003d02: f04f 0c00 mov.w ip, #0
  9403. 8003d06: 46d9 mov r9, fp
  9404. 8003d08: 46e2 mov sl, ip
  9405. 8003d0a: eb19 0309 adds.w r3, r9, r9
  9406. 8003d0e: eb4a 040a adc.w r4, sl, sl
  9407. 8003d12: 4699 mov r9, r3
  9408. 8003d14: 46a2 mov sl, r4
  9409. 8003d16: eb19 090b adds.w r9, r9, fp
  9410. 8003d1a: eb4a 0a0c adc.w sl, sl, ip
  9411. 8003d1e: f04f 0100 mov.w r1, #0
  9412. 8003d22: f04f 0200 mov.w r2, #0
  9413. 8003d26: ea4f 02ca mov.w r2, sl, lsl #3
  9414. 8003d2a: ea42 7259 orr.w r2, r2, r9, lsr #29
  9415. 8003d2e: ea4f 01c9 mov.w r1, r9, lsl #3
  9416. 8003d32: 4689 mov r9, r1
  9417. 8003d34: 4692 mov sl, r2
  9418. 8003d36: eb1b 0509 adds.w r5, fp, r9
  9419. 8003d3a: eb4c 060a adc.w r6, ip, sl
  9420. 8003d3e: 687b ldr r3, [r7, #4]
  9421. 8003d40: 685b ldr r3, [r3, #4]
  9422. 8003d42: 4619 mov r1, r3
  9423. 8003d44: f04f 0200 mov.w r2, #0
  9424. 8003d48: f04f 0300 mov.w r3, #0
  9425. 8003d4c: f04f 0400 mov.w r4, #0
  9426. 8003d50: 0094 lsls r4, r2, #2
  9427. 8003d52: ea44 7491 orr.w r4, r4, r1, lsr #30
  9428. 8003d56: 008b lsls r3, r1, #2
  9429. 8003d58: 461a mov r2, r3
  9430. 8003d5a: 4623 mov r3, r4
  9431. 8003d5c: 4628 mov r0, r5
  9432. 8003d5e: 4631 mov r1, r6
  9433. 8003d60: f7fc fa40 bl 80001e4 <__aeabi_uldivmod>
  9434. 8003d64: 4603 mov r3, r0
  9435. 8003d66: 460c mov r4, r1
  9436. 8003d68: 461a mov r2, r3
  9437. 8003d6a: 4b77 ldr r3, [pc, #476] ; (8003f48 <UART_SetConfig+0x6f4>)
  9438. 8003d6c: fba3 1302 umull r1, r3, r3, r2
  9439. 8003d70: 095b lsrs r3, r3, #5
  9440. 8003d72: 2164 movs r1, #100 ; 0x64
  9441. 8003d74: fb01 f303 mul.w r3, r1, r3
  9442. 8003d78: 1ad3 subs r3, r2, r3
  9443. 8003d7a: 011b lsls r3, r3, #4
  9444. 8003d7c: 3332 adds r3, #50 ; 0x32
  9445. 8003d7e: 4a72 ldr r2, [pc, #456] ; (8003f48 <UART_SetConfig+0x6f4>)
  9446. 8003d80: fba2 2303 umull r2, r3, r2, r3
  9447. 8003d84: 095b lsrs r3, r3, #5
  9448. 8003d86: f003 020f and.w r2, r3, #15
  9449. 8003d8a: 687b ldr r3, [r7, #4]
  9450. 8003d8c: 681b ldr r3, [r3, #0]
  9451. 8003d8e: 4442 add r2, r8
  9452. 8003d90: 609a str r2, [r3, #8]
  9453. 8003d92: e0d0 b.n 8003f36 <UART_SetConfig+0x6e2>
  9454. pclk = HAL_RCC_GetPCLK1Freq();
  9455. 8003d94: f7ff f820 bl 8002dd8 <HAL_RCC_GetPCLK1Freq>
  9456. 8003d98: 60b8 str r0, [r7, #8]
  9457. huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate);
  9458. 8003d9a: 68bb ldr r3, [r7, #8]
  9459. 8003d9c: 469a mov sl, r3
  9460. 8003d9e: f04f 0b00 mov.w fp, #0
  9461. 8003da2: 46d0 mov r8, sl
  9462. 8003da4: 46d9 mov r9, fp
  9463. 8003da6: eb18 0308 adds.w r3, r8, r8
  9464. 8003daa: eb49 0409 adc.w r4, r9, r9
  9465. 8003dae: 4698 mov r8, r3
  9466. 8003db0: 46a1 mov r9, r4
  9467. 8003db2: eb18 080a adds.w r8, r8, sl
  9468. 8003db6: eb49 090b adc.w r9, r9, fp
  9469. 8003dba: f04f 0100 mov.w r1, #0
  9470. 8003dbe: f04f 0200 mov.w r2, #0
  9471. 8003dc2: ea4f 02c9 mov.w r2, r9, lsl #3
  9472. 8003dc6: ea42 7258 orr.w r2, r2, r8, lsr #29
  9473. 8003dca: ea4f 01c8 mov.w r1, r8, lsl #3
  9474. 8003dce: 4688 mov r8, r1
  9475. 8003dd0: 4691 mov r9, r2
  9476. 8003dd2: eb1a 0508 adds.w r5, sl, r8
  9477. 8003dd6: eb4b 0609 adc.w r6, fp, r9
  9478. 8003dda: 687b ldr r3, [r7, #4]
  9479. 8003ddc: 685b ldr r3, [r3, #4]
  9480. 8003dde: 4619 mov r1, r3
  9481. 8003de0: f04f 0200 mov.w r2, #0
  9482. 8003de4: f04f 0300 mov.w r3, #0
  9483. 8003de8: f04f 0400 mov.w r4, #0
  9484. 8003dec: 0094 lsls r4, r2, #2
  9485. 8003dee: ea44 7491 orr.w r4, r4, r1, lsr #30
  9486. 8003df2: 008b lsls r3, r1, #2
  9487. 8003df4: 461a mov r2, r3
  9488. 8003df6: 4623 mov r3, r4
  9489. 8003df8: 4628 mov r0, r5
  9490. 8003dfa: 4631 mov r1, r6
  9491. 8003dfc: f7fc f9f2 bl 80001e4 <__aeabi_uldivmod>
  9492. 8003e00: 4603 mov r3, r0
  9493. 8003e02: 460c mov r4, r1
  9494. 8003e04: 461a mov r2, r3
  9495. 8003e06: 4b50 ldr r3, [pc, #320] ; (8003f48 <UART_SetConfig+0x6f4>)
  9496. 8003e08: fba3 2302 umull r2, r3, r3, r2
  9497. 8003e0c: 095b lsrs r3, r3, #5
  9498. 8003e0e: ea4f 1803 mov.w r8, r3, lsl #4
  9499. 8003e12: 68bb ldr r3, [r7, #8]
  9500. 8003e14: 469b mov fp, r3
  9501. 8003e16: f04f 0c00 mov.w ip, #0
  9502. 8003e1a: 46d9 mov r9, fp
  9503. 8003e1c: 46e2 mov sl, ip
  9504. 8003e1e: eb19 0309 adds.w r3, r9, r9
  9505. 8003e22: eb4a 040a adc.w r4, sl, sl
  9506. 8003e26: 4699 mov r9, r3
  9507. 8003e28: 46a2 mov sl, r4
  9508. 8003e2a: eb19 090b adds.w r9, r9, fp
  9509. 8003e2e: eb4a 0a0c adc.w sl, sl, ip
  9510. 8003e32: f04f 0100 mov.w r1, #0
  9511. 8003e36: f04f 0200 mov.w r2, #0
  9512. 8003e3a: ea4f 02ca mov.w r2, sl, lsl #3
  9513. 8003e3e: ea42 7259 orr.w r2, r2, r9, lsr #29
  9514. 8003e42: ea4f 01c9 mov.w r1, r9, lsl #3
  9515. 8003e46: 4689 mov r9, r1
  9516. 8003e48: 4692 mov sl, r2
  9517. 8003e4a: eb1b 0509 adds.w r5, fp, r9
  9518. 8003e4e: eb4c 060a adc.w r6, ip, sl
  9519. 8003e52: 687b ldr r3, [r7, #4]
  9520. 8003e54: 685b ldr r3, [r3, #4]
  9521. 8003e56: 4619 mov r1, r3
  9522. 8003e58: f04f 0200 mov.w r2, #0
  9523. 8003e5c: f04f 0300 mov.w r3, #0
  9524. 8003e60: f04f 0400 mov.w r4, #0
  9525. 8003e64: 0094 lsls r4, r2, #2
  9526. 8003e66: ea44 7491 orr.w r4, r4, r1, lsr #30
  9527. 8003e6a: 008b lsls r3, r1, #2
  9528. 8003e6c: 461a mov r2, r3
  9529. 8003e6e: 4623 mov r3, r4
  9530. 8003e70: 4628 mov r0, r5
  9531. 8003e72: 4631 mov r1, r6
  9532. 8003e74: f7fc f9b6 bl 80001e4 <__aeabi_uldivmod>
  9533. 8003e78: 4603 mov r3, r0
  9534. 8003e7a: 460c mov r4, r1
  9535. 8003e7c: 461a mov r2, r3
  9536. 8003e7e: 4b32 ldr r3, [pc, #200] ; (8003f48 <UART_SetConfig+0x6f4>)
  9537. 8003e80: fba3 1302 umull r1, r3, r3, r2
  9538. 8003e84: 095b lsrs r3, r3, #5
  9539. 8003e86: 2164 movs r1, #100 ; 0x64
  9540. 8003e88: fb01 f303 mul.w r3, r1, r3
  9541. 8003e8c: 1ad3 subs r3, r2, r3
  9542. 8003e8e: 011b lsls r3, r3, #4
  9543. 8003e90: 3332 adds r3, #50 ; 0x32
  9544. 8003e92: 4a2d ldr r2, [pc, #180] ; (8003f48 <UART_SetConfig+0x6f4>)
  9545. 8003e94: fba2 2303 umull r2, r3, r2, r3
  9546. 8003e98: 095b lsrs r3, r3, #5
  9547. 8003e9a: f003 03f0 and.w r3, r3, #240 ; 0xf0
  9548. 8003e9e: 4498 add r8, r3
  9549. 8003ea0: 68bb ldr r3, [r7, #8]
  9550. 8003ea2: 469b mov fp, r3
  9551. 8003ea4: f04f 0c00 mov.w ip, #0
  9552. 8003ea8: 46d9 mov r9, fp
  9553. 8003eaa: 46e2 mov sl, ip
  9554. 8003eac: eb19 0309 adds.w r3, r9, r9
  9555. 8003eb0: eb4a 040a adc.w r4, sl, sl
  9556. 8003eb4: 4699 mov r9, r3
  9557. 8003eb6: 46a2 mov sl, r4
  9558. 8003eb8: eb19 090b adds.w r9, r9, fp
  9559. 8003ebc: eb4a 0a0c adc.w sl, sl, ip
  9560. 8003ec0: f04f 0100 mov.w r1, #0
  9561. 8003ec4: f04f 0200 mov.w r2, #0
  9562. 8003ec8: ea4f 02ca mov.w r2, sl, lsl #3
  9563. 8003ecc: ea42 7259 orr.w r2, r2, r9, lsr #29
  9564. 8003ed0: ea4f 01c9 mov.w r1, r9, lsl #3
  9565. 8003ed4: 4689 mov r9, r1
  9566. 8003ed6: 4692 mov sl, r2
  9567. 8003ed8: eb1b 0509 adds.w r5, fp, r9
  9568. 8003edc: eb4c 060a adc.w r6, ip, sl
  9569. 8003ee0: 687b ldr r3, [r7, #4]
  9570. 8003ee2: 685b ldr r3, [r3, #4]
  9571. 8003ee4: 4619 mov r1, r3
  9572. 8003ee6: f04f 0200 mov.w r2, #0
  9573. 8003eea: f04f 0300 mov.w r3, #0
  9574. 8003eee: f04f 0400 mov.w r4, #0
  9575. 8003ef2: 0094 lsls r4, r2, #2
  9576. 8003ef4: ea44 7491 orr.w r4, r4, r1, lsr #30
  9577. 8003ef8: 008b lsls r3, r1, #2
  9578. 8003efa: 461a mov r2, r3
  9579. 8003efc: 4623 mov r3, r4
  9580. 8003efe: 4628 mov r0, r5
  9581. 8003f00: 4631 mov r1, r6
  9582. 8003f02: f7fc f96f bl 80001e4 <__aeabi_uldivmod>
  9583. 8003f06: 4603 mov r3, r0
  9584. 8003f08: 460c mov r4, r1
  9585. 8003f0a: 461a mov r2, r3
  9586. 8003f0c: 4b0e ldr r3, [pc, #56] ; (8003f48 <UART_SetConfig+0x6f4>)
  9587. 8003f0e: fba3 1302 umull r1, r3, r3, r2
  9588. 8003f12: 095b lsrs r3, r3, #5
  9589. 8003f14: 2164 movs r1, #100 ; 0x64
  9590. 8003f16: fb01 f303 mul.w r3, r1, r3
  9591. 8003f1a: 1ad3 subs r3, r2, r3
  9592. 8003f1c: 011b lsls r3, r3, #4
  9593. 8003f1e: 3332 adds r3, #50 ; 0x32
  9594. 8003f20: 4a09 ldr r2, [pc, #36] ; (8003f48 <UART_SetConfig+0x6f4>)
  9595. 8003f22: fba2 2303 umull r2, r3, r2, r3
  9596. 8003f26: 095b lsrs r3, r3, #5
  9597. 8003f28: f003 020f and.w r2, r3, #15
  9598. 8003f2c: 687b ldr r3, [r7, #4]
  9599. 8003f2e: 681b ldr r3, [r3, #0]
  9600. 8003f30: 4442 add r2, r8
  9601. 8003f32: 609a str r2, [r3, #8]
  9602. }
  9603. 8003f34: e7ff b.n 8003f36 <UART_SetConfig+0x6e2>
  9604. 8003f36: bf00 nop
  9605. 8003f38: 3714 adds r7, #20
  9606. 8003f3a: 46bd mov sp, r7
  9607. 8003f3c: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
  9608. 8003f40: 40011000 .word 0x40011000
  9609. 8003f44: 40011400 .word 0x40011400
  9610. 8003f48: 51eb851f .word 0x51eb851f
  9611. 08003f4c <MX_FATFS_Init>:
  9612. /* USER CODE BEGIN Variables */
  9613. /* USER CODE END Variables */
  9614. void MX_FATFS_Init(void)
  9615. {
  9616. 8003f4c: b580 push {r7, lr}
  9617. 8003f4e: af00 add r7, sp, #0
  9618. /*## FatFS: Link the USER driver ###########################*/
  9619. retUSER = FATFS_LinkDriver(&USER_Driver, USERPath);
  9620. 8003f50: 4904 ldr r1, [pc, #16] ; (8003f64 <MX_FATFS_Init+0x18>)
  9621. 8003f52: 4805 ldr r0, [pc, #20] ; (8003f68 <MX_FATFS_Init+0x1c>)
  9622. 8003f54: f002 ff72 bl 8006e3c <FATFS_LinkDriver>
  9623. 8003f58: 4603 mov r3, r0
  9624. 8003f5a: 461a mov r2, r3
  9625. 8003f5c: 4b03 ldr r3, [pc, #12] ; (8003f6c <MX_FATFS_Init+0x20>)
  9626. 8003f5e: 701a strb r2, [r3, #0]
  9627. /* USER CODE BEGIN Init */
  9628. /* additional user code for init */
  9629. /* USER CODE END Init */
  9630. }
  9631. 8003f60: bf00 nop
  9632. 8003f62: bd80 pop {r7, pc}
  9633. 8003f64: 20002444 .word 0x20002444
  9634. 8003f68: 20000010 .word 0x20000010
  9635. 8003f6c: 20002448 .word 0x20002448
  9636. 08003f70 <get_fattime>:
  9637. * @brief Gets Time from RTC
  9638. * @param None
  9639. * @retval Time in DWORD
  9640. */
  9641. DWORD get_fattime(void)
  9642. {
  9643. 8003f70: b480 push {r7}
  9644. 8003f72: af00 add r7, sp, #0
  9645. /* USER CODE BEGIN get_fattime */
  9646. return 0;
  9647. 8003f74: 2300 movs r3, #0
  9648. /* USER CODE END get_fattime */
  9649. }
  9650. 8003f76: 4618 mov r0, r3
  9651. 8003f78: 46bd mov sp, r7
  9652. 8003f7a: f85d 7b04 ldr.w r7, [sp], #4
  9653. 8003f7e: 4770 bx lr
  9654. 08003f80 <USER_initialize>:
  9655. * @retval DSTATUS: Operation status
  9656. */
  9657. DSTATUS USER_initialize (
  9658. BYTE pdrv /* Physical drive nmuber to identify the drive */
  9659. )
  9660. {
  9661. 8003f80: b580 push {r7, lr}
  9662. 8003f82: b082 sub sp, #8
  9663. 8003f84: af00 add r7, sp, #0
  9664. 8003f86: 4603 mov r3, r0
  9665. 8003f88: 71fb strb r3, [r7, #7]
  9666. /* USER CODE BEGIN INIT */
  9667. SD_disk_initialize (pdrv);
  9668. 8003f8a: 79fb ldrb r3, [r7, #7]
  9669. 8003f8c: 4618 mov r0, r3
  9670. 8003f8e: f7fc fc5d bl 800084c <SD_disk_initialize>
  9671. /* USER CODE END INIT */
  9672. }
  9673. 8003f92: bf00 nop
  9674. 8003f94: 4618 mov r0, r3
  9675. 8003f96: 3708 adds r7, #8
  9676. 8003f98: 46bd mov sp, r7
  9677. 8003f9a: bd80 pop {r7, pc}
  9678. 08003f9c <USER_status>:
  9679. * @retval DSTATUS: Operation status
  9680. */
  9681. DSTATUS USER_status (
  9682. BYTE pdrv /* Physical drive number to identify the drive */
  9683. )
  9684. {
  9685. 8003f9c: b580 push {r7, lr}
  9686. 8003f9e: b082 sub sp, #8
  9687. 8003fa0: af00 add r7, sp, #0
  9688. 8003fa2: 4603 mov r3, r0
  9689. 8003fa4: 71fb strb r3, [r7, #7]
  9690. /* USER CODE BEGIN STATUS */
  9691. SD_disk_status (pdrv);
  9692. 8003fa6: 79fb ldrb r3, [r7, #7]
  9693. 8003fa8: 4618 mov r0, r3
  9694. 8003faa: f7fc fd35 bl 8000a18 <SD_disk_status>
  9695. /* USER CODE END STATUS */
  9696. }
  9697. 8003fae: bf00 nop
  9698. 8003fb0: 4618 mov r0, r3
  9699. 8003fb2: 3708 adds r7, #8
  9700. 8003fb4: 46bd mov sp, r7
  9701. 8003fb6: bd80 pop {r7, pc}
  9702. 08003fb8 <USER_read>:
  9703. BYTE pdrv, /* Physical drive nmuber to identify the drive */
  9704. BYTE *buff, /* Data buffer to store read data */
  9705. DWORD sector, /* Sector address in LBA */
  9706. UINT count /* Number of sectors to read */
  9707. )
  9708. {
  9709. 8003fb8: b580 push {r7, lr}
  9710. 8003fba: b084 sub sp, #16
  9711. 8003fbc: af00 add r7, sp, #0
  9712. 8003fbe: 60b9 str r1, [r7, #8]
  9713. 8003fc0: 607a str r2, [r7, #4]
  9714. 8003fc2: 603b str r3, [r7, #0]
  9715. 8003fc4: 4603 mov r3, r0
  9716. 8003fc6: 73fb strb r3, [r7, #15]
  9717. /* USER CODE BEGIN READ */
  9718. SD_disk_read (pdrv, buff, sector, count);
  9719. 8003fc8: 7bf8 ldrb r0, [r7, #15]
  9720. 8003fca: 683b ldr r3, [r7, #0]
  9721. 8003fcc: 687a ldr r2, [r7, #4]
  9722. 8003fce: 68b9 ldr r1, [r7, #8]
  9723. 8003fd0: f7fc fd38 bl 8000a44 <SD_disk_read>
  9724. /* USER CODE END READ */
  9725. }
  9726. 8003fd4: bf00 nop
  9727. 8003fd6: 4618 mov r0, r3
  9728. 8003fd8: 3710 adds r7, #16
  9729. 8003fda: 46bd mov sp, r7
  9730. 8003fdc: bd80 pop {r7, pc}
  9731. 08003fde <USER_write>:
  9732. BYTE pdrv, /* Physical drive nmuber to identify the drive */
  9733. const BYTE *buff, /* Data to be written */
  9734. DWORD sector, /* Sector address in LBA */
  9735. UINT count /* Number of sectors to write */
  9736. )
  9737. {
  9738. 8003fde: b580 push {r7, lr}
  9739. 8003fe0: b084 sub sp, #16
  9740. 8003fe2: af00 add r7, sp, #0
  9741. 8003fe4: 60b9 str r1, [r7, #8]
  9742. 8003fe6: 607a str r2, [r7, #4]
  9743. 8003fe8: 603b str r3, [r7, #0]
  9744. 8003fea: 4603 mov r3, r0
  9745. 8003fec: 73fb strb r3, [r7, #15]
  9746. /* USER CODE BEGIN WRITE */
  9747. /* USER CODE HERE */
  9748. SD_disk_write (pdrv, buff, sector, count);
  9749. 8003fee: 7bf8 ldrb r0, [r7, #15]
  9750. 8003ff0: 683b ldr r3, [r7, #0]
  9751. 8003ff2: 687a ldr r2, [r7, #4]
  9752. 8003ff4: 68b9 ldr r1, [r7, #8]
  9753. 8003ff6: f7fc fd8f bl 8000b18 <SD_disk_write>
  9754. /* USER CODE END WRITE */
  9755. }
  9756. 8003ffa: bf00 nop
  9757. 8003ffc: 4618 mov r0, r3
  9758. 8003ffe: 3710 adds r7, #16
  9759. 8004000: 46bd mov sp, r7
  9760. 8004002: bd80 pop {r7, pc}
  9761. 08004004 <USER_ioctl>:
  9762. DRESULT USER_ioctl (
  9763. BYTE pdrv, /* Physical drive nmuber (0..) */
  9764. BYTE cmd, /* Control code */
  9765. void *buff /* Buffer to send/receive control data */
  9766. )
  9767. {
  9768. 8004004: b580 push {r7, lr}
  9769. 8004006: b082 sub sp, #8
  9770. 8004008: af00 add r7, sp, #0
  9771. 800400a: 4603 mov r3, r0
  9772. 800400c: 603a str r2, [r7, #0]
  9773. 800400e: 71fb strb r3, [r7, #7]
  9774. 8004010: 460b mov r3, r1
  9775. 8004012: 71bb strb r3, [r7, #6]
  9776. /* USER CODE BEGIN IOCTL */
  9777. SD_disk_ioctl (pdrv, cmd, buff);
  9778. 8004014: 79fb ldrb r3, [r7, #7]
  9779. 8004016: 79b9 ldrb r1, [r7, #6]
  9780. 8004018: 683a ldr r2, [r7, #0]
  9781. 800401a: 4618 mov r0, r3
  9782. 800401c: f7fc fe00 bl 8000c20 <SD_disk_ioctl>
  9783. /* USER CODE END IOCTL */
  9784. }
  9785. 8004020: bf00 nop
  9786. 8004022: 4618 mov r0, r3
  9787. 8004024: 3708 adds r7, #8
  9788. 8004026: 46bd mov sp, r7
  9789. 8004028: bd80 pop {r7, pc}
  9790. ...
  9791. 0800402c <disk_status>:
  9792. * @retval DSTATUS: Operation status
  9793. */
  9794. DSTATUS disk_status (
  9795. BYTE pdrv /* Physical drive number to identify the drive */
  9796. )
  9797. {
  9798. 800402c: b580 push {r7, lr}
  9799. 800402e: b084 sub sp, #16
  9800. 8004030: af00 add r7, sp, #0
  9801. 8004032: 4603 mov r3, r0
  9802. 8004034: 71fb strb r3, [r7, #7]
  9803. DSTATUS stat;
  9804. stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]);
  9805. 8004036: 79fb ldrb r3, [r7, #7]
  9806. 8004038: 4a08 ldr r2, [pc, #32] ; (800405c <disk_status+0x30>)
  9807. 800403a: 009b lsls r3, r3, #2
  9808. 800403c: 4413 add r3, r2
  9809. 800403e: 685b ldr r3, [r3, #4]
  9810. 8004040: 685b ldr r3, [r3, #4]
  9811. 8004042: 79fa ldrb r2, [r7, #7]
  9812. 8004044: 4905 ldr r1, [pc, #20] ; (800405c <disk_status+0x30>)
  9813. 8004046: 440a add r2, r1
  9814. 8004048: 7a12 ldrb r2, [r2, #8]
  9815. 800404a: 4610 mov r0, r2
  9816. 800404c: 4798 blx r3
  9817. 800404e: 4603 mov r3, r0
  9818. 8004050: 73fb strb r3, [r7, #15]
  9819. return stat;
  9820. 8004052: 7bfb ldrb r3, [r7, #15]
  9821. }
  9822. 8004054: 4618 mov r0, r3
  9823. 8004056: 3710 adds r7, #16
  9824. 8004058: 46bd mov sp, r7
  9825. 800405a: bd80 pop {r7, pc}
  9826. 800405c: 2000026c .word 0x2000026c
  9827. 08004060 <disk_initialize>:
  9828. * @retval DSTATUS: Operation status
  9829. */
  9830. DSTATUS disk_initialize (
  9831. BYTE pdrv /* Physical drive nmuber to identify the drive */
  9832. )
  9833. {
  9834. 8004060: b580 push {r7, lr}
  9835. 8004062: b084 sub sp, #16
  9836. 8004064: af00 add r7, sp, #0
  9837. 8004066: 4603 mov r3, r0
  9838. 8004068: 71fb strb r3, [r7, #7]
  9839. DSTATUS stat = RES_OK;
  9840. 800406a: 2300 movs r3, #0
  9841. 800406c: 73fb strb r3, [r7, #15]
  9842. if(disk.is_initialized[pdrv] == 0)
  9843. 800406e: 79fb ldrb r3, [r7, #7]
  9844. 8004070: 4a0d ldr r2, [pc, #52] ; (80040a8 <disk_initialize+0x48>)
  9845. 8004072: 5cd3 ldrb r3, [r2, r3]
  9846. 8004074: 2b00 cmp r3, #0
  9847. 8004076: d111 bne.n 800409c <disk_initialize+0x3c>
  9848. {
  9849. disk.is_initialized[pdrv] = 1;
  9850. 8004078: 79fb ldrb r3, [r7, #7]
  9851. 800407a: 4a0b ldr r2, [pc, #44] ; (80040a8 <disk_initialize+0x48>)
  9852. 800407c: 2101 movs r1, #1
  9853. 800407e: 54d1 strb r1, [r2, r3]
  9854. stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]);
  9855. 8004080: 79fb ldrb r3, [r7, #7]
  9856. 8004082: 4a09 ldr r2, [pc, #36] ; (80040a8 <disk_initialize+0x48>)
  9857. 8004084: 009b lsls r3, r3, #2
  9858. 8004086: 4413 add r3, r2
  9859. 8004088: 685b ldr r3, [r3, #4]
  9860. 800408a: 681b ldr r3, [r3, #0]
  9861. 800408c: 79fa ldrb r2, [r7, #7]
  9862. 800408e: 4906 ldr r1, [pc, #24] ; (80040a8 <disk_initialize+0x48>)
  9863. 8004090: 440a add r2, r1
  9864. 8004092: 7a12 ldrb r2, [r2, #8]
  9865. 8004094: 4610 mov r0, r2
  9866. 8004096: 4798 blx r3
  9867. 8004098: 4603 mov r3, r0
  9868. 800409a: 73fb strb r3, [r7, #15]
  9869. }
  9870. return stat;
  9871. 800409c: 7bfb ldrb r3, [r7, #15]
  9872. }
  9873. 800409e: 4618 mov r0, r3
  9874. 80040a0: 3710 adds r7, #16
  9875. 80040a2: 46bd mov sp, r7
  9876. 80040a4: bd80 pop {r7, pc}
  9877. 80040a6: bf00 nop
  9878. 80040a8: 2000026c .word 0x2000026c
  9879. 080040ac <disk_read>:
  9880. BYTE pdrv, /* Physical drive nmuber to identify the drive */
  9881. BYTE *buff, /* Data buffer to store read data */
  9882. DWORD sector, /* Sector address in LBA */
  9883. UINT count /* Number of sectors to read */
  9884. )
  9885. {
  9886. 80040ac: b590 push {r4, r7, lr}
  9887. 80040ae: b087 sub sp, #28
  9888. 80040b0: af00 add r7, sp, #0
  9889. 80040b2: 60b9 str r1, [r7, #8]
  9890. 80040b4: 607a str r2, [r7, #4]
  9891. 80040b6: 603b str r3, [r7, #0]
  9892. 80040b8: 4603 mov r3, r0
  9893. 80040ba: 73fb strb r3, [r7, #15]
  9894. DRESULT res;
  9895. res = disk.drv[pdrv]->disk_read(disk.lun[pdrv], buff, sector, count);
  9896. 80040bc: 7bfb ldrb r3, [r7, #15]
  9897. 80040be: 4a0a ldr r2, [pc, #40] ; (80040e8 <disk_read+0x3c>)
  9898. 80040c0: 009b lsls r3, r3, #2
  9899. 80040c2: 4413 add r3, r2
  9900. 80040c4: 685b ldr r3, [r3, #4]
  9901. 80040c6: 689c ldr r4, [r3, #8]
  9902. 80040c8: 7bfb ldrb r3, [r7, #15]
  9903. 80040ca: 4a07 ldr r2, [pc, #28] ; (80040e8 <disk_read+0x3c>)
  9904. 80040cc: 4413 add r3, r2
  9905. 80040ce: 7a18 ldrb r0, [r3, #8]
  9906. 80040d0: 683b ldr r3, [r7, #0]
  9907. 80040d2: 687a ldr r2, [r7, #4]
  9908. 80040d4: 68b9 ldr r1, [r7, #8]
  9909. 80040d6: 47a0 blx r4
  9910. 80040d8: 4603 mov r3, r0
  9911. 80040da: 75fb strb r3, [r7, #23]
  9912. return res;
  9913. 80040dc: 7dfb ldrb r3, [r7, #23]
  9914. }
  9915. 80040de: 4618 mov r0, r3
  9916. 80040e0: 371c adds r7, #28
  9917. 80040e2: 46bd mov sp, r7
  9918. 80040e4: bd90 pop {r4, r7, pc}
  9919. 80040e6: bf00 nop
  9920. 80040e8: 2000026c .word 0x2000026c
  9921. 080040ec <disk_write>:
  9922. BYTE pdrv, /* Physical drive nmuber to identify the drive */
  9923. const BYTE *buff, /* Data to be written */
  9924. DWORD sector, /* Sector address in LBA */
  9925. UINT count /* Number of sectors to write */
  9926. )
  9927. {
  9928. 80040ec: b590 push {r4, r7, lr}
  9929. 80040ee: b087 sub sp, #28
  9930. 80040f0: af00 add r7, sp, #0
  9931. 80040f2: 60b9 str r1, [r7, #8]
  9932. 80040f4: 607a str r2, [r7, #4]
  9933. 80040f6: 603b str r3, [r7, #0]
  9934. 80040f8: 4603 mov r3, r0
  9935. 80040fa: 73fb strb r3, [r7, #15]
  9936. DRESULT res;
  9937. res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count);
  9938. 80040fc: 7bfb ldrb r3, [r7, #15]
  9939. 80040fe: 4a0a ldr r2, [pc, #40] ; (8004128 <disk_write+0x3c>)
  9940. 8004100: 009b lsls r3, r3, #2
  9941. 8004102: 4413 add r3, r2
  9942. 8004104: 685b ldr r3, [r3, #4]
  9943. 8004106: 68dc ldr r4, [r3, #12]
  9944. 8004108: 7bfb ldrb r3, [r7, #15]
  9945. 800410a: 4a07 ldr r2, [pc, #28] ; (8004128 <disk_write+0x3c>)
  9946. 800410c: 4413 add r3, r2
  9947. 800410e: 7a18 ldrb r0, [r3, #8]
  9948. 8004110: 683b ldr r3, [r7, #0]
  9949. 8004112: 687a ldr r2, [r7, #4]
  9950. 8004114: 68b9 ldr r1, [r7, #8]
  9951. 8004116: 47a0 blx r4
  9952. 8004118: 4603 mov r3, r0
  9953. 800411a: 75fb strb r3, [r7, #23]
  9954. return res;
  9955. 800411c: 7dfb ldrb r3, [r7, #23]
  9956. }
  9957. 800411e: 4618 mov r0, r3
  9958. 8004120: 371c adds r7, #28
  9959. 8004122: 46bd mov sp, r7
  9960. 8004124: bd90 pop {r4, r7, pc}
  9961. 8004126: bf00 nop
  9962. 8004128: 2000026c .word 0x2000026c
  9963. 0800412c <disk_ioctl>:
  9964. DRESULT disk_ioctl (
  9965. BYTE pdrv, /* Physical drive nmuber (0..) */
  9966. BYTE cmd, /* Control code */
  9967. void *buff /* Buffer to send/receive control data */
  9968. )
  9969. {
  9970. 800412c: b580 push {r7, lr}
  9971. 800412e: b084 sub sp, #16
  9972. 8004130: af00 add r7, sp, #0
  9973. 8004132: 4603 mov r3, r0
  9974. 8004134: 603a str r2, [r7, #0]
  9975. 8004136: 71fb strb r3, [r7, #7]
  9976. 8004138: 460b mov r3, r1
  9977. 800413a: 71bb strb r3, [r7, #6]
  9978. DRESULT res;
  9979. res = disk.drv[pdrv]->disk_ioctl(disk.lun[pdrv], cmd, buff);
  9980. 800413c: 79fb ldrb r3, [r7, #7]
  9981. 800413e: 4a09 ldr r2, [pc, #36] ; (8004164 <disk_ioctl+0x38>)
  9982. 8004140: 009b lsls r3, r3, #2
  9983. 8004142: 4413 add r3, r2
  9984. 8004144: 685b ldr r3, [r3, #4]
  9985. 8004146: 691b ldr r3, [r3, #16]
  9986. 8004148: 79fa ldrb r2, [r7, #7]
  9987. 800414a: 4906 ldr r1, [pc, #24] ; (8004164 <disk_ioctl+0x38>)
  9988. 800414c: 440a add r2, r1
  9989. 800414e: 7a10 ldrb r0, [r2, #8]
  9990. 8004150: 79b9 ldrb r1, [r7, #6]
  9991. 8004152: 683a ldr r2, [r7, #0]
  9992. 8004154: 4798 blx r3
  9993. 8004156: 4603 mov r3, r0
  9994. 8004158: 73fb strb r3, [r7, #15]
  9995. return res;
  9996. 800415a: 7bfb ldrb r3, [r7, #15]
  9997. }
  9998. 800415c: 4618 mov r0, r3
  9999. 800415e: 3710 adds r7, #16
  10000. 8004160: 46bd mov sp, r7
  10001. 8004162: bd80 pop {r7, pc}
  10002. 8004164: 2000026c .word 0x2000026c
  10003. 08004168 <ld_word>:
  10004. /* Load/Store multi-byte word in the FAT structure */
  10005. /*-----------------------------------------------------------------------*/
  10006. static
  10007. WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */
  10008. {
  10009. 8004168: b480 push {r7}
  10010. 800416a: b085 sub sp, #20
  10011. 800416c: af00 add r7, sp, #0
  10012. 800416e: 6078 str r0, [r7, #4]
  10013. WORD rv;
  10014. rv = ptr[1];
  10015. 8004170: 687b ldr r3, [r7, #4]
  10016. 8004172: 3301 adds r3, #1
  10017. 8004174: 781b ldrb r3, [r3, #0]
  10018. 8004176: 81fb strh r3, [r7, #14]
  10019. rv = rv << 8 | ptr[0];
  10020. 8004178: 89fb ldrh r3, [r7, #14]
  10021. 800417a: 021b lsls r3, r3, #8
  10022. 800417c: b21a sxth r2, r3
  10023. 800417e: 687b ldr r3, [r7, #4]
  10024. 8004180: 781b ldrb r3, [r3, #0]
  10025. 8004182: b21b sxth r3, r3
  10026. 8004184: 4313 orrs r3, r2
  10027. 8004186: b21b sxth r3, r3
  10028. 8004188: 81fb strh r3, [r7, #14]
  10029. return rv;
  10030. 800418a: 89fb ldrh r3, [r7, #14]
  10031. }
  10032. 800418c: 4618 mov r0, r3
  10033. 800418e: 3714 adds r7, #20
  10034. 8004190: 46bd mov sp, r7
  10035. 8004192: f85d 7b04 ldr.w r7, [sp], #4
  10036. 8004196: 4770 bx lr
  10037. 08004198 <ld_dword>:
  10038. static
  10039. DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */
  10040. {
  10041. 8004198: b480 push {r7}
  10042. 800419a: b085 sub sp, #20
  10043. 800419c: af00 add r7, sp, #0
  10044. 800419e: 6078 str r0, [r7, #4]
  10045. DWORD rv;
  10046. rv = ptr[3];
  10047. 80041a0: 687b ldr r3, [r7, #4]
  10048. 80041a2: 3303 adds r3, #3
  10049. 80041a4: 781b ldrb r3, [r3, #0]
  10050. 80041a6: 60fb str r3, [r7, #12]
  10051. rv = rv << 8 | ptr[2];
  10052. 80041a8: 68fb ldr r3, [r7, #12]
  10053. 80041aa: 021b lsls r3, r3, #8
  10054. 80041ac: 687a ldr r2, [r7, #4]
  10055. 80041ae: 3202 adds r2, #2
  10056. 80041b0: 7812 ldrb r2, [r2, #0]
  10057. 80041b2: 4313 orrs r3, r2
  10058. 80041b4: 60fb str r3, [r7, #12]
  10059. rv = rv << 8 | ptr[1];
  10060. 80041b6: 68fb ldr r3, [r7, #12]
  10061. 80041b8: 021b lsls r3, r3, #8
  10062. 80041ba: 687a ldr r2, [r7, #4]
  10063. 80041bc: 3201 adds r2, #1
  10064. 80041be: 7812 ldrb r2, [r2, #0]
  10065. 80041c0: 4313 orrs r3, r2
  10066. 80041c2: 60fb str r3, [r7, #12]
  10067. rv = rv << 8 | ptr[0];
  10068. 80041c4: 68fb ldr r3, [r7, #12]
  10069. 80041c6: 021b lsls r3, r3, #8
  10070. 80041c8: 687a ldr r2, [r7, #4]
  10071. 80041ca: 7812 ldrb r2, [r2, #0]
  10072. 80041cc: 4313 orrs r3, r2
  10073. 80041ce: 60fb str r3, [r7, #12]
  10074. return rv;
  10075. 80041d0: 68fb ldr r3, [r7, #12]
  10076. }
  10077. 80041d2: 4618 mov r0, r3
  10078. 80041d4: 3714 adds r7, #20
  10079. 80041d6: 46bd mov sp, r7
  10080. 80041d8: f85d 7b04 ldr.w r7, [sp], #4
  10081. 80041dc: 4770 bx lr
  10082. 080041de <st_word>:
  10083. #endif
  10084. #if !_FS_READONLY
  10085. static
  10086. void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */
  10087. {
  10088. 80041de: b480 push {r7}
  10089. 80041e0: b083 sub sp, #12
  10090. 80041e2: af00 add r7, sp, #0
  10091. 80041e4: 6078 str r0, [r7, #4]
  10092. 80041e6: 460b mov r3, r1
  10093. 80041e8: 807b strh r3, [r7, #2]
  10094. *ptr++ = (BYTE)val; val >>= 8;
  10095. 80041ea: 687b ldr r3, [r7, #4]
  10096. 80041ec: 1c5a adds r2, r3, #1
  10097. 80041ee: 607a str r2, [r7, #4]
  10098. 80041f0: 887a ldrh r2, [r7, #2]
  10099. 80041f2: b2d2 uxtb r2, r2
  10100. 80041f4: 701a strb r2, [r3, #0]
  10101. 80041f6: 887b ldrh r3, [r7, #2]
  10102. 80041f8: 0a1b lsrs r3, r3, #8
  10103. 80041fa: 807b strh r3, [r7, #2]
  10104. *ptr++ = (BYTE)val;
  10105. 80041fc: 687b ldr r3, [r7, #4]
  10106. 80041fe: 1c5a adds r2, r3, #1
  10107. 8004200: 607a str r2, [r7, #4]
  10108. 8004202: 887a ldrh r2, [r7, #2]
  10109. 8004204: b2d2 uxtb r2, r2
  10110. 8004206: 701a strb r2, [r3, #0]
  10111. }
  10112. 8004208: bf00 nop
  10113. 800420a: 370c adds r7, #12
  10114. 800420c: 46bd mov sp, r7
  10115. 800420e: f85d 7b04 ldr.w r7, [sp], #4
  10116. 8004212: 4770 bx lr
  10117. 08004214 <st_dword>:
  10118. static
  10119. void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */
  10120. {
  10121. 8004214: b480 push {r7}
  10122. 8004216: b083 sub sp, #12
  10123. 8004218: af00 add r7, sp, #0
  10124. 800421a: 6078 str r0, [r7, #4]
  10125. 800421c: 6039 str r1, [r7, #0]
  10126. *ptr++ = (BYTE)val; val >>= 8;
  10127. 800421e: 687b ldr r3, [r7, #4]
  10128. 8004220: 1c5a adds r2, r3, #1
  10129. 8004222: 607a str r2, [r7, #4]
  10130. 8004224: 683a ldr r2, [r7, #0]
  10131. 8004226: b2d2 uxtb r2, r2
  10132. 8004228: 701a strb r2, [r3, #0]
  10133. 800422a: 683b ldr r3, [r7, #0]
  10134. 800422c: 0a1b lsrs r3, r3, #8
  10135. 800422e: 603b str r3, [r7, #0]
  10136. *ptr++ = (BYTE)val; val >>= 8;
  10137. 8004230: 687b ldr r3, [r7, #4]
  10138. 8004232: 1c5a adds r2, r3, #1
  10139. 8004234: 607a str r2, [r7, #4]
  10140. 8004236: 683a ldr r2, [r7, #0]
  10141. 8004238: b2d2 uxtb r2, r2
  10142. 800423a: 701a strb r2, [r3, #0]
  10143. 800423c: 683b ldr r3, [r7, #0]
  10144. 800423e: 0a1b lsrs r3, r3, #8
  10145. 8004240: 603b str r3, [r7, #0]
  10146. *ptr++ = (BYTE)val; val >>= 8;
  10147. 8004242: 687b ldr r3, [r7, #4]
  10148. 8004244: 1c5a adds r2, r3, #1
  10149. 8004246: 607a str r2, [r7, #4]
  10150. 8004248: 683a ldr r2, [r7, #0]
  10151. 800424a: b2d2 uxtb r2, r2
  10152. 800424c: 701a strb r2, [r3, #0]
  10153. 800424e: 683b ldr r3, [r7, #0]
  10154. 8004250: 0a1b lsrs r3, r3, #8
  10155. 8004252: 603b str r3, [r7, #0]
  10156. *ptr++ = (BYTE)val;
  10157. 8004254: 687b ldr r3, [r7, #4]
  10158. 8004256: 1c5a adds r2, r3, #1
  10159. 8004258: 607a str r2, [r7, #4]
  10160. 800425a: 683a ldr r2, [r7, #0]
  10161. 800425c: b2d2 uxtb r2, r2
  10162. 800425e: 701a strb r2, [r3, #0]
  10163. }
  10164. 8004260: bf00 nop
  10165. 8004262: 370c adds r7, #12
  10166. 8004264: 46bd mov sp, r7
  10167. 8004266: f85d 7b04 ldr.w r7, [sp], #4
  10168. 800426a: 4770 bx lr
  10169. 0800426c <mem_cpy>:
  10170. /* String functions */
  10171. /*-----------------------------------------------------------------------*/
  10172. /* Copy memory to memory */
  10173. static
  10174. void mem_cpy (void* dst, const void* src, UINT cnt) {
  10175. 800426c: b480 push {r7}
  10176. 800426e: b087 sub sp, #28
  10177. 8004270: af00 add r7, sp, #0
  10178. 8004272: 60f8 str r0, [r7, #12]
  10179. 8004274: 60b9 str r1, [r7, #8]
  10180. 8004276: 607a str r2, [r7, #4]
  10181. BYTE *d = (BYTE*)dst;
  10182. 8004278: 68fb ldr r3, [r7, #12]
  10183. 800427a: 617b str r3, [r7, #20]
  10184. const BYTE *s = (const BYTE*)src;
  10185. 800427c: 68bb ldr r3, [r7, #8]
  10186. 800427e: 613b str r3, [r7, #16]
  10187. if (cnt) {
  10188. 8004280: 687b ldr r3, [r7, #4]
  10189. 8004282: 2b00 cmp r3, #0
  10190. 8004284: d00d beq.n 80042a2 <mem_cpy+0x36>
  10191. do {
  10192. *d++ = *s++;
  10193. 8004286: 693a ldr r2, [r7, #16]
  10194. 8004288: 1c53 adds r3, r2, #1
  10195. 800428a: 613b str r3, [r7, #16]
  10196. 800428c: 697b ldr r3, [r7, #20]
  10197. 800428e: 1c59 adds r1, r3, #1
  10198. 8004290: 6179 str r1, [r7, #20]
  10199. 8004292: 7812 ldrb r2, [r2, #0]
  10200. 8004294: 701a strb r2, [r3, #0]
  10201. } while (--cnt);
  10202. 8004296: 687b ldr r3, [r7, #4]
  10203. 8004298: 3b01 subs r3, #1
  10204. 800429a: 607b str r3, [r7, #4]
  10205. 800429c: 687b ldr r3, [r7, #4]
  10206. 800429e: 2b00 cmp r3, #0
  10207. 80042a0: d1f1 bne.n 8004286 <mem_cpy+0x1a>
  10208. }
  10209. }
  10210. 80042a2: bf00 nop
  10211. 80042a4: 371c adds r7, #28
  10212. 80042a6: 46bd mov sp, r7
  10213. 80042a8: f85d 7b04 ldr.w r7, [sp], #4
  10214. 80042ac: 4770 bx lr
  10215. 080042ae <mem_set>:
  10216. /* Fill memory block */
  10217. static
  10218. void mem_set (void* dst, int val, UINT cnt) {
  10219. 80042ae: b480 push {r7}
  10220. 80042b0: b087 sub sp, #28
  10221. 80042b2: af00 add r7, sp, #0
  10222. 80042b4: 60f8 str r0, [r7, #12]
  10223. 80042b6: 60b9 str r1, [r7, #8]
  10224. 80042b8: 607a str r2, [r7, #4]
  10225. BYTE *d = (BYTE*)dst;
  10226. 80042ba: 68fb ldr r3, [r7, #12]
  10227. 80042bc: 617b str r3, [r7, #20]
  10228. do {
  10229. *d++ = (BYTE)val;
  10230. 80042be: 697b ldr r3, [r7, #20]
  10231. 80042c0: 1c5a adds r2, r3, #1
  10232. 80042c2: 617a str r2, [r7, #20]
  10233. 80042c4: 68ba ldr r2, [r7, #8]
  10234. 80042c6: b2d2 uxtb r2, r2
  10235. 80042c8: 701a strb r2, [r3, #0]
  10236. } while (--cnt);
  10237. 80042ca: 687b ldr r3, [r7, #4]
  10238. 80042cc: 3b01 subs r3, #1
  10239. 80042ce: 607b str r3, [r7, #4]
  10240. 80042d0: 687b ldr r3, [r7, #4]
  10241. 80042d2: 2b00 cmp r3, #0
  10242. 80042d4: d1f3 bne.n 80042be <mem_set+0x10>
  10243. }
  10244. 80042d6: bf00 nop
  10245. 80042d8: 371c adds r7, #28
  10246. 80042da: 46bd mov sp, r7
  10247. 80042dc: f85d 7b04 ldr.w r7, [sp], #4
  10248. 80042e0: 4770 bx lr
  10249. 080042e2 <mem_cmp>:
  10250. /* Compare memory block */
  10251. static
  10252. int mem_cmp (const void* dst, const void* src, UINT cnt) { /* ZR:same, NZ:different */
  10253. 80042e2: b480 push {r7}
  10254. 80042e4: b089 sub sp, #36 ; 0x24
  10255. 80042e6: af00 add r7, sp, #0
  10256. 80042e8: 60f8 str r0, [r7, #12]
  10257. 80042ea: 60b9 str r1, [r7, #8]
  10258. 80042ec: 607a str r2, [r7, #4]
  10259. const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src;
  10260. 80042ee: 68fb ldr r3, [r7, #12]
  10261. 80042f0: 61fb str r3, [r7, #28]
  10262. 80042f2: 68bb ldr r3, [r7, #8]
  10263. 80042f4: 61bb str r3, [r7, #24]
  10264. int r = 0;
  10265. 80042f6: 2300 movs r3, #0
  10266. 80042f8: 617b str r3, [r7, #20]
  10267. do {
  10268. r = *d++ - *s++;
  10269. 80042fa: 69fb ldr r3, [r7, #28]
  10270. 80042fc: 1c5a adds r2, r3, #1
  10271. 80042fe: 61fa str r2, [r7, #28]
  10272. 8004300: 781b ldrb r3, [r3, #0]
  10273. 8004302: 4619 mov r1, r3
  10274. 8004304: 69bb ldr r3, [r7, #24]
  10275. 8004306: 1c5a adds r2, r3, #1
  10276. 8004308: 61ba str r2, [r7, #24]
  10277. 800430a: 781b ldrb r3, [r3, #0]
  10278. 800430c: 1acb subs r3, r1, r3
  10279. 800430e: 617b str r3, [r7, #20]
  10280. } while (--cnt && r == 0);
  10281. 8004310: 687b ldr r3, [r7, #4]
  10282. 8004312: 3b01 subs r3, #1
  10283. 8004314: 607b str r3, [r7, #4]
  10284. 8004316: 687b ldr r3, [r7, #4]
  10285. 8004318: 2b00 cmp r3, #0
  10286. 800431a: d002 beq.n 8004322 <mem_cmp+0x40>
  10287. 800431c: 697b ldr r3, [r7, #20]
  10288. 800431e: 2b00 cmp r3, #0
  10289. 8004320: d0eb beq.n 80042fa <mem_cmp+0x18>
  10290. return r;
  10291. 8004322: 697b ldr r3, [r7, #20]
  10292. }
  10293. 8004324: 4618 mov r0, r3
  10294. 8004326: 3724 adds r7, #36 ; 0x24
  10295. 8004328: 46bd mov sp, r7
  10296. 800432a: f85d 7b04 ldr.w r7, [sp], #4
  10297. 800432e: 4770 bx lr
  10298. 08004330 <chk_chr>:
  10299. /* Check if chr is contained in the string */
  10300. static
  10301. int chk_chr (const char* str, int chr) { /* NZ:contained, ZR:not contained */
  10302. 8004330: b480 push {r7}
  10303. 8004332: b083 sub sp, #12
  10304. 8004334: af00 add r7, sp, #0
  10305. 8004336: 6078 str r0, [r7, #4]
  10306. 8004338: 6039 str r1, [r7, #0]
  10307. while (*str && *str != chr) str++;
  10308. 800433a: e002 b.n 8004342 <chk_chr+0x12>
  10309. 800433c: 687b ldr r3, [r7, #4]
  10310. 800433e: 3301 adds r3, #1
  10311. 8004340: 607b str r3, [r7, #4]
  10312. 8004342: 687b ldr r3, [r7, #4]
  10313. 8004344: 781b ldrb r3, [r3, #0]
  10314. 8004346: 2b00 cmp r3, #0
  10315. 8004348: d005 beq.n 8004356 <chk_chr+0x26>
  10316. 800434a: 687b ldr r3, [r7, #4]
  10317. 800434c: 781b ldrb r3, [r3, #0]
  10318. 800434e: 461a mov r2, r3
  10319. 8004350: 683b ldr r3, [r7, #0]
  10320. 8004352: 4293 cmp r3, r2
  10321. 8004354: d1f2 bne.n 800433c <chk_chr+0xc>
  10322. return *str;
  10323. 8004356: 687b ldr r3, [r7, #4]
  10324. 8004358: 781b ldrb r3, [r3, #0]
  10325. }
  10326. 800435a: 4618 mov r0, r3
  10327. 800435c: 370c adds r7, #12
  10328. 800435e: 46bd mov sp, r7
  10329. 8004360: f85d 7b04 ldr.w r7, [sp], #4
  10330. 8004364: 4770 bx lr
  10331. ...
  10332. 08004368 <chk_lock>:
  10333. static
  10334. FRESULT chk_lock ( /* Check if the file can be accessed */
  10335. DIR* dp, /* Directory object pointing the file to be checked */
  10336. int acc /* Desired access type (0:Read, 1:Write, 2:Delete/Rename) */
  10337. )
  10338. {
  10339. 8004368: b480 push {r7}
  10340. 800436a: b085 sub sp, #20
  10341. 800436c: af00 add r7, sp, #0
  10342. 800436e: 6078 str r0, [r7, #4]
  10343. 8004370: 6039 str r1, [r7, #0]
  10344. UINT i, be;
  10345. /* Search file semaphore table */
  10346. for (i = be = 0; i < _FS_LOCK; i++) {
  10347. 8004372: 2300 movs r3, #0
  10348. 8004374: 60bb str r3, [r7, #8]
  10349. 8004376: 68bb ldr r3, [r7, #8]
  10350. 8004378: 60fb str r3, [r7, #12]
  10351. 800437a: e029 b.n 80043d0 <chk_lock+0x68>
  10352. if (Files[i].fs) { /* Existing entry */
  10353. 800437c: 4a27 ldr r2, [pc, #156] ; (800441c <chk_lock+0xb4>)
  10354. 800437e: 68fb ldr r3, [r7, #12]
  10355. 8004380: 011b lsls r3, r3, #4
  10356. 8004382: 4413 add r3, r2
  10357. 8004384: 681b ldr r3, [r3, #0]
  10358. 8004386: 2b00 cmp r3, #0
  10359. 8004388: d01d beq.n 80043c6 <chk_lock+0x5e>
  10360. if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */
  10361. 800438a: 4a24 ldr r2, [pc, #144] ; (800441c <chk_lock+0xb4>)
  10362. 800438c: 68fb ldr r3, [r7, #12]
  10363. 800438e: 011b lsls r3, r3, #4
  10364. 8004390: 4413 add r3, r2
  10365. 8004392: 681a ldr r2, [r3, #0]
  10366. 8004394: 687b ldr r3, [r7, #4]
  10367. 8004396: 681b ldr r3, [r3, #0]
  10368. 8004398: 429a cmp r2, r3
  10369. 800439a: d116 bne.n 80043ca <chk_lock+0x62>
  10370. Files[i].clu == dp->obj.sclust &&
  10371. 800439c: 4a1f ldr r2, [pc, #124] ; (800441c <chk_lock+0xb4>)
  10372. 800439e: 68fb ldr r3, [r7, #12]
  10373. 80043a0: 011b lsls r3, r3, #4
  10374. 80043a2: 4413 add r3, r2
  10375. 80043a4: 3304 adds r3, #4
  10376. 80043a6: 681a ldr r2, [r3, #0]
  10377. 80043a8: 687b ldr r3, [r7, #4]
  10378. 80043aa: 689b ldr r3, [r3, #8]
  10379. if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */
  10380. 80043ac: 429a cmp r2, r3
  10381. 80043ae: d10c bne.n 80043ca <chk_lock+0x62>
  10382. Files[i].ofs == dp->dptr) break;
  10383. 80043b0: 4a1a ldr r2, [pc, #104] ; (800441c <chk_lock+0xb4>)
  10384. 80043b2: 68fb ldr r3, [r7, #12]
  10385. 80043b4: 011b lsls r3, r3, #4
  10386. 80043b6: 4413 add r3, r2
  10387. 80043b8: 3308 adds r3, #8
  10388. 80043ba: 681a ldr r2, [r3, #0]
  10389. 80043bc: 687b ldr r3, [r7, #4]
  10390. 80043be: 695b ldr r3, [r3, #20]
  10391. Files[i].clu == dp->obj.sclust &&
  10392. 80043c0: 429a cmp r2, r3
  10393. 80043c2: d102 bne.n 80043ca <chk_lock+0x62>
  10394. Files[i].ofs == dp->dptr) break;
  10395. 80043c4: e007 b.n 80043d6 <chk_lock+0x6e>
  10396. } else { /* Blank entry */
  10397. be = 1;
  10398. 80043c6: 2301 movs r3, #1
  10399. 80043c8: 60bb str r3, [r7, #8]
  10400. for (i = be = 0; i < _FS_LOCK; i++) {
  10401. 80043ca: 68fb ldr r3, [r7, #12]
  10402. 80043cc: 3301 adds r3, #1
  10403. 80043ce: 60fb str r3, [r7, #12]
  10404. 80043d0: 68fb ldr r3, [r7, #12]
  10405. 80043d2: 2b01 cmp r3, #1
  10406. 80043d4: d9d2 bls.n 800437c <chk_lock+0x14>
  10407. }
  10408. }
  10409. if (i == _FS_LOCK) { /* The object is not opened */
  10410. 80043d6: 68fb ldr r3, [r7, #12]
  10411. 80043d8: 2b02 cmp r3, #2
  10412. 80043da: d109 bne.n 80043f0 <chk_lock+0x88>
  10413. return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES; /* Is there a blank entry for new object? */
  10414. 80043dc: 68bb ldr r3, [r7, #8]
  10415. 80043de: 2b00 cmp r3, #0
  10416. 80043e0: d102 bne.n 80043e8 <chk_lock+0x80>
  10417. 80043e2: 683b ldr r3, [r7, #0]
  10418. 80043e4: 2b02 cmp r3, #2
  10419. 80043e6: d101 bne.n 80043ec <chk_lock+0x84>
  10420. 80043e8: 2300 movs r3, #0
  10421. 80043ea: e010 b.n 800440e <chk_lock+0xa6>
  10422. 80043ec: 2312 movs r3, #18
  10423. 80043ee: e00e b.n 800440e <chk_lock+0xa6>
  10424. }
  10425. /* The object has been opened. Reject any open against writing file and all write mode open */
  10426. return (acc || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK;
  10427. 80043f0: 683b ldr r3, [r7, #0]
  10428. 80043f2: 2b00 cmp r3, #0
  10429. 80043f4: d108 bne.n 8004408 <chk_lock+0xa0>
  10430. 80043f6: 4a09 ldr r2, [pc, #36] ; (800441c <chk_lock+0xb4>)
  10431. 80043f8: 68fb ldr r3, [r7, #12]
  10432. 80043fa: 011b lsls r3, r3, #4
  10433. 80043fc: 4413 add r3, r2
  10434. 80043fe: 330c adds r3, #12
  10435. 8004400: 881b ldrh r3, [r3, #0]
  10436. 8004402: f5b3 7f80 cmp.w r3, #256 ; 0x100
  10437. 8004406: d101 bne.n 800440c <chk_lock+0xa4>
  10438. 8004408: 2310 movs r3, #16
  10439. 800440a: e000 b.n 800440e <chk_lock+0xa6>
  10440. 800440c: 2300 movs r3, #0
  10441. }
  10442. 800440e: 4618 mov r0, r3
  10443. 8004410: 3714 adds r7, #20
  10444. 8004412: 46bd mov sp, r7
  10445. 8004414: f85d 7b04 ldr.w r7, [sp], #4
  10446. 8004418: 4770 bx lr
  10447. 800441a: bf00 nop
  10448. 800441c: 2000004c .word 0x2000004c
  10449. 08004420 <enq_lock>:
  10450. static
  10451. int enq_lock (void) /* Check if an entry is available for a new object */
  10452. {
  10453. 8004420: b480 push {r7}
  10454. 8004422: b083 sub sp, #12
  10455. 8004424: af00 add r7, sp, #0
  10456. UINT i;
  10457. for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
  10458. 8004426: 2300 movs r3, #0
  10459. 8004428: 607b str r3, [r7, #4]
  10460. 800442a: e002 b.n 8004432 <enq_lock+0x12>
  10461. 800442c: 687b ldr r3, [r7, #4]
  10462. 800442e: 3301 adds r3, #1
  10463. 8004430: 607b str r3, [r7, #4]
  10464. 8004432: 687b ldr r3, [r7, #4]
  10465. 8004434: 2b01 cmp r3, #1
  10466. 8004436: d806 bhi.n 8004446 <enq_lock+0x26>
  10467. 8004438: 4a09 ldr r2, [pc, #36] ; (8004460 <enq_lock+0x40>)
  10468. 800443a: 687b ldr r3, [r7, #4]
  10469. 800443c: 011b lsls r3, r3, #4
  10470. 800443e: 4413 add r3, r2
  10471. 8004440: 681b ldr r3, [r3, #0]
  10472. 8004442: 2b00 cmp r3, #0
  10473. 8004444: d1f2 bne.n 800442c <enq_lock+0xc>
  10474. return (i == _FS_LOCK) ? 0 : 1;
  10475. 8004446: 687b ldr r3, [r7, #4]
  10476. 8004448: 2b02 cmp r3, #2
  10477. 800444a: bf14 ite ne
  10478. 800444c: 2301 movne r3, #1
  10479. 800444e: 2300 moveq r3, #0
  10480. 8004450: b2db uxtb r3, r3
  10481. }
  10482. 8004452: 4618 mov r0, r3
  10483. 8004454: 370c adds r7, #12
  10484. 8004456: 46bd mov sp, r7
  10485. 8004458: f85d 7b04 ldr.w r7, [sp], #4
  10486. 800445c: 4770 bx lr
  10487. 800445e: bf00 nop
  10488. 8004460: 2000004c .word 0x2000004c
  10489. 08004464 <inc_lock>:
  10490. static
  10491. UINT inc_lock ( /* Increment object open counter and returns its index (0:Internal error) */
  10492. DIR* dp, /* Directory object pointing the file to register or increment */
  10493. int acc /* Desired access (0:Read, 1:Write, 2:Delete/Rename) */
  10494. )
  10495. {
  10496. 8004464: b480 push {r7}
  10497. 8004466: b085 sub sp, #20
  10498. 8004468: af00 add r7, sp, #0
  10499. 800446a: 6078 str r0, [r7, #4]
  10500. 800446c: 6039 str r1, [r7, #0]
  10501. UINT i;
  10502. for (i = 0; i < _FS_LOCK; i++) { /* Find the object */
  10503. 800446e: 2300 movs r3, #0
  10504. 8004470: 60fb str r3, [r7, #12]
  10505. 8004472: e01f b.n 80044b4 <inc_lock+0x50>
  10506. if (Files[i].fs == dp->obj.fs &&
  10507. 8004474: 4a41 ldr r2, [pc, #260] ; (800457c <inc_lock+0x118>)
  10508. 8004476: 68fb ldr r3, [r7, #12]
  10509. 8004478: 011b lsls r3, r3, #4
  10510. 800447a: 4413 add r3, r2
  10511. 800447c: 681a ldr r2, [r3, #0]
  10512. 800447e: 687b ldr r3, [r7, #4]
  10513. 8004480: 681b ldr r3, [r3, #0]
  10514. 8004482: 429a cmp r2, r3
  10515. 8004484: d113 bne.n 80044ae <inc_lock+0x4a>
  10516. Files[i].clu == dp->obj.sclust &&
  10517. 8004486: 4a3d ldr r2, [pc, #244] ; (800457c <inc_lock+0x118>)
  10518. 8004488: 68fb ldr r3, [r7, #12]
  10519. 800448a: 011b lsls r3, r3, #4
  10520. 800448c: 4413 add r3, r2
  10521. 800448e: 3304 adds r3, #4
  10522. 8004490: 681a ldr r2, [r3, #0]
  10523. 8004492: 687b ldr r3, [r7, #4]
  10524. 8004494: 689b ldr r3, [r3, #8]
  10525. if (Files[i].fs == dp->obj.fs &&
  10526. 8004496: 429a cmp r2, r3
  10527. 8004498: d109 bne.n 80044ae <inc_lock+0x4a>
  10528. Files[i].ofs == dp->dptr) break;
  10529. 800449a: 4a38 ldr r2, [pc, #224] ; (800457c <inc_lock+0x118>)
  10530. 800449c: 68fb ldr r3, [r7, #12]
  10531. 800449e: 011b lsls r3, r3, #4
  10532. 80044a0: 4413 add r3, r2
  10533. 80044a2: 3308 adds r3, #8
  10534. 80044a4: 681a ldr r2, [r3, #0]
  10535. 80044a6: 687b ldr r3, [r7, #4]
  10536. 80044a8: 695b ldr r3, [r3, #20]
  10537. Files[i].clu == dp->obj.sclust &&
  10538. 80044aa: 429a cmp r2, r3
  10539. 80044ac: d006 beq.n 80044bc <inc_lock+0x58>
  10540. for (i = 0; i < _FS_LOCK; i++) { /* Find the object */
  10541. 80044ae: 68fb ldr r3, [r7, #12]
  10542. 80044b0: 3301 adds r3, #1
  10543. 80044b2: 60fb str r3, [r7, #12]
  10544. 80044b4: 68fb ldr r3, [r7, #12]
  10545. 80044b6: 2b01 cmp r3, #1
  10546. 80044b8: d9dc bls.n 8004474 <inc_lock+0x10>
  10547. 80044ba: e000 b.n 80044be <inc_lock+0x5a>
  10548. Files[i].ofs == dp->dptr) break;
  10549. 80044bc: bf00 nop
  10550. }
  10551. if (i == _FS_LOCK) { /* Not opened. Register it as new. */
  10552. 80044be: 68fb ldr r3, [r7, #12]
  10553. 80044c0: 2b02 cmp r3, #2
  10554. 80044c2: d132 bne.n 800452a <inc_lock+0xc6>
  10555. for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
  10556. 80044c4: 2300 movs r3, #0
  10557. 80044c6: 60fb str r3, [r7, #12]
  10558. 80044c8: e002 b.n 80044d0 <inc_lock+0x6c>
  10559. 80044ca: 68fb ldr r3, [r7, #12]
  10560. 80044cc: 3301 adds r3, #1
  10561. 80044ce: 60fb str r3, [r7, #12]
  10562. 80044d0: 68fb ldr r3, [r7, #12]
  10563. 80044d2: 2b01 cmp r3, #1
  10564. 80044d4: d806 bhi.n 80044e4 <inc_lock+0x80>
  10565. 80044d6: 4a29 ldr r2, [pc, #164] ; (800457c <inc_lock+0x118>)
  10566. 80044d8: 68fb ldr r3, [r7, #12]
  10567. 80044da: 011b lsls r3, r3, #4
  10568. 80044dc: 4413 add r3, r2
  10569. 80044de: 681b ldr r3, [r3, #0]
  10570. 80044e0: 2b00 cmp r3, #0
  10571. 80044e2: d1f2 bne.n 80044ca <inc_lock+0x66>
  10572. if (i == _FS_LOCK) return 0; /* No free entry to register (int err) */
  10573. 80044e4: 68fb ldr r3, [r7, #12]
  10574. 80044e6: 2b02 cmp r3, #2
  10575. 80044e8: d101 bne.n 80044ee <inc_lock+0x8a>
  10576. 80044ea: 2300 movs r3, #0
  10577. 80044ec: e040 b.n 8004570 <inc_lock+0x10c>
  10578. Files[i].fs = dp->obj.fs;
  10579. 80044ee: 687b ldr r3, [r7, #4]
  10580. 80044f0: 681a ldr r2, [r3, #0]
  10581. 80044f2: 4922 ldr r1, [pc, #136] ; (800457c <inc_lock+0x118>)
  10582. 80044f4: 68fb ldr r3, [r7, #12]
  10583. 80044f6: 011b lsls r3, r3, #4
  10584. 80044f8: 440b add r3, r1
  10585. 80044fa: 601a str r2, [r3, #0]
  10586. Files[i].clu = dp->obj.sclust;
  10587. 80044fc: 687b ldr r3, [r7, #4]
  10588. 80044fe: 689a ldr r2, [r3, #8]
  10589. 8004500: 491e ldr r1, [pc, #120] ; (800457c <inc_lock+0x118>)
  10590. 8004502: 68fb ldr r3, [r7, #12]
  10591. 8004504: 011b lsls r3, r3, #4
  10592. 8004506: 440b add r3, r1
  10593. 8004508: 3304 adds r3, #4
  10594. 800450a: 601a str r2, [r3, #0]
  10595. Files[i].ofs = dp->dptr;
  10596. 800450c: 687b ldr r3, [r7, #4]
  10597. 800450e: 695a ldr r2, [r3, #20]
  10598. 8004510: 491a ldr r1, [pc, #104] ; (800457c <inc_lock+0x118>)
  10599. 8004512: 68fb ldr r3, [r7, #12]
  10600. 8004514: 011b lsls r3, r3, #4
  10601. 8004516: 440b add r3, r1
  10602. 8004518: 3308 adds r3, #8
  10603. 800451a: 601a str r2, [r3, #0]
  10604. Files[i].ctr = 0;
  10605. 800451c: 4a17 ldr r2, [pc, #92] ; (800457c <inc_lock+0x118>)
  10606. 800451e: 68fb ldr r3, [r7, #12]
  10607. 8004520: 011b lsls r3, r3, #4
  10608. 8004522: 4413 add r3, r2
  10609. 8004524: 330c adds r3, #12
  10610. 8004526: 2200 movs r2, #0
  10611. 8004528: 801a strh r2, [r3, #0]
  10612. }
  10613. if (acc && Files[i].ctr) return 0; /* Access violation (int err) */
  10614. 800452a: 683b ldr r3, [r7, #0]
  10615. 800452c: 2b00 cmp r3, #0
  10616. 800452e: d009 beq.n 8004544 <inc_lock+0xe0>
  10617. 8004530: 4a12 ldr r2, [pc, #72] ; (800457c <inc_lock+0x118>)
  10618. 8004532: 68fb ldr r3, [r7, #12]
  10619. 8004534: 011b lsls r3, r3, #4
  10620. 8004536: 4413 add r3, r2
  10621. 8004538: 330c adds r3, #12
  10622. 800453a: 881b ldrh r3, [r3, #0]
  10623. 800453c: 2b00 cmp r3, #0
  10624. 800453e: d001 beq.n 8004544 <inc_lock+0xe0>
  10625. 8004540: 2300 movs r3, #0
  10626. 8004542: e015 b.n 8004570 <inc_lock+0x10c>
  10627. Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1; /* Set semaphore value */
  10628. 8004544: 683b ldr r3, [r7, #0]
  10629. 8004546: 2b00 cmp r3, #0
  10630. 8004548: d108 bne.n 800455c <inc_lock+0xf8>
  10631. 800454a: 4a0c ldr r2, [pc, #48] ; (800457c <inc_lock+0x118>)
  10632. 800454c: 68fb ldr r3, [r7, #12]
  10633. 800454e: 011b lsls r3, r3, #4
  10634. 8004550: 4413 add r3, r2
  10635. 8004552: 330c adds r3, #12
  10636. 8004554: 881b ldrh r3, [r3, #0]
  10637. 8004556: 3301 adds r3, #1
  10638. 8004558: b29a uxth r2, r3
  10639. 800455a: e001 b.n 8004560 <inc_lock+0xfc>
  10640. 800455c: f44f 7280 mov.w r2, #256 ; 0x100
  10641. 8004560: 4906 ldr r1, [pc, #24] ; (800457c <inc_lock+0x118>)
  10642. 8004562: 68fb ldr r3, [r7, #12]
  10643. 8004564: 011b lsls r3, r3, #4
  10644. 8004566: 440b add r3, r1
  10645. 8004568: 330c adds r3, #12
  10646. 800456a: 801a strh r2, [r3, #0]
  10647. return i + 1;
  10648. 800456c: 68fb ldr r3, [r7, #12]
  10649. 800456e: 3301 adds r3, #1
  10650. }
  10651. 8004570: 4618 mov r0, r3
  10652. 8004572: 3714 adds r7, #20
  10653. 8004574: 46bd mov sp, r7
  10654. 8004576: f85d 7b04 ldr.w r7, [sp], #4
  10655. 800457a: 4770 bx lr
  10656. 800457c: 2000004c .word 0x2000004c
  10657. 08004580 <dec_lock>:
  10658. static
  10659. FRESULT dec_lock ( /* Decrement object open counter */
  10660. UINT i /* Semaphore index (1..) */
  10661. )
  10662. {
  10663. 8004580: b480 push {r7}
  10664. 8004582: b085 sub sp, #20
  10665. 8004584: af00 add r7, sp, #0
  10666. 8004586: 6078 str r0, [r7, #4]
  10667. WORD n;
  10668. FRESULT res;
  10669. if (--i < _FS_LOCK) { /* Shift index number origin from 0 */
  10670. 8004588: 687b ldr r3, [r7, #4]
  10671. 800458a: 3b01 subs r3, #1
  10672. 800458c: 607b str r3, [r7, #4]
  10673. 800458e: 687b ldr r3, [r7, #4]
  10674. 8004590: 2b01 cmp r3, #1
  10675. 8004592: d825 bhi.n 80045e0 <dec_lock+0x60>
  10676. n = Files[i].ctr;
  10677. 8004594: 4a17 ldr r2, [pc, #92] ; (80045f4 <dec_lock+0x74>)
  10678. 8004596: 687b ldr r3, [r7, #4]
  10679. 8004598: 011b lsls r3, r3, #4
  10680. 800459a: 4413 add r3, r2
  10681. 800459c: 330c adds r3, #12
  10682. 800459e: 881b ldrh r3, [r3, #0]
  10683. 80045a0: 81fb strh r3, [r7, #14]
  10684. if (n == 0x100) n = 0; /* If write mode open, delete the entry */
  10685. 80045a2: 89fb ldrh r3, [r7, #14]
  10686. 80045a4: f5b3 7f80 cmp.w r3, #256 ; 0x100
  10687. 80045a8: d101 bne.n 80045ae <dec_lock+0x2e>
  10688. 80045aa: 2300 movs r3, #0
  10689. 80045ac: 81fb strh r3, [r7, #14]
  10690. if (n > 0) n--; /* Decrement read mode open count */
  10691. 80045ae: 89fb ldrh r3, [r7, #14]
  10692. 80045b0: 2b00 cmp r3, #0
  10693. 80045b2: d002 beq.n 80045ba <dec_lock+0x3a>
  10694. 80045b4: 89fb ldrh r3, [r7, #14]
  10695. 80045b6: 3b01 subs r3, #1
  10696. 80045b8: 81fb strh r3, [r7, #14]
  10697. Files[i].ctr = n;
  10698. 80045ba: 4a0e ldr r2, [pc, #56] ; (80045f4 <dec_lock+0x74>)
  10699. 80045bc: 687b ldr r3, [r7, #4]
  10700. 80045be: 011b lsls r3, r3, #4
  10701. 80045c0: 4413 add r3, r2
  10702. 80045c2: 330c adds r3, #12
  10703. 80045c4: 89fa ldrh r2, [r7, #14]
  10704. 80045c6: 801a strh r2, [r3, #0]
  10705. if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */
  10706. 80045c8: 89fb ldrh r3, [r7, #14]
  10707. 80045ca: 2b00 cmp r3, #0
  10708. 80045cc: d105 bne.n 80045da <dec_lock+0x5a>
  10709. 80045ce: 4a09 ldr r2, [pc, #36] ; (80045f4 <dec_lock+0x74>)
  10710. 80045d0: 687b ldr r3, [r7, #4]
  10711. 80045d2: 011b lsls r3, r3, #4
  10712. 80045d4: 4413 add r3, r2
  10713. 80045d6: 2200 movs r2, #0
  10714. 80045d8: 601a str r2, [r3, #0]
  10715. res = FR_OK;
  10716. 80045da: 2300 movs r3, #0
  10717. 80045dc: 737b strb r3, [r7, #13]
  10718. 80045de: e001 b.n 80045e4 <dec_lock+0x64>
  10719. } else {
  10720. res = FR_INT_ERR; /* Invalid index nunber */
  10721. 80045e0: 2302 movs r3, #2
  10722. 80045e2: 737b strb r3, [r7, #13]
  10723. }
  10724. return res;
  10725. 80045e4: 7b7b ldrb r3, [r7, #13]
  10726. }
  10727. 80045e6: 4618 mov r0, r3
  10728. 80045e8: 3714 adds r7, #20
  10729. 80045ea: 46bd mov sp, r7
  10730. 80045ec: f85d 7b04 ldr.w r7, [sp], #4
  10731. 80045f0: 4770 bx lr
  10732. 80045f2: bf00 nop
  10733. 80045f4: 2000004c .word 0x2000004c
  10734. 080045f8 <clear_lock>:
  10735. static
  10736. void clear_lock ( /* Clear lock entries of the volume */
  10737. FATFS *fs
  10738. )
  10739. {
  10740. 80045f8: b480 push {r7}
  10741. 80045fa: b085 sub sp, #20
  10742. 80045fc: af00 add r7, sp, #0
  10743. 80045fe: 6078 str r0, [r7, #4]
  10744. UINT i;
  10745. for (i = 0; i < _FS_LOCK; i++) {
  10746. 8004600: 2300 movs r3, #0
  10747. 8004602: 60fb str r3, [r7, #12]
  10748. 8004604: e010 b.n 8004628 <clear_lock+0x30>
  10749. if (Files[i].fs == fs) Files[i].fs = 0;
  10750. 8004606: 4a0d ldr r2, [pc, #52] ; (800463c <clear_lock+0x44>)
  10751. 8004608: 68fb ldr r3, [r7, #12]
  10752. 800460a: 011b lsls r3, r3, #4
  10753. 800460c: 4413 add r3, r2
  10754. 800460e: 681b ldr r3, [r3, #0]
  10755. 8004610: 687a ldr r2, [r7, #4]
  10756. 8004612: 429a cmp r2, r3
  10757. 8004614: d105 bne.n 8004622 <clear_lock+0x2a>
  10758. 8004616: 4a09 ldr r2, [pc, #36] ; (800463c <clear_lock+0x44>)
  10759. 8004618: 68fb ldr r3, [r7, #12]
  10760. 800461a: 011b lsls r3, r3, #4
  10761. 800461c: 4413 add r3, r2
  10762. 800461e: 2200 movs r2, #0
  10763. 8004620: 601a str r2, [r3, #0]
  10764. for (i = 0; i < _FS_LOCK; i++) {
  10765. 8004622: 68fb ldr r3, [r7, #12]
  10766. 8004624: 3301 adds r3, #1
  10767. 8004626: 60fb str r3, [r7, #12]
  10768. 8004628: 68fb ldr r3, [r7, #12]
  10769. 800462a: 2b01 cmp r3, #1
  10770. 800462c: d9eb bls.n 8004606 <clear_lock+0xe>
  10771. }
  10772. }
  10773. 800462e: bf00 nop
  10774. 8004630: 3714 adds r7, #20
  10775. 8004632: 46bd mov sp, r7
  10776. 8004634: f85d 7b04 ldr.w r7, [sp], #4
  10777. 8004638: 4770 bx lr
  10778. 800463a: bf00 nop
  10779. 800463c: 2000004c .word 0x2000004c
  10780. 08004640 <sync_window>:
  10781. #if !_FS_READONLY
  10782. static
  10783. FRESULT sync_window ( /* Returns FR_OK or FR_DISK_ERROR */
  10784. FATFS* fs /* File system object */
  10785. )
  10786. {
  10787. 8004640: b580 push {r7, lr}
  10788. 8004642: b086 sub sp, #24
  10789. 8004644: af00 add r7, sp, #0
  10790. 8004646: 6078 str r0, [r7, #4]
  10791. DWORD wsect;
  10792. UINT nf;
  10793. FRESULT res = FR_OK;
  10794. 8004648: 2300 movs r3, #0
  10795. 800464a: 73fb strb r3, [r7, #15]
  10796. if (fs->wflag) { /* Write back the sector if it is dirty */
  10797. 800464c: 687b ldr r3, [r7, #4]
  10798. 800464e: 78db ldrb r3, [r3, #3]
  10799. 8004650: 2b00 cmp r3, #0
  10800. 8004652: d034 beq.n 80046be <sync_window+0x7e>
  10801. wsect = fs->winsect; /* Current sector number */
  10802. 8004654: 687b ldr r3, [r7, #4]
  10803. 8004656: 6b5b ldr r3, [r3, #52] ; 0x34
  10804. 8004658: 617b str r3, [r7, #20]
  10805. if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK) {
  10806. 800465a: 687b ldr r3, [r7, #4]
  10807. 800465c: 7858 ldrb r0, [r3, #1]
  10808. 800465e: 687b ldr r3, [r7, #4]
  10809. 8004660: f103 0138 add.w r1, r3, #56 ; 0x38
  10810. 8004664: 2301 movs r3, #1
  10811. 8004666: 697a ldr r2, [r7, #20]
  10812. 8004668: f7ff fd40 bl 80040ec <disk_write>
  10813. 800466c: 4603 mov r3, r0
  10814. 800466e: 2b00 cmp r3, #0
  10815. 8004670: d002 beq.n 8004678 <sync_window+0x38>
  10816. res = FR_DISK_ERR;
  10817. 8004672: 2301 movs r3, #1
  10818. 8004674: 73fb strb r3, [r7, #15]
  10819. 8004676: e022 b.n 80046be <sync_window+0x7e>
  10820. } else {
  10821. fs->wflag = 0;
  10822. 8004678: 687b ldr r3, [r7, #4]
  10823. 800467a: 2200 movs r2, #0
  10824. 800467c: 70da strb r2, [r3, #3]
  10825. if (wsect - fs->fatbase < fs->fsize) { /* Is it in the FAT area? */
  10826. 800467e: 687b ldr r3, [r7, #4]
  10827. 8004680: 6a9b ldr r3, [r3, #40] ; 0x28
  10828. 8004682: 697a ldr r2, [r7, #20]
  10829. 8004684: 1ad2 subs r2, r2, r3
  10830. 8004686: 687b ldr r3, [r7, #4]
  10831. 8004688: 6a1b ldr r3, [r3, #32]
  10832. 800468a: 429a cmp r2, r3
  10833. 800468c: d217 bcs.n 80046be <sync_window+0x7e>
  10834. for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
  10835. 800468e: 687b ldr r3, [r7, #4]
  10836. 8004690: 789b ldrb r3, [r3, #2]
  10837. 8004692: 613b str r3, [r7, #16]
  10838. 8004694: e010 b.n 80046b8 <sync_window+0x78>
  10839. wsect += fs->fsize;
  10840. 8004696: 687b ldr r3, [r7, #4]
  10841. 8004698: 6a1b ldr r3, [r3, #32]
  10842. 800469a: 697a ldr r2, [r7, #20]
  10843. 800469c: 4413 add r3, r2
  10844. 800469e: 617b str r3, [r7, #20]
  10845. disk_write(fs->drv, fs->win, wsect, 1);
  10846. 80046a0: 687b ldr r3, [r7, #4]
  10847. 80046a2: 7858 ldrb r0, [r3, #1]
  10848. 80046a4: 687b ldr r3, [r7, #4]
  10849. 80046a6: f103 0138 add.w r1, r3, #56 ; 0x38
  10850. 80046aa: 2301 movs r3, #1
  10851. 80046ac: 697a ldr r2, [r7, #20]
  10852. 80046ae: f7ff fd1d bl 80040ec <disk_write>
  10853. for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
  10854. 80046b2: 693b ldr r3, [r7, #16]
  10855. 80046b4: 3b01 subs r3, #1
  10856. 80046b6: 613b str r3, [r7, #16]
  10857. 80046b8: 693b ldr r3, [r7, #16]
  10858. 80046ba: 2b01 cmp r3, #1
  10859. 80046bc: d8eb bhi.n 8004696 <sync_window+0x56>
  10860. }
  10861. }
  10862. }
  10863. }
  10864. return res;
  10865. 80046be: 7bfb ldrb r3, [r7, #15]
  10866. }
  10867. 80046c0: 4618 mov r0, r3
  10868. 80046c2: 3718 adds r7, #24
  10869. 80046c4: 46bd mov sp, r7
  10870. 80046c6: bd80 pop {r7, pc}
  10871. 080046c8 <move_window>:
  10872. static
  10873. FRESULT move_window ( /* Returns FR_OK or FR_DISK_ERROR */
  10874. FATFS* fs, /* File system object */
  10875. DWORD sector /* Sector number to make appearance in the fs->win[] */
  10876. )
  10877. {
  10878. 80046c8: b580 push {r7, lr}
  10879. 80046ca: b084 sub sp, #16
  10880. 80046cc: af00 add r7, sp, #0
  10881. 80046ce: 6078 str r0, [r7, #4]
  10882. 80046d0: 6039 str r1, [r7, #0]
  10883. FRESULT res = FR_OK;
  10884. 80046d2: 2300 movs r3, #0
  10885. 80046d4: 73fb strb r3, [r7, #15]
  10886. if (sector != fs->winsect) { /* Window offset changed? */
  10887. 80046d6: 687b ldr r3, [r7, #4]
  10888. 80046d8: 6b5b ldr r3, [r3, #52] ; 0x34
  10889. 80046da: 683a ldr r2, [r7, #0]
  10890. 80046dc: 429a cmp r2, r3
  10891. 80046de: d01b beq.n 8004718 <move_window+0x50>
  10892. #if !_FS_READONLY
  10893. res = sync_window(fs); /* Write-back changes */
  10894. 80046e0: 6878 ldr r0, [r7, #4]
  10895. 80046e2: f7ff ffad bl 8004640 <sync_window>
  10896. 80046e6: 4603 mov r3, r0
  10897. 80046e8: 73fb strb r3, [r7, #15]
  10898. #endif
  10899. if (res == FR_OK) { /* Fill sector window with new data */
  10900. 80046ea: 7bfb ldrb r3, [r7, #15]
  10901. 80046ec: 2b00 cmp r3, #0
  10902. 80046ee: d113 bne.n 8004718 <move_window+0x50>
  10903. if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK) {
  10904. 80046f0: 687b ldr r3, [r7, #4]
  10905. 80046f2: 7858 ldrb r0, [r3, #1]
  10906. 80046f4: 687b ldr r3, [r7, #4]
  10907. 80046f6: f103 0138 add.w r1, r3, #56 ; 0x38
  10908. 80046fa: 2301 movs r3, #1
  10909. 80046fc: 683a ldr r2, [r7, #0]
  10910. 80046fe: f7ff fcd5 bl 80040ac <disk_read>
  10911. 8004702: 4603 mov r3, r0
  10912. 8004704: 2b00 cmp r3, #0
  10913. 8004706: d004 beq.n 8004712 <move_window+0x4a>
  10914. sector = 0xFFFFFFFF; /* Invalidate window if data is not reliable */
  10915. 8004708: f04f 33ff mov.w r3, #4294967295
  10916. 800470c: 603b str r3, [r7, #0]
  10917. res = FR_DISK_ERR;
  10918. 800470e: 2301 movs r3, #1
  10919. 8004710: 73fb strb r3, [r7, #15]
  10920. }
  10921. fs->winsect = sector;
  10922. 8004712: 687b ldr r3, [r7, #4]
  10923. 8004714: 683a ldr r2, [r7, #0]
  10924. 8004716: 635a str r2, [r3, #52] ; 0x34
  10925. }
  10926. }
  10927. return res;
  10928. 8004718: 7bfb ldrb r3, [r7, #15]
  10929. }
  10930. 800471a: 4618 mov r0, r3
  10931. 800471c: 3710 adds r7, #16
  10932. 800471e: 46bd mov sp, r7
  10933. 8004720: bd80 pop {r7, pc}
  10934. ...
  10935. 08004724 <sync_fs>:
  10936. static
  10937. FRESULT sync_fs ( /* FR_OK:succeeded, !=0:error */
  10938. FATFS* fs /* File system object */
  10939. )
  10940. {
  10941. 8004724: b580 push {r7, lr}
  10942. 8004726: b084 sub sp, #16
  10943. 8004728: af00 add r7, sp, #0
  10944. 800472a: 6078 str r0, [r7, #4]
  10945. FRESULT res;
  10946. res = sync_window(fs);
  10947. 800472c: 6878 ldr r0, [r7, #4]
  10948. 800472e: f7ff ff87 bl 8004640 <sync_window>
  10949. 8004732: 4603 mov r3, r0
  10950. 8004734: 73fb strb r3, [r7, #15]
  10951. if (res == FR_OK) {
  10952. 8004736: 7bfb ldrb r3, [r7, #15]
  10953. 8004738: 2b00 cmp r3, #0
  10954. 800473a: d159 bne.n 80047f0 <sync_fs+0xcc>
  10955. /* Update FSInfo sector if needed */
  10956. if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) {
  10957. 800473c: 687b ldr r3, [r7, #4]
  10958. 800473e: 781b ldrb r3, [r3, #0]
  10959. 8004740: 2b03 cmp r3, #3
  10960. 8004742: d149 bne.n 80047d8 <sync_fs+0xb4>
  10961. 8004744: 687b ldr r3, [r7, #4]
  10962. 8004746: 791b ldrb r3, [r3, #4]
  10963. 8004748: 2b01 cmp r3, #1
  10964. 800474a: d145 bne.n 80047d8 <sync_fs+0xb4>
  10965. /* Create FSInfo structure */
  10966. mem_set(fs->win, 0, SS(fs));
  10967. 800474c: 687b ldr r3, [r7, #4]
  10968. 800474e: f103 0038 add.w r0, r3, #56 ; 0x38
  10969. 8004752: 687b ldr r3, [r7, #4]
  10970. 8004754: 899b ldrh r3, [r3, #12]
  10971. 8004756: 461a mov r2, r3
  10972. 8004758: 2100 movs r1, #0
  10973. 800475a: f7ff fda8 bl 80042ae <mem_set>
  10974. st_word(fs->win + BS_55AA, 0xAA55);
  10975. 800475e: 687b ldr r3, [r7, #4]
  10976. 8004760: 3338 adds r3, #56 ; 0x38
  10977. 8004762: f503 73ff add.w r3, r3, #510 ; 0x1fe
  10978. 8004766: f64a 2155 movw r1, #43605 ; 0xaa55
  10979. 800476a: 4618 mov r0, r3
  10980. 800476c: f7ff fd37 bl 80041de <st_word>
  10981. st_dword(fs->win + FSI_LeadSig, 0x41615252);
  10982. 8004770: 687b ldr r3, [r7, #4]
  10983. 8004772: 3338 adds r3, #56 ; 0x38
  10984. 8004774: 4921 ldr r1, [pc, #132] ; (80047fc <sync_fs+0xd8>)
  10985. 8004776: 4618 mov r0, r3
  10986. 8004778: f7ff fd4c bl 8004214 <st_dword>
  10987. st_dword(fs->win + FSI_StrucSig, 0x61417272);
  10988. 800477c: 687b ldr r3, [r7, #4]
  10989. 800477e: 3338 adds r3, #56 ; 0x38
  10990. 8004780: f503 73f2 add.w r3, r3, #484 ; 0x1e4
  10991. 8004784: 491e ldr r1, [pc, #120] ; (8004800 <sync_fs+0xdc>)
  10992. 8004786: 4618 mov r0, r3
  10993. 8004788: f7ff fd44 bl 8004214 <st_dword>
  10994. st_dword(fs->win + FSI_Free_Count, fs->free_clst);
  10995. 800478c: 687b ldr r3, [r7, #4]
  10996. 800478e: 3338 adds r3, #56 ; 0x38
  10997. 8004790: f503 72f4 add.w r2, r3, #488 ; 0x1e8
  10998. 8004794: 687b ldr r3, [r7, #4]
  10999. 8004796: 699b ldr r3, [r3, #24]
  11000. 8004798: 4619 mov r1, r3
  11001. 800479a: 4610 mov r0, r2
  11002. 800479c: f7ff fd3a bl 8004214 <st_dword>
  11003. st_dword(fs->win + FSI_Nxt_Free, fs->last_clst);
  11004. 80047a0: 687b ldr r3, [r7, #4]
  11005. 80047a2: 3338 adds r3, #56 ; 0x38
  11006. 80047a4: f503 72f6 add.w r2, r3, #492 ; 0x1ec
  11007. 80047a8: 687b ldr r3, [r7, #4]
  11008. 80047aa: 695b ldr r3, [r3, #20]
  11009. 80047ac: 4619 mov r1, r3
  11010. 80047ae: 4610 mov r0, r2
  11011. 80047b0: f7ff fd30 bl 8004214 <st_dword>
  11012. /* Write it into the FSInfo sector */
  11013. fs->winsect = fs->volbase + 1;
  11014. 80047b4: 687b ldr r3, [r7, #4]
  11015. 80047b6: 6a5b ldr r3, [r3, #36] ; 0x24
  11016. 80047b8: 1c5a adds r2, r3, #1
  11017. 80047ba: 687b ldr r3, [r7, #4]
  11018. 80047bc: 635a str r2, [r3, #52] ; 0x34
  11019. disk_write(fs->drv, fs->win, fs->winsect, 1);
  11020. 80047be: 687b ldr r3, [r7, #4]
  11021. 80047c0: 7858 ldrb r0, [r3, #1]
  11022. 80047c2: 687b ldr r3, [r7, #4]
  11023. 80047c4: f103 0138 add.w r1, r3, #56 ; 0x38
  11024. 80047c8: 687b ldr r3, [r7, #4]
  11025. 80047ca: 6b5a ldr r2, [r3, #52] ; 0x34
  11026. 80047cc: 2301 movs r3, #1
  11027. 80047ce: f7ff fc8d bl 80040ec <disk_write>
  11028. fs->fsi_flag = 0;
  11029. 80047d2: 687b ldr r3, [r7, #4]
  11030. 80047d4: 2200 movs r2, #0
  11031. 80047d6: 711a strb r2, [r3, #4]
  11032. }
  11033. /* Make sure that no pending write process in the physical drive */
  11034. if (disk_ioctl(fs->drv, CTRL_SYNC, 0) != RES_OK) res = FR_DISK_ERR;
  11035. 80047d8: 687b ldr r3, [r7, #4]
  11036. 80047da: 785b ldrb r3, [r3, #1]
  11037. 80047dc: 2200 movs r2, #0
  11038. 80047de: 2100 movs r1, #0
  11039. 80047e0: 4618 mov r0, r3
  11040. 80047e2: f7ff fca3 bl 800412c <disk_ioctl>
  11041. 80047e6: 4603 mov r3, r0
  11042. 80047e8: 2b00 cmp r3, #0
  11043. 80047ea: d001 beq.n 80047f0 <sync_fs+0xcc>
  11044. 80047ec: 2301 movs r3, #1
  11045. 80047ee: 73fb strb r3, [r7, #15]
  11046. }
  11047. return res;
  11048. 80047f0: 7bfb ldrb r3, [r7, #15]
  11049. }
  11050. 80047f2: 4618 mov r0, r3
  11051. 80047f4: 3710 adds r7, #16
  11052. 80047f6: 46bd mov sp, r7
  11053. 80047f8: bd80 pop {r7, pc}
  11054. 80047fa: bf00 nop
  11055. 80047fc: 41615252 .word 0x41615252
  11056. 8004800: 61417272 .word 0x61417272
  11057. 08004804 <clust2sect>:
  11058. static
  11059. DWORD clust2sect ( /* !=0:Sector number, 0:Failed (invalid cluster#) */
  11060. FATFS* fs, /* File system object */
  11061. DWORD clst /* Cluster# to be converted */
  11062. )
  11063. {
  11064. 8004804: b480 push {r7}
  11065. 8004806: b083 sub sp, #12
  11066. 8004808: af00 add r7, sp, #0
  11067. 800480a: 6078 str r0, [r7, #4]
  11068. 800480c: 6039 str r1, [r7, #0]
  11069. clst -= 2;
  11070. 800480e: 683b ldr r3, [r7, #0]
  11071. 8004810: 3b02 subs r3, #2
  11072. 8004812: 603b str r3, [r7, #0]
  11073. if (clst >= fs->n_fatent - 2) return 0; /* Invalid cluster# */
  11074. 8004814: 687b ldr r3, [r7, #4]
  11075. 8004816: 69db ldr r3, [r3, #28]
  11076. 8004818: 3b02 subs r3, #2
  11077. 800481a: 683a ldr r2, [r7, #0]
  11078. 800481c: 429a cmp r2, r3
  11079. 800481e: d301 bcc.n 8004824 <clust2sect+0x20>
  11080. 8004820: 2300 movs r3, #0
  11081. 8004822: e008 b.n 8004836 <clust2sect+0x32>
  11082. return clst * fs->csize + fs->database;
  11083. 8004824: 687b ldr r3, [r7, #4]
  11084. 8004826: 895b ldrh r3, [r3, #10]
  11085. 8004828: 461a mov r2, r3
  11086. 800482a: 683b ldr r3, [r7, #0]
  11087. 800482c: fb03 f202 mul.w r2, r3, r2
  11088. 8004830: 687b ldr r3, [r7, #4]
  11089. 8004832: 6b1b ldr r3, [r3, #48] ; 0x30
  11090. 8004834: 4413 add r3, r2
  11091. }
  11092. 8004836: 4618 mov r0, r3
  11093. 8004838: 370c adds r7, #12
  11094. 800483a: 46bd mov sp, r7
  11095. 800483c: f85d 7b04 ldr.w r7, [sp], #4
  11096. 8004840: 4770 bx lr
  11097. 08004842 <get_fat>:
  11098. static
  11099. DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluster status */
  11100. _FDID* obj, /* Corresponding object */
  11101. DWORD clst /* Cluster number to get the value */
  11102. )
  11103. {
  11104. 8004842: b580 push {r7, lr}
  11105. 8004844: b086 sub sp, #24
  11106. 8004846: af00 add r7, sp, #0
  11107. 8004848: 6078 str r0, [r7, #4]
  11108. 800484a: 6039 str r1, [r7, #0]
  11109. UINT wc, bc;
  11110. DWORD val;
  11111. FATFS *fs = obj->fs;
  11112. 800484c: 687b ldr r3, [r7, #4]
  11113. 800484e: 681b ldr r3, [r3, #0]
  11114. 8004850: 613b str r3, [r7, #16]
  11115. if (clst < 2 || clst >= fs->n_fatent) { /* Check if in valid range */
  11116. 8004852: 683b ldr r3, [r7, #0]
  11117. 8004854: 2b01 cmp r3, #1
  11118. 8004856: d904 bls.n 8004862 <get_fat+0x20>
  11119. 8004858: 693b ldr r3, [r7, #16]
  11120. 800485a: 69db ldr r3, [r3, #28]
  11121. 800485c: 683a ldr r2, [r7, #0]
  11122. 800485e: 429a cmp r2, r3
  11123. 8004860: d302 bcc.n 8004868 <get_fat+0x26>
  11124. val = 1; /* Internal error */
  11125. 8004862: 2301 movs r3, #1
  11126. 8004864: 617b str r3, [r7, #20]
  11127. 8004866: e0b7 b.n 80049d8 <get_fat+0x196>
  11128. } else {
  11129. val = 0xFFFFFFFF; /* Default value falls on disk error */
  11130. 8004868: f04f 33ff mov.w r3, #4294967295
  11131. 800486c: 617b str r3, [r7, #20]
  11132. switch (fs->fs_type) {
  11133. 800486e: 693b ldr r3, [r7, #16]
  11134. 8004870: 781b ldrb r3, [r3, #0]
  11135. 8004872: 2b02 cmp r3, #2
  11136. 8004874: d05a beq.n 800492c <get_fat+0xea>
  11137. 8004876: 2b03 cmp r3, #3
  11138. 8004878: d07d beq.n 8004976 <get_fat+0x134>
  11139. 800487a: 2b01 cmp r3, #1
  11140. 800487c: f040 80a2 bne.w 80049c4 <get_fat+0x182>
  11141. case FS_FAT12 :
  11142. bc = (UINT)clst; bc += bc / 2;
  11143. 8004880: 683b ldr r3, [r7, #0]
  11144. 8004882: 60fb str r3, [r7, #12]
  11145. 8004884: 68fb ldr r3, [r7, #12]
  11146. 8004886: 085b lsrs r3, r3, #1
  11147. 8004888: 68fa ldr r2, [r7, #12]
  11148. 800488a: 4413 add r3, r2
  11149. 800488c: 60fb str r3, [r7, #12]
  11150. if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
  11151. 800488e: 693b ldr r3, [r7, #16]
  11152. 8004890: 6a9a ldr r2, [r3, #40] ; 0x28
  11153. 8004892: 693b ldr r3, [r7, #16]
  11154. 8004894: 899b ldrh r3, [r3, #12]
  11155. 8004896: 4619 mov r1, r3
  11156. 8004898: 68fb ldr r3, [r7, #12]
  11157. 800489a: fbb3 f3f1 udiv r3, r3, r1
  11158. 800489e: 4413 add r3, r2
  11159. 80048a0: 4619 mov r1, r3
  11160. 80048a2: 6938 ldr r0, [r7, #16]
  11161. 80048a4: f7ff ff10 bl 80046c8 <move_window>
  11162. 80048a8: 4603 mov r3, r0
  11163. 80048aa: 2b00 cmp r3, #0
  11164. 80048ac: f040 808d bne.w 80049ca <get_fat+0x188>
  11165. wc = fs->win[bc++ % SS(fs)];
  11166. 80048b0: 68fb ldr r3, [r7, #12]
  11167. 80048b2: 1c5a adds r2, r3, #1
  11168. 80048b4: 60fa str r2, [r7, #12]
  11169. 80048b6: 693a ldr r2, [r7, #16]
  11170. 80048b8: 8992 ldrh r2, [r2, #12]
  11171. 80048ba: fbb3 f1f2 udiv r1, r3, r2
  11172. 80048be: fb02 f201 mul.w r2, r2, r1
  11173. 80048c2: 1a9b subs r3, r3, r2
  11174. 80048c4: 693a ldr r2, [r7, #16]
  11175. 80048c6: 4413 add r3, r2
  11176. 80048c8: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
  11177. 80048cc: 60bb str r3, [r7, #8]
  11178. if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
  11179. 80048ce: 693b ldr r3, [r7, #16]
  11180. 80048d0: 6a9a ldr r2, [r3, #40] ; 0x28
  11181. 80048d2: 693b ldr r3, [r7, #16]
  11182. 80048d4: 899b ldrh r3, [r3, #12]
  11183. 80048d6: 4619 mov r1, r3
  11184. 80048d8: 68fb ldr r3, [r7, #12]
  11185. 80048da: fbb3 f3f1 udiv r3, r3, r1
  11186. 80048de: 4413 add r3, r2
  11187. 80048e0: 4619 mov r1, r3
  11188. 80048e2: 6938 ldr r0, [r7, #16]
  11189. 80048e4: f7ff fef0 bl 80046c8 <move_window>
  11190. 80048e8: 4603 mov r3, r0
  11191. 80048ea: 2b00 cmp r3, #0
  11192. 80048ec: d16f bne.n 80049ce <get_fat+0x18c>
  11193. wc |= fs->win[bc % SS(fs)] << 8;
  11194. 80048ee: 693b ldr r3, [r7, #16]
  11195. 80048f0: 899b ldrh r3, [r3, #12]
  11196. 80048f2: 461a mov r2, r3
  11197. 80048f4: 68fb ldr r3, [r7, #12]
  11198. 80048f6: fbb3 f1f2 udiv r1, r3, r2
  11199. 80048fa: fb02 f201 mul.w r2, r2, r1
  11200. 80048fe: 1a9b subs r3, r3, r2
  11201. 8004900: 693a ldr r2, [r7, #16]
  11202. 8004902: 4413 add r3, r2
  11203. 8004904: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
  11204. 8004908: 021b lsls r3, r3, #8
  11205. 800490a: 461a mov r2, r3
  11206. 800490c: 68bb ldr r3, [r7, #8]
  11207. 800490e: 4313 orrs r3, r2
  11208. 8004910: 60bb str r3, [r7, #8]
  11209. val = (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
  11210. 8004912: 683b ldr r3, [r7, #0]
  11211. 8004914: f003 0301 and.w r3, r3, #1
  11212. 8004918: 2b00 cmp r3, #0
  11213. 800491a: d002 beq.n 8004922 <get_fat+0xe0>
  11214. 800491c: 68bb ldr r3, [r7, #8]
  11215. 800491e: 091b lsrs r3, r3, #4
  11216. 8004920: e002 b.n 8004928 <get_fat+0xe6>
  11217. 8004922: 68bb ldr r3, [r7, #8]
  11218. 8004924: f3c3 030b ubfx r3, r3, #0, #12
  11219. 8004928: 617b str r3, [r7, #20]
  11220. break;
  11221. 800492a: e055 b.n 80049d8 <get_fat+0x196>
  11222. case FS_FAT16 :
  11223. if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
  11224. 800492c: 693b ldr r3, [r7, #16]
  11225. 800492e: 6a9a ldr r2, [r3, #40] ; 0x28
  11226. 8004930: 693b ldr r3, [r7, #16]
  11227. 8004932: 899b ldrh r3, [r3, #12]
  11228. 8004934: 085b lsrs r3, r3, #1
  11229. 8004936: b29b uxth r3, r3
  11230. 8004938: 4619 mov r1, r3
  11231. 800493a: 683b ldr r3, [r7, #0]
  11232. 800493c: fbb3 f3f1 udiv r3, r3, r1
  11233. 8004940: 4413 add r3, r2
  11234. 8004942: 4619 mov r1, r3
  11235. 8004944: 6938 ldr r0, [r7, #16]
  11236. 8004946: f7ff febf bl 80046c8 <move_window>
  11237. 800494a: 4603 mov r3, r0
  11238. 800494c: 2b00 cmp r3, #0
  11239. 800494e: d140 bne.n 80049d2 <get_fat+0x190>
  11240. val = ld_word(fs->win + clst * 2 % SS(fs));
  11241. 8004950: 693b ldr r3, [r7, #16]
  11242. 8004952: f103 0138 add.w r1, r3, #56 ; 0x38
  11243. 8004956: 683b ldr r3, [r7, #0]
  11244. 8004958: 005b lsls r3, r3, #1
  11245. 800495a: 693a ldr r2, [r7, #16]
  11246. 800495c: 8992 ldrh r2, [r2, #12]
  11247. 800495e: fbb3 f0f2 udiv r0, r3, r2
  11248. 8004962: fb02 f200 mul.w r2, r2, r0
  11249. 8004966: 1a9b subs r3, r3, r2
  11250. 8004968: 440b add r3, r1
  11251. 800496a: 4618 mov r0, r3
  11252. 800496c: f7ff fbfc bl 8004168 <ld_word>
  11253. 8004970: 4603 mov r3, r0
  11254. 8004972: 617b str r3, [r7, #20]
  11255. break;
  11256. 8004974: e030 b.n 80049d8 <get_fat+0x196>
  11257. case FS_FAT32 :
  11258. if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
  11259. 8004976: 693b ldr r3, [r7, #16]
  11260. 8004978: 6a9a ldr r2, [r3, #40] ; 0x28
  11261. 800497a: 693b ldr r3, [r7, #16]
  11262. 800497c: 899b ldrh r3, [r3, #12]
  11263. 800497e: 089b lsrs r3, r3, #2
  11264. 8004980: b29b uxth r3, r3
  11265. 8004982: 4619 mov r1, r3
  11266. 8004984: 683b ldr r3, [r7, #0]
  11267. 8004986: fbb3 f3f1 udiv r3, r3, r1
  11268. 800498a: 4413 add r3, r2
  11269. 800498c: 4619 mov r1, r3
  11270. 800498e: 6938 ldr r0, [r7, #16]
  11271. 8004990: f7ff fe9a bl 80046c8 <move_window>
  11272. 8004994: 4603 mov r3, r0
  11273. 8004996: 2b00 cmp r3, #0
  11274. 8004998: d11d bne.n 80049d6 <get_fat+0x194>
  11275. val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF;
  11276. 800499a: 693b ldr r3, [r7, #16]
  11277. 800499c: f103 0138 add.w r1, r3, #56 ; 0x38
  11278. 80049a0: 683b ldr r3, [r7, #0]
  11279. 80049a2: 009b lsls r3, r3, #2
  11280. 80049a4: 693a ldr r2, [r7, #16]
  11281. 80049a6: 8992 ldrh r2, [r2, #12]
  11282. 80049a8: fbb3 f0f2 udiv r0, r3, r2
  11283. 80049ac: fb02 f200 mul.w r2, r2, r0
  11284. 80049b0: 1a9b subs r3, r3, r2
  11285. 80049b2: 440b add r3, r1
  11286. 80049b4: 4618 mov r0, r3
  11287. 80049b6: f7ff fbef bl 8004198 <ld_dword>
  11288. 80049ba: 4603 mov r3, r0
  11289. 80049bc: f023 4370 bic.w r3, r3, #4026531840 ; 0xf0000000
  11290. 80049c0: 617b str r3, [r7, #20]
  11291. break;
  11292. 80049c2: e009 b.n 80049d8 <get_fat+0x196>
  11293. }
  11294. }
  11295. /* go to default */
  11296. #endif
  11297. default:
  11298. val = 1; /* Internal error */
  11299. 80049c4: 2301 movs r3, #1
  11300. 80049c6: 617b str r3, [r7, #20]
  11301. 80049c8: e006 b.n 80049d8 <get_fat+0x196>
  11302. if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
  11303. 80049ca: bf00 nop
  11304. 80049cc: e004 b.n 80049d8 <get_fat+0x196>
  11305. if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
  11306. 80049ce: bf00 nop
  11307. 80049d0: e002 b.n 80049d8 <get_fat+0x196>
  11308. if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
  11309. 80049d2: bf00 nop
  11310. 80049d4: e000 b.n 80049d8 <get_fat+0x196>
  11311. if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
  11312. 80049d6: bf00 nop
  11313. }
  11314. }
  11315. return val;
  11316. 80049d8: 697b ldr r3, [r7, #20]
  11317. }
  11318. 80049da: 4618 mov r0, r3
  11319. 80049dc: 3718 adds r7, #24
  11320. 80049de: 46bd mov sp, r7
  11321. 80049e0: bd80 pop {r7, pc}
  11322. 080049e2 <put_fat>:
  11323. FRESULT put_fat ( /* FR_OK(0):succeeded, !=0:error */
  11324. FATFS* fs, /* Corresponding file system object */
  11325. DWORD clst, /* FAT index number (cluster number) to be changed */
  11326. DWORD val /* New value to be set to the entry */
  11327. )
  11328. {
  11329. 80049e2: b590 push {r4, r7, lr}
  11330. 80049e4: b089 sub sp, #36 ; 0x24
  11331. 80049e6: af00 add r7, sp, #0
  11332. 80049e8: 60f8 str r0, [r7, #12]
  11333. 80049ea: 60b9 str r1, [r7, #8]
  11334. 80049ec: 607a str r2, [r7, #4]
  11335. UINT bc;
  11336. BYTE *p;
  11337. FRESULT res = FR_INT_ERR;
  11338. 80049ee: 2302 movs r3, #2
  11339. 80049f0: 77fb strb r3, [r7, #31]
  11340. if (clst >= 2 && clst < fs->n_fatent) { /* Check if in valid range */
  11341. 80049f2: 68bb ldr r3, [r7, #8]
  11342. 80049f4: 2b01 cmp r3, #1
  11343. 80049f6: f240 8106 bls.w 8004c06 <put_fat+0x224>
  11344. 80049fa: 68fb ldr r3, [r7, #12]
  11345. 80049fc: 69db ldr r3, [r3, #28]
  11346. 80049fe: 68ba ldr r2, [r7, #8]
  11347. 8004a00: 429a cmp r2, r3
  11348. 8004a02: f080 8100 bcs.w 8004c06 <put_fat+0x224>
  11349. switch (fs->fs_type) {
  11350. 8004a06: 68fb ldr r3, [r7, #12]
  11351. 8004a08: 781b ldrb r3, [r3, #0]
  11352. 8004a0a: 2b02 cmp r3, #2
  11353. 8004a0c: f000 8088 beq.w 8004b20 <put_fat+0x13e>
  11354. 8004a10: 2b03 cmp r3, #3
  11355. 8004a12: f000 80b0 beq.w 8004b76 <put_fat+0x194>
  11356. 8004a16: 2b01 cmp r3, #1
  11357. 8004a18: f040 80f5 bne.w 8004c06 <put_fat+0x224>
  11358. case FS_FAT12 : /* Bitfield items */
  11359. bc = (UINT)clst; bc += bc / 2;
  11360. 8004a1c: 68bb ldr r3, [r7, #8]
  11361. 8004a1e: 61bb str r3, [r7, #24]
  11362. 8004a20: 69bb ldr r3, [r7, #24]
  11363. 8004a22: 085b lsrs r3, r3, #1
  11364. 8004a24: 69ba ldr r2, [r7, #24]
  11365. 8004a26: 4413 add r3, r2
  11366. 8004a28: 61bb str r3, [r7, #24]
  11367. res = move_window(fs, fs->fatbase + (bc / SS(fs)));
  11368. 8004a2a: 68fb ldr r3, [r7, #12]
  11369. 8004a2c: 6a9a ldr r2, [r3, #40] ; 0x28
  11370. 8004a2e: 68fb ldr r3, [r7, #12]
  11371. 8004a30: 899b ldrh r3, [r3, #12]
  11372. 8004a32: 4619 mov r1, r3
  11373. 8004a34: 69bb ldr r3, [r7, #24]
  11374. 8004a36: fbb3 f3f1 udiv r3, r3, r1
  11375. 8004a3a: 4413 add r3, r2
  11376. 8004a3c: 4619 mov r1, r3
  11377. 8004a3e: 68f8 ldr r0, [r7, #12]
  11378. 8004a40: f7ff fe42 bl 80046c8 <move_window>
  11379. 8004a44: 4603 mov r3, r0
  11380. 8004a46: 77fb strb r3, [r7, #31]
  11381. if (res != FR_OK) break;
  11382. 8004a48: 7ffb ldrb r3, [r7, #31]
  11383. 8004a4a: 2b00 cmp r3, #0
  11384. 8004a4c: f040 80d4 bne.w 8004bf8 <put_fat+0x216>
  11385. p = fs->win + bc++ % SS(fs);
  11386. 8004a50: 68fb ldr r3, [r7, #12]
  11387. 8004a52: f103 0138 add.w r1, r3, #56 ; 0x38
  11388. 8004a56: 69bb ldr r3, [r7, #24]
  11389. 8004a58: 1c5a adds r2, r3, #1
  11390. 8004a5a: 61ba str r2, [r7, #24]
  11391. 8004a5c: 68fa ldr r2, [r7, #12]
  11392. 8004a5e: 8992 ldrh r2, [r2, #12]
  11393. 8004a60: fbb3 f0f2 udiv r0, r3, r2
  11394. 8004a64: fb02 f200 mul.w r2, r2, r0
  11395. 8004a68: 1a9b subs r3, r3, r2
  11396. 8004a6a: 440b add r3, r1
  11397. 8004a6c: 617b str r3, [r7, #20]
  11398. *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val;
  11399. 8004a6e: 68bb ldr r3, [r7, #8]
  11400. 8004a70: f003 0301 and.w r3, r3, #1
  11401. 8004a74: 2b00 cmp r3, #0
  11402. 8004a76: d00d beq.n 8004a94 <put_fat+0xb2>
  11403. 8004a78: 697b ldr r3, [r7, #20]
  11404. 8004a7a: 781b ldrb r3, [r3, #0]
  11405. 8004a7c: b25b sxtb r3, r3
  11406. 8004a7e: f003 030f and.w r3, r3, #15
  11407. 8004a82: b25a sxtb r2, r3
  11408. 8004a84: 687b ldr r3, [r7, #4]
  11409. 8004a86: b2db uxtb r3, r3
  11410. 8004a88: 011b lsls r3, r3, #4
  11411. 8004a8a: b25b sxtb r3, r3
  11412. 8004a8c: 4313 orrs r3, r2
  11413. 8004a8e: b25b sxtb r3, r3
  11414. 8004a90: b2db uxtb r3, r3
  11415. 8004a92: e001 b.n 8004a98 <put_fat+0xb6>
  11416. 8004a94: 687b ldr r3, [r7, #4]
  11417. 8004a96: b2db uxtb r3, r3
  11418. 8004a98: 697a ldr r2, [r7, #20]
  11419. 8004a9a: 7013 strb r3, [r2, #0]
  11420. fs->wflag = 1;
  11421. 8004a9c: 68fb ldr r3, [r7, #12]
  11422. 8004a9e: 2201 movs r2, #1
  11423. 8004aa0: 70da strb r2, [r3, #3]
  11424. res = move_window(fs, fs->fatbase + (bc / SS(fs)));
  11425. 8004aa2: 68fb ldr r3, [r7, #12]
  11426. 8004aa4: 6a9a ldr r2, [r3, #40] ; 0x28
  11427. 8004aa6: 68fb ldr r3, [r7, #12]
  11428. 8004aa8: 899b ldrh r3, [r3, #12]
  11429. 8004aaa: 4619 mov r1, r3
  11430. 8004aac: 69bb ldr r3, [r7, #24]
  11431. 8004aae: fbb3 f3f1 udiv r3, r3, r1
  11432. 8004ab2: 4413 add r3, r2
  11433. 8004ab4: 4619 mov r1, r3
  11434. 8004ab6: 68f8 ldr r0, [r7, #12]
  11435. 8004ab8: f7ff fe06 bl 80046c8 <move_window>
  11436. 8004abc: 4603 mov r3, r0
  11437. 8004abe: 77fb strb r3, [r7, #31]
  11438. if (res != FR_OK) break;
  11439. 8004ac0: 7ffb ldrb r3, [r7, #31]
  11440. 8004ac2: 2b00 cmp r3, #0
  11441. 8004ac4: f040 809a bne.w 8004bfc <put_fat+0x21a>
  11442. p = fs->win + bc % SS(fs);
  11443. 8004ac8: 68fb ldr r3, [r7, #12]
  11444. 8004aca: f103 0138 add.w r1, r3, #56 ; 0x38
  11445. 8004ace: 68fb ldr r3, [r7, #12]
  11446. 8004ad0: 899b ldrh r3, [r3, #12]
  11447. 8004ad2: 461a mov r2, r3
  11448. 8004ad4: 69bb ldr r3, [r7, #24]
  11449. 8004ad6: fbb3 f0f2 udiv r0, r3, r2
  11450. 8004ada: fb02 f200 mul.w r2, r2, r0
  11451. 8004ade: 1a9b subs r3, r3, r2
  11452. 8004ae0: 440b add r3, r1
  11453. 8004ae2: 617b str r3, [r7, #20]
  11454. *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F));
  11455. 8004ae4: 68bb ldr r3, [r7, #8]
  11456. 8004ae6: f003 0301 and.w r3, r3, #1
  11457. 8004aea: 2b00 cmp r3, #0
  11458. 8004aec: d003 beq.n 8004af6 <put_fat+0x114>
  11459. 8004aee: 687b ldr r3, [r7, #4]
  11460. 8004af0: 091b lsrs r3, r3, #4
  11461. 8004af2: b2db uxtb r3, r3
  11462. 8004af4: e00e b.n 8004b14 <put_fat+0x132>
  11463. 8004af6: 697b ldr r3, [r7, #20]
  11464. 8004af8: 781b ldrb r3, [r3, #0]
  11465. 8004afa: b25b sxtb r3, r3
  11466. 8004afc: f023 030f bic.w r3, r3, #15
  11467. 8004b00: b25a sxtb r2, r3
  11468. 8004b02: 687b ldr r3, [r7, #4]
  11469. 8004b04: 0a1b lsrs r3, r3, #8
  11470. 8004b06: b25b sxtb r3, r3
  11471. 8004b08: f003 030f and.w r3, r3, #15
  11472. 8004b0c: b25b sxtb r3, r3
  11473. 8004b0e: 4313 orrs r3, r2
  11474. 8004b10: b25b sxtb r3, r3
  11475. 8004b12: b2db uxtb r3, r3
  11476. 8004b14: 697a ldr r2, [r7, #20]
  11477. 8004b16: 7013 strb r3, [r2, #0]
  11478. fs->wflag = 1;
  11479. 8004b18: 68fb ldr r3, [r7, #12]
  11480. 8004b1a: 2201 movs r2, #1
  11481. 8004b1c: 70da strb r2, [r3, #3]
  11482. break;
  11483. 8004b1e: e072 b.n 8004c06 <put_fat+0x224>
  11484. case FS_FAT16 : /* WORD aligned items */
  11485. res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)));
  11486. 8004b20: 68fb ldr r3, [r7, #12]
  11487. 8004b22: 6a9a ldr r2, [r3, #40] ; 0x28
  11488. 8004b24: 68fb ldr r3, [r7, #12]
  11489. 8004b26: 899b ldrh r3, [r3, #12]
  11490. 8004b28: 085b lsrs r3, r3, #1
  11491. 8004b2a: b29b uxth r3, r3
  11492. 8004b2c: 4619 mov r1, r3
  11493. 8004b2e: 68bb ldr r3, [r7, #8]
  11494. 8004b30: fbb3 f3f1 udiv r3, r3, r1
  11495. 8004b34: 4413 add r3, r2
  11496. 8004b36: 4619 mov r1, r3
  11497. 8004b38: 68f8 ldr r0, [r7, #12]
  11498. 8004b3a: f7ff fdc5 bl 80046c8 <move_window>
  11499. 8004b3e: 4603 mov r3, r0
  11500. 8004b40: 77fb strb r3, [r7, #31]
  11501. if (res != FR_OK) break;
  11502. 8004b42: 7ffb ldrb r3, [r7, #31]
  11503. 8004b44: 2b00 cmp r3, #0
  11504. 8004b46: d15b bne.n 8004c00 <put_fat+0x21e>
  11505. st_word(fs->win + clst * 2 % SS(fs), (WORD)val);
  11506. 8004b48: 68fb ldr r3, [r7, #12]
  11507. 8004b4a: f103 0138 add.w r1, r3, #56 ; 0x38
  11508. 8004b4e: 68bb ldr r3, [r7, #8]
  11509. 8004b50: 005b lsls r3, r3, #1
  11510. 8004b52: 68fa ldr r2, [r7, #12]
  11511. 8004b54: 8992 ldrh r2, [r2, #12]
  11512. 8004b56: fbb3 f0f2 udiv r0, r3, r2
  11513. 8004b5a: fb02 f200 mul.w r2, r2, r0
  11514. 8004b5e: 1a9b subs r3, r3, r2
  11515. 8004b60: 440b add r3, r1
  11516. 8004b62: 687a ldr r2, [r7, #4]
  11517. 8004b64: b292 uxth r2, r2
  11518. 8004b66: 4611 mov r1, r2
  11519. 8004b68: 4618 mov r0, r3
  11520. 8004b6a: f7ff fb38 bl 80041de <st_word>
  11521. fs->wflag = 1;
  11522. 8004b6e: 68fb ldr r3, [r7, #12]
  11523. 8004b70: 2201 movs r2, #1
  11524. 8004b72: 70da strb r2, [r3, #3]
  11525. break;
  11526. 8004b74: e047 b.n 8004c06 <put_fat+0x224>
  11527. case FS_FAT32 : /* DWORD aligned items */
  11528. #if _FS_EXFAT
  11529. case FS_EXFAT :
  11530. #endif
  11531. res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)));
  11532. 8004b76: 68fb ldr r3, [r7, #12]
  11533. 8004b78: 6a9a ldr r2, [r3, #40] ; 0x28
  11534. 8004b7a: 68fb ldr r3, [r7, #12]
  11535. 8004b7c: 899b ldrh r3, [r3, #12]
  11536. 8004b7e: 089b lsrs r3, r3, #2
  11537. 8004b80: b29b uxth r3, r3
  11538. 8004b82: 4619 mov r1, r3
  11539. 8004b84: 68bb ldr r3, [r7, #8]
  11540. 8004b86: fbb3 f3f1 udiv r3, r3, r1
  11541. 8004b8a: 4413 add r3, r2
  11542. 8004b8c: 4619 mov r1, r3
  11543. 8004b8e: 68f8 ldr r0, [r7, #12]
  11544. 8004b90: f7ff fd9a bl 80046c8 <move_window>
  11545. 8004b94: 4603 mov r3, r0
  11546. 8004b96: 77fb strb r3, [r7, #31]
  11547. if (res != FR_OK) break;
  11548. 8004b98: 7ffb ldrb r3, [r7, #31]
  11549. 8004b9a: 2b00 cmp r3, #0
  11550. 8004b9c: d132 bne.n 8004c04 <put_fat+0x222>
  11551. if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) {
  11552. val = (val & 0x0FFFFFFF) | (ld_dword(fs->win + clst * 4 % SS(fs)) & 0xF0000000);
  11553. 8004b9e: 687b ldr r3, [r7, #4]
  11554. 8004ba0: f023 4470 bic.w r4, r3, #4026531840 ; 0xf0000000
  11555. 8004ba4: 68fb ldr r3, [r7, #12]
  11556. 8004ba6: f103 0138 add.w r1, r3, #56 ; 0x38
  11557. 8004baa: 68bb ldr r3, [r7, #8]
  11558. 8004bac: 009b lsls r3, r3, #2
  11559. 8004bae: 68fa ldr r2, [r7, #12]
  11560. 8004bb0: 8992 ldrh r2, [r2, #12]
  11561. 8004bb2: fbb3 f0f2 udiv r0, r3, r2
  11562. 8004bb6: fb02 f200 mul.w r2, r2, r0
  11563. 8004bba: 1a9b subs r3, r3, r2
  11564. 8004bbc: 440b add r3, r1
  11565. 8004bbe: 4618 mov r0, r3
  11566. 8004bc0: f7ff faea bl 8004198 <ld_dword>
  11567. 8004bc4: 4603 mov r3, r0
  11568. 8004bc6: f003 4370 and.w r3, r3, #4026531840 ; 0xf0000000
  11569. 8004bca: 4323 orrs r3, r4
  11570. 8004bcc: 607b str r3, [r7, #4]
  11571. }
  11572. st_dword(fs->win + clst * 4 % SS(fs), val);
  11573. 8004bce: 68fb ldr r3, [r7, #12]
  11574. 8004bd0: f103 0138 add.w r1, r3, #56 ; 0x38
  11575. 8004bd4: 68bb ldr r3, [r7, #8]
  11576. 8004bd6: 009b lsls r3, r3, #2
  11577. 8004bd8: 68fa ldr r2, [r7, #12]
  11578. 8004bda: 8992 ldrh r2, [r2, #12]
  11579. 8004bdc: fbb3 f0f2 udiv r0, r3, r2
  11580. 8004be0: fb02 f200 mul.w r2, r2, r0
  11581. 8004be4: 1a9b subs r3, r3, r2
  11582. 8004be6: 440b add r3, r1
  11583. 8004be8: 6879 ldr r1, [r7, #4]
  11584. 8004bea: 4618 mov r0, r3
  11585. 8004bec: f7ff fb12 bl 8004214 <st_dword>
  11586. fs->wflag = 1;
  11587. 8004bf0: 68fb ldr r3, [r7, #12]
  11588. 8004bf2: 2201 movs r2, #1
  11589. 8004bf4: 70da strb r2, [r3, #3]
  11590. break;
  11591. 8004bf6: e006 b.n 8004c06 <put_fat+0x224>
  11592. if (res != FR_OK) break;
  11593. 8004bf8: bf00 nop
  11594. 8004bfa: e004 b.n 8004c06 <put_fat+0x224>
  11595. if (res != FR_OK) break;
  11596. 8004bfc: bf00 nop
  11597. 8004bfe: e002 b.n 8004c06 <put_fat+0x224>
  11598. if (res != FR_OK) break;
  11599. 8004c00: bf00 nop
  11600. 8004c02: e000 b.n 8004c06 <put_fat+0x224>
  11601. if (res != FR_OK) break;
  11602. 8004c04: bf00 nop
  11603. }
  11604. }
  11605. return res;
  11606. 8004c06: 7ffb ldrb r3, [r7, #31]
  11607. }
  11608. 8004c08: 4618 mov r0, r3
  11609. 8004c0a: 3724 adds r7, #36 ; 0x24
  11610. 8004c0c: 46bd mov sp, r7
  11611. 8004c0e: bd90 pop {r4, r7, pc}
  11612. 08004c10 <remove_chain>:
  11613. FRESULT remove_chain ( /* FR_OK(0):succeeded, !=0:error */
  11614. _FDID* obj, /* Corresponding object */
  11615. DWORD clst, /* Cluster to remove a chain from */
  11616. DWORD pclst /* Previous cluster of clst (0:an entire chain) */
  11617. )
  11618. {
  11619. 8004c10: b580 push {r7, lr}
  11620. 8004c12: b088 sub sp, #32
  11621. 8004c14: af00 add r7, sp, #0
  11622. 8004c16: 60f8 str r0, [r7, #12]
  11623. 8004c18: 60b9 str r1, [r7, #8]
  11624. 8004c1a: 607a str r2, [r7, #4]
  11625. FRESULT res = FR_OK;
  11626. 8004c1c: 2300 movs r3, #0
  11627. 8004c1e: 77fb strb r3, [r7, #31]
  11628. DWORD nxt;
  11629. FATFS *fs = obj->fs;
  11630. 8004c20: 68fb ldr r3, [r7, #12]
  11631. 8004c22: 681b ldr r3, [r3, #0]
  11632. 8004c24: 61bb str r3, [r7, #24]
  11633. #endif
  11634. #if _USE_TRIM
  11635. DWORD rt[2];
  11636. #endif
  11637. if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Check if in valid range */
  11638. 8004c26: 68bb ldr r3, [r7, #8]
  11639. 8004c28: 2b01 cmp r3, #1
  11640. 8004c2a: d904 bls.n 8004c36 <remove_chain+0x26>
  11641. 8004c2c: 69bb ldr r3, [r7, #24]
  11642. 8004c2e: 69db ldr r3, [r3, #28]
  11643. 8004c30: 68ba ldr r2, [r7, #8]
  11644. 8004c32: 429a cmp r2, r3
  11645. 8004c34: d301 bcc.n 8004c3a <remove_chain+0x2a>
  11646. 8004c36: 2302 movs r3, #2
  11647. 8004c38: e04b b.n 8004cd2 <remove_chain+0xc2>
  11648. /* Mark the previous cluster 'EOC' on the FAT if it exists */
  11649. if (pclst && (!_FS_EXFAT || fs->fs_type != FS_EXFAT || obj->stat != 2)) {
  11650. 8004c3a: 687b ldr r3, [r7, #4]
  11651. 8004c3c: 2b00 cmp r3, #0
  11652. 8004c3e: d00c beq.n 8004c5a <remove_chain+0x4a>
  11653. res = put_fat(fs, pclst, 0xFFFFFFFF);
  11654. 8004c40: f04f 32ff mov.w r2, #4294967295
  11655. 8004c44: 6879 ldr r1, [r7, #4]
  11656. 8004c46: 69b8 ldr r0, [r7, #24]
  11657. 8004c48: f7ff fecb bl 80049e2 <put_fat>
  11658. 8004c4c: 4603 mov r3, r0
  11659. 8004c4e: 77fb strb r3, [r7, #31]
  11660. if (res != FR_OK) return res;
  11661. 8004c50: 7ffb ldrb r3, [r7, #31]
  11662. 8004c52: 2b00 cmp r3, #0
  11663. 8004c54: d001 beq.n 8004c5a <remove_chain+0x4a>
  11664. 8004c56: 7ffb ldrb r3, [r7, #31]
  11665. 8004c58: e03b b.n 8004cd2 <remove_chain+0xc2>
  11666. }
  11667. /* Remove the chain */
  11668. do {
  11669. nxt = get_fat(obj, clst); /* Get cluster status */
  11670. 8004c5a: 68b9 ldr r1, [r7, #8]
  11671. 8004c5c: 68f8 ldr r0, [r7, #12]
  11672. 8004c5e: f7ff fdf0 bl 8004842 <get_fat>
  11673. 8004c62: 6178 str r0, [r7, #20]
  11674. if (nxt == 0) break; /* Empty cluster? */
  11675. 8004c64: 697b ldr r3, [r7, #20]
  11676. 8004c66: 2b00 cmp r3, #0
  11677. 8004c68: d031 beq.n 8004cce <remove_chain+0xbe>
  11678. if (nxt == 1) return FR_INT_ERR; /* Internal error? */
  11679. 8004c6a: 697b ldr r3, [r7, #20]
  11680. 8004c6c: 2b01 cmp r3, #1
  11681. 8004c6e: d101 bne.n 8004c74 <remove_chain+0x64>
  11682. 8004c70: 2302 movs r3, #2
  11683. 8004c72: e02e b.n 8004cd2 <remove_chain+0xc2>
  11684. if (nxt == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error? */
  11685. 8004c74: 697b ldr r3, [r7, #20]
  11686. 8004c76: f1b3 3fff cmp.w r3, #4294967295
  11687. 8004c7a: d101 bne.n 8004c80 <remove_chain+0x70>
  11688. 8004c7c: 2301 movs r3, #1
  11689. 8004c7e: e028 b.n 8004cd2 <remove_chain+0xc2>
  11690. if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) {
  11691. res = put_fat(fs, clst, 0); /* Mark the cluster 'free' on the FAT */
  11692. 8004c80: 2200 movs r2, #0
  11693. 8004c82: 68b9 ldr r1, [r7, #8]
  11694. 8004c84: 69b8 ldr r0, [r7, #24]
  11695. 8004c86: f7ff feac bl 80049e2 <put_fat>
  11696. 8004c8a: 4603 mov r3, r0
  11697. 8004c8c: 77fb strb r3, [r7, #31]
  11698. if (res != FR_OK) return res;
  11699. 8004c8e: 7ffb ldrb r3, [r7, #31]
  11700. 8004c90: 2b00 cmp r3, #0
  11701. 8004c92: d001 beq.n 8004c98 <remove_chain+0x88>
  11702. 8004c94: 7ffb ldrb r3, [r7, #31]
  11703. 8004c96: e01c b.n 8004cd2 <remove_chain+0xc2>
  11704. }
  11705. if (fs->free_clst < fs->n_fatent - 2) { /* Update FSINFO */
  11706. 8004c98: 69bb ldr r3, [r7, #24]
  11707. 8004c9a: 699a ldr r2, [r3, #24]
  11708. 8004c9c: 69bb ldr r3, [r7, #24]
  11709. 8004c9e: 69db ldr r3, [r3, #28]
  11710. 8004ca0: 3b02 subs r3, #2
  11711. 8004ca2: 429a cmp r2, r3
  11712. 8004ca4: d20b bcs.n 8004cbe <remove_chain+0xae>
  11713. fs->free_clst++;
  11714. 8004ca6: 69bb ldr r3, [r7, #24]
  11715. 8004ca8: 699b ldr r3, [r3, #24]
  11716. 8004caa: 1c5a adds r2, r3, #1
  11717. 8004cac: 69bb ldr r3, [r7, #24]
  11718. 8004cae: 619a str r2, [r3, #24]
  11719. fs->fsi_flag |= 1;
  11720. 8004cb0: 69bb ldr r3, [r7, #24]
  11721. 8004cb2: 791b ldrb r3, [r3, #4]
  11722. 8004cb4: f043 0301 orr.w r3, r3, #1
  11723. 8004cb8: b2da uxtb r2, r3
  11724. 8004cba: 69bb ldr r3, [r7, #24]
  11725. 8004cbc: 711a strb r2, [r3, #4]
  11726. disk_ioctl(fs->drv, CTRL_TRIM, rt); /* Inform device the block can be erased */
  11727. #endif
  11728. scl = ecl = nxt;
  11729. }
  11730. #endif
  11731. clst = nxt; /* Next cluster */
  11732. 8004cbe: 697b ldr r3, [r7, #20]
  11733. 8004cc0: 60bb str r3, [r7, #8]
  11734. } while (clst < fs->n_fatent); /* Repeat while not the last link */
  11735. 8004cc2: 69bb ldr r3, [r7, #24]
  11736. 8004cc4: 69db ldr r3, [r3, #28]
  11737. 8004cc6: 68ba ldr r2, [r7, #8]
  11738. 8004cc8: 429a cmp r2, r3
  11739. 8004cca: d3c6 bcc.n 8004c5a <remove_chain+0x4a>
  11740. 8004ccc: e000 b.n 8004cd0 <remove_chain+0xc0>
  11741. if (nxt == 0) break; /* Empty cluster? */
  11742. 8004cce: bf00 nop
  11743. obj->stat = 2; /* Change the object status 'contiguous' */
  11744. }
  11745. }
  11746. }
  11747. #endif
  11748. return FR_OK;
  11749. 8004cd0: 2300 movs r3, #0
  11750. }
  11751. 8004cd2: 4618 mov r0, r3
  11752. 8004cd4: 3720 adds r7, #32
  11753. 8004cd6: 46bd mov sp, r7
  11754. 8004cd8: bd80 pop {r7, pc}
  11755. 08004cda <create_chain>:
  11756. static
  11757. DWORD create_chain ( /* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */
  11758. _FDID* obj, /* Corresponding object */
  11759. DWORD clst /* Cluster# to stretch, 0:Create a new chain */
  11760. )
  11761. {
  11762. 8004cda: b580 push {r7, lr}
  11763. 8004cdc: b088 sub sp, #32
  11764. 8004cde: af00 add r7, sp, #0
  11765. 8004ce0: 6078 str r0, [r7, #4]
  11766. 8004ce2: 6039 str r1, [r7, #0]
  11767. DWORD cs, ncl, scl;
  11768. FRESULT res;
  11769. FATFS *fs = obj->fs;
  11770. 8004ce4: 687b ldr r3, [r7, #4]
  11771. 8004ce6: 681b ldr r3, [r3, #0]
  11772. 8004ce8: 613b str r3, [r7, #16]
  11773. if (clst == 0) { /* Create a new chain */
  11774. 8004cea: 683b ldr r3, [r7, #0]
  11775. 8004cec: 2b00 cmp r3, #0
  11776. 8004cee: d10d bne.n 8004d0c <create_chain+0x32>
  11777. scl = fs->last_clst; /* Get suggested cluster to start from */
  11778. 8004cf0: 693b ldr r3, [r7, #16]
  11779. 8004cf2: 695b ldr r3, [r3, #20]
  11780. 8004cf4: 61bb str r3, [r7, #24]
  11781. if (scl == 0 || scl >= fs->n_fatent) scl = 1;
  11782. 8004cf6: 69bb ldr r3, [r7, #24]
  11783. 8004cf8: 2b00 cmp r3, #0
  11784. 8004cfa: d004 beq.n 8004d06 <create_chain+0x2c>
  11785. 8004cfc: 693b ldr r3, [r7, #16]
  11786. 8004cfe: 69db ldr r3, [r3, #28]
  11787. 8004d00: 69ba ldr r2, [r7, #24]
  11788. 8004d02: 429a cmp r2, r3
  11789. 8004d04: d31b bcc.n 8004d3e <create_chain+0x64>
  11790. 8004d06: 2301 movs r3, #1
  11791. 8004d08: 61bb str r3, [r7, #24]
  11792. 8004d0a: e018 b.n 8004d3e <create_chain+0x64>
  11793. }
  11794. else { /* Stretch current chain */
  11795. cs = get_fat(obj, clst); /* Check the cluster status */
  11796. 8004d0c: 6839 ldr r1, [r7, #0]
  11797. 8004d0e: 6878 ldr r0, [r7, #4]
  11798. 8004d10: f7ff fd97 bl 8004842 <get_fat>
  11799. 8004d14: 60f8 str r0, [r7, #12]
  11800. if (cs < 2) return 1; /* Invalid FAT value */
  11801. 8004d16: 68fb ldr r3, [r7, #12]
  11802. 8004d18: 2b01 cmp r3, #1
  11803. 8004d1a: d801 bhi.n 8004d20 <create_chain+0x46>
  11804. 8004d1c: 2301 movs r3, #1
  11805. 8004d1e: e070 b.n 8004e02 <create_chain+0x128>
  11806. if (cs == 0xFFFFFFFF) return cs; /* A disk error occurred */
  11807. 8004d20: 68fb ldr r3, [r7, #12]
  11808. 8004d22: f1b3 3fff cmp.w r3, #4294967295
  11809. 8004d26: d101 bne.n 8004d2c <create_chain+0x52>
  11810. 8004d28: 68fb ldr r3, [r7, #12]
  11811. 8004d2a: e06a b.n 8004e02 <create_chain+0x128>
  11812. if (cs < fs->n_fatent) return cs; /* It is already followed by next cluster */
  11813. 8004d2c: 693b ldr r3, [r7, #16]
  11814. 8004d2e: 69db ldr r3, [r3, #28]
  11815. 8004d30: 68fa ldr r2, [r7, #12]
  11816. 8004d32: 429a cmp r2, r3
  11817. 8004d34: d201 bcs.n 8004d3a <create_chain+0x60>
  11818. 8004d36: 68fb ldr r3, [r7, #12]
  11819. 8004d38: e063 b.n 8004e02 <create_chain+0x128>
  11820. scl = clst;
  11821. 8004d3a: 683b ldr r3, [r7, #0]
  11822. 8004d3c: 61bb str r3, [r7, #24]
  11823. }
  11824. }
  11825. } else
  11826. #endif
  11827. { /* On the FAT12/16/32 volume */
  11828. ncl = scl; /* Start cluster */
  11829. 8004d3e: 69bb ldr r3, [r7, #24]
  11830. 8004d40: 61fb str r3, [r7, #28]
  11831. for (;;) {
  11832. ncl++; /* Next cluster */
  11833. 8004d42: 69fb ldr r3, [r7, #28]
  11834. 8004d44: 3301 adds r3, #1
  11835. 8004d46: 61fb str r3, [r7, #28]
  11836. if (ncl >= fs->n_fatent) { /* Check wrap-around */
  11837. 8004d48: 693b ldr r3, [r7, #16]
  11838. 8004d4a: 69db ldr r3, [r3, #28]
  11839. 8004d4c: 69fa ldr r2, [r7, #28]
  11840. 8004d4e: 429a cmp r2, r3
  11841. 8004d50: d307 bcc.n 8004d62 <create_chain+0x88>
  11842. ncl = 2;
  11843. 8004d52: 2302 movs r3, #2
  11844. 8004d54: 61fb str r3, [r7, #28]
  11845. if (ncl > scl) return 0; /* No free cluster */
  11846. 8004d56: 69fa ldr r2, [r7, #28]
  11847. 8004d58: 69bb ldr r3, [r7, #24]
  11848. 8004d5a: 429a cmp r2, r3
  11849. 8004d5c: d901 bls.n 8004d62 <create_chain+0x88>
  11850. 8004d5e: 2300 movs r3, #0
  11851. 8004d60: e04f b.n 8004e02 <create_chain+0x128>
  11852. }
  11853. cs = get_fat(obj, ncl); /* Get the cluster status */
  11854. 8004d62: 69f9 ldr r1, [r7, #28]
  11855. 8004d64: 6878 ldr r0, [r7, #4]
  11856. 8004d66: f7ff fd6c bl 8004842 <get_fat>
  11857. 8004d6a: 60f8 str r0, [r7, #12]
  11858. if (cs == 0) break; /* Found a free cluster */
  11859. 8004d6c: 68fb ldr r3, [r7, #12]
  11860. 8004d6e: 2b00 cmp r3, #0
  11861. 8004d70: d00e beq.n 8004d90 <create_chain+0xb6>
  11862. if (cs == 1 || cs == 0xFFFFFFFF) return cs; /* An error occurred */
  11863. 8004d72: 68fb ldr r3, [r7, #12]
  11864. 8004d74: 2b01 cmp r3, #1
  11865. 8004d76: d003 beq.n 8004d80 <create_chain+0xa6>
  11866. 8004d78: 68fb ldr r3, [r7, #12]
  11867. 8004d7a: f1b3 3fff cmp.w r3, #4294967295
  11868. 8004d7e: d101 bne.n 8004d84 <create_chain+0xaa>
  11869. 8004d80: 68fb ldr r3, [r7, #12]
  11870. 8004d82: e03e b.n 8004e02 <create_chain+0x128>
  11871. if (ncl == scl) return 0; /* No free cluster */
  11872. 8004d84: 69fa ldr r2, [r7, #28]
  11873. 8004d86: 69bb ldr r3, [r7, #24]
  11874. 8004d88: 429a cmp r2, r3
  11875. 8004d8a: d1da bne.n 8004d42 <create_chain+0x68>
  11876. 8004d8c: 2300 movs r3, #0
  11877. 8004d8e: e038 b.n 8004e02 <create_chain+0x128>
  11878. if (cs == 0) break; /* Found a free cluster */
  11879. 8004d90: bf00 nop
  11880. }
  11881. res = put_fat(fs, ncl, 0xFFFFFFFF); /* Mark the new cluster 'EOC' */
  11882. 8004d92: f04f 32ff mov.w r2, #4294967295
  11883. 8004d96: 69f9 ldr r1, [r7, #28]
  11884. 8004d98: 6938 ldr r0, [r7, #16]
  11885. 8004d9a: f7ff fe22 bl 80049e2 <put_fat>
  11886. 8004d9e: 4603 mov r3, r0
  11887. 8004da0: 75fb strb r3, [r7, #23]
  11888. if (res == FR_OK && clst != 0) {
  11889. 8004da2: 7dfb ldrb r3, [r7, #23]
  11890. 8004da4: 2b00 cmp r3, #0
  11891. 8004da6: d109 bne.n 8004dbc <create_chain+0xe2>
  11892. 8004da8: 683b ldr r3, [r7, #0]
  11893. 8004daa: 2b00 cmp r3, #0
  11894. 8004dac: d006 beq.n 8004dbc <create_chain+0xe2>
  11895. res = put_fat(fs, clst, ncl); /* Link it from the previous one if needed */
  11896. 8004dae: 69fa ldr r2, [r7, #28]
  11897. 8004db0: 6839 ldr r1, [r7, #0]
  11898. 8004db2: 6938 ldr r0, [r7, #16]
  11899. 8004db4: f7ff fe15 bl 80049e2 <put_fat>
  11900. 8004db8: 4603 mov r3, r0
  11901. 8004dba: 75fb strb r3, [r7, #23]
  11902. }
  11903. }
  11904. if (res == FR_OK) { /* Update FSINFO if function succeeded. */
  11905. 8004dbc: 7dfb ldrb r3, [r7, #23]
  11906. 8004dbe: 2b00 cmp r3, #0
  11907. 8004dc0: d116 bne.n 8004df0 <create_chain+0x116>
  11908. fs->last_clst = ncl;
  11909. 8004dc2: 693b ldr r3, [r7, #16]
  11910. 8004dc4: 69fa ldr r2, [r7, #28]
  11911. 8004dc6: 615a str r2, [r3, #20]
  11912. if (fs->free_clst <= fs->n_fatent - 2) fs->free_clst--;
  11913. 8004dc8: 693b ldr r3, [r7, #16]
  11914. 8004dca: 699a ldr r2, [r3, #24]
  11915. 8004dcc: 693b ldr r3, [r7, #16]
  11916. 8004dce: 69db ldr r3, [r3, #28]
  11917. 8004dd0: 3b02 subs r3, #2
  11918. 8004dd2: 429a cmp r2, r3
  11919. 8004dd4: d804 bhi.n 8004de0 <create_chain+0x106>
  11920. 8004dd6: 693b ldr r3, [r7, #16]
  11921. 8004dd8: 699b ldr r3, [r3, #24]
  11922. 8004dda: 1e5a subs r2, r3, #1
  11923. 8004ddc: 693b ldr r3, [r7, #16]
  11924. 8004dde: 619a str r2, [r3, #24]
  11925. fs->fsi_flag |= 1;
  11926. 8004de0: 693b ldr r3, [r7, #16]
  11927. 8004de2: 791b ldrb r3, [r3, #4]
  11928. 8004de4: f043 0301 orr.w r3, r3, #1
  11929. 8004de8: b2da uxtb r2, r3
  11930. 8004dea: 693b ldr r3, [r7, #16]
  11931. 8004dec: 711a strb r2, [r3, #4]
  11932. 8004dee: e007 b.n 8004e00 <create_chain+0x126>
  11933. } else {
  11934. ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1; /* Failed. Generate error status */
  11935. 8004df0: 7dfb ldrb r3, [r7, #23]
  11936. 8004df2: 2b01 cmp r3, #1
  11937. 8004df4: d102 bne.n 8004dfc <create_chain+0x122>
  11938. 8004df6: f04f 33ff mov.w r3, #4294967295
  11939. 8004dfa: e000 b.n 8004dfe <create_chain+0x124>
  11940. 8004dfc: 2301 movs r3, #1
  11941. 8004dfe: 61fb str r3, [r7, #28]
  11942. }
  11943. return ncl; /* Return new cluster number or error status */
  11944. 8004e00: 69fb ldr r3, [r7, #28]
  11945. }
  11946. 8004e02: 4618 mov r0, r3
  11947. 8004e04: 3720 adds r7, #32
  11948. 8004e06: 46bd mov sp, r7
  11949. 8004e08: bd80 pop {r7, pc}
  11950. 08004e0a <clmt_clust>:
  11951. static
  11952. DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */
  11953. FIL* fp, /* Pointer to the file object */
  11954. FSIZE_t ofs /* File offset to be converted to cluster# */
  11955. )
  11956. {
  11957. 8004e0a: b480 push {r7}
  11958. 8004e0c: b087 sub sp, #28
  11959. 8004e0e: af00 add r7, sp, #0
  11960. 8004e10: 6078 str r0, [r7, #4]
  11961. 8004e12: 6039 str r1, [r7, #0]
  11962. DWORD cl, ncl, *tbl;
  11963. FATFS *fs = fp->obj.fs;
  11964. 8004e14: 687b ldr r3, [r7, #4]
  11965. 8004e16: 681b ldr r3, [r3, #0]
  11966. 8004e18: 60fb str r3, [r7, #12]
  11967. tbl = fp->cltbl + 1; /* Top of CLMT */
  11968. 8004e1a: 687b ldr r3, [r7, #4]
  11969. 8004e1c: 6adb ldr r3, [r3, #44] ; 0x2c
  11970. 8004e1e: 3304 adds r3, #4
  11971. 8004e20: 613b str r3, [r7, #16]
  11972. cl = (DWORD)(ofs / SS(fs) / fs->csize); /* Cluster order from top of the file */
  11973. 8004e22: 68fb ldr r3, [r7, #12]
  11974. 8004e24: 899b ldrh r3, [r3, #12]
  11975. 8004e26: 461a mov r2, r3
  11976. 8004e28: 683b ldr r3, [r7, #0]
  11977. 8004e2a: fbb3 f3f2 udiv r3, r3, r2
  11978. 8004e2e: 68fa ldr r2, [r7, #12]
  11979. 8004e30: 8952 ldrh r2, [r2, #10]
  11980. 8004e32: fbb3 f3f2 udiv r3, r3, r2
  11981. 8004e36: 617b str r3, [r7, #20]
  11982. for (;;) {
  11983. ncl = *tbl++; /* Number of cluters in the fragment */
  11984. 8004e38: 693b ldr r3, [r7, #16]
  11985. 8004e3a: 1d1a adds r2, r3, #4
  11986. 8004e3c: 613a str r2, [r7, #16]
  11987. 8004e3e: 681b ldr r3, [r3, #0]
  11988. 8004e40: 60bb str r3, [r7, #8]
  11989. if (ncl == 0) return 0; /* End of table? (error) */
  11990. 8004e42: 68bb ldr r3, [r7, #8]
  11991. 8004e44: 2b00 cmp r3, #0
  11992. 8004e46: d101 bne.n 8004e4c <clmt_clust+0x42>
  11993. 8004e48: 2300 movs r3, #0
  11994. 8004e4a: e010 b.n 8004e6e <clmt_clust+0x64>
  11995. if (cl < ncl) break; /* In this fragment? */
  11996. 8004e4c: 697a ldr r2, [r7, #20]
  11997. 8004e4e: 68bb ldr r3, [r7, #8]
  11998. 8004e50: 429a cmp r2, r3
  11999. 8004e52: d307 bcc.n 8004e64 <clmt_clust+0x5a>
  12000. cl -= ncl; tbl++; /* Next fragment */
  12001. 8004e54: 697a ldr r2, [r7, #20]
  12002. 8004e56: 68bb ldr r3, [r7, #8]
  12003. 8004e58: 1ad3 subs r3, r2, r3
  12004. 8004e5a: 617b str r3, [r7, #20]
  12005. 8004e5c: 693b ldr r3, [r7, #16]
  12006. 8004e5e: 3304 adds r3, #4
  12007. 8004e60: 613b str r3, [r7, #16]
  12008. ncl = *tbl++; /* Number of cluters in the fragment */
  12009. 8004e62: e7e9 b.n 8004e38 <clmt_clust+0x2e>
  12010. if (cl < ncl) break; /* In this fragment? */
  12011. 8004e64: bf00 nop
  12012. }
  12013. return cl + *tbl; /* Return the cluster number */
  12014. 8004e66: 693b ldr r3, [r7, #16]
  12015. 8004e68: 681a ldr r2, [r3, #0]
  12016. 8004e6a: 697b ldr r3, [r7, #20]
  12017. 8004e6c: 4413 add r3, r2
  12018. }
  12019. 8004e6e: 4618 mov r0, r3
  12020. 8004e70: 371c adds r7, #28
  12021. 8004e72: 46bd mov sp, r7
  12022. 8004e74: f85d 7b04 ldr.w r7, [sp], #4
  12023. 8004e78: 4770 bx lr
  12024. 08004e7a <dir_sdi>:
  12025. static
  12026. FRESULT dir_sdi ( /* FR_OK(0):succeeded, !=0:error */
  12027. DIR* dp, /* Pointer to directory object */
  12028. DWORD ofs /* Offset of directory table */
  12029. )
  12030. {
  12031. 8004e7a: b580 push {r7, lr}
  12032. 8004e7c: b086 sub sp, #24
  12033. 8004e7e: af00 add r7, sp, #0
  12034. 8004e80: 6078 str r0, [r7, #4]
  12035. 8004e82: 6039 str r1, [r7, #0]
  12036. DWORD csz, clst;
  12037. FATFS *fs = dp->obj.fs;
  12038. 8004e84: 687b ldr r3, [r7, #4]
  12039. 8004e86: 681b ldr r3, [r3, #0]
  12040. 8004e88: 613b str r3, [r7, #16]
  12041. if (ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR) || ofs % SZDIRE) { /* Check range of offset and alignment */
  12042. 8004e8a: 683b ldr r3, [r7, #0]
  12043. 8004e8c: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000
  12044. 8004e90: d204 bcs.n 8004e9c <dir_sdi+0x22>
  12045. 8004e92: 683b ldr r3, [r7, #0]
  12046. 8004e94: f003 031f and.w r3, r3, #31
  12047. 8004e98: 2b00 cmp r3, #0
  12048. 8004e9a: d001 beq.n 8004ea0 <dir_sdi+0x26>
  12049. return FR_INT_ERR;
  12050. 8004e9c: 2302 movs r3, #2
  12051. 8004e9e: e071 b.n 8004f84 <dir_sdi+0x10a>
  12052. }
  12053. dp->dptr = ofs; /* Set current offset */
  12054. 8004ea0: 687b ldr r3, [r7, #4]
  12055. 8004ea2: 683a ldr r2, [r7, #0]
  12056. 8004ea4: 615a str r2, [r3, #20]
  12057. clst = dp->obj.sclust; /* Table start cluster (0:root) */
  12058. 8004ea6: 687b ldr r3, [r7, #4]
  12059. 8004ea8: 689b ldr r3, [r3, #8]
  12060. 8004eaa: 617b str r3, [r7, #20]
  12061. if (clst == 0 && fs->fs_type >= FS_FAT32) { /* Replace cluster# 0 with root cluster# */
  12062. 8004eac: 697b ldr r3, [r7, #20]
  12063. 8004eae: 2b00 cmp r3, #0
  12064. 8004eb0: d106 bne.n 8004ec0 <dir_sdi+0x46>
  12065. 8004eb2: 693b ldr r3, [r7, #16]
  12066. 8004eb4: 781b ldrb r3, [r3, #0]
  12067. 8004eb6: 2b02 cmp r3, #2
  12068. 8004eb8: d902 bls.n 8004ec0 <dir_sdi+0x46>
  12069. clst = fs->dirbase;
  12070. 8004eba: 693b ldr r3, [r7, #16]
  12071. 8004ebc: 6adb ldr r3, [r3, #44] ; 0x2c
  12072. 8004ebe: 617b str r3, [r7, #20]
  12073. if (_FS_EXFAT) dp->obj.stat = 0; /* exFAT: Root dir has an FAT chain */
  12074. }
  12075. if (clst == 0) { /* Static table (root-directory in FAT12/16) */
  12076. 8004ec0: 697b ldr r3, [r7, #20]
  12077. 8004ec2: 2b00 cmp r3, #0
  12078. 8004ec4: d10c bne.n 8004ee0 <dir_sdi+0x66>
  12079. if (ofs / SZDIRE >= fs->n_rootdir) return FR_INT_ERR; /* Is index out of range? */
  12080. 8004ec6: 683b ldr r3, [r7, #0]
  12081. 8004ec8: 095b lsrs r3, r3, #5
  12082. 8004eca: 693a ldr r2, [r7, #16]
  12083. 8004ecc: 8912 ldrh r2, [r2, #8]
  12084. 8004ece: 4293 cmp r3, r2
  12085. 8004ed0: d301 bcc.n 8004ed6 <dir_sdi+0x5c>
  12086. 8004ed2: 2302 movs r3, #2
  12087. 8004ed4: e056 b.n 8004f84 <dir_sdi+0x10a>
  12088. dp->sect = fs->dirbase;
  12089. 8004ed6: 693b ldr r3, [r7, #16]
  12090. 8004ed8: 6ada ldr r2, [r3, #44] ; 0x2c
  12091. 8004eda: 687b ldr r3, [r7, #4]
  12092. 8004edc: 61da str r2, [r3, #28]
  12093. 8004ede: e02d b.n 8004f3c <dir_sdi+0xc2>
  12094. } else { /* Dynamic table (sub-directory or root-directory in FAT32+) */
  12095. csz = (DWORD)fs->csize * SS(fs); /* Bytes per cluster */
  12096. 8004ee0: 693b ldr r3, [r7, #16]
  12097. 8004ee2: 895b ldrh r3, [r3, #10]
  12098. 8004ee4: 461a mov r2, r3
  12099. 8004ee6: 693b ldr r3, [r7, #16]
  12100. 8004ee8: 899b ldrh r3, [r3, #12]
  12101. 8004eea: fb03 f302 mul.w r3, r3, r2
  12102. 8004eee: 60fb str r3, [r7, #12]
  12103. while (ofs >= csz) { /* Follow cluster chain */
  12104. 8004ef0: e019 b.n 8004f26 <dir_sdi+0xac>
  12105. clst = get_fat(&dp->obj, clst); /* Get next cluster */
  12106. 8004ef2: 687b ldr r3, [r7, #4]
  12107. 8004ef4: 6979 ldr r1, [r7, #20]
  12108. 8004ef6: 4618 mov r0, r3
  12109. 8004ef8: f7ff fca3 bl 8004842 <get_fat>
  12110. 8004efc: 6178 str r0, [r7, #20]
  12111. if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
  12112. 8004efe: 697b ldr r3, [r7, #20]
  12113. 8004f00: f1b3 3fff cmp.w r3, #4294967295
  12114. 8004f04: d101 bne.n 8004f0a <dir_sdi+0x90>
  12115. 8004f06: 2301 movs r3, #1
  12116. 8004f08: e03c b.n 8004f84 <dir_sdi+0x10a>
  12117. if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Reached to end of table or internal error */
  12118. 8004f0a: 697b ldr r3, [r7, #20]
  12119. 8004f0c: 2b01 cmp r3, #1
  12120. 8004f0e: d904 bls.n 8004f1a <dir_sdi+0xa0>
  12121. 8004f10: 693b ldr r3, [r7, #16]
  12122. 8004f12: 69db ldr r3, [r3, #28]
  12123. 8004f14: 697a ldr r2, [r7, #20]
  12124. 8004f16: 429a cmp r2, r3
  12125. 8004f18: d301 bcc.n 8004f1e <dir_sdi+0xa4>
  12126. 8004f1a: 2302 movs r3, #2
  12127. 8004f1c: e032 b.n 8004f84 <dir_sdi+0x10a>
  12128. ofs -= csz;
  12129. 8004f1e: 683a ldr r2, [r7, #0]
  12130. 8004f20: 68fb ldr r3, [r7, #12]
  12131. 8004f22: 1ad3 subs r3, r2, r3
  12132. 8004f24: 603b str r3, [r7, #0]
  12133. while (ofs >= csz) { /* Follow cluster chain */
  12134. 8004f26: 683a ldr r2, [r7, #0]
  12135. 8004f28: 68fb ldr r3, [r7, #12]
  12136. 8004f2a: 429a cmp r2, r3
  12137. 8004f2c: d2e1 bcs.n 8004ef2 <dir_sdi+0x78>
  12138. }
  12139. dp->sect = clust2sect(fs, clst);
  12140. 8004f2e: 6979 ldr r1, [r7, #20]
  12141. 8004f30: 6938 ldr r0, [r7, #16]
  12142. 8004f32: f7ff fc67 bl 8004804 <clust2sect>
  12143. 8004f36: 4602 mov r2, r0
  12144. 8004f38: 687b ldr r3, [r7, #4]
  12145. 8004f3a: 61da str r2, [r3, #28]
  12146. }
  12147. dp->clust = clst; /* Current cluster# */
  12148. 8004f3c: 687b ldr r3, [r7, #4]
  12149. 8004f3e: 697a ldr r2, [r7, #20]
  12150. 8004f40: 619a str r2, [r3, #24]
  12151. if (!dp->sect) return FR_INT_ERR;
  12152. 8004f42: 687b ldr r3, [r7, #4]
  12153. 8004f44: 69db ldr r3, [r3, #28]
  12154. 8004f46: 2b00 cmp r3, #0
  12155. 8004f48: d101 bne.n 8004f4e <dir_sdi+0xd4>
  12156. 8004f4a: 2302 movs r3, #2
  12157. 8004f4c: e01a b.n 8004f84 <dir_sdi+0x10a>
  12158. dp->sect += ofs / SS(fs); /* Sector# of the directory entry */
  12159. 8004f4e: 687b ldr r3, [r7, #4]
  12160. 8004f50: 69da ldr r2, [r3, #28]
  12161. 8004f52: 693b ldr r3, [r7, #16]
  12162. 8004f54: 899b ldrh r3, [r3, #12]
  12163. 8004f56: 4619 mov r1, r3
  12164. 8004f58: 683b ldr r3, [r7, #0]
  12165. 8004f5a: fbb3 f3f1 udiv r3, r3, r1
  12166. 8004f5e: 441a add r2, r3
  12167. 8004f60: 687b ldr r3, [r7, #4]
  12168. 8004f62: 61da str r2, [r3, #28]
  12169. dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */
  12170. 8004f64: 693b ldr r3, [r7, #16]
  12171. 8004f66: f103 0138 add.w r1, r3, #56 ; 0x38
  12172. 8004f6a: 693b ldr r3, [r7, #16]
  12173. 8004f6c: 899b ldrh r3, [r3, #12]
  12174. 8004f6e: 461a mov r2, r3
  12175. 8004f70: 683b ldr r3, [r7, #0]
  12176. 8004f72: fbb3 f0f2 udiv r0, r3, r2
  12177. 8004f76: fb02 f200 mul.w r2, r2, r0
  12178. 8004f7a: 1a9b subs r3, r3, r2
  12179. 8004f7c: 18ca adds r2, r1, r3
  12180. 8004f7e: 687b ldr r3, [r7, #4]
  12181. 8004f80: 621a str r2, [r3, #32]
  12182. return FR_OK;
  12183. 8004f82: 2300 movs r3, #0
  12184. }
  12185. 8004f84: 4618 mov r0, r3
  12186. 8004f86: 3718 adds r7, #24
  12187. 8004f88: 46bd mov sp, r7
  12188. 8004f8a: bd80 pop {r7, pc}
  12189. 08004f8c <dir_next>:
  12190. static
  12191. FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */
  12192. DIR* dp, /* Pointer to the directory object */
  12193. int stretch /* 0: Do not stretch table, 1: Stretch table if needed */
  12194. )
  12195. {
  12196. 8004f8c: b580 push {r7, lr}
  12197. 8004f8e: b086 sub sp, #24
  12198. 8004f90: af00 add r7, sp, #0
  12199. 8004f92: 6078 str r0, [r7, #4]
  12200. 8004f94: 6039 str r1, [r7, #0]
  12201. DWORD ofs, clst;
  12202. FATFS *fs = dp->obj.fs;
  12203. 8004f96: 687b ldr r3, [r7, #4]
  12204. 8004f98: 681b ldr r3, [r3, #0]
  12205. 8004f9a: 60fb str r3, [r7, #12]
  12206. #if !_FS_READONLY
  12207. UINT n;
  12208. #endif
  12209. ofs = dp->dptr + SZDIRE; /* Next entry */
  12210. 8004f9c: 687b ldr r3, [r7, #4]
  12211. 8004f9e: 695b ldr r3, [r3, #20]
  12212. 8004fa0: 3320 adds r3, #32
  12213. 8004fa2: 60bb str r3, [r7, #8]
  12214. if (!dp->sect || ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) return FR_NO_FILE; /* Report EOT when offset has reached max value */
  12215. 8004fa4: 687b ldr r3, [r7, #4]
  12216. 8004fa6: 69db ldr r3, [r3, #28]
  12217. 8004fa8: 2b00 cmp r3, #0
  12218. 8004faa: d003 beq.n 8004fb4 <dir_next+0x28>
  12219. 8004fac: 68bb ldr r3, [r7, #8]
  12220. 8004fae: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000
  12221. 8004fb2: d301 bcc.n 8004fb8 <dir_next+0x2c>
  12222. 8004fb4: 2304 movs r3, #4
  12223. 8004fb6: e0bb b.n 8005130 <dir_next+0x1a4>
  12224. if (ofs % SS(fs) == 0) { /* Sector changed? */
  12225. 8004fb8: 68fb ldr r3, [r7, #12]
  12226. 8004fba: 899b ldrh r3, [r3, #12]
  12227. 8004fbc: 461a mov r2, r3
  12228. 8004fbe: 68bb ldr r3, [r7, #8]
  12229. 8004fc0: fbb3 f1f2 udiv r1, r3, r2
  12230. 8004fc4: fb02 f201 mul.w r2, r2, r1
  12231. 8004fc8: 1a9b subs r3, r3, r2
  12232. 8004fca: 2b00 cmp r3, #0
  12233. 8004fcc: f040 809d bne.w 800510a <dir_next+0x17e>
  12234. dp->sect++; /* Next sector */
  12235. 8004fd0: 687b ldr r3, [r7, #4]
  12236. 8004fd2: 69db ldr r3, [r3, #28]
  12237. 8004fd4: 1c5a adds r2, r3, #1
  12238. 8004fd6: 687b ldr r3, [r7, #4]
  12239. 8004fd8: 61da str r2, [r3, #28]
  12240. if (!dp->clust) { /* Static table */
  12241. 8004fda: 687b ldr r3, [r7, #4]
  12242. 8004fdc: 699b ldr r3, [r3, #24]
  12243. 8004fde: 2b00 cmp r3, #0
  12244. 8004fe0: d10b bne.n 8004ffa <dir_next+0x6e>
  12245. if (ofs / SZDIRE >= fs->n_rootdir) { /* Report EOT if it reached end of static table */
  12246. 8004fe2: 68bb ldr r3, [r7, #8]
  12247. 8004fe4: 095b lsrs r3, r3, #5
  12248. 8004fe6: 68fa ldr r2, [r7, #12]
  12249. 8004fe8: 8912 ldrh r2, [r2, #8]
  12250. 8004fea: 4293 cmp r3, r2
  12251. 8004fec: f0c0 808d bcc.w 800510a <dir_next+0x17e>
  12252. dp->sect = 0; return FR_NO_FILE;
  12253. 8004ff0: 687b ldr r3, [r7, #4]
  12254. 8004ff2: 2200 movs r2, #0
  12255. 8004ff4: 61da str r2, [r3, #28]
  12256. 8004ff6: 2304 movs r3, #4
  12257. 8004ff8: e09a b.n 8005130 <dir_next+0x1a4>
  12258. }
  12259. }
  12260. else { /* Dynamic table */
  12261. if ((ofs / SS(fs) & (fs->csize - 1)) == 0) { /* Cluster changed? */
  12262. 8004ffa: 68fb ldr r3, [r7, #12]
  12263. 8004ffc: 899b ldrh r3, [r3, #12]
  12264. 8004ffe: 461a mov r2, r3
  12265. 8005000: 68bb ldr r3, [r7, #8]
  12266. 8005002: fbb3 f3f2 udiv r3, r3, r2
  12267. 8005006: 68fa ldr r2, [r7, #12]
  12268. 8005008: 8952 ldrh r2, [r2, #10]
  12269. 800500a: 3a01 subs r2, #1
  12270. 800500c: 4013 ands r3, r2
  12271. 800500e: 2b00 cmp r3, #0
  12272. 8005010: d17b bne.n 800510a <dir_next+0x17e>
  12273. clst = get_fat(&dp->obj, dp->clust); /* Get next cluster */
  12274. 8005012: 687a ldr r2, [r7, #4]
  12275. 8005014: 687b ldr r3, [r7, #4]
  12276. 8005016: 699b ldr r3, [r3, #24]
  12277. 8005018: 4619 mov r1, r3
  12278. 800501a: 4610 mov r0, r2
  12279. 800501c: f7ff fc11 bl 8004842 <get_fat>
  12280. 8005020: 6178 str r0, [r7, #20]
  12281. if (clst <= 1) return FR_INT_ERR; /* Internal error */
  12282. 8005022: 697b ldr r3, [r7, #20]
  12283. 8005024: 2b01 cmp r3, #1
  12284. 8005026: d801 bhi.n 800502c <dir_next+0xa0>
  12285. 8005028: 2302 movs r3, #2
  12286. 800502a: e081 b.n 8005130 <dir_next+0x1a4>
  12287. if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
  12288. 800502c: 697b ldr r3, [r7, #20]
  12289. 800502e: f1b3 3fff cmp.w r3, #4294967295
  12290. 8005032: d101 bne.n 8005038 <dir_next+0xac>
  12291. 8005034: 2301 movs r3, #1
  12292. 8005036: e07b b.n 8005130 <dir_next+0x1a4>
  12293. if (clst >= fs->n_fatent) { /* Reached end of dynamic table */
  12294. 8005038: 68fb ldr r3, [r7, #12]
  12295. 800503a: 69db ldr r3, [r3, #28]
  12296. 800503c: 697a ldr r2, [r7, #20]
  12297. 800503e: 429a cmp r2, r3
  12298. 8005040: d359 bcc.n 80050f6 <dir_next+0x16a>
  12299. #if !_FS_READONLY
  12300. if (!stretch) { /* If no stretch, report EOT */
  12301. 8005042: 683b ldr r3, [r7, #0]
  12302. 8005044: 2b00 cmp r3, #0
  12303. 8005046: d104 bne.n 8005052 <dir_next+0xc6>
  12304. dp->sect = 0; return FR_NO_FILE;
  12305. 8005048: 687b ldr r3, [r7, #4]
  12306. 800504a: 2200 movs r2, #0
  12307. 800504c: 61da str r2, [r3, #28]
  12308. 800504e: 2304 movs r3, #4
  12309. 8005050: e06e b.n 8005130 <dir_next+0x1a4>
  12310. }
  12311. clst = create_chain(&dp->obj, dp->clust); /* Allocate a cluster */
  12312. 8005052: 687a ldr r2, [r7, #4]
  12313. 8005054: 687b ldr r3, [r7, #4]
  12314. 8005056: 699b ldr r3, [r3, #24]
  12315. 8005058: 4619 mov r1, r3
  12316. 800505a: 4610 mov r0, r2
  12317. 800505c: f7ff fe3d bl 8004cda <create_chain>
  12318. 8005060: 6178 str r0, [r7, #20]
  12319. if (clst == 0) return FR_DENIED; /* No free cluster */
  12320. 8005062: 697b ldr r3, [r7, #20]
  12321. 8005064: 2b00 cmp r3, #0
  12322. 8005066: d101 bne.n 800506c <dir_next+0xe0>
  12323. 8005068: 2307 movs r3, #7
  12324. 800506a: e061 b.n 8005130 <dir_next+0x1a4>
  12325. if (clst == 1) return FR_INT_ERR; /* Internal error */
  12326. 800506c: 697b ldr r3, [r7, #20]
  12327. 800506e: 2b01 cmp r3, #1
  12328. 8005070: d101 bne.n 8005076 <dir_next+0xea>
  12329. 8005072: 2302 movs r3, #2
  12330. 8005074: e05c b.n 8005130 <dir_next+0x1a4>
  12331. if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
  12332. 8005076: 697b ldr r3, [r7, #20]
  12333. 8005078: f1b3 3fff cmp.w r3, #4294967295
  12334. 800507c: d101 bne.n 8005082 <dir_next+0xf6>
  12335. 800507e: 2301 movs r3, #1
  12336. 8005080: e056 b.n 8005130 <dir_next+0x1a4>
  12337. /* Clean-up the stretched table */
  12338. if (_FS_EXFAT) dp->obj.stat |= 4; /* The directory needs to be updated */
  12339. if (sync_window(fs) != FR_OK) return FR_DISK_ERR; /* Flush disk access window */
  12340. 8005082: 68f8 ldr r0, [r7, #12]
  12341. 8005084: f7ff fadc bl 8004640 <sync_window>
  12342. 8005088: 4603 mov r3, r0
  12343. 800508a: 2b00 cmp r3, #0
  12344. 800508c: d001 beq.n 8005092 <dir_next+0x106>
  12345. 800508e: 2301 movs r3, #1
  12346. 8005090: e04e b.n 8005130 <dir_next+0x1a4>
  12347. mem_set(fs->win, 0, SS(fs)); /* Clear window buffer */
  12348. 8005092: 68fb ldr r3, [r7, #12]
  12349. 8005094: f103 0038 add.w r0, r3, #56 ; 0x38
  12350. 8005098: 68fb ldr r3, [r7, #12]
  12351. 800509a: 899b ldrh r3, [r3, #12]
  12352. 800509c: 461a mov r2, r3
  12353. 800509e: 2100 movs r1, #0
  12354. 80050a0: f7ff f905 bl 80042ae <mem_set>
  12355. for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */
  12356. 80050a4: 2300 movs r3, #0
  12357. 80050a6: 613b str r3, [r7, #16]
  12358. 80050a8: 6979 ldr r1, [r7, #20]
  12359. 80050aa: 68f8 ldr r0, [r7, #12]
  12360. 80050ac: f7ff fbaa bl 8004804 <clust2sect>
  12361. 80050b0: 4602 mov r2, r0
  12362. 80050b2: 68fb ldr r3, [r7, #12]
  12363. 80050b4: 635a str r2, [r3, #52] ; 0x34
  12364. 80050b6: e012 b.n 80050de <dir_next+0x152>
  12365. fs->wflag = 1;
  12366. 80050b8: 68fb ldr r3, [r7, #12]
  12367. 80050ba: 2201 movs r2, #1
  12368. 80050bc: 70da strb r2, [r3, #3]
  12369. if (sync_window(fs) != FR_OK) return FR_DISK_ERR;
  12370. 80050be: 68f8 ldr r0, [r7, #12]
  12371. 80050c0: f7ff fabe bl 8004640 <sync_window>
  12372. 80050c4: 4603 mov r3, r0
  12373. 80050c6: 2b00 cmp r3, #0
  12374. 80050c8: d001 beq.n 80050ce <dir_next+0x142>
  12375. 80050ca: 2301 movs r3, #1
  12376. 80050cc: e030 b.n 8005130 <dir_next+0x1a4>
  12377. for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */
  12378. 80050ce: 693b ldr r3, [r7, #16]
  12379. 80050d0: 3301 adds r3, #1
  12380. 80050d2: 613b str r3, [r7, #16]
  12381. 80050d4: 68fb ldr r3, [r7, #12]
  12382. 80050d6: 6b5b ldr r3, [r3, #52] ; 0x34
  12383. 80050d8: 1c5a adds r2, r3, #1
  12384. 80050da: 68fb ldr r3, [r7, #12]
  12385. 80050dc: 635a str r2, [r3, #52] ; 0x34
  12386. 80050de: 68fb ldr r3, [r7, #12]
  12387. 80050e0: 895b ldrh r3, [r3, #10]
  12388. 80050e2: 461a mov r2, r3
  12389. 80050e4: 693b ldr r3, [r7, #16]
  12390. 80050e6: 4293 cmp r3, r2
  12391. 80050e8: d3e6 bcc.n 80050b8 <dir_next+0x12c>
  12392. }
  12393. fs->winsect -= n; /* Restore window offset */
  12394. 80050ea: 68fb ldr r3, [r7, #12]
  12395. 80050ec: 6b5a ldr r2, [r3, #52] ; 0x34
  12396. 80050ee: 693b ldr r3, [r7, #16]
  12397. 80050f0: 1ad2 subs r2, r2, r3
  12398. 80050f2: 68fb ldr r3, [r7, #12]
  12399. 80050f4: 635a str r2, [r3, #52] ; 0x34
  12400. #else
  12401. if (!stretch) dp->sect = 0; /* (this line is to suppress compiler warning) */
  12402. dp->sect = 0; return FR_NO_FILE; /* Report EOT */
  12403. #endif
  12404. }
  12405. dp->clust = clst; /* Initialize data for new cluster */
  12406. 80050f6: 687b ldr r3, [r7, #4]
  12407. 80050f8: 697a ldr r2, [r7, #20]
  12408. 80050fa: 619a str r2, [r3, #24]
  12409. dp->sect = clust2sect(fs, clst);
  12410. 80050fc: 6979 ldr r1, [r7, #20]
  12411. 80050fe: 68f8 ldr r0, [r7, #12]
  12412. 8005100: f7ff fb80 bl 8004804 <clust2sect>
  12413. 8005104: 4602 mov r2, r0
  12414. 8005106: 687b ldr r3, [r7, #4]
  12415. 8005108: 61da str r2, [r3, #28]
  12416. }
  12417. }
  12418. }
  12419. dp->dptr = ofs; /* Current entry */
  12420. 800510a: 687b ldr r3, [r7, #4]
  12421. 800510c: 68ba ldr r2, [r7, #8]
  12422. 800510e: 615a str r2, [r3, #20]
  12423. dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */
  12424. 8005110: 68fb ldr r3, [r7, #12]
  12425. 8005112: f103 0138 add.w r1, r3, #56 ; 0x38
  12426. 8005116: 68fb ldr r3, [r7, #12]
  12427. 8005118: 899b ldrh r3, [r3, #12]
  12428. 800511a: 461a mov r2, r3
  12429. 800511c: 68bb ldr r3, [r7, #8]
  12430. 800511e: fbb3 f0f2 udiv r0, r3, r2
  12431. 8005122: fb02 f200 mul.w r2, r2, r0
  12432. 8005126: 1a9b subs r3, r3, r2
  12433. 8005128: 18ca adds r2, r1, r3
  12434. 800512a: 687b ldr r3, [r7, #4]
  12435. 800512c: 621a str r2, [r3, #32]
  12436. return FR_OK;
  12437. 800512e: 2300 movs r3, #0
  12438. }
  12439. 8005130: 4618 mov r0, r3
  12440. 8005132: 3718 adds r7, #24
  12441. 8005134: 46bd mov sp, r7
  12442. 8005136: bd80 pop {r7, pc}
  12443. 08005138 <dir_alloc>:
  12444. static
  12445. FRESULT dir_alloc ( /* FR_OK(0):succeeded, !=0:error */
  12446. DIR* dp, /* Pointer to the directory object */
  12447. UINT nent /* Number of contiguous entries to allocate */
  12448. )
  12449. {
  12450. 8005138: b580 push {r7, lr}
  12451. 800513a: b086 sub sp, #24
  12452. 800513c: af00 add r7, sp, #0
  12453. 800513e: 6078 str r0, [r7, #4]
  12454. 8005140: 6039 str r1, [r7, #0]
  12455. FRESULT res;
  12456. UINT n;
  12457. FATFS *fs = dp->obj.fs;
  12458. 8005142: 687b ldr r3, [r7, #4]
  12459. 8005144: 681b ldr r3, [r3, #0]
  12460. 8005146: 60fb str r3, [r7, #12]
  12461. res = dir_sdi(dp, 0);
  12462. 8005148: 2100 movs r1, #0
  12463. 800514a: 6878 ldr r0, [r7, #4]
  12464. 800514c: f7ff fe95 bl 8004e7a <dir_sdi>
  12465. 8005150: 4603 mov r3, r0
  12466. 8005152: 75fb strb r3, [r7, #23]
  12467. if (res == FR_OK) {
  12468. 8005154: 7dfb ldrb r3, [r7, #23]
  12469. 8005156: 2b00 cmp r3, #0
  12470. 8005158: d12b bne.n 80051b2 <dir_alloc+0x7a>
  12471. n = 0;
  12472. 800515a: 2300 movs r3, #0
  12473. 800515c: 613b str r3, [r7, #16]
  12474. do {
  12475. res = move_window(fs, dp->sect);
  12476. 800515e: 687b ldr r3, [r7, #4]
  12477. 8005160: 69db ldr r3, [r3, #28]
  12478. 8005162: 4619 mov r1, r3
  12479. 8005164: 68f8 ldr r0, [r7, #12]
  12480. 8005166: f7ff faaf bl 80046c8 <move_window>
  12481. 800516a: 4603 mov r3, r0
  12482. 800516c: 75fb strb r3, [r7, #23]
  12483. if (res != FR_OK) break;
  12484. 800516e: 7dfb ldrb r3, [r7, #23]
  12485. 8005170: 2b00 cmp r3, #0
  12486. 8005172: d11d bne.n 80051b0 <dir_alloc+0x78>
  12487. #if _FS_EXFAT
  12488. if ((fs->fs_type == FS_EXFAT) ? (int)((dp->dir[XDIR_Type] & 0x80) == 0) : (int)(dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0)) {
  12489. #else
  12490. if (dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0) {
  12491. 8005174: 687b ldr r3, [r7, #4]
  12492. 8005176: 6a1b ldr r3, [r3, #32]
  12493. 8005178: 781b ldrb r3, [r3, #0]
  12494. 800517a: 2be5 cmp r3, #229 ; 0xe5
  12495. 800517c: d004 beq.n 8005188 <dir_alloc+0x50>
  12496. 800517e: 687b ldr r3, [r7, #4]
  12497. 8005180: 6a1b ldr r3, [r3, #32]
  12498. 8005182: 781b ldrb r3, [r3, #0]
  12499. 8005184: 2b00 cmp r3, #0
  12500. 8005186: d107 bne.n 8005198 <dir_alloc+0x60>
  12501. #endif
  12502. if (++n == nent) break; /* A block of contiguous free entries is found */
  12503. 8005188: 693b ldr r3, [r7, #16]
  12504. 800518a: 3301 adds r3, #1
  12505. 800518c: 613b str r3, [r7, #16]
  12506. 800518e: 693a ldr r2, [r7, #16]
  12507. 8005190: 683b ldr r3, [r7, #0]
  12508. 8005192: 429a cmp r2, r3
  12509. 8005194: d102 bne.n 800519c <dir_alloc+0x64>
  12510. 8005196: e00c b.n 80051b2 <dir_alloc+0x7a>
  12511. } else {
  12512. n = 0; /* Not a blank entry. Restart to search */
  12513. 8005198: 2300 movs r3, #0
  12514. 800519a: 613b str r3, [r7, #16]
  12515. }
  12516. res = dir_next(dp, 1);
  12517. 800519c: 2101 movs r1, #1
  12518. 800519e: 6878 ldr r0, [r7, #4]
  12519. 80051a0: f7ff fef4 bl 8004f8c <dir_next>
  12520. 80051a4: 4603 mov r3, r0
  12521. 80051a6: 75fb strb r3, [r7, #23]
  12522. } while (res == FR_OK); /* Next entry with table stretch enabled */
  12523. 80051a8: 7dfb ldrb r3, [r7, #23]
  12524. 80051aa: 2b00 cmp r3, #0
  12525. 80051ac: d0d7 beq.n 800515e <dir_alloc+0x26>
  12526. 80051ae: e000 b.n 80051b2 <dir_alloc+0x7a>
  12527. if (res != FR_OK) break;
  12528. 80051b0: bf00 nop
  12529. }
  12530. if (res == FR_NO_FILE) res = FR_DENIED; /* No directory entry to allocate */
  12531. 80051b2: 7dfb ldrb r3, [r7, #23]
  12532. 80051b4: 2b04 cmp r3, #4
  12533. 80051b6: d101 bne.n 80051bc <dir_alloc+0x84>
  12534. 80051b8: 2307 movs r3, #7
  12535. 80051ba: 75fb strb r3, [r7, #23]
  12536. return res;
  12537. 80051bc: 7dfb ldrb r3, [r7, #23]
  12538. }
  12539. 80051be: 4618 mov r0, r3
  12540. 80051c0: 3718 adds r7, #24
  12541. 80051c2: 46bd mov sp, r7
  12542. 80051c4: bd80 pop {r7, pc}
  12543. 080051c6 <ld_clust>:
  12544. static
  12545. DWORD ld_clust ( /* Returns the top cluster value of the SFN entry */
  12546. FATFS* fs, /* Pointer to the fs object */
  12547. const BYTE* dir /* Pointer to the key entry */
  12548. )
  12549. {
  12550. 80051c6: b580 push {r7, lr}
  12551. 80051c8: b084 sub sp, #16
  12552. 80051ca: af00 add r7, sp, #0
  12553. 80051cc: 6078 str r0, [r7, #4]
  12554. 80051ce: 6039 str r1, [r7, #0]
  12555. DWORD cl;
  12556. cl = ld_word(dir + DIR_FstClusLO);
  12557. 80051d0: 683b ldr r3, [r7, #0]
  12558. 80051d2: 331a adds r3, #26
  12559. 80051d4: 4618 mov r0, r3
  12560. 80051d6: f7fe ffc7 bl 8004168 <ld_word>
  12561. 80051da: 4603 mov r3, r0
  12562. 80051dc: 60fb str r3, [r7, #12]
  12563. if (fs->fs_type == FS_FAT32) {
  12564. 80051de: 687b ldr r3, [r7, #4]
  12565. 80051e0: 781b ldrb r3, [r3, #0]
  12566. 80051e2: 2b03 cmp r3, #3
  12567. 80051e4: d109 bne.n 80051fa <ld_clust+0x34>
  12568. cl |= (DWORD)ld_word(dir + DIR_FstClusHI) << 16;
  12569. 80051e6: 683b ldr r3, [r7, #0]
  12570. 80051e8: 3314 adds r3, #20
  12571. 80051ea: 4618 mov r0, r3
  12572. 80051ec: f7fe ffbc bl 8004168 <ld_word>
  12573. 80051f0: 4603 mov r3, r0
  12574. 80051f2: 041b lsls r3, r3, #16
  12575. 80051f4: 68fa ldr r2, [r7, #12]
  12576. 80051f6: 4313 orrs r3, r2
  12577. 80051f8: 60fb str r3, [r7, #12]
  12578. }
  12579. return cl;
  12580. 80051fa: 68fb ldr r3, [r7, #12]
  12581. }
  12582. 80051fc: 4618 mov r0, r3
  12583. 80051fe: 3710 adds r7, #16
  12584. 8005200: 46bd mov sp, r7
  12585. 8005202: bd80 pop {r7, pc}
  12586. 08005204 <st_clust>:
  12587. void st_clust (
  12588. FATFS* fs, /* Pointer to the fs object */
  12589. BYTE* dir, /* Pointer to the key entry */
  12590. DWORD cl /* Value to be set */
  12591. )
  12592. {
  12593. 8005204: b580 push {r7, lr}
  12594. 8005206: b084 sub sp, #16
  12595. 8005208: af00 add r7, sp, #0
  12596. 800520a: 60f8 str r0, [r7, #12]
  12597. 800520c: 60b9 str r1, [r7, #8]
  12598. 800520e: 607a str r2, [r7, #4]
  12599. st_word(dir + DIR_FstClusLO, (WORD)cl);
  12600. 8005210: 68bb ldr r3, [r7, #8]
  12601. 8005212: 331a adds r3, #26
  12602. 8005214: 687a ldr r2, [r7, #4]
  12603. 8005216: b292 uxth r2, r2
  12604. 8005218: 4611 mov r1, r2
  12605. 800521a: 4618 mov r0, r3
  12606. 800521c: f7fe ffdf bl 80041de <st_word>
  12607. if (fs->fs_type == FS_FAT32) {
  12608. 8005220: 68fb ldr r3, [r7, #12]
  12609. 8005222: 781b ldrb r3, [r3, #0]
  12610. 8005224: 2b03 cmp r3, #3
  12611. 8005226: d109 bne.n 800523c <st_clust+0x38>
  12612. st_word(dir + DIR_FstClusHI, (WORD)(cl >> 16));
  12613. 8005228: 68bb ldr r3, [r7, #8]
  12614. 800522a: f103 0214 add.w r2, r3, #20
  12615. 800522e: 687b ldr r3, [r7, #4]
  12616. 8005230: 0c1b lsrs r3, r3, #16
  12617. 8005232: b29b uxth r3, r3
  12618. 8005234: 4619 mov r1, r3
  12619. 8005236: 4610 mov r0, r2
  12620. 8005238: f7fe ffd1 bl 80041de <st_word>
  12621. }
  12622. }
  12623. 800523c: bf00 nop
  12624. 800523e: 3710 adds r7, #16
  12625. 8005240: 46bd mov sp, r7
  12626. 8005242: bd80 pop {r7, pc}
  12627. 08005244 <cmp_lfn>:
  12628. static
  12629. int cmp_lfn ( /* 1:matched, 0:not matched */
  12630. const WCHAR* lfnbuf, /* Pointer to the LFN working buffer to be compared */
  12631. BYTE* dir /* Pointer to the directory entry containing the part of LFN */
  12632. )
  12633. {
  12634. 8005244: b590 push {r4, r7, lr}
  12635. 8005246: b087 sub sp, #28
  12636. 8005248: af00 add r7, sp, #0
  12637. 800524a: 6078 str r0, [r7, #4]
  12638. 800524c: 6039 str r1, [r7, #0]
  12639. UINT i, s;
  12640. WCHAR wc, uc;
  12641. if (ld_word(dir + LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO */
  12642. 800524e: 683b ldr r3, [r7, #0]
  12643. 8005250: 331a adds r3, #26
  12644. 8005252: 4618 mov r0, r3
  12645. 8005254: f7fe ff88 bl 8004168 <ld_word>
  12646. 8005258: 4603 mov r3, r0
  12647. 800525a: 2b00 cmp r3, #0
  12648. 800525c: d001 beq.n 8005262 <cmp_lfn+0x1e>
  12649. 800525e: 2300 movs r3, #0
  12650. 8005260: e059 b.n 8005316 <cmp_lfn+0xd2>
  12651. i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13; /* Offset in the LFN buffer */
  12652. 8005262: 683b ldr r3, [r7, #0]
  12653. 8005264: 781b ldrb r3, [r3, #0]
  12654. 8005266: f003 033f and.w r3, r3, #63 ; 0x3f
  12655. 800526a: 1e5a subs r2, r3, #1
  12656. 800526c: 4613 mov r3, r2
  12657. 800526e: 005b lsls r3, r3, #1
  12658. 8005270: 4413 add r3, r2
  12659. 8005272: 009b lsls r3, r3, #2
  12660. 8005274: 4413 add r3, r2
  12661. 8005276: 617b str r3, [r7, #20]
  12662. for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */
  12663. 8005278: 2301 movs r3, #1
  12664. 800527a: 81fb strh r3, [r7, #14]
  12665. 800527c: 2300 movs r3, #0
  12666. 800527e: 613b str r3, [r7, #16]
  12667. 8005280: e033 b.n 80052ea <cmp_lfn+0xa6>
  12668. uc = ld_word(dir + LfnOfs[s]); /* Pick an LFN character */
  12669. 8005282: 4a27 ldr r2, [pc, #156] ; (8005320 <cmp_lfn+0xdc>)
  12670. 8005284: 693b ldr r3, [r7, #16]
  12671. 8005286: 4413 add r3, r2
  12672. 8005288: 781b ldrb r3, [r3, #0]
  12673. 800528a: 461a mov r2, r3
  12674. 800528c: 683b ldr r3, [r7, #0]
  12675. 800528e: 4413 add r3, r2
  12676. 8005290: 4618 mov r0, r3
  12677. 8005292: f7fe ff69 bl 8004168 <ld_word>
  12678. 8005296: 4603 mov r3, r0
  12679. 8005298: 81bb strh r3, [r7, #12]
  12680. if (wc) {
  12681. 800529a: 89fb ldrh r3, [r7, #14]
  12682. 800529c: 2b00 cmp r3, #0
  12683. 800529e: d01a beq.n 80052d6 <cmp_lfn+0x92>
  12684. if (i >= _MAX_LFN || ff_wtoupper(uc) != ff_wtoupper(lfnbuf[i++])) { /* Compare it */
  12685. 80052a0: 697b ldr r3, [r7, #20]
  12686. 80052a2: 2bfe cmp r3, #254 ; 0xfe
  12687. 80052a4: d812 bhi.n 80052cc <cmp_lfn+0x88>
  12688. 80052a6: 89bb ldrh r3, [r7, #12]
  12689. 80052a8: 4618 mov r0, r3
  12690. 80052aa: f001 fe13 bl 8006ed4 <ff_wtoupper>
  12691. 80052ae: 4603 mov r3, r0
  12692. 80052b0: 461c mov r4, r3
  12693. 80052b2: 697b ldr r3, [r7, #20]
  12694. 80052b4: 1c5a adds r2, r3, #1
  12695. 80052b6: 617a str r2, [r7, #20]
  12696. 80052b8: 005b lsls r3, r3, #1
  12697. 80052ba: 687a ldr r2, [r7, #4]
  12698. 80052bc: 4413 add r3, r2
  12699. 80052be: 881b ldrh r3, [r3, #0]
  12700. 80052c0: 4618 mov r0, r3
  12701. 80052c2: f001 fe07 bl 8006ed4 <ff_wtoupper>
  12702. 80052c6: 4603 mov r3, r0
  12703. 80052c8: 429c cmp r4, r3
  12704. 80052ca: d001 beq.n 80052d0 <cmp_lfn+0x8c>
  12705. return 0; /* Not matched */
  12706. 80052cc: 2300 movs r3, #0
  12707. 80052ce: e022 b.n 8005316 <cmp_lfn+0xd2>
  12708. }
  12709. wc = uc;
  12710. 80052d0: 89bb ldrh r3, [r7, #12]
  12711. 80052d2: 81fb strh r3, [r7, #14]
  12712. 80052d4: e006 b.n 80052e4 <cmp_lfn+0xa0>
  12713. } else {
  12714. if (uc != 0xFFFF) return 0; /* Check filler */
  12715. 80052d6: 89bb ldrh r3, [r7, #12]
  12716. 80052d8: f64f 72ff movw r2, #65535 ; 0xffff
  12717. 80052dc: 4293 cmp r3, r2
  12718. 80052de: d001 beq.n 80052e4 <cmp_lfn+0xa0>
  12719. 80052e0: 2300 movs r3, #0
  12720. 80052e2: e018 b.n 8005316 <cmp_lfn+0xd2>
  12721. for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */
  12722. 80052e4: 693b ldr r3, [r7, #16]
  12723. 80052e6: 3301 adds r3, #1
  12724. 80052e8: 613b str r3, [r7, #16]
  12725. 80052ea: 693b ldr r3, [r7, #16]
  12726. 80052ec: 2b0c cmp r3, #12
  12727. 80052ee: d9c8 bls.n 8005282 <cmp_lfn+0x3e>
  12728. }
  12729. }
  12730. if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i]) return 0; /* Last segment matched but different length */
  12731. 80052f0: 683b ldr r3, [r7, #0]
  12732. 80052f2: 781b ldrb r3, [r3, #0]
  12733. 80052f4: f003 0340 and.w r3, r3, #64 ; 0x40
  12734. 80052f8: 2b00 cmp r3, #0
  12735. 80052fa: d00b beq.n 8005314 <cmp_lfn+0xd0>
  12736. 80052fc: 89fb ldrh r3, [r7, #14]
  12737. 80052fe: 2b00 cmp r3, #0
  12738. 8005300: d008 beq.n 8005314 <cmp_lfn+0xd0>
  12739. 8005302: 697b ldr r3, [r7, #20]
  12740. 8005304: 005b lsls r3, r3, #1
  12741. 8005306: 687a ldr r2, [r7, #4]
  12742. 8005308: 4413 add r3, r2
  12743. 800530a: 881b ldrh r3, [r3, #0]
  12744. 800530c: 2b00 cmp r3, #0
  12745. 800530e: d001 beq.n 8005314 <cmp_lfn+0xd0>
  12746. 8005310: 2300 movs r3, #0
  12747. 8005312: e000 b.n 8005316 <cmp_lfn+0xd2>
  12748. return 1; /* The part of LFN matched */
  12749. 8005314: 2301 movs r3, #1
  12750. }
  12751. 8005316: 4618 mov r0, r3
  12752. 8005318: 371c adds r7, #28
  12753. 800531a: 46bd mov sp, r7
  12754. 800531c: bd90 pop {r4, r7, pc}
  12755. 800531e: bf00 nop
  12756. 8005320: 080071f4 .word 0x080071f4
  12757. 08005324 <put_lfn>:
  12758. const WCHAR* lfn, /* Pointer to the LFN */
  12759. BYTE* dir, /* Pointer to the LFN entry to be created */
  12760. BYTE ord, /* LFN order (1-20) */
  12761. BYTE sum /* Checksum of the corresponding SFN */
  12762. )
  12763. {
  12764. 8005324: b580 push {r7, lr}
  12765. 8005326: b088 sub sp, #32
  12766. 8005328: af00 add r7, sp, #0
  12767. 800532a: 60f8 str r0, [r7, #12]
  12768. 800532c: 60b9 str r1, [r7, #8]
  12769. 800532e: 4611 mov r1, r2
  12770. 8005330: 461a mov r2, r3
  12771. 8005332: 460b mov r3, r1
  12772. 8005334: 71fb strb r3, [r7, #7]
  12773. 8005336: 4613 mov r3, r2
  12774. 8005338: 71bb strb r3, [r7, #6]
  12775. UINT i, s;
  12776. WCHAR wc;
  12777. dir[LDIR_Chksum] = sum; /* Set checksum */
  12778. 800533a: 68bb ldr r3, [r7, #8]
  12779. 800533c: 330d adds r3, #13
  12780. 800533e: 79ba ldrb r2, [r7, #6]
  12781. 8005340: 701a strb r2, [r3, #0]
  12782. dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */
  12783. 8005342: 68bb ldr r3, [r7, #8]
  12784. 8005344: 330b adds r3, #11
  12785. 8005346: 220f movs r2, #15
  12786. 8005348: 701a strb r2, [r3, #0]
  12787. dir[LDIR_Type] = 0;
  12788. 800534a: 68bb ldr r3, [r7, #8]
  12789. 800534c: 330c adds r3, #12
  12790. 800534e: 2200 movs r2, #0
  12791. 8005350: 701a strb r2, [r3, #0]
  12792. st_word(dir + LDIR_FstClusLO, 0);
  12793. 8005352: 68bb ldr r3, [r7, #8]
  12794. 8005354: 331a adds r3, #26
  12795. 8005356: 2100 movs r1, #0
  12796. 8005358: 4618 mov r0, r3
  12797. 800535a: f7fe ff40 bl 80041de <st_word>
  12798. i = (ord - 1) * 13; /* Get offset in the LFN working buffer */
  12799. 800535e: 79fb ldrb r3, [r7, #7]
  12800. 8005360: 1e5a subs r2, r3, #1
  12801. 8005362: 4613 mov r3, r2
  12802. 8005364: 005b lsls r3, r3, #1
  12803. 8005366: 4413 add r3, r2
  12804. 8005368: 009b lsls r3, r3, #2
  12805. 800536a: 4413 add r3, r2
  12806. 800536c: 61fb str r3, [r7, #28]
  12807. s = wc = 0;
  12808. 800536e: 2300 movs r3, #0
  12809. 8005370: 82fb strh r3, [r7, #22]
  12810. 8005372: 2300 movs r3, #0
  12811. 8005374: 61bb str r3, [r7, #24]
  12812. do {
  12813. if (wc != 0xFFFF) wc = lfn[i++]; /* Get an effective character */
  12814. 8005376: 8afb ldrh r3, [r7, #22]
  12815. 8005378: f64f 72ff movw r2, #65535 ; 0xffff
  12816. 800537c: 4293 cmp r3, r2
  12817. 800537e: d007 beq.n 8005390 <put_lfn+0x6c>
  12818. 8005380: 69fb ldr r3, [r7, #28]
  12819. 8005382: 1c5a adds r2, r3, #1
  12820. 8005384: 61fa str r2, [r7, #28]
  12821. 8005386: 005b lsls r3, r3, #1
  12822. 8005388: 68fa ldr r2, [r7, #12]
  12823. 800538a: 4413 add r3, r2
  12824. 800538c: 881b ldrh r3, [r3, #0]
  12825. 800538e: 82fb strh r3, [r7, #22]
  12826. st_word(dir + LfnOfs[s], wc); /* Put it */
  12827. 8005390: 4a17 ldr r2, [pc, #92] ; (80053f0 <put_lfn+0xcc>)
  12828. 8005392: 69bb ldr r3, [r7, #24]
  12829. 8005394: 4413 add r3, r2
  12830. 8005396: 781b ldrb r3, [r3, #0]
  12831. 8005398: 461a mov r2, r3
  12832. 800539a: 68bb ldr r3, [r7, #8]
  12833. 800539c: 4413 add r3, r2
  12834. 800539e: 8afa ldrh r2, [r7, #22]
  12835. 80053a0: 4611 mov r1, r2
  12836. 80053a2: 4618 mov r0, r3
  12837. 80053a4: f7fe ff1b bl 80041de <st_word>
  12838. if (wc == 0) wc = 0xFFFF; /* Padding characters for left locations */
  12839. 80053a8: 8afb ldrh r3, [r7, #22]
  12840. 80053aa: 2b00 cmp r3, #0
  12841. 80053ac: d102 bne.n 80053b4 <put_lfn+0x90>
  12842. 80053ae: f64f 73ff movw r3, #65535 ; 0xffff
  12843. 80053b2: 82fb strh r3, [r7, #22]
  12844. } while (++s < 13);
  12845. 80053b4: 69bb ldr r3, [r7, #24]
  12846. 80053b6: 3301 adds r3, #1
  12847. 80053b8: 61bb str r3, [r7, #24]
  12848. 80053ba: 69bb ldr r3, [r7, #24]
  12849. 80053bc: 2b0c cmp r3, #12
  12850. 80053be: d9da bls.n 8005376 <put_lfn+0x52>
  12851. if (wc == 0xFFFF || !lfn[i]) ord |= LLEF; /* Last LFN part is the start of LFN sequence */
  12852. 80053c0: 8afb ldrh r3, [r7, #22]
  12853. 80053c2: f64f 72ff movw r2, #65535 ; 0xffff
  12854. 80053c6: 4293 cmp r3, r2
  12855. 80053c8: d006 beq.n 80053d8 <put_lfn+0xb4>
  12856. 80053ca: 69fb ldr r3, [r7, #28]
  12857. 80053cc: 005b lsls r3, r3, #1
  12858. 80053ce: 68fa ldr r2, [r7, #12]
  12859. 80053d0: 4413 add r3, r2
  12860. 80053d2: 881b ldrh r3, [r3, #0]
  12861. 80053d4: 2b00 cmp r3, #0
  12862. 80053d6: d103 bne.n 80053e0 <put_lfn+0xbc>
  12863. 80053d8: 79fb ldrb r3, [r7, #7]
  12864. 80053da: f043 0340 orr.w r3, r3, #64 ; 0x40
  12865. 80053de: 71fb strb r3, [r7, #7]
  12866. dir[LDIR_Ord] = ord; /* Set the LFN order */
  12867. 80053e0: 68bb ldr r3, [r7, #8]
  12868. 80053e2: 79fa ldrb r2, [r7, #7]
  12869. 80053e4: 701a strb r2, [r3, #0]
  12870. }
  12871. 80053e6: bf00 nop
  12872. 80053e8: 3720 adds r7, #32
  12873. 80053ea: 46bd mov sp, r7
  12874. 80053ec: bd80 pop {r7, pc}
  12875. 80053ee: bf00 nop
  12876. 80053f0: 080071f4 .word 0x080071f4
  12877. 080053f4 <gen_numname>:
  12878. BYTE* dst, /* Pointer to the buffer to store numbered SFN */
  12879. const BYTE* src, /* Pointer to SFN */
  12880. const WCHAR* lfn, /* Pointer to LFN */
  12881. UINT seq /* Sequence number */
  12882. )
  12883. {
  12884. 80053f4: b580 push {r7, lr}
  12885. 80053f6: b08c sub sp, #48 ; 0x30
  12886. 80053f8: af00 add r7, sp, #0
  12887. 80053fa: 60f8 str r0, [r7, #12]
  12888. 80053fc: 60b9 str r1, [r7, #8]
  12889. 80053fe: 607a str r2, [r7, #4]
  12890. 8005400: 603b str r3, [r7, #0]
  12891. UINT i, j;
  12892. WCHAR wc;
  12893. DWORD sr;
  12894. mem_cpy(dst, src, 11);
  12895. 8005402: 220b movs r2, #11
  12896. 8005404: 68b9 ldr r1, [r7, #8]
  12897. 8005406: 68f8 ldr r0, [r7, #12]
  12898. 8005408: f7fe ff30 bl 800426c <mem_cpy>
  12899. if (seq > 5) { /* In case of many collisions, generate a hash number instead of sequential number */
  12900. 800540c: 683b ldr r3, [r7, #0]
  12901. 800540e: 2b05 cmp r3, #5
  12902. 8005410: d92b bls.n 800546a <gen_numname+0x76>
  12903. sr = seq;
  12904. 8005412: 683b ldr r3, [r7, #0]
  12905. 8005414: 61fb str r3, [r7, #28]
  12906. while (*lfn) { /* Create a CRC */
  12907. 8005416: e022 b.n 800545e <gen_numname+0x6a>
  12908. wc = *lfn++;
  12909. 8005418: 687b ldr r3, [r7, #4]
  12910. 800541a: 1c9a adds r2, r3, #2
  12911. 800541c: 607a str r2, [r7, #4]
  12912. 800541e: 881b ldrh r3, [r3, #0]
  12913. 8005420: 847b strh r3, [r7, #34] ; 0x22
  12914. for (i = 0; i < 16; i++) {
  12915. 8005422: 2300 movs r3, #0
  12916. 8005424: 62bb str r3, [r7, #40] ; 0x28
  12917. 8005426: e017 b.n 8005458 <gen_numname+0x64>
  12918. sr = (sr << 1) + (wc & 1);
  12919. 8005428: 69fb ldr r3, [r7, #28]
  12920. 800542a: 005a lsls r2, r3, #1
  12921. 800542c: 8c7b ldrh r3, [r7, #34] ; 0x22
  12922. 800542e: f003 0301 and.w r3, r3, #1
  12923. 8005432: 4413 add r3, r2
  12924. 8005434: 61fb str r3, [r7, #28]
  12925. wc >>= 1;
  12926. 8005436: 8c7b ldrh r3, [r7, #34] ; 0x22
  12927. 8005438: 085b lsrs r3, r3, #1
  12928. 800543a: 847b strh r3, [r7, #34] ; 0x22
  12929. if (sr & 0x10000) sr ^= 0x11021;
  12930. 800543c: 69fb ldr r3, [r7, #28]
  12931. 800543e: f403 3380 and.w r3, r3, #65536 ; 0x10000
  12932. 8005442: 2b00 cmp r3, #0
  12933. 8005444: d005 beq.n 8005452 <gen_numname+0x5e>
  12934. 8005446: 69fb ldr r3, [r7, #28]
  12935. 8005448: f483 3388 eor.w r3, r3, #69632 ; 0x11000
  12936. 800544c: f083 0321 eor.w r3, r3, #33 ; 0x21
  12937. 8005450: 61fb str r3, [r7, #28]
  12938. for (i = 0; i < 16; i++) {
  12939. 8005452: 6abb ldr r3, [r7, #40] ; 0x28
  12940. 8005454: 3301 adds r3, #1
  12941. 8005456: 62bb str r3, [r7, #40] ; 0x28
  12942. 8005458: 6abb ldr r3, [r7, #40] ; 0x28
  12943. 800545a: 2b0f cmp r3, #15
  12944. 800545c: d9e4 bls.n 8005428 <gen_numname+0x34>
  12945. while (*lfn) { /* Create a CRC */
  12946. 800545e: 687b ldr r3, [r7, #4]
  12947. 8005460: 881b ldrh r3, [r3, #0]
  12948. 8005462: 2b00 cmp r3, #0
  12949. 8005464: d1d8 bne.n 8005418 <gen_numname+0x24>
  12950. }
  12951. }
  12952. seq = (UINT)sr;
  12953. 8005466: 69fb ldr r3, [r7, #28]
  12954. 8005468: 603b str r3, [r7, #0]
  12955. }
  12956. /* itoa (hexdecimal) */
  12957. i = 7;
  12958. 800546a: 2307 movs r3, #7
  12959. 800546c: 62bb str r3, [r7, #40] ; 0x28
  12960. do {
  12961. c = (BYTE)((seq % 16) + '0');
  12962. 800546e: 683b ldr r3, [r7, #0]
  12963. 8005470: b2db uxtb r3, r3
  12964. 8005472: f003 030f and.w r3, r3, #15
  12965. 8005476: b2db uxtb r3, r3
  12966. 8005478: 3330 adds r3, #48 ; 0x30
  12967. 800547a: f887 302f strb.w r3, [r7, #47] ; 0x2f
  12968. if (c > '9') c += 7;
  12969. 800547e: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  12970. 8005482: 2b39 cmp r3, #57 ; 0x39
  12971. 8005484: d904 bls.n 8005490 <gen_numname+0x9c>
  12972. 8005486: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  12973. 800548a: 3307 adds r3, #7
  12974. 800548c: f887 302f strb.w r3, [r7, #47] ; 0x2f
  12975. ns[i--] = c;
  12976. 8005490: 6abb ldr r3, [r7, #40] ; 0x28
  12977. 8005492: 1e5a subs r2, r3, #1
  12978. 8005494: 62ba str r2, [r7, #40] ; 0x28
  12979. 8005496: f107 0230 add.w r2, r7, #48 ; 0x30
  12980. 800549a: 4413 add r3, r2
  12981. 800549c: f897 202f ldrb.w r2, [r7, #47] ; 0x2f
  12982. 80054a0: f803 2c1c strb.w r2, [r3, #-28]
  12983. seq /= 16;
  12984. 80054a4: 683b ldr r3, [r7, #0]
  12985. 80054a6: 091b lsrs r3, r3, #4
  12986. 80054a8: 603b str r3, [r7, #0]
  12987. } while (seq);
  12988. 80054aa: 683b ldr r3, [r7, #0]
  12989. 80054ac: 2b00 cmp r3, #0
  12990. 80054ae: d1de bne.n 800546e <gen_numname+0x7a>
  12991. ns[i] = '~';
  12992. 80054b0: f107 0214 add.w r2, r7, #20
  12993. 80054b4: 6abb ldr r3, [r7, #40] ; 0x28
  12994. 80054b6: 4413 add r3, r2
  12995. 80054b8: 227e movs r2, #126 ; 0x7e
  12996. 80054ba: 701a strb r2, [r3, #0]
  12997. /* Append the number */
  12998. for (j = 0; j < i && dst[j] != ' '; j++) {
  12999. 80054bc: 2300 movs r3, #0
  13000. 80054be: 627b str r3, [r7, #36] ; 0x24
  13001. 80054c0: e002 b.n 80054c8 <gen_numname+0xd4>
  13002. 80054c2: 6a7b ldr r3, [r7, #36] ; 0x24
  13003. 80054c4: 3301 adds r3, #1
  13004. 80054c6: 627b str r3, [r7, #36] ; 0x24
  13005. 80054c8: 6a7a ldr r2, [r7, #36] ; 0x24
  13006. 80054ca: 6abb ldr r3, [r7, #40] ; 0x28
  13007. 80054cc: 429a cmp r2, r3
  13008. 80054ce: d205 bcs.n 80054dc <gen_numname+0xe8>
  13009. 80054d0: 68fa ldr r2, [r7, #12]
  13010. 80054d2: 6a7b ldr r3, [r7, #36] ; 0x24
  13011. 80054d4: 4413 add r3, r2
  13012. 80054d6: 781b ldrb r3, [r3, #0]
  13013. 80054d8: 2b20 cmp r3, #32
  13014. 80054da: d1f2 bne.n 80054c2 <gen_numname+0xce>
  13015. if (j == i - 1) break;
  13016. j++;
  13017. }
  13018. }
  13019. do {
  13020. dst[j++] = (i < 8) ? ns[i++] : ' ';
  13021. 80054dc: 6abb ldr r3, [r7, #40] ; 0x28
  13022. 80054de: 2b07 cmp r3, #7
  13023. 80054e0: d808 bhi.n 80054f4 <gen_numname+0x100>
  13024. 80054e2: 6abb ldr r3, [r7, #40] ; 0x28
  13025. 80054e4: 1c5a adds r2, r3, #1
  13026. 80054e6: 62ba str r2, [r7, #40] ; 0x28
  13027. 80054e8: f107 0230 add.w r2, r7, #48 ; 0x30
  13028. 80054ec: 4413 add r3, r2
  13029. 80054ee: f813 1c1c ldrb.w r1, [r3, #-28]
  13030. 80054f2: e000 b.n 80054f6 <gen_numname+0x102>
  13031. 80054f4: 2120 movs r1, #32
  13032. 80054f6: 6a7b ldr r3, [r7, #36] ; 0x24
  13033. 80054f8: 1c5a adds r2, r3, #1
  13034. 80054fa: 627a str r2, [r7, #36] ; 0x24
  13035. 80054fc: 68fa ldr r2, [r7, #12]
  13036. 80054fe: 4413 add r3, r2
  13037. 8005500: 460a mov r2, r1
  13038. 8005502: 701a strb r2, [r3, #0]
  13039. } while (j < 8);
  13040. 8005504: 6a7b ldr r3, [r7, #36] ; 0x24
  13041. 8005506: 2b07 cmp r3, #7
  13042. 8005508: d9e8 bls.n 80054dc <gen_numname+0xe8>
  13043. }
  13044. 800550a: bf00 nop
  13045. 800550c: 3730 adds r7, #48 ; 0x30
  13046. 800550e: 46bd mov sp, r7
  13047. 8005510: bd80 pop {r7, pc}
  13048. 08005512 <sum_sfn>:
  13049. static
  13050. BYTE sum_sfn (
  13051. const BYTE* dir /* Pointer to the SFN entry */
  13052. )
  13053. {
  13054. 8005512: b480 push {r7}
  13055. 8005514: b085 sub sp, #20
  13056. 8005516: af00 add r7, sp, #0
  13057. 8005518: 6078 str r0, [r7, #4]
  13058. BYTE sum = 0;
  13059. 800551a: 2300 movs r3, #0
  13060. 800551c: 73fb strb r3, [r7, #15]
  13061. UINT n = 11;
  13062. 800551e: 230b movs r3, #11
  13063. 8005520: 60bb str r3, [r7, #8]
  13064. do {
  13065. sum = (sum >> 1) + (sum << 7) + *dir++;
  13066. 8005522: 7bfb ldrb r3, [r7, #15]
  13067. 8005524: b2da uxtb r2, r3
  13068. 8005526: 0852 lsrs r2, r2, #1
  13069. 8005528: 01db lsls r3, r3, #7
  13070. 800552a: 4313 orrs r3, r2
  13071. 800552c: b2da uxtb r2, r3
  13072. 800552e: 687b ldr r3, [r7, #4]
  13073. 8005530: 1c59 adds r1, r3, #1
  13074. 8005532: 6079 str r1, [r7, #4]
  13075. 8005534: 781b ldrb r3, [r3, #0]
  13076. 8005536: 4413 add r3, r2
  13077. 8005538: 73fb strb r3, [r7, #15]
  13078. } while (--n);
  13079. 800553a: 68bb ldr r3, [r7, #8]
  13080. 800553c: 3b01 subs r3, #1
  13081. 800553e: 60bb str r3, [r7, #8]
  13082. 8005540: 68bb ldr r3, [r7, #8]
  13083. 8005542: 2b00 cmp r3, #0
  13084. 8005544: d1ed bne.n 8005522 <sum_sfn+0x10>
  13085. return sum;
  13086. 8005546: 7bfb ldrb r3, [r7, #15]
  13087. }
  13088. 8005548: 4618 mov r0, r3
  13089. 800554a: 3714 adds r7, #20
  13090. 800554c: 46bd mov sp, r7
  13091. 800554e: f85d 7b04 ldr.w r7, [sp], #4
  13092. 8005552: 4770 bx lr
  13093. 08005554 <dir_find>:
  13094. static
  13095. FRESULT dir_find ( /* FR_OK(0):succeeded, !=0:error */
  13096. DIR* dp /* Pointer to the directory object with the file name */
  13097. )
  13098. {
  13099. 8005554: b580 push {r7, lr}
  13100. 8005556: b086 sub sp, #24
  13101. 8005558: af00 add r7, sp, #0
  13102. 800555a: 6078 str r0, [r7, #4]
  13103. FRESULT res;
  13104. FATFS *fs = dp->obj.fs;
  13105. 800555c: 687b ldr r3, [r7, #4]
  13106. 800555e: 681b ldr r3, [r3, #0]
  13107. 8005560: 613b str r3, [r7, #16]
  13108. BYTE c;
  13109. #if _USE_LFN != 0
  13110. BYTE a, ord, sum;
  13111. #endif
  13112. res = dir_sdi(dp, 0); /* Rewind directory object */
  13113. 8005562: 2100 movs r1, #0
  13114. 8005564: 6878 ldr r0, [r7, #4]
  13115. 8005566: f7ff fc88 bl 8004e7a <dir_sdi>
  13116. 800556a: 4603 mov r3, r0
  13117. 800556c: 75fb strb r3, [r7, #23]
  13118. if (res != FR_OK) return res;
  13119. 800556e: 7dfb ldrb r3, [r7, #23]
  13120. 8005570: 2b00 cmp r3, #0
  13121. 8005572: d001 beq.n 8005578 <dir_find+0x24>
  13122. 8005574: 7dfb ldrb r3, [r7, #23]
  13123. 8005576: e0a9 b.n 80056cc <dir_find+0x178>
  13124. return res;
  13125. }
  13126. #endif
  13127. /* On the FAT12/16/32 volume */
  13128. #if _USE_LFN != 0
  13129. ord = sum = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
  13130. 8005578: 23ff movs r3, #255 ; 0xff
  13131. 800557a: 753b strb r3, [r7, #20]
  13132. 800557c: 7d3b ldrb r3, [r7, #20]
  13133. 800557e: 757b strb r3, [r7, #21]
  13134. 8005580: 687b ldr r3, [r7, #4]
  13135. 8005582: f04f 32ff mov.w r2, #4294967295
  13136. 8005586: 631a str r2, [r3, #48] ; 0x30
  13137. #endif
  13138. do {
  13139. res = move_window(fs, dp->sect);
  13140. 8005588: 687b ldr r3, [r7, #4]
  13141. 800558a: 69db ldr r3, [r3, #28]
  13142. 800558c: 4619 mov r1, r3
  13143. 800558e: 6938 ldr r0, [r7, #16]
  13144. 8005590: f7ff f89a bl 80046c8 <move_window>
  13145. 8005594: 4603 mov r3, r0
  13146. 8005596: 75fb strb r3, [r7, #23]
  13147. if (res != FR_OK) break;
  13148. 8005598: 7dfb ldrb r3, [r7, #23]
  13149. 800559a: 2b00 cmp r3, #0
  13150. 800559c: f040 8090 bne.w 80056c0 <dir_find+0x16c>
  13151. c = dp->dir[DIR_Name];
  13152. 80055a0: 687b ldr r3, [r7, #4]
  13153. 80055a2: 6a1b ldr r3, [r3, #32]
  13154. 80055a4: 781b ldrb r3, [r3, #0]
  13155. 80055a6: 75bb strb r3, [r7, #22]
  13156. if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
  13157. 80055a8: 7dbb ldrb r3, [r7, #22]
  13158. 80055aa: 2b00 cmp r3, #0
  13159. 80055ac: d102 bne.n 80055b4 <dir_find+0x60>
  13160. 80055ae: 2304 movs r3, #4
  13161. 80055b0: 75fb strb r3, [r7, #23]
  13162. 80055b2: e08a b.n 80056ca <dir_find+0x176>
  13163. #if _USE_LFN != 0 /* LFN configuration */
  13164. dp->obj.attr = a = dp->dir[DIR_Attr] & AM_MASK;
  13165. 80055b4: 687b ldr r3, [r7, #4]
  13166. 80055b6: 6a1b ldr r3, [r3, #32]
  13167. 80055b8: 330b adds r3, #11
  13168. 80055ba: 781b ldrb r3, [r3, #0]
  13169. 80055bc: f003 033f and.w r3, r3, #63 ; 0x3f
  13170. 80055c0: 73fb strb r3, [r7, #15]
  13171. 80055c2: 687b ldr r3, [r7, #4]
  13172. 80055c4: 7bfa ldrb r2, [r7, #15]
  13173. 80055c6: 719a strb r2, [r3, #6]
  13174. if (c == DDEM || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */
  13175. 80055c8: 7dbb ldrb r3, [r7, #22]
  13176. 80055ca: 2be5 cmp r3, #229 ; 0xe5
  13177. 80055cc: d007 beq.n 80055de <dir_find+0x8a>
  13178. 80055ce: 7bfb ldrb r3, [r7, #15]
  13179. 80055d0: f003 0308 and.w r3, r3, #8
  13180. 80055d4: 2b00 cmp r3, #0
  13181. 80055d6: d009 beq.n 80055ec <dir_find+0x98>
  13182. 80055d8: 7bfb ldrb r3, [r7, #15]
  13183. 80055da: 2b0f cmp r3, #15
  13184. 80055dc: d006 beq.n 80055ec <dir_find+0x98>
  13185. ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
  13186. 80055de: 23ff movs r3, #255 ; 0xff
  13187. 80055e0: 757b strb r3, [r7, #21]
  13188. 80055e2: 687b ldr r3, [r7, #4]
  13189. 80055e4: f04f 32ff mov.w r2, #4294967295
  13190. 80055e8: 631a str r2, [r3, #48] ; 0x30
  13191. 80055ea: e05e b.n 80056aa <dir_find+0x156>
  13192. } else {
  13193. if (a == AM_LFN) { /* An LFN entry is found */
  13194. 80055ec: 7bfb ldrb r3, [r7, #15]
  13195. 80055ee: 2b0f cmp r3, #15
  13196. 80055f0: d136 bne.n 8005660 <dir_find+0x10c>
  13197. if (!(dp->fn[NSFLAG] & NS_NOLFN)) {
  13198. 80055f2: 687b ldr r3, [r7, #4]
  13199. 80055f4: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
  13200. 80055f8: f003 0340 and.w r3, r3, #64 ; 0x40
  13201. 80055fc: 2b00 cmp r3, #0
  13202. 80055fe: d154 bne.n 80056aa <dir_find+0x156>
  13203. if (c & LLEF) { /* Is it start of LFN sequence? */
  13204. 8005600: 7dbb ldrb r3, [r7, #22]
  13205. 8005602: f003 0340 and.w r3, r3, #64 ; 0x40
  13206. 8005606: 2b00 cmp r3, #0
  13207. 8005608: d00d beq.n 8005626 <dir_find+0xd2>
  13208. sum = dp->dir[LDIR_Chksum];
  13209. 800560a: 687b ldr r3, [r7, #4]
  13210. 800560c: 6a1b ldr r3, [r3, #32]
  13211. 800560e: 7b5b ldrb r3, [r3, #13]
  13212. 8005610: 753b strb r3, [r7, #20]
  13213. c &= (BYTE)~LLEF; ord = c; /* LFN start order */
  13214. 8005612: 7dbb ldrb r3, [r7, #22]
  13215. 8005614: f023 0340 bic.w r3, r3, #64 ; 0x40
  13216. 8005618: 75bb strb r3, [r7, #22]
  13217. 800561a: 7dbb ldrb r3, [r7, #22]
  13218. 800561c: 757b strb r3, [r7, #21]
  13219. dp->blk_ofs = dp->dptr; /* Start offset of LFN */
  13220. 800561e: 687b ldr r3, [r7, #4]
  13221. 8005620: 695a ldr r2, [r3, #20]
  13222. 8005622: 687b ldr r3, [r7, #4]
  13223. 8005624: 631a str r2, [r3, #48] ; 0x30
  13224. }
  13225. /* Check validity of the LFN entry and compare it with given name */
  13226. ord = (c == ord && sum == dp->dir[LDIR_Chksum] && cmp_lfn(fs->lfnbuf, dp->dir)) ? ord - 1 : 0xFF;
  13227. 8005626: 7dba ldrb r2, [r7, #22]
  13228. 8005628: 7d7b ldrb r3, [r7, #21]
  13229. 800562a: 429a cmp r2, r3
  13230. 800562c: d115 bne.n 800565a <dir_find+0x106>
  13231. 800562e: 687b ldr r3, [r7, #4]
  13232. 8005630: 6a1b ldr r3, [r3, #32]
  13233. 8005632: 330d adds r3, #13
  13234. 8005634: 781b ldrb r3, [r3, #0]
  13235. 8005636: 7d3a ldrb r2, [r7, #20]
  13236. 8005638: 429a cmp r2, r3
  13237. 800563a: d10e bne.n 800565a <dir_find+0x106>
  13238. 800563c: 693b ldr r3, [r7, #16]
  13239. 800563e: 691a ldr r2, [r3, #16]
  13240. 8005640: 687b ldr r3, [r7, #4]
  13241. 8005642: 6a1b ldr r3, [r3, #32]
  13242. 8005644: 4619 mov r1, r3
  13243. 8005646: 4610 mov r0, r2
  13244. 8005648: f7ff fdfc bl 8005244 <cmp_lfn>
  13245. 800564c: 4603 mov r3, r0
  13246. 800564e: 2b00 cmp r3, #0
  13247. 8005650: d003 beq.n 800565a <dir_find+0x106>
  13248. 8005652: 7d7b ldrb r3, [r7, #21]
  13249. 8005654: 3b01 subs r3, #1
  13250. 8005656: b2db uxtb r3, r3
  13251. 8005658: e000 b.n 800565c <dir_find+0x108>
  13252. 800565a: 23ff movs r3, #255 ; 0xff
  13253. 800565c: 757b strb r3, [r7, #21]
  13254. 800565e: e024 b.n 80056aa <dir_find+0x156>
  13255. }
  13256. } else { /* An SFN entry is found */
  13257. if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */
  13258. 8005660: 7d7b ldrb r3, [r7, #21]
  13259. 8005662: 2b00 cmp r3, #0
  13260. 8005664: d109 bne.n 800567a <dir_find+0x126>
  13261. 8005666: 687b ldr r3, [r7, #4]
  13262. 8005668: 6a1b ldr r3, [r3, #32]
  13263. 800566a: 4618 mov r0, r3
  13264. 800566c: f7ff ff51 bl 8005512 <sum_sfn>
  13265. 8005670: 4603 mov r3, r0
  13266. 8005672: 461a mov r2, r3
  13267. 8005674: 7d3b ldrb r3, [r7, #20]
  13268. 8005676: 4293 cmp r3, r2
  13269. 8005678: d024 beq.n 80056c4 <dir_find+0x170>
  13270. if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */
  13271. 800567a: 687b ldr r3, [r7, #4]
  13272. 800567c: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
  13273. 8005680: f003 0301 and.w r3, r3, #1
  13274. 8005684: 2b00 cmp r3, #0
  13275. 8005686: d10a bne.n 800569e <dir_find+0x14a>
  13276. 8005688: 687b ldr r3, [r7, #4]
  13277. 800568a: 6a18 ldr r0, [r3, #32]
  13278. 800568c: 687b ldr r3, [r7, #4]
  13279. 800568e: 3324 adds r3, #36 ; 0x24
  13280. 8005690: 220b movs r2, #11
  13281. 8005692: 4619 mov r1, r3
  13282. 8005694: f7fe fe25 bl 80042e2 <mem_cmp>
  13283. 8005698: 4603 mov r3, r0
  13284. 800569a: 2b00 cmp r3, #0
  13285. 800569c: d014 beq.n 80056c8 <dir_find+0x174>
  13286. ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */
  13287. 800569e: 23ff movs r3, #255 ; 0xff
  13288. 80056a0: 757b strb r3, [r7, #21]
  13289. 80056a2: 687b ldr r3, [r7, #4]
  13290. 80056a4: f04f 32ff mov.w r2, #4294967295
  13291. 80056a8: 631a str r2, [r3, #48] ; 0x30
  13292. }
  13293. #else /* Non LFN configuration */
  13294. dp->obj.attr = dp->dir[DIR_Attr] & AM_MASK;
  13295. if (!(dp->dir[DIR_Attr] & AM_VOL) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* Is it a valid entry? */
  13296. #endif
  13297. res = dir_next(dp, 0); /* Next entry */
  13298. 80056aa: 2100 movs r1, #0
  13299. 80056ac: 6878 ldr r0, [r7, #4]
  13300. 80056ae: f7ff fc6d bl 8004f8c <dir_next>
  13301. 80056b2: 4603 mov r3, r0
  13302. 80056b4: 75fb strb r3, [r7, #23]
  13303. } while (res == FR_OK);
  13304. 80056b6: 7dfb ldrb r3, [r7, #23]
  13305. 80056b8: 2b00 cmp r3, #0
  13306. 80056ba: f43f af65 beq.w 8005588 <dir_find+0x34>
  13307. 80056be: e004 b.n 80056ca <dir_find+0x176>
  13308. if (res != FR_OK) break;
  13309. 80056c0: bf00 nop
  13310. 80056c2: e002 b.n 80056ca <dir_find+0x176>
  13311. if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */
  13312. 80056c4: bf00 nop
  13313. 80056c6: e000 b.n 80056ca <dir_find+0x176>
  13314. if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */
  13315. 80056c8: bf00 nop
  13316. return res;
  13317. 80056ca: 7dfb ldrb r3, [r7, #23]
  13318. }
  13319. 80056cc: 4618 mov r0, r3
  13320. 80056ce: 3718 adds r7, #24
  13321. 80056d0: 46bd mov sp, r7
  13322. 80056d2: bd80 pop {r7, pc}
  13323. 080056d4 <dir_register>:
  13324. static
  13325. FRESULT dir_register ( /* FR_OK:succeeded, FR_DENIED:no free entry or too many SFN collision, FR_DISK_ERR:disk error */
  13326. DIR* dp /* Target directory with object name to be created */
  13327. )
  13328. {
  13329. 80056d4: b580 push {r7, lr}
  13330. 80056d6: b08c sub sp, #48 ; 0x30
  13331. 80056d8: af00 add r7, sp, #0
  13332. 80056da: 6078 str r0, [r7, #4]
  13333. FRESULT res;
  13334. FATFS *fs = dp->obj.fs;
  13335. 80056dc: 687b ldr r3, [r7, #4]
  13336. 80056de: 681b ldr r3, [r3, #0]
  13337. 80056e0: 61fb str r3, [r7, #28]
  13338. #if _USE_LFN != 0 /* LFN configuration */
  13339. UINT n, nlen, nent;
  13340. BYTE sn[12], sum;
  13341. if (dp->fn[NSFLAG] & (NS_DOT | NS_NONAME)) return FR_INVALID_NAME; /* Check name validity */
  13342. 80056e2: 687b ldr r3, [r7, #4]
  13343. 80056e4: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
  13344. 80056e8: f003 03a0 and.w r3, r3, #160 ; 0xa0
  13345. 80056ec: 2b00 cmp r3, #0
  13346. 80056ee: d001 beq.n 80056f4 <dir_register+0x20>
  13347. 80056f0: 2306 movs r3, #6
  13348. 80056f2: e0e0 b.n 80058b6 <dir_register+0x1e2>
  13349. for (nlen = 0; fs->lfnbuf[nlen]; nlen++) ; /* Get lfn length */
  13350. 80056f4: 2300 movs r3, #0
  13351. 80056f6: 627b str r3, [r7, #36] ; 0x24
  13352. 80056f8: e002 b.n 8005700 <dir_register+0x2c>
  13353. 80056fa: 6a7b ldr r3, [r7, #36] ; 0x24
  13354. 80056fc: 3301 adds r3, #1
  13355. 80056fe: 627b str r3, [r7, #36] ; 0x24
  13356. 8005700: 69fb ldr r3, [r7, #28]
  13357. 8005702: 691a ldr r2, [r3, #16]
  13358. 8005704: 6a7b ldr r3, [r7, #36] ; 0x24
  13359. 8005706: 005b lsls r3, r3, #1
  13360. 8005708: 4413 add r3, r2
  13361. 800570a: 881b ldrh r3, [r3, #0]
  13362. 800570c: 2b00 cmp r3, #0
  13363. 800570e: d1f4 bne.n 80056fa <dir_register+0x26>
  13364. create_xdir(fs->dirbuf, fs->lfnbuf); /* Create on-memory directory block to be written later */
  13365. return FR_OK;
  13366. }
  13367. #endif
  13368. /* On the FAT12/16/32 volume */
  13369. mem_cpy(sn, dp->fn, 12);
  13370. 8005710: 687b ldr r3, [r7, #4]
  13371. 8005712: f103 0124 add.w r1, r3, #36 ; 0x24
  13372. 8005716: f107 030c add.w r3, r7, #12
  13373. 800571a: 220c movs r2, #12
  13374. 800571c: 4618 mov r0, r3
  13375. 800571e: f7fe fda5 bl 800426c <mem_cpy>
  13376. if (sn[NSFLAG] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */
  13377. 8005722: 7dfb ldrb r3, [r7, #23]
  13378. 8005724: f003 0301 and.w r3, r3, #1
  13379. 8005728: 2b00 cmp r3, #0
  13380. 800572a: d032 beq.n 8005792 <dir_register+0xbe>
  13381. dp->fn[NSFLAG] = NS_NOLFN; /* Find only SFN */
  13382. 800572c: 687b ldr r3, [r7, #4]
  13383. 800572e: 2240 movs r2, #64 ; 0x40
  13384. 8005730: f883 202f strb.w r2, [r3, #47] ; 0x2f
  13385. for (n = 1; n < 100; n++) {
  13386. 8005734: 2301 movs r3, #1
  13387. 8005736: 62bb str r3, [r7, #40] ; 0x28
  13388. 8005738: e016 b.n 8005768 <dir_register+0x94>
  13389. gen_numname(dp->fn, sn, fs->lfnbuf, n); /* Generate a numbered name */
  13390. 800573a: 687b ldr r3, [r7, #4]
  13391. 800573c: f103 0024 add.w r0, r3, #36 ; 0x24
  13392. 8005740: 69fb ldr r3, [r7, #28]
  13393. 8005742: 691a ldr r2, [r3, #16]
  13394. 8005744: f107 010c add.w r1, r7, #12
  13395. 8005748: 6abb ldr r3, [r7, #40] ; 0x28
  13396. 800574a: f7ff fe53 bl 80053f4 <gen_numname>
  13397. res = dir_find(dp); /* Check if the name collides with existing SFN */
  13398. 800574e: 6878 ldr r0, [r7, #4]
  13399. 8005750: f7ff ff00 bl 8005554 <dir_find>
  13400. 8005754: 4603 mov r3, r0
  13401. 8005756: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13402. if (res != FR_OK) break;
  13403. 800575a: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13404. 800575e: 2b00 cmp r3, #0
  13405. 8005760: d106 bne.n 8005770 <dir_register+0x9c>
  13406. for (n = 1; n < 100; n++) {
  13407. 8005762: 6abb ldr r3, [r7, #40] ; 0x28
  13408. 8005764: 3301 adds r3, #1
  13409. 8005766: 62bb str r3, [r7, #40] ; 0x28
  13410. 8005768: 6abb ldr r3, [r7, #40] ; 0x28
  13411. 800576a: 2b63 cmp r3, #99 ; 0x63
  13412. 800576c: d9e5 bls.n 800573a <dir_register+0x66>
  13413. 800576e: e000 b.n 8005772 <dir_register+0x9e>
  13414. if (res != FR_OK) break;
  13415. 8005770: bf00 nop
  13416. }
  13417. if (n == 100) return FR_DENIED; /* Abort if too many collisions */
  13418. 8005772: 6abb ldr r3, [r7, #40] ; 0x28
  13419. 8005774: 2b64 cmp r3, #100 ; 0x64
  13420. 8005776: d101 bne.n 800577c <dir_register+0xa8>
  13421. 8005778: 2307 movs r3, #7
  13422. 800577a: e09c b.n 80058b6 <dir_register+0x1e2>
  13423. if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */
  13424. 800577c: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13425. 8005780: 2b04 cmp r3, #4
  13426. 8005782: d002 beq.n 800578a <dir_register+0xb6>
  13427. 8005784: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13428. 8005788: e095 b.n 80058b6 <dir_register+0x1e2>
  13429. dp->fn[NSFLAG] = sn[NSFLAG];
  13430. 800578a: 7dfa ldrb r2, [r7, #23]
  13431. 800578c: 687b ldr r3, [r7, #4]
  13432. 800578e: f883 202f strb.w r2, [r3, #47] ; 0x2f
  13433. }
  13434. /* Create an SFN with/without LFNs. */
  13435. nent = (sn[NSFLAG] & NS_LFN) ? (nlen + 12) / 13 + 1 : 1; /* Number of entries to allocate */
  13436. 8005792: 7dfb ldrb r3, [r7, #23]
  13437. 8005794: f003 0302 and.w r3, r3, #2
  13438. 8005798: 2b00 cmp r3, #0
  13439. 800579a: d007 beq.n 80057ac <dir_register+0xd8>
  13440. 800579c: 6a7b ldr r3, [r7, #36] ; 0x24
  13441. 800579e: 330c adds r3, #12
  13442. 80057a0: 4a47 ldr r2, [pc, #284] ; (80058c0 <dir_register+0x1ec>)
  13443. 80057a2: fba2 2303 umull r2, r3, r2, r3
  13444. 80057a6: 089b lsrs r3, r3, #2
  13445. 80057a8: 3301 adds r3, #1
  13446. 80057aa: e000 b.n 80057ae <dir_register+0xda>
  13447. 80057ac: 2301 movs r3, #1
  13448. 80057ae: 623b str r3, [r7, #32]
  13449. res = dir_alloc(dp, nent); /* Allocate entries */
  13450. 80057b0: 6a39 ldr r1, [r7, #32]
  13451. 80057b2: 6878 ldr r0, [r7, #4]
  13452. 80057b4: f7ff fcc0 bl 8005138 <dir_alloc>
  13453. 80057b8: 4603 mov r3, r0
  13454. 80057ba: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13455. if (res == FR_OK && --nent) { /* Set LFN entry if needed */
  13456. 80057be: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13457. 80057c2: 2b00 cmp r3, #0
  13458. 80057c4: d148 bne.n 8005858 <dir_register+0x184>
  13459. 80057c6: 6a3b ldr r3, [r7, #32]
  13460. 80057c8: 3b01 subs r3, #1
  13461. 80057ca: 623b str r3, [r7, #32]
  13462. 80057cc: 6a3b ldr r3, [r7, #32]
  13463. 80057ce: 2b00 cmp r3, #0
  13464. 80057d0: d042 beq.n 8005858 <dir_register+0x184>
  13465. res = dir_sdi(dp, dp->dptr - nent * SZDIRE);
  13466. 80057d2: 687b ldr r3, [r7, #4]
  13467. 80057d4: 695a ldr r2, [r3, #20]
  13468. 80057d6: 6a3b ldr r3, [r7, #32]
  13469. 80057d8: 015b lsls r3, r3, #5
  13470. 80057da: 1ad3 subs r3, r2, r3
  13471. 80057dc: 4619 mov r1, r3
  13472. 80057de: 6878 ldr r0, [r7, #4]
  13473. 80057e0: f7ff fb4b bl 8004e7a <dir_sdi>
  13474. 80057e4: 4603 mov r3, r0
  13475. 80057e6: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13476. if (res == FR_OK) {
  13477. 80057ea: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13478. 80057ee: 2b00 cmp r3, #0
  13479. 80057f0: d132 bne.n 8005858 <dir_register+0x184>
  13480. sum = sum_sfn(dp->fn); /* Checksum value of the SFN tied to the LFN */
  13481. 80057f2: 687b ldr r3, [r7, #4]
  13482. 80057f4: 3324 adds r3, #36 ; 0x24
  13483. 80057f6: 4618 mov r0, r3
  13484. 80057f8: f7ff fe8b bl 8005512 <sum_sfn>
  13485. 80057fc: 4603 mov r3, r0
  13486. 80057fe: 76fb strb r3, [r7, #27]
  13487. do { /* Store LFN entries in bottom first */
  13488. res = move_window(fs, dp->sect);
  13489. 8005800: 687b ldr r3, [r7, #4]
  13490. 8005802: 69db ldr r3, [r3, #28]
  13491. 8005804: 4619 mov r1, r3
  13492. 8005806: 69f8 ldr r0, [r7, #28]
  13493. 8005808: f7fe ff5e bl 80046c8 <move_window>
  13494. 800580c: 4603 mov r3, r0
  13495. 800580e: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13496. if (res != FR_OK) break;
  13497. 8005812: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13498. 8005816: 2b00 cmp r3, #0
  13499. 8005818: d11d bne.n 8005856 <dir_register+0x182>
  13500. put_lfn(fs->lfnbuf, dp->dir, (BYTE)nent, sum);
  13501. 800581a: 69fb ldr r3, [r7, #28]
  13502. 800581c: 6918 ldr r0, [r3, #16]
  13503. 800581e: 687b ldr r3, [r7, #4]
  13504. 8005820: 6a19 ldr r1, [r3, #32]
  13505. 8005822: 6a3b ldr r3, [r7, #32]
  13506. 8005824: b2da uxtb r2, r3
  13507. 8005826: 7efb ldrb r3, [r7, #27]
  13508. 8005828: f7ff fd7c bl 8005324 <put_lfn>
  13509. fs->wflag = 1;
  13510. 800582c: 69fb ldr r3, [r7, #28]
  13511. 800582e: 2201 movs r2, #1
  13512. 8005830: 70da strb r2, [r3, #3]
  13513. res = dir_next(dp, 0); /* Next entry */
  13514. 8005832: 2100 movs r1, #0
  13515. 8005834: 6878 ldr r0, [r7, #4]
  13516. 8005836: f7ff fba9 bl 8004f8c <dir_next>
  13517. 800583a: 4603 mov r3, r0
  13518. 800583c: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13519. } while (res == FR_OK && --nent);
  13520. 8005840: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13521. 8005844: 2b00 cmp r3, #0
  13522. 8005846: d107 bne.n 8005858 <dir_register+0x184>
  13523. 8005848: 6a3b ldr r3, [r7, #32]
  13524. 800584a: 3b01 subs r3, #1
  13525. 800584c: 623b str r3, [r7, #32]
  13526. 800584e: 6a3b ldr r3, [r7, #32]
  13527. 8005850: 2b00 cmp r3, #0
  13528. 8005852: d1d5 bne.n 8005800 <dir_register+0x12c>
  13529. 8005854: e000 b.n 8005858 <dir_register+0x184>
  13530. if (res != FR_OK) break;
  13531. 8005856: bf00 nop
  13532. res = dir_alloc(dp, 1); /* Allocate an entry for SFN */
  13533. #endif
  13534. /* Set SFN entry */
  13535. if (res == FR_OK) {
  13536. 8005858: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13537. 800585c: 2b00 cmp r3, #0
  13538. 800585e: d128 bne.n 80058b2 <dir_register+0x1de>
  13539. res = move_window(fs, dp->sect);
  13540. 8005860: 687b ldr r3, [r7, #4]
  13541. 8005862: 69db ldr r3, [r3, #28]
  13542. 8005864: 4619 mov r1, r3
  13543. 8005866: 69f8 ldr r0, [r7, #28]
  13544. 8005868: f7fe ff2e bl 80046c8 <move_window>
  13545. 800586c: 4603 mov r3, r0
  13546. 800586e: f887 302f strb.w r3, [r7, #47] ; 0x2f
  13547. if (res == FR_OK) {
  13548. 8005872: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13549. 8005876: 2b00 cmp r3, #0
  13550. 8005878: d11b bne.n 80058b2 <dir_register+0x1de>
  13551. mem_set(dp->dir, 0, SZDIRE); /* Clean the entry */
  13552. 800587a: 687b ldr r3, [r7, #4]
  13553. 800587c: 6a1b ldr r3, [r3, #32]
  13554. 800587e: 2220 movs r2, #32
  13555. 8005880: 2100 movs r1, #0
  13556. 8005882: 4618 mov r0, r3
  13557. 8005884: f7fe fd13 bl 80042ae <mem_set>
  13558. mem_cpy(dp->dir + DIR_Name, dp->fn, 11); /* Put SFN */
  13559. 8005888: 687b ldr r3, [r7, #4]
  13560. 800588a: 6a18 ldr r0, [r3, #32]
  13561. 800588c: 687b ldr r3, [r7, #4]
  13562. 800588e: 3324 adds r3, #36 ; 0x24
  13563. 8005890: 220b movs r2, #11
  13564. 8005892: 4619 mov r1, r3
  13565. 8005894: f7fe fcea bl 800426c <mem_cpy>
  13566. #if _USE_LFN != 0
  13567. dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT); /* Put NT flag */
  13568. 8005898: 687b ldr r3, [r7, #4]
  13569. 800589a: f893 202f ldrb.w r2, [r3, #47] ; 0x2f
  13570. 800589e: 687b ldr r3, [r7, #4]
  13571. 80058a0: 6a1b ldr r3, [r3, #32]
  13572. 80058a2: 330c adds r3, #12
  13573. 80058a4: f002 0218 and.w r2, r2, #24
  13574. 80058a8: b2d2 uxtb r2, r2
  13575. 80058aa: 701a strb r2, [r3, #0]
  13576. #endif
  13577. fs->wflag = 1;
  13578. 80058ac: 69fb ldr r3, [r7, #28]
  13579. 80058ae: 2201 movs r2, #1
  13580. 80058b0: 70da strb r2, [r3, #3]
  13581. }
  13582. }
  13583. return res;
  13584. 80058b2: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  13585. }
  13586. 80058b6: 4618 mov r0, r3
  13587. 80058b8: 3730 adds r7, #48 ; 0x30
  13588. 80058ba: 46bd mov sp, r7
  13589. 80058bc: bd80 pop {r7, pc}
  13590. 80058be: bf00 nop
  13591. 80058c0: 4ec4ec4f .word 0x4ec4ec4f
  13592. 080058c4 <create_name>:
  13593. static
  13594. FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not create */
  13595. DIR* dp, /* Pointer to the directory object */
  13596. const TCHAR** path /* Pointer to pointer to the segment in the path string */
  13597. )
  13598. {
  13599. 80058c4: b580 push {r7, lr}
  13600. 80058c6: b08a sub sp, #40 ; 0x28
  13601. 80058c8: af00 add r7, sp, #0
  13602. 80058ca: 6078 str r0, [r7, #4]
  13603. 80058cc: 6039 str r1, [r7, #0]
  13604. WCHAR w, *lfn;
  13605. UINT i, ni, si, di;
  13606. const TCHAR *p;
  13607. /* Create LFN in Unicode */
  13608. p = *path; lfn = dp->obj.fs->lfnbuf; si = di = 0;
  13609. 80058ce: 683b ldr r3, [r7, #0]
  13610. 80058d0: 681b ldr r3, [r3, #0]
  13611. 80058d2: 613b str r3, [r7, #16]
  13612. 80058d4: 687b ldr r3, [r7, #4]
  13613. 80058d6: 681b ldr r3, [r3, #0]
  13614. 80058d8: 691b ldr r3, [r3, #16]
  13615. 80058da: 60fb str r3, [r7, #12]
  13616. 80058dc: 2300 movs r3, #0
  13617. 80058de: 617b str r3, [r7, #20]
  13618. 80058e0: 697b ldr r3, [r7, #20]
  13619. 80058e2: 61bb str r3, [r7, #24]
  13620. for (;;) {
  13621. w = p[si++]; /* Get a character */
  13622. 80058e4: 69bb ldr r3, [r7, #24]
  13623. 80058e6: 1c5a adds r2, r3, #1
  13624. 80058e8: 61ba str r2, [r7, #24]
  13625. 80058ea: 693a ldr r2, [r7, #16]
  13626. 80058ec: 4413 add r3, r2
  13627. 80058ee: 781b ldrb r3, [r3, #0]
  13628. 80058f0: 84bb strh r3, [r7, #36] ; 0x24
  13629. if (w < ' ') break; /* Break if end of the path name */
  13630. 80058f2: 8cbb ldrh r3, [r7, #36] ; 0x24
  13631. 80058f4: 2b1f cmp r3, #31
  13632. 80058f6: d940 bls.n 800597a <create_name+0xb6>
  13633. if (w == '/' || w == '\\') { /* Break if a separator is found */
  13634. 80058f8: 8cbb ldrh r3, [r7, #36] ; 0x24
  13635. 80058fa: 2b2f cmp r3, #47 ; 0x2f
  13636. 80058fc: d006 beq.n 800590c <create_name+0x48>
  13637. 80058fe: 8cbb ldrh r3, [r7, #36] ; 0x24
  13638. 8005900: 2b5c cmp r3, #92 ; 0x5c
  13639. 8005902: d110 bne.n 8005926 <create_name+0x62>
  13640. while (p[si] == '/' || p[si] == '\\') si++; /* Skip duplicated separator if exist */
  13641. 8005904: e002 b.n 800590c <create_name+0x48>
  13642. 8005906: 69bb ldr r3, [r7, #24]
  13643. 8005908: 3301 adds r3, #1
  13644. 800590a: 61bb str r3, [r7, #24]
  13645. 800590c: 693a ldr r2, [r7, #16]
  13646. 800590e: 69bb ldr r3, [r7, #24]
  13647. 8005910: 4413 add r3, r2
  13648. 8005912: 781b ldrb r3, [r3, #0]
  13649. 8005914: 2b2f cmp r3, #47 ; 0x2f
  13650. 8005916: d0f6 beq.n 8005906 <create_name+0x42>
  13651. 8005918: 693a ldr r2, [r7, #16]
  13652. 800591a: 69bb ldr r3, [r7, #24]
  13653. 800591c: 4413 add r3, r2
  13654. 800591e: 781b ldrb r3, [r3, #0]
  13655. 8005920: 2b5c cmp r3, #92 ; 0x5c
  13656. 8005922: d0f0 beq.n 8005906 <create_name+0x42>
  13657. break;
  13658. 8005924: e02a b.n 800597c <create_name+0xb8>
  13659. }
  13660. if (di >= _MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */
  13661. 8005926: 697b ldr r3, [r7, #20]
  13662. 8005928: 2bfe cmp r3, #254 ; 0xfe
  13663. 800592a: d901 bls.n 8005930 <create_name+0x6c>
  13664. 800592c: 2306 movs r3, #6
  13665. 800592e: e177 b.n 8005c20 <create_name+0x35c>
  13666. #if !_LFN_UNICODE
  13667. w &= 0xFF;
  13668. 8005930: 8cbb ldrh r3, [r7, #36] ; 0x24
  13669. 8005932: b2db uxtb r3, r3
  13670. 8005934: 84bb strh r3, [r7, #36] ; 0x24
  13671. if (IsDBCS1(w)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */
  13672. b = (BYTE)p[si++]; /* Get 2nd byte */
  13673. w = (w << 8) + b; /* Create a DBC */
  13674. if (!IsDBCS2(b)) return FR_INVALID_NAME; /* Reject invalid sequence */
  13675. }
  13676. w = ff_convert(w, 1); /* Convert ANSI/OEM to Unicode */
  13677. 8005936: 8cbb ldrh r3, [r7, #36] ; 0x24
  13678. 8005938: 2101 movs r1, #1
  13679. 800593a: 4618 mov r0, r3
  13680. 800593c: f001 fa8e bl 8006e5c <ff_convert>
  13681. 8005940: 4603 mov r3, r0
  13682. 8005942: 84bb strh r3, [r7, #36] ; 0x24
  13683. if (!w) return FR_INVALID_NAME; /* Reject invalid code */
  13684. 8005944: 8cbb ldrh r3, [r7, #36] ; 0x24
  13685. 8005946: 2b00 cmp r3, #0
  13686. 8005948: d101 bne.n 800594e <create_name+0x8a>
  13687. 800594a: 2306 movs r3, #6
  13688. 800594c: e168 b.n 8005c20 <create_name+0x35c>
  13689. #endif
  13690. if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) return FR_INVALID_NAME; /* Reject illegal characters for LFN */
  13691. 800594e: 8cbb ldrh r3, [r7, #36] ; 0x24
  13692. 8005950: 2b7f cmp r3, #127 ; 0x7f
  13693. 8005952: d809 bhi.n 8005968 <create_name+0xa4>
  13694. 8005954: 8cbb ldrh r3, [r7, #36] ; 0x24
  13695. 8005956: 4619 mov r1, r3
  13696. 8005958: 48b3 ldr r0, [pc, #716] ; (8005c28 <create_name+0x364>)
  13697. 800595a: f7fe fce9 bl 8004330 <chk_chr>
  13698. 800595e: 4603 mov r3, r0
  13699. 8005960: 2b00 cmp r3, #0
  13700. 8005962: d001 beq.n 8005968 <create_name+0xa4>
  13701. 8005964: 2306 movs r3, #6
  13702. 8005966: e15b b.n 8005c20 <create_name+0x35c>
  13703. lfn[di++] = w; /* Store the Unicode character */
  13704. 8005968: 697b ldr r3, [r7, #20]
  13705. 800596a: 1c5a adds r2, r3, #1
  13706. 800596c: 617a str r2, [r7, #20]
  13707. 800596e: 005b lsls r3, r3, #1
  13708. 8005970: 68fa ldr r2, [r7, #12]
  13709. 8005972: 4413 add r3, r2
  13710. 8005974: 8cba ldrh r2, [r7, #36] ; 0x24
  13711. 8005976: 801a strh r2, [r3, #0]
  13712. w = p[si++]; /* Get a character */
  13713. 8005978: e7b4 b.n 80058e4 <create_name+0x20>
  13714. if (w < ' ') break; /* Break if end of the path name */
  13715. 800597a: bf00 nop
  13716. }
  13717. *path = &p[si]; /* Return pointer to the next segment */
  13718. 800597c: 693a ldr r2, [r7, #16]
  13719. 800597e: 69bb ldr r3, [r7, #24]
  13720. 8005980: 441a add r2, r3
  13721. 8005982: 683b ldr r3, [r7, #0]
  13722. 8005984: 601a str r2, [r3, #0]
  13723. cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
  13724. 8005986: 8cbb ldrh r3, [r7, #36] ; 0x24
  13725. 8005988: 2b1f cmp r3, #31
  13726. 800598a: d801 bhi.n 8005990 <create_name+0xcc>
  13727. 800598c: 2304 movs r3, #4
  13728. 800598e: e000 b.n 8005992 <create_name+0xce>
  13729. 8005990: 2300 movs r3, #0
  13730. 8005992: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13731. dp->fn[i] = (i < di) ? '.' : ' ';
  13732. dp->fn[i] = cf | NS_DOT; /* This is a dot entry */
  13733. return FR_OK;
  13734. }
  13735. #endif
  13736. while (di) { /* Snip off trailing spaces and dots if exist */
  13737. 8005996: e011 b.n 80059bc <create_name+0xf8>
  13738. w = lfn[di - 1];
  13739. 8005998: 697b ldr r3, [r7, #20]
  13740. 800599a: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000
  13741. 800599e: 3b01 subs r3, #1
  13742. 80059a0: 005b lsls r3, r3, #1
  13743. 80059a2: 68fa ldr r2, [r7, #12]
  13744. 80059a4: 4413 add r3, r2
  13745. 80059a6: 881b ldrh r3, [r3, #0]
  13746. 80059a8: 84bb strh r3, [r7, #36] ; 0x24
  13747. if (w != ' ' && w != '.') break;
  13748. 80059aa: 8cbb ldrh r3, [r7, #36] ; 0x24
  13749. 80059ac: 2b20 cmp r3, #32
  13750. 80059ae: d002 beq.n 80059b6 <create_name+0xf2>
  13751. 80059b0: 8cbb ldrh r3, [r7, #36] ; 0x24
  13752. 80059b2: 2b2e cmp r3, #46 ; 0x2e
  13753. 80059b4: d106 bne.n 80059c4 <create_name+0x100>
  13754. di--;
  13755. 80059b6: 697b ldr r3, [r7, #20]
  13756. 80059b8: 3b01 subs r3, #1
  13757. 80059ba: 617b str r3, [r7, #20]
  13758. while (di) { /* Snip off trailing spaces and dots if exist */
  13759. 80059bc: 697b ldr r3, [r7, #20]
  13760. 80059be: 2b00 cmp r3, #0
  13761. 80059c0: d1ea bne.n 8005998 <create_name+0xd4>
  13762. 80059c2: e000 b.n 80059c6 <create_name+0x102>
  13763. if (w != ' ' && w != '.') break;
  13764. 80059c4: bf00 nop
  13765. }
  13766. lfn[di] = 0; /* LFN is created */
  13767. 80059c6: 697b ldr r3, [r7, #20]
  13768. 80059c8: 005b lsls r3, r3, #1
  13769. 80059ca: 68fa ldr r2, [r7, #12]
  13770. 80059cc: 4413 add r3, r2
  13771. 80059ce: 2200 movs r2, #0
  13772. 80059d0: 801a strh r2, [r3, #0]
  13773. if (di == 0) return FR_INVALID_NAME; /* Reject nul name */
  13774. 80059d2: 697b ldr r3, [r7, #20]
  13775. 80059d4: 2b00 cmp r3, #0
  13776. 80059d6: d101 bne.n 80059dc <create_name+0x118>
  13777. 80059d8: 2306 movs r3, #6
  13778. 80059da: e121 b.n 8005c20 <create_name+0x35c>
  13779. /* Create SFN in directory form */
  13780. mem_set(dp->fn, ' ', 11);
  13781. 80059dc: 687b ldr r3, [r7, #4]
  13782. 80059de: 3324 adds r3, #36 ; 0x24
  13783. 80059e0: 220b movs r2, #11
  13784. 80059e2: 2120 movs r1, #32
  13785. 80059e4: 4618 mov r0, r3
  13786. 80059e6: f7fe fc62 bl 80042ae <mem_set>
  13787. for (si = 0; lfn[si] == ' ' || lfn[si] == '.'; si++) ; /* Strip leading spaces and dots */
  13788. 80059ea: 2300 movs r3, #0
  13789. 80059ec: 61bb str r3, [r7, #24]
  13790. 80059ee: e002 b.n 80059f6 <create_name+0x132>
  13791. 80059f0: 69bb ldr r3, [r7, #24]
  13792. 80059f2: 3301 adds r3, #1
  13793. 80059f4: 61bb str r3, [r7, #24]
  13794. 80059f6: 69bb ldr r3, [r7, #24]
  13795. 80059f8: 005b lsls r3, r3, #1
  13796. 80059fa: 68fa ldr r2, [r7, #12]
  13797. 80059fc: 4413 add r3, r2
  13798. 80059fe: 881b ldrh r3, [r3, #0]
  13799. 8005a00: 2b20 cmp r3, #32
  13800. 8005a02: d0f5 beq.n 80059f0 <create_name+0x12c>
  13801. 8005a04: 69bb ldr r3, [r7, #24]
  13802. 8005a06: 005b lsls r3, r3, #1
  13803. 8005a08: 68fa ldr r2, [r7, #12]
  13804. 8005a0a: 4413 add r3, r2
  13805. 8005a0c: 881b ldrh r3, [r3, #0]
  13806. 8005a0e: 2b2e cmp r3, #46 ; 0x2e
  13807. 8005a10: d0ee beq.n 80059f0 <create_name+0x12c>
  13808. if (si) cf |= NS_LOSS | NS_LFN;
  13809. 8005a12: 69bb ldr r3, [r7, #24]
  13810. 8005a14: 2b00 cmp r3, #0
  13811. 8005a16: d009 beq.n 8005a2c <create_name+0x168>
  13812. 8005a18: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13813. 8005a1c: f043 0303 orr.w r3, r3, #3
  13814. 8005a20: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13815. while (di && lfn[di - 1] != '.') di--; /* Find extension (di<=si: no extension) */
  13816. 8005a24: e002 b.n 8005a2c <create_name+0x168>
  13817. 8005a26: 697b ldr r3, [r7, #20]
  13818. 8005a28: 3b01 subs r3, #1
  13819. 8005a2a: 617b str r3, [r7, #20]
  13820. 8005a2c: 697b ldr r3, [r7, #20]
  13821. 8005a2e: 2b00 cmp r3, #0
  13822. 8005a30: d009 beq.n 8005a46 <create_name+0x182>
  13823. 8005a32: 697b ldr r3, [r7, #20]
  13824. 8005a34: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000
  13825. 8005a38: 3b01 subs r3, #1
  13826. 8005a3a: 005b lsls r3, r3, #1
  13827. 8005a3c: 68fa ldr r2, [r7, #12]
  13828. 8005a3e: 4413 add r3, r2
  13829. 8005a40: 881b ldrh r3, [r3, #0]
  13830. 8005a42: 2b2e cmp r3, #46 ; 0x2e
  13831. 8005a44: d1ef bne.n 8005a26 <create_name+0x162>
  13832. i = b = 0; ni = 8;
  13833. 8005a46: 2300 movs r3, #0
  13834. 8005a48: f887 3026 strb.w r3, [r7, #38] ; 0x26
  13835. 8005a4c: 2300 movs r3, #0
  13836. 8005a4e: 623b str r3, [r7, #32]
  13837. 8005a50: 2308 movs r3, #8
  13838. 8005a52: 61fb str r3, [r7, #28]
  13839. for (;;) {
  13840. w = lfn[si++]; /* Get an LFN character */
  13841. 8005a54: 69bb ldr r3, [r7, #24]
  13842. 8005a56: 1c5a adds r2, r3, #1
  13843. 8005a58: 61ba str r2, [r7, #24]
  13844. 8005a5a: 005b lsls r3, r3, #1
  13845. 8005a5c: 68fa ldr r2, [r7, #12]
  13846. 8005a5e: 4413 add r3, r2
  13847. 8005a60: 881b ldrh r3, [r3, #0]
  13848. 8005a62: 84bb strh r3, [r7, #36] ; 0x24
  13849. if (!w) break; /* Break on end of the LFN */
  13850. 8005a64: 8cbb ldrh r3, [r7, #36] ; 0x24
  13851. 8005a66: 2b00 cmp r3, #0
  13852. 8005a68: f000 8090 beq.w 8005b8c <create_name+0x2c8>
  13853. if (w == ' ' || (w == '.' && si != di)) { /* Remove spaces and dots */
  13854. 8005a6c: 8cbb ldrh r3, [r7, #36] ; 0x24
  13855. 8005a6e: 2b20 cmp r3, #32
  13856. 8005a70: d006 beq.n 8005a80 <create_name+0x1bc>
  13857. 8005a72: 8cbb ldrh r3, [r7, #36] ; 0x24
  13858. 8005a74: 2b2e cmp r3, #46 ; 0x2e
  13859. 8005a76: d10a bne.n 8005a8e <create_name+0x1ca>
  13860. 8005a78: 69ba ldr r2, [r7, #24]
  13861. 8005a7a: 697b ldr r3, [r7, #20]
  13862. 8005a7c: 429a cmp r2, r3
  13863. 8005a7e: d006 beq.n 8005a8e <create_name+0x1ca>
  13864. cf |= NS_LOSS | NS_LFN; continue;
  13865. 8005a80: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13866. 8005a84: f043 0303 orr.w r3, r3, #3
  13867. 8005a88: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13868. 8005a8c: e07d b.n 8005b8a <create_name+0x2c6>
  13869. }
  13870. if (i >= ni || si == di) { /* Extension or end of SFN */
  13871. 8005a8e: 6a3a ldr r2, [r7, #32]
  13872. 8005a90: 69fb ldr r3, [r7, #28]
  13873. 8005a92: 429a cmp r2, r3
  13874. 8005a94: d203 bcs.n 8005a9e <create_name+0x1da>
  13875. 8005a96: 69ba ldr r2, [r7, #24]
  13876. 8005a98: 697b ldr r3, [r7, #20]
  13877. 8005a9a: 429a cmp r2, r3
  13878. 8005a9c: d123 bne.n 8005ae6 <create_name+0x222>
  13879. if (ni == 11) { /* Long extension */
  13880. 8005a9e: 69fb ldr r3, [r7, #28]
  13881. 8005aa0: 2b0b cmp r3, #11
  13882. 8005aa2: d106 bne.n 8005ab2 <create_name+0x1ee>
  13883. cf |= NS_LOSS | NS_LFN; break;
  13884. 8005aa4: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13885. 8005aa8: f043 0303 orr.w r3, r3, #3
  13886. 8005aac: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13887. 8005ab0: e06f b.n 8005b92 <create_name+0x2ce>
  13888. }
  13889. if (si != di) cf |= NS_LOSS | NS_LFN; /* Out of 8.3 format */
  13890. 8005ab2: 69ba ldr r2, [r7, #24]
  13891. 8005ab4: 697b ldr r3, [r7, #20]
  13892. 8005ab6: 429a cmp r2, r3
  13893. 8005ab8: d005 beq.n 8005ac6 <create_name+0x202>
  13894. 8005aba: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13895. 8005abe: f043 0303 orr.w r3, r3, #3
  13896. 8005ac2: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13897. if (si > di) break; /* No extension */
  13898. 8005ac6: 69ba ldr r2, [r7, #24]
  13899. 8005ac8: 697b ldr r3, [r7, #20]
  13900. 8005aca: 429a cmp r2, r3
  13901. 8005acc: d860 bhi.n 8005b90 <create_name+0x2cc>
  13902. si = di; i = 8; ni = 11; /* Enter extension section */
  13903. 8005ace: 697b ldr r3, [r7, #20]
  13904. 8005ad0: 61bb str r3, [r7, #24]
  13905. 8005ad2: 2308 movs r3, #8
  13906. 8005ad4: 623b str r3, [r7, #32]
  13907. 8005ad6: 230b movs r3, #11
  13908. 8005ad8: 61fb str r3, [r7, #28]
  13909. b <<= 2; continue;
  13910. 8005ada: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  13911. 8005ade: 009b lsls r3, r3, #2
  13912. 8005ae0: f887 3026 strb.w r3, [r7, #38] ; 0x26
  13913. 8005ae4: e051 b.n 8005b8a <create_name+0x2c6>
  13914. }
  13915. if (w >= 0x80) { /* Non ASCII character */
  13916. 8005ae6: 8cbb ldrh r3, [r7, #36] ; 0x24
  13917. 8005ae8: 2b7f cmp r3, #127 ; 0x7f
  13918. 8005aea: d914 bls.n 8005b16 <create_name+0x252>
  13919. #ifdef _EXCVT
  13920. w = ff_convert(w, 0); /* Unicode -> OEM code */
  13921. 8005aec: 8cbb ldrh r3, [r7, #36] ; 0x24
  13922. 8005aee: 2100 movs r1, #0
  13923. 8005af0: 4618 mov r0, r3
  13924. 8005af2: f001 f9b3 bl 8006e5c <ff_convert>
  13925. 8005af6: 4603 mov r3, r0
  13926. 8005af8: 84bb strh r3, [r7, #36] ; 0x24
  13927. if (w) w = ExCvt[w - 0x80]; /* Convert extended character to upper (SBCS) */
  13928. 8005afa: 8cbb ldrh r3, [r7, #36] ; 0x24
  13929. 8005afc: 2b00 cmp r3, #0
  13930. 8005afe: d004 beq.n 8005b0a <create_name+0x246>
  13931. 8005b00: 8cbb ldrh r3, [r7, #36] ; 0x24
  13932. 8005b02: 3b80 subs r3, #128 ; 0x80
  13933. 8005b04: 4a49 ldr r2, [pc, #292] ; (8005c2c <create_name+0x368>)
  13934. 8005b06: 5cd3 ldrb r3, [r2, r3]
  13935. 8005b08: 84bb strh r3, [r7, #36] ; 0x24
  13936. #else
  13937. w = ff_convert(ff_wtoupper(w), 0); /* Upper converted Unicode -> OEM code */
  13938. #endif
  13939. cf |= NS_LFN; /* Force create LFN entry */
  13940. 8005b0a: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13941. 8005b0e: f043 0302 orr.w r3, r3, #2
  13942. 8005b12: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13943. if (i >= ni - 1) {
  13944. cf |= NS_LOSS | NS_LFN; i = ni; continue;
  13945. }
  13946. dp->fn[i++] = (BYTE)(w >> 8);
  13947. } else { /* SBC */
  13948. if (!w || chk_chr("+,;=[]", w)) { /* Replace illegal characters for SFN */
  13949. 8005b16: 8cbb ldrh r3, [r7, #36] ; 0x24
  13950. 8005b18: 2b00 cmp r3, #0
  13951. 8005b1a: d007 beq.n 8005b2c <create_name+0x268>
  13952. 8005b1c: 8cbb ldrh r3, [r7, #36] ; 0x24
  13953. 8005b1e: 4619 mov r1, r3
  13954. 8005b20: 4843 ldr r0, [pc, #268] ; (8005c30 <create_name+0x36c>)
  13955. 8005b22: f7fe fc05 bl 8004330 <chk_chr>
  13956. 8005b26: 4603 mov r3, r0
  13957. 8005b28: 2b00 cmp r3, #0
  13958. 8005b2a: d008 beq.n 8005b3e <create_name+0x27a>
  13959. w = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */
  13960. 8005b2c: 235f movs r3, #95 ; 0x5f
  13961. 8005b2e: 84bb strh r3, [r7, #36] ; 0x24
  13962. 8005b30: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  13963. 8005b34: f043 0303 orr.w r3, r3, #3
  13964. 8005b38: f887 3027 strb.w r3, [r7, #39] ; 0x27
  13965. 8005b3c: e01b b.n 8005b76 <create_name+0x2b2>
  13966. } else {
  13967. if (IsUpper(w)) { /* ASCII large capital */
  13968. 8005b3e: 8cbb ldrh r3, [r7, #36] ; 0x24
  13969. 8005b40: 2b40 cmp r3, #64 ; 0x40
  13970. 8005b42: d909 bls.n 8005b58 <create_name+0x294>
  13971. 8005b44: 8cbb ldrh r3, [r7, #36] ; 0x24
  13972. 8005b46: 2b5a cmp r3, #90 ; 0x5a
  13973. 8005b48: d806 bhi.n 8005b58 <create_name+0x294>
  13974. b |= 2;
  13975. 8005b4a: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  13976. 8005b4e: f043 0302 orr.w r3, r3, #2
  13977. 8005b52: f887 3026 strb.w r3, [r7, #38] ; 0x26
  13978. 8005b56: e00e b.n 8005b76 <create_name+0x2b2>
  13979. } else {
  13980. if (IsLower(w)) { /* ASCII small capital */
  13981. 8005b58: 8cbb ldrh r3, [r7, #36] ; 0x24
  13982. 8005b5a: 2b60 cmp r3, #96 ; 0x60
  13983. 8005b5c: d90b bls.n 8005b76 <create_name+0x2b2>
  13984. 8005b5e: 8cbb ldrh r3, [r7, #36] ; 0x24
  13985. 8005b60: 2b7a cmp r3, #122 ; 0x7a
  13986. 8005b62: d808 bhi.n 8005b76 <create_name+0x2b2>
  13987. b |= 1; w -= 0x20;
  13988. 8005b64: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  13989. 8005b68: f043 0301 orr.w r3, r3, #1
  13990. 8005b6c: f887 3026 strb.w r3, [r7, #38] ; 0x26
  13991. 8005b70: 8cbb ldrh r3, [r7, #36] ; 0x24
  13992. 8005b72: 3b20 subs r3, #32
  13993. 8005b74: 84bb strh r3, [r7, #36] ; 0x24
  13994. }
  13995. }
  13996. }
  13997. }
  13998. dp->fn[i++] = (BYTE)w;
  13999. 8005b76: 6a3b ldr r3, [r7, #32]
  14000. 8005b78: 1c5a adds r2, r3, #1
  14001. 8005b7a: 623a str r2, [r7, #32]
  14002. 8005b7c: 8cba ldrh r2, [r7, #36] ; 0x24
  14003. 8005b7e: b2d1 uxtb r1, r2
  14004. 8005b80: 687a ldr r2, [r7, #4]
  14005. 8005b82: 4413 add r3, r2
  14006. 8005b84: 460a mov r2, r1
  14007. 8005b86: f883 2024 strb.w r2, [r3, #36] ; 0x24
  14008. w = lfn[si++]; /* Get an LFN character */
  14009. 8005b8a: e763 b.n 8005a54 <create_name+0x190>
  14010. if (!w) break; /* Break on end of the LFN */
  14011. 8005b8c: bf00 nop
  14012. 8005b8e: e000 b.n 8005b92 <create_name+0x2ce>
  14013. if (si > di) break; /* No extension */
  14014. 8005b90: bf00 nop
  14015. }
  14016. if (dp->fn[0] == DDEM) dp->fn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */
  14017. 8005b92: 687b ldr r3, [r7, #4]
  14018. 8005b94: f893 3024 ldrb.w r3, [r3, #36] ; 0x24
  14019. 8005b98: 2be5 cmp r3, #229 ; 0xe5
  14020. 8005b9a: d103 bne.n 8005ba4 <create_name+0x2e0>
  14021. 8005b9c: 687b ldr r3, [r7, #4]
  14022. 8005b9e: 2205 movs r2, #5
  14023. 8005ba0: f883 2024 strb.w r2, [r3, #36] ; 0x24
  14024. if (ni == 8) b <<= 2;
  14025. 8005ba4: 69fb ldr r3, [r7, #28]
  14026. 8005ba6: 2b08 cmp r3, #8
  14027. 8005ba8: d104 bne.n 8005bb4 <create_name+0x2f0>
  14028. 8005baa: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  14029. 8005bae: 009b lsls r3, r3, #2
  14030. 8005bb0: f887 3026 strb.w r3, [r7, #38] ; 0x26
  14031. if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03) cf |= NS_LFN; /* Create LFN entry when there are composite capitals */
  14032. 8005bb4: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  14033. 8005bb8: f003 030c and.w r3, r3, #12
  14034. 8005bbc: 2b0c cmp r3, #12
  14035. 8005bbe: d005 beq.n 8005bcc <create_name+0x308>
  14036. 8005bc0: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  14037. 8005bc4: f003 0303 and.w r3, r3, #3
  14038. 8005bc8: 2b03 cmp r3, #3
  14039. 8005bca: d105 bne.n 8005bd8 <create_name+0x314>
  14040. 8005bcc: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  14041. 8005bd0: f043 0302 orr.w r3, r3, #2
  14042. 8005bd4: f887 3027 strb.w r3, [r7, #39] ; 0x27
  14043. if (!(cf & NS_LFN)) { /* When LFN is in 8.3 format without extended character, NT flags are created */
  14044. 8005bd8: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  14045. 8005bdc: f003 0302 and.w r3, r3, #2
  14046. 8005be0: 2b00 cmp r3, #0
  14047. 8005be2: d117 bne.n 8005c14 <create_name+0x350>
  14048. if ((b & 0x03) == 0x01) cf |= NS_EXT; /* NT flag (Extension has only small capital) */
  14049. 8005be4: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  14050. 8005be8: f003 0303 and.w r3, r3, #3
  14051. 8005bec: 2b01 cmp r3, #1
  14052. 8005bee: d105 bne.n 8005bfc <create_name+0x338>
  14053. 8005bf0: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  14054. 8005bf4: f043 0310 orr.w r3, r3, #16
  14055. 8005bf8: f887 3027 strb.w r3, [r7, #39] ; 0x27
  14056. if ((b & 0x0C) == 0x04) cf |= NS_BODY; /* NT flag (Filename has only small capital) */
  14057. 8005bfc: f897 3026 ldrb.w r3, [r7, #38] ; 0x26
  14058. 8005c00: f003 030c and.w r3, r3, #12
  14059. 8005c04: 2b04 cmp r3, #4
  14060. 8005c06: d105 bne.n 8005c14 <create_name+0x350>
  14061. 8005c08: f897 3027 ldrb.w r3, [r7, #39] ; 0x27
  14062. 8005c0c: f043 0308 orr.w r3, r3, #8
  14063. 8005c10: f887 3027 strb.w r3, [r7, #39] ; 0x27
  14064. }
  14065. dp->fn[NSFLAG] = cf; /* SFN is created */
  14066. 8005c14: 687b ldr r3, [r7, #4]
  14067. 8005c16: f897 2027 ldrb.w r2, [r7, #39] ; 0x27
  14068. 8005c1a: f883 202f strb.w r2, [r3, #47] ; 0x2f
  14069. return FR_OK;
  14070. 8005c1e: 2300 movs r3, #0
  14071. if (sfn[0] == DDEM) sfn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */
  14072. sfn[NSFLAG] = (c <= ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
  14073. return FR_OK;
  14074. #endif /* _USE_LFN != 0 */
  14075. }
  14076. 8005c20: 4618 mov r0, r3
  14077. 8005c22: 3728 adds r7, #40 ; 0x28
  14078. 8005c24: 46bd mov sp, r7
  14079. 8005c26: bd80 pop {r7, pc}
  14080. 8005c28: 08007114 .word 0x08007114
  14081. 8005c2c: 08007174 .word 0x08007174
  14082. 8005c30: 08007120 .word 0x08007120
  14083. 08005c34 <follow_path>:
  14084. static
  14085. FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
  14086. DIR* dp, /* Directory object to return last directory and found object */
  14087. const TCHAR* path /* Full-path string to find a file or directory */
  14088. )
  14089. {
  14090. 8005c34: b580 push {r7, lr}
  14091. 8005c36: b086 sub sp, #24
  14092. 8005c38: af00 add r7, sp, #0
  14093. 8005c3a: 6078 str r0, [r7, #4]
  14094. 8005c3c: 6039 str r1, [r7, #0]
  14095. FRESULT res;
  14096. BYTE ns;
  14097. _FDID *obj = &dp->obj;
  14098. 8005c3e: 687b ldr r3, [r7, #4]
  14099. 8005c40: 613b str r3, [r7, #16]
  14100. FATFS *fs = obj->fs;
  14101. 8005c42: 693b ldr r3, [r7, #16]
  14102. 8005c44: 681b ldr r3, [r3, #0]
  14103. 8005c46: 60fb str r3, [r7, #12]
  14104. if (*path != '/' && *path != '\\') { /* Without heading separator */
  14105. obj->sclust = fs->cdir; /* Start from current directory */
  14106. } else
  14107. #endif
  14108. { /* With heading separator */
  14109. while (*path == '/' || *path == '\\') path++; /* Strip heading separator */
  14110. 8005c48: e002 b.n 8005c50 <follow_path+0x1c>
  14111. 8005c4a: 683b ldr r3, [r7, #0]
  14112. 8005c4c: 3301 adds r3, #1
  14113. 8005c4e: 603b str r3, [r7, #0]
  14114. 8005c50: 683b ldr r3, [r7, #0]
  14115. 8005c52: 781b ldrb r3, [r3, #0]
  14116. 8005c54: 2b2f cmp r3, #47 ; 0x2f
  14117. 8005c56: d0f8 beq.n 8005c4a <follow_path+0x16>
  14118. 8005c58: 683b ldr r3, [r7, #0]
  14119. 8005c5a: 781b ldrb r3, [r3, #0]
  14120. 8005c5c: 2b5c cmp r3, #92 ; 0x5c
  14121. 8005c5e: d0f4 beq.n 8005c4a <follow_path+0x16>
  14122. obj->sclust = 0; /* Start from root directory */
  14123. 8005c60: 693b ldr r3, [r7, #16]
  14124. 8005c62: 2200 movs r2, #0
  14125. 8005c64: 609a str r2, [r3, #8]
  14126. obj->stat = fs->dirbuf[XDIR_GenFlags] & 2;
  14127. }
  14128. #endif
  14129. #endif
  14130. if ((UINT)*path < ' ') { /* Null path name is the origin directory itself */
  14131. 8005c66: 683b ldr r3, [r7, #0]
  14132. 8005c68: 781b ldrb r3, [r3, #0]
  14133. 8005c6a: 2b1f cmp r3, #31
  14134. 8005c6c: d80a bhi.n 8005c84 <follow_path+0x50>
  14135. dp->fn[NSFLAG] = NS_NONAME;
  14136. 8005c6e: 687b ldr r3, [r7, #4]
  14137. 8005c70: 2280 movs r2, #128 ; 0x80
  14138. 8005c72: f883 202f strb.w r2, [r3, #47] ; 0x2f
  14139. res = dir_sdi(dp, 0);
  14140. 8005c76: 2100 movs r1, #0
  14141. 8005c78: 6878 ldr r0, [r7, #4]
  14142. 8005c7a: f7ff f8fe bl 8004e7a <dir_sdi>
  14143. 8005c7e: 4603 mov r3, r0
  14144. 8005c80: 75fb strb r3, [r7, #23]
  14145. 8005c82: e048 b.n 8005d16 <follow_path+0xe2>
  14146. } else { /* Follow path */
  14147. for (;;) {
  14148. res = create_name(dp, &path); /* Get a segment name of the path */
  14149. 8005c84: 463b mov r3, r7
  14150. 8005c86: 4619 mov r1, r3
  14151. 8005c88: 6878 ldr r0, [r7, #4]
  14152. 8005c8a: f7ff fe1b bl 80058c4 <create_name>
  14153. 8005c8e: 4603 mov r3, r0
  14154. 8005c90: 75fb strb r3, [r7, #23]
  14155. if (res != FR_OK) break;
  14156. 8005c92: 7dfb ldrb r3, [r7, #23]
  14157. 8005c94: 2b00 cmp r3, #0
  14158. 8005c96: d139 bne.n 8005d0c <follow_path+0xd8>
  14159. res = dir_find(dp); /* Find an object with the segment name */
  14160. 8005c98: 6878 ldr r0, [r7, #4]
  14161. 8005c9a: f7ff fc5b bl 8005554 <dir_find>
  14162. 8005c9e: 4603 mov r3, r0
  14163. 8005ca0: 75fb strb r3, [r7, #23]
  14164. ns = dp->fn[NSFLAG];
  14165. 8005ca2: 687b ldr r3, [r7, #4]
  14166. 8005ca4: f893 302f ldrb.w r3, [r3, #47] ; 0x2f
  14167. 8005ca8: 72fb strb r3, [r7, #11]
  14168. if (res != FR_OK) { /* Failed to find the object */
  14169. 8005caa: 7dfb ldrb r3, [r7, #23]
  14170. 8005cac: 2b00 cmp r3, #0
  14171. 8005cae: d00a beq.n 8005cc6 <follow_path+0x92>
  14172. if (res == FR_NO_FILE) { /* Object is not found */
  14173. 8005cb0: 7dfb ldrb r3, [r7, #23]
  14174. 8005cb2: 2b04 cmp r3, #4
  14175. 8005cb4: d12c bne.n 8005d10 <follow_path+0xdc>
  14176. if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exist, stay there */
  14177. if (!(ns & NS_LAST)) continue; /* Continue to follow if not last segment */
  14178. dp->fn[NSFLAG] = NS_NONAME;
  14179. res = FR_OK;
  14180. } else { /* Could not find the object */
  14181. if (!(ns & NS_LAST)) res = FR_NO_PATH; /* Adjust error code if not last segment */
  14182. 8005cb6: 7afb ldrb r3, [r7, #11]
  14183. 8005cb8: f003 0304 and.w r3, r3, #4
  14184. 8005cbc: 2b00 cmp r3, #0
  14185. 8005cbe: d127 bne.n 8005d10 <follow_path+0xdc>
  14186. 8005cc0: 2305 movs r3, #5
  14187. 8005cc2: 75fb strb r3, [r7, #23]
  14188. }
  14189. }
  14190. break;
  14191. 8005cc4: e024 b.n 8005d10 <follow_path+0xdc>
  14192. }
  14193. if (ns & NS_LAST) break; /* Last segment matched. Function completed. */
  14194. 8005cc6: 7afb ldrb r3, [r7, #11]
  14195. 8005cc8: f003 0304 and.w r3, r3, #4
  14196. 8005ccc: 2b00 cmp r3, #0
  14197. 8005cce: d121 bne.n 8005d14 <follow_path+0xe0>
  14198. /* Get into the sub-directory */
  14199. if (!(obj->attr & AM_DIR)) { /* It is not a sub-directory and cannot follow */
  14200. 8005cd0: 693b ldr r3, [r7, #16]
  14201. 8005cd2: 799b ldrb r3, [r3, #6]
  14202. 8005cd4: f003 0310 and.w r3, r3, #16
  14203. 8005cd8: 2b00 cmp r3, #0
  14204. 8005cda: d102 bne.n 8005ce2 <follow_path+0xae>
  14205. res = FR_NO_PATH; break;
  14206. 8005cdc: 2305 movs r3, #5
  14207. 8005cde: 75fb strb r3, [r7, #23]
  14208. 8005ce0: e019 b.n 8005d16 <follow_path+0xe2>
  14209. obj->stat = fs->dirbuf[XDIR_GenFlags] & 2;
  14210. obj->objsize = ld_qword(fs->dirbuf + XDIR_FileSize);
  14211. } else
  14212. #endif
  14213. {
  14214. obj->sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */
  14215. 8005ce2: 68fb ldr r3, [r7, #12]
  14216. 8005ce4: f103 0138 add.w r1, r3, #56 ; 0x38
  14217. 8005ce8: 687b ldr r3, [r7, #4]
  14218. 8005cea: 695b ldr r3, [r3, #20]
  14219. 8005cec: 68fa ldr r2, [r7, #12]
  14220. 8005cee: 8992 ldrh r2, [r2, #12]
  14221. 8005cf0: fbb3 f0f2 udiv r0, r3, r2
  14222. 8005cf4: fb02 f200 mul.w r2, r2, r0
  14223. 8005cf8: 1a9b subs r3, r3, r2
  14224. 8005cfa: 440b add r3, r1
  14225. 8005cfc: 4619 mov r1, r3
  14226. 8005cfe: 68f8 ldr r0, [r7, #12]
  14227. 8005d00: f7ff fa61 bl 80051c6 <ld_clust>
  14228. 8005d04: 4602 mov r2, r0
  14229. 8005d06: 693b ldr r3, [r7, #16]
  14230. 8005d08: 609a str r2, [r3, #8]
  14231. res = create_name(dp, &path); /* Get a segment name of the path */
  14232. 8005d0a: e7bb b.n 8005c84 <follow_path+0x50>
  14233. if (res != FR_OK) break;
  14234. 8005d0c: bf00 nop
  14235. 8005d0e: e002 b.n 8005d16 <follow_path+0xe2>
  14236. break;
  14237. 8005d10: bf00 nop
  14238. 8005d12: e000 b.n 8005d16 <follow_path+0xe2>
  14239. if (ns & NS_LAST) break; /* Last segment matched. Function completed. */
  14240. 8005d14: bf00 nop
  14241. }
  14242. }
  14243. }
  14244. return res;
  14245. 8005d16: 7dfb ldrb r3, [r7, #23]
  14246. }
  14247. 8005d18: 4618 mov r0, r3
  14248. 8005d1a: 3718 adds r7, #24
  14249. 8005d1c: 46bd mov sp, r7
  14250. 8005d1e: bd80 pop {r7, pc}
  14251. 08005d20 <get_ldnumber>:
  14252. static
  14253. int get_ldnumber ( /* Returns logical drive number (-1:invalid drive) */
  14254. const TCHAR** path /* Pointer to pointer to the path name */
  14255. )
  14256. {
  14257. 8005d20: b480 push {r7}
  14258. 8005d22: b087 sub sp, #28
  14259. 8005d24: af00 add r7, sp, #0
  14260. 8005d26: 6078 str r0, [r7, #4]
  14261. const TCHAR *tp, *tt;
  14262. UINT i;
  14263. int vol = -1;
  14264. 8005d28: f04f 33ff mov.w r3, #4294967295
  14265. 8005d2c: 613b str r3, [r7, #16]
  14266. char c;
  14267. TCHAR tc;
  14268. #endif
  14269. if (*path) { /* If the pointer is not a null */
  14270. 8005d2e: 687b ldr r3, [r7, #4]
  14271. 8005d30: 681b ldr r3, [r3, #0]
  14272. 8005d32: 2b00 cmp r3, #0
  14273. 8005d34: d031 beq.n 8005d9a <get_ldnumber+0x7a>
  14274. for (tt = *path; (UINT)*tt >= (_USE_LFN ? ' ' : '!') && *tt != ':'; tt++) ; /* Find ':' in the path */
  14275. 8005d36: 687b ldr r3, [r7, #4]
  14276. 8005d38: 681b ldr r3, [r3, #0]
  14277. 8005d3a: 617b str r3, [r7, #20]
  14278. 8005d3c: e002 b.n 8005d44 <get_ldnumber+0x24>
  14279. 8005d3e: 697b ldr r3, [r7, #20]
  14280. 8005d40: 3301 adds r3, #1
  14281. 8005d42: 617b str r3, [r7, #20]
  14282. 8005d44: 697b ldr r3, [r7, #20]
  14283. 8005d46: 781b ldrb r3, [r3, #0]
  14284. 8005d48: 2b1f cmp r3, #31
  14285. 8005d4a: d903 bls.n 8005d54 <get_ldnumber+0x34>
  14286. 8005d4c: 697b ldr r3, [r7, #20]
  14287. 8005d4e: 781b ldrb r3, [r3, #0]
  14288. 8005d50: 2b3a cmp r3, #58 ; 0x3a
  14289. 8005d52: d1f4 bne.n 8005d3e <get_ldnumber+0x1e>
  14290. if (*tt == ':') { /* If a ':' is exist in the path name */
  14291. 8005d54: 697b ldr r3, [r7, #20]
  14292. 8005d56: 781b ldrb r3, [r3, #0]
  14293. 8005d58: 2b3a cmp r3, #58 ; 0x3a
  14294. 8005d5a: d11c bne.n 8005d96 <get_ldnumber+0x76>
  14295. tp = *path;
  14296. 8005d5c: 687b ldr r3, [r7, #4]
  14297. 8005d5e: 681b ldr r3, [r3, #0]
  14298. 8005d60: 60fb str r3, [r7, #12]
  14299. i = *tp++ - '0';
  14300. 8005d62: 68fb ldr r3, [r7, #12]
  14301. 8005d64: 1c5a adds r2, r3, #1
  14302. 8005d66: 60fa str r2, [r7, #12]
  14303. 8005d68: 781b ldrb r3, [r3, #0]
  14304. 8005d6a: 3b30 subs r3, #48 ; 0x30
  14305. 8005d6c: 60bb str r3, [r7, #8]
  14306. if (i < 10 && tp == tt) { /* Is there a numeric drive id? */
  14307. 8005d6e: 68bb ldr r3, [r7, #8]
  14308. 8005d70: 2b09 cmp r3, #9
  14309. 8005d72: d80e bhi.n 8005d92 <get_ldnumber+0x72>
  14310. 8005d74: 68fa ldr r2, [r7, #12]
  14311. 8005d76: 697b ldr r3, [r7, #20]
  14312. 8005d78: 429a cmp r2, r3
  14313. 8005d7a: d10a bne.n 8005d92 <get_ldnumber+0x72>
  14314. if (i < _VOLUMES) { /* If a drive id is found, get the value and strip it */
  14315. 8005d7c: 68bb ldr r3, [r7, #8]
  14316. 8005d7e: 2b00 cmp r3, #0
  14317. 8005d80: d107 bne.n 8005d92 <get_ldnumber+0x72>
  14318. vol = (int)i;
  14319. 8005d82: 68bb ldr r3, [r7, #8]
  14320. 8005d84: 613b str r3, [r7, #16]
  14321. *path = ++tt;
  14322. 8005d86: 697b ldr r3, [r7, #20]
  14323. 8005d88: 3301 adds r3, #1
  14324. 8005d8a: 617b str r3, [r7, #20]
  14325. 8005d8c: 687b ldr r3, [r7, #4]
  14326. 8005d8e: 697a ldr r2, [r7, #20]
  14327. 8005d90: 601a str r2, [r3, #0]
  14328. vol = (int)i;
  14329. *path = tt;
  14330. }
  14331. }
  14332. #endif
  14333. return vol;
  14334. 8005d92: 693b ldr r3, [r7, #16]
  14335. 8005d94: e002 b.n 8005d9c <get_ldnumber+0x7c>
  14336. }
  14337. #if _FS_RPATH != 0 && _VOLUMES >= 2
  14338. vol = CurrVol; /* Current drive */
  14339. #else
  14340. vol = 0; /* Drive 0 */
  14341. 8005d96: 2300 movs r3, #0
  14342. 8005d98: 613b str r3, [r7, #16]
  14343. #endif
  14344. }
  14345. return vol;
  14346. 8005d9a: 693b ldr r3, [r7, #16]
  14347. }
  14348. 8005d9c: 4618 mov r0, r3
  14349. 8005d9e: 371c adds r7, #28
  14350. 8005da0: 46bd mov sp, r7
  14351. 8005da2: f85d 7b04 ldr.w r7, [sp], #4
  14352. 8005da6: 4770 bx lr
  14353. 08005da8 <check_fs>:
  14354. static
  14355. BYTE check_fs ( /* 0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error */
  14356. FATFS* fs, /* File system object */
  14357. DWORD sect /* Sector# (lba) to load and check if it is an FAT-VBR or not */
  14358. )
  14359. {
  14360. 8005da8: b580 push {r7, lr}
  14361. 8005daa: b082 sub sp, #8
  14362. 8005dac: af00 add r7, sp, #0
  14363. 8005dae: 6078 str r0, [r7, #4]
  14364. 8005db0: 6039 str r1, [r7, #0]
  14365. fs->wflag = 0; fs->winsect = 0xFFFFFFFF; /* Invaidate window */
  14366. 8005db2: 687b ldr r3, [r7, #4]
  14367. 8005db4: 2200 movs r2, #0
  14368. 8005db6: 70da strb r2, [r3, #3]
  14369. 8005db8: 687b ldr r3, [r7, #4]
  14370. 8005dba: f04f 32ff mov.w r2, #4294967295
  14371. 8005dbe: 635a str r2, [r3, #52] ; 0x34
  14372. if (move_window(fs, sect) != FR_OK) return 4; /* Load boot record */
  14373. 8005dc0: 6839 ldr r1, [r7, #0]
  14374. 8005dc2: 6878 ldr r0, [r7, #4]
  14375. 8005dc4: f7fe fc80 bl 80046c8 <move_window>
  14376. 8005dc8: 4603 mov r3, r0
  14377. 8005dca: 2b00 cmp r3, #0
  14378. 8005dcc: d001 beq.n 8005dd2 <check_fs+0x2a>
  14379. 8005dce: 2304 movs r3, #4
  14380. 8005dd0: e038 b.n 8005e44 <check_fs+0x9c>
  14381. if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3; /* Check boot record signature (always placed here even if the sector size is >512) */
  14382. 8005dd2: 687b ldr r3, [r7, #4]
  14383. 8005dd4: 3338 adds r3, #56 ; 0x38
  14384. 8005dd6: f503 73ff add.w r3, r3, #510 ; 0x1fe
  14385. 8005dda: 4618 mov r0, r3
  14386. 8005ddc: f7fe f9c4 bl 8004168 <ld_word>
  14387. 8005de0: 4603 mov r3, r0
  14388. 8005de2: 461a mov r2, r3
  14389. 8005de4: f64a 2355 movw r3, #43605 ; 0xaa55
  14390. 8005de8: 429a cmp r2, r3
  14391. 8005dea: d001 beq.n 8005df0 <check_fs+0x48>
  14392. 8005dec: 2303 movs r3, #3
  14393. 8005dee: e029 b.n 8005e44 <check_fs+0x9c>
  14394. if (fs->win[BS_JmpBoot] == 0xE9 || (fs->win[BS_JmpBoot] == 0xEB && fs->win[BS_JmpBoot + 2] == 0x90)) {
  14395. 8005df0: 687b ldr r3, [r7, #4]
  14396. 8005df2: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
  14397. 8005df6: 2be9 cmp r3, #233 ; 0xe9
  14398. 8005df8: d009 beq.n 8005e0e <check_fs+0x66>
  14399. 8005dfa: 687b ldr r3, [r7, #4]
  14400. 8005dfc: f893 3038 ldrb.w r3, [r3, #56] ; 0x38
  14401. 8005e00: 2beb cmp r3, #235 ; 0xeb
  14402. 8005e02: d11e bne.n 8005e42 <check_fs+0x9a>
  14403. 8005e04: 687b ldr r3, [r7, #4]
  14404. 8005e06: f893 303a ldrb.w r3, [r3, #58] ; 0x3a
  14405. 8005e0a: 2b90 cmp r3, #144 ; 0x90
  14406. 8005e0c: d119 bne.n 8005e42 <check_fs+0x9a>
  14407. if ((ld_dword(fs->win + BS_FilSysType) & 0xFFFFFF) == 0x544146) return 0; /* Check "FAT" string */
  14408. 8005e0e: 687b ldr r3, [r7, #4]
  14409. 8005e10: 3338 adds r3, #56 ; 0x38
  14410. 8005e12: 3336 adds r3, #54 ; 0x36
  14411. 8005e14: 4618 mov r0, r3
  14412. 8005e16: f7fe f9bf bl 8004198 <ld_dword>
  14413. 8005e1a: 4603 mov r3, r0
  14414. 8005e1c: f023 437f bic.w r3, r3, #4278190080 ; 0xff000000
  14415. 8005e20: 4a0a ldr r2, [pc, #40] ; (8005e4c <check_fs+0xa4>)
  14416. 8005e22: 4293 cmp r3, r2
  14417. 8005e24: d101 bne.n 8005e2a <check_fs+0x82>
  14418. 8005e26: 2300 movs r3, #0
  14419. 8005e28: e00c b.n 8005e44 <check_fs+0x9c>
  14420. if (ld_dword(fs->win + BS_FilSysType32) == 0x33544146) return 0; /* Check "FAT3" string */
  14421. 8005e2a: 687b ldr r3, [r7, #4]
  14422. 8005e2c: 3338 adds r3, #56 ; 0x38
  14423. 8005e2e: 3352 adds r3, #82 ; 0x52
  14424. 8005e30: 4618 mov r0, r3
  14425. 8005e32: f7fe f9b1 bl 8004198 <ld_dword>
  14426. 8005e36: 4602 mov r2, r0
  14427. 8005e38: 4b05 ldr r3, [pc, #20] ; (8005e50 <check_fs+0xa8>)
  14428. 8005e3a: 429a cmp r2, r3
  14429. 8005e3c: d101 bne.n 8005e42 <check_fs+0x9a>
  14430. 8005e3e: 2300 movs r3, #0
  14431. 8005e40: e000 b.n 8005e44 <check_fs+0x9c>
  14432. }
  14433. #if _FS_EXFAT
  14434. if (!mem_cmp(fs->win + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11)) return 1;
  14435. #endif
  14436. return 2;
  14437. 8005e42: 2302 movs r3, #2
  14438. }
  14439. 8005e44: 4618 mov r0, r3
  14440. 8005e46: 3708 adds r7, #8
  14441. 8005e48: 46bd mov sp, r7
  14442. 8005e4a: bd80 pop {r7, pc}
  14443. 8005e4c: 00544146 .word 0x00544146
  14444. 8005e50: 33544146 .word 0x33544146
  14445. 08005e54 <find_volume>:
  14446. FRESULT find_volume ( /* FR_OK(0): successful, !=0: any error occurred */
  14447. const TCHAR** path, /* Pointer to pointer to the path name (drive number) */
  14448. FATFS** rfs, /* Pointer to pointer to the found file system object */
  14449. BYTE mode /* !=0: Check write protection for write access */
  14450. )
  14451. {
  14452. 8005e54: b580 push {r7, lr}
  14453. 8005e56: b096 sub sp, #88 ; 0x58
  14454. 8005e58: af00 add r7, sp, #0
  14455. 8005e5a: 60f8 str r0, [r7, #12]
  14456. 8005e5c: 60b9 str r1, [r7, #8]
  14457. 8005e5e: 4613 mov r3, r2
  14458. 8005e60: 71fb strb r3, [r7, #7]
  14459. FATFS *fs;
  14460. UINT i;
  14461. /* Get logical drive number */
  14462. *rfs = 0;
  14463. 8005e62: 68bb ldr r3, [r7, #8]
  14464. 8005e64: 2200 movs r2, #0
  14465. 8005e66: 601a str r2, [r3, #0]
  14466. vol = get_ldnumber(path);
  14467. 8005e68: 68f8 ldr r0, [r7, #12]
  14468. 8005e6a: f7ff ff59 bl 8005d20 <get_ldnumber>
  14469. 8005e6e: 63f8 str r0, [r7, #60] ; 0x3c
  14470. if (vol < 0) return FR_INVALID_DRIVE;
  14471. 8005e70: 6bfb ldr r3, [r7, #60] ; 0x3c
  14472. 8005e72: 2b00 cmp r3, #0
  14473. 8005e74: da01 bge.n 8005e7a <find_volume+0x26>
  14474. 8005e76: 230b movs r3, #11
  14475. 8005e78: e268 b.n 800634c <find_volume+0x4f8>
  14476. /* Check if the file system object is valid or not */
  14477. fs = FatFs[vol]; /* Get pointer to the file system object */
  14478. 8005e7a: 4ab0 ldr r2, [pc, #704] ; (800613c <find_volume+0x2e8>)
  14479. 8005e7c: 6bfb ldr r3, [r7, #60] ; 0x3c
  14480. 8005e7e: f852 3023 ldr.w r3, [r2, r3, lsl #2]
  14481. 8005e82: 63bb str r3, [r7, #56] ; 0x38
  14482. if (!fs) return FR_NOT_ENABLED; /* Is the file system object available? */
  14483. 8005e84: 6bbb ldr r3, [r7, #56] ; 0x38
  14484. 8005e86: 2b00 cmp r3, #0
  14485. 8005e88: d101 bne.n 8005e8e <find_volume+0x3a>
  14486. 8005e8a: 230c movs r3, #12
  14487. 8005e8c: e25e b.n 800634c <find_volume+0x4f8>
  14488. ENTER_FF(fs); /* Lock the volume */
  14489. *rfs = fs; /* Return pointer to the file system object */
  14490. 8005e8e: 68bb ldr r3, [r7, #8]
  14491. 8005e90: 6bba ldr r2, [r7, #56] ; 0x38
  14492. 8005e92: 601a str r2, [r3, #0]
  14493. mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */
  14494. 8005e94: 79fb ldrb r3, [r7, #7]
  14495. 8005e96: f023 0301 bic.w r3, r3, #1
  14496. 8005e9a: 71fb strb r3, [r7, #7]
  14497. if (fs->fs_type) { /* If the volume has been mounted */
  14498. 8005e9c: 6bbb ldr r3, [r7, #56] ; 0x38
  14499. 8005e9e: 781b ldrb r3, [r3, #0]
  14500. 8005ea0: 2b00 cmp r3, #0
  14501. 8005ea2: d01a beq.n 8005eda <find_volume+0x86>
  14502. stat = disk_status(fs->drv);
  14503. 8005ea4: 6bbb ldr r3, [r7, #56] ; 0x38
  14504. 8005ea6: 785b ldrb r3, [r3, #1]
  14505. 8005ea8: 4618 mov r0, r3
  14506. 8005eaa: f7fe f8bf bl 800402c <disk_status>
  14507. 8005eae: 4603 mov r3, r0
  14508. 8005eb0: f887 3037 strb.w r3, [r7, #55] ; 0x37
  14509. if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized */
  14510. 8005eb4: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
  14511. 8005eb8: f003 0301 and.w r3, r3, #1
  14512. 8005ebc: 2b00 cmp r3, #0
  14513. 8005ebe: d10c bne.n 8005eda <find_volume+0x86>
  14514. if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check write protection if needed */
  14515. 8005ec0: 79fb ldrb r3, [r7, #7]
  14516. 8005ec2: 2b00 cmp r3, #0
  14517. 8005ec4: d007 beq.n 8005ed6 <find_volume+0x82>
  14518. 8005ec6: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
  14519. 8005eca: f003 0304 and.w r3, r3, #4
  14520. 8005ece: 2b00 cmp r3, #0
  14521. 8005ed0: d001 beq.n 8005ed6 <find_volume+0x82>
  14522. return FR_WRITE_PROTECTED;
  14523. 8005ed2: 230a movs r3, #10
  14524. 8005ed4: e23a b.n 800634c <find_volume+0x4f8>
  14525. }
  14526. return FR_OK; /* The file system object is valid */
  14527. 8005ed6: 2300 movs r3, #0
  14528. 8005ed8: e238 b.n 800634c <find_volume+0x4f8>
  14529. }
  14530. /* The file system object is not valid. */
  14531. /* Following code attempts to mount the volume. (analyze BPB and initialize the fs object) */
  14532. fs->fs_type = 0; /* Clear the file system object */
  14533. 8005eda: 6bbb ldr r3, [r7, #56] ; 0x38
  14534. 8005edc: 2200 movs r2, #0
  14535. 8005ede: 701a strb r2, [r3, #0]
  14536. fs->drv = LD2PD(vol); /* Bind the logical drive and a physical drive */
  14537. 8005ee0: 6bfb ldr r3, [r7, #60] ; 0x3c
  14538. 8005ee2: b2da uxtb r2, r3
  14539. 8005ee4: 6bbb ldr r3, [r7, #56] ; 0x38
  14540. 8005ee6: 705a strb r2, [r3, #1]
  14541. stat = disk_initialize(fs->drv); /* Initialize the physical drive */
  14542. 8005ee8: 6bbb ldr r3, [r7, #56] ; 0x38
  14543. 8005eea: 785b ldrb r3, [r3, #1]
  14544. 8005eec: 4618 mov r0, r3
  14545. 8005eee: f7fe f8b7 bl 8004060 <disk_initialize>
  14546. 8005ef2: 4603 mov r3, r0
  14547. 8005ef4: f887 3037 strb.w r3, [r7, #55] ; 0x37
  14548. if (stat & STA_NOINIT) { /* Check if the initialization succeeded */
  14549. 8005ef8: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
  14550. 8005efc: f003 0301 and.w r3, r3, #1
  14551. 8005f00: 2b00 cmp r3, #0
  14552. 8005f02: d001 beq.n 8005f08 <find_volume+0xb4>
  14553. return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */
  14554. 8005f04: 2303 movs r3, #3
  14555. 8005f06: e221 b.n 800634c <find_volume+0x4f8>
  14556. }
  14557. if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check disk write protection if needed */
  14558. 8005f08: 79fb ldrb r3, [r7, #7]
  14559. 8005f0a: 2b00 cmp r3, #0
  14560. 8005f0c: d007 beq.n 8005f1e <find_volume+0xca>
  14561. 8005f0e: f897 3037 ldrb.w r3, [r7, #55] ; 0x37
  14562. 8005f12: f003 0304 and.w r3, r3, #4
  14563. 8005f16: 2b00 cmp r3, #0
  14564. 8005f18: d001 beq.n 8005f1e <find_volume+0xca>
  14565. return FR_WRITE_PROTECTED;
  14566. 8005f1a: 230a movs r3, #10
  14567. 8005f1c: e216 b.n 800634c <find_volume+0x4f8>
  14568. }
  14569. #if _MAX_SS != _MIN_SS /* Get sector size (multiple sector size cfg only) */
  14570. if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR;
  14571. 8005f1e: 6bbb ldr r3, [r7, #56] ; 0x38
  14572. 8005f20: 7858 ldrb r0, [r3, #1]
  14573. 8005f22: 6bbb ldr r3, [r7, #56] ; 0x38
  14574. 8005f24: 330c adds r3, #12
  14575. 8005f26: 461a mov r2, r3
  14576. 8005f28: 2102 movs r1, #2
  14577. 8005f2a: f7fe f8ff bl 800412c <disk_ioctl>
  14578. 8005f2e: 4603 mov r3, r0
  14579. 8005f30: 2b00 cmp r3, #0
  14580. 8005f32: d001 beq.n 8005f38 <find_volume+0xe4>
  14581. 8005f34: 2301 movs r3, #1
  14582. 8005f36: e209 b.n 800634c <find_volume+0x4f8>
  14583. if (SS(fs) > _MAX_SS || SS(fs) < _MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR;
  14584. 8005f38: 6bbb ldr r3, [r7, #56] ; 0x38
  14585. 8005f3a: 899b ldrh r3, [r3, #12]
  14586. 8005f3c: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
  14587. 8005f40: d80d bhi.n 8005f5e <find_volume+0x10a>
  14588. 8005f42: 6bbb ldr r3, [r7, #56] ; 0x38
  14589. 8005f44: 899b ldrh r3, [r3, #12]
  14590. 8005f46: f5b3 7f00 cmp.w r3, #512 ; 0x200
  14591. 8005f4a: d308 bcc.n 8005f5e <find_volume+0x10a>
  14592. 8005f4c: 6bbb ldr r3, [r7, #56] ; 0x38
  14593. 8005f4e: 899b ldrh r3, [r3, #12]
  14594. 8005f50: 461a mov r2, r3
  14595. 8005f52: 6bbb ldr r3, [r7, #56] ; 0x38
  14596. 8005f54: 899b ldrh r3, [r3, #12]
  14597. 8005f56: 3b01 subs r3, #1
  14598. 8005f58: 4013 ands r3, r2
  14599. 8005f5a: 2b00 cmp r3, #0
  14600. 8005f5c: d001 beq.n 8005f62 <find_volume+0x10e>
  14601. 8005f5e: 2301 movs r3, #1
  14602. 8005f60: e1f4 b.n 800634c <find_volume+0x4f8>
  14603. #endif
  14604. /* Find an FAT partition on the drive. Supports only generic partitioning rules, FDISK and SFD. */
  14605. bsect = 0;
  14606. 8005f62: 2300 movs r3, #0
  14607. 8005f64: 653b str r3, [r7, #80] ; 0x50
  14608. fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT-VBR as SFD */
  14609. 8005f66: 6d39 ldr r1, [r7, #80] ; 0x50
  14610. 8005f68: 6bb8 ldr r0, [r7, #56] ; 0x38
  14611. 8005f6a: f7ff ff1d bl 8005da8 <check_fs>
  14612. 8005f6e: 4603 mov r3, r0
  14613. 8005f70: f887 3057 strb.w r3, [r7, #87] ; 0x57
  14614. if (fmt == 2 || (fmt < 2 && LD2PT(vol) != 0)) { /* Not an FAT-VBR or forced partition number */
  14615. 8005f74: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14616. 8005f78: 2b02 cmp r3, #2
  14617. 8005f7a: d14b bne.n 8006014 <find_volume+0x1c0>
  14618. for (i = 0; i < 4; i++) { /* Get partition offset */
  14619. 8005f7c: 2300 movs r3, #0
  14620. 8005f7e: 643b str r3, [r7, #64] ; 0x40
  14621. 8005f80: e01f b.n 8005fc2 <find_volume+0x16e>
  14622. pt = fs->win + (MBR_Table + i * SZ_PTE);
  14623. 8005f82: 6bbb ldr r3, [r7, #56] ; 0x38
  14624. 8005f84: f103 0238 add.w r2, r3, #56 ; 0x38
  14625. 8005f88: 6c3b ldr r3, [r7, #64] ; 0x40
  14626. 8005f8a: 011b lsls r3, r3, #4
  14627. 8005f8c: f503 73df add.w r3, r3, #446 ; 0x1be
  14628. 8005f90: 4413 add r3, r2
  14629. 8005f92: 633b str r3, [r7, #48] ; 0x30
  14630. br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0;
  14631. 8005f94: 6b3b ldr r3, [r7, #48] ; 0x30
  14632. 8005f96: 3304 adds r3, #4
  14633. 8005f98: 781b ldrb r3, [r3, #0]
  14634. 8005f9a: 2b00 cmp r3, #0
  14635. 8005f9c: d006 beq.n 8005fac <find_volume+0x158>
  14636. 8005f9e: 6b3b ldr r3, [r7, #48] ; 0x30
  14637. 8005fa0: 3308 adds r3, #8
  14638. 8005fa2: 4618 mov r0, r3
  14639. 8005fa4: f7fe f8f8 bl 8004198 <ld_dword>
  14640. 8005fa8: 4602 mov r2, r0
  14641. 8005faa: e000 b.n 8005fae <find_volume+0x15a>
  14642. 8005fac: 2200 movs r2, #0
  14643. 8005fae: 6c3b ldr r3, [r7, #64] ; 0x40
  14644. 8005fb0: 009b lsls r3, r3, #2
  14645. 8005fb2: f107 0158 add.w r1, r7, #88 ; 0x58
  14646. 8005fb6: 440b add r3, r1
  14647. 8005fb8: f843 2c44 str.w r2, [r3, #-68]
  14648. for (i = 0; i < 4; i++) { /* Get partition offset */
  14649. 8005fbc: 6c3b ldr r3, [r7, #64] ; 0x40
  14650. 8005fbe: 3301 adds r3, #1
  14651. 8005fc0: 643b str r3, [r7, #64] ; 0x40
  14652. 8005fc2: 6c3b ldr r3, [r7, #64] ; 0x40
  14653. 8005fc4: 2b03 cmp r3, #3
  14654. 8005fc6: d9dc bls.n 8005f82 <find_volume+0x12e>
  14655. }
  14656. i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */
  14657. 8005fc8: 2300 movs r3, #0
  14658. 8005fca: 643b str r3, [r7, #64] ; 0x40
  14659. if (i) i--;
  14660. 8005fcc: 6c3b ldr r3, [r7, #64] ; 0x40
  14661. 8005fce: 2b00 cmp r3, #0
  14662. 8005fd0: d002 beq.n 8005fd8 <find_volume+0x184>
  14663. 8005fd2: 6c3b ldr r3, [r7, #64] ; 0x40
  14664. 8005fd4: 3b01 subs r3, #1
  14665. 8005fd6: 643b str r3, [r7, #64] ; 0x40
  14666. do { /* Find an FAT volume */
  14667. bsect = br[i];
  14668. 8005fd8: 6c3b ldr r3, [r7, #64] ; 0x40
  14669. 8005fda: 009b lsls r3, r3, #2
  14670. 8005fdc: f107 0258 add.w r2, r7, #88 ; 0x58
  14671. 8005fe0: 4413 add r3, r2
  14672. 8005fe2: f853 3c44 ldr.w r3, [r3, #-68]
  14673. 8005fe6: 653b str r3, [r7, #80] ; 0x50
  14674. fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */
  14675. 8005fe8: 6d3b ldr r3, [r7, #80] ; 0x50
  14676. 8005fea: 2b00 cmp r3, #0
  14677. 8005fec: d005 beq.n 8005ffa <find_volume+0x1a6>
  14678. 8005fee: 6d39 ldr r1, [r7, #80] ; 0x50
  14679. 8005ff0: 6bb8 ldr r0, [r7, #56] ; 0x38
  14680. 8005ff2: f7ff fed9 bl 8005da8 <check_fs>
  14681. 8005ff6: 4603 mov r3, r0
  14682. 8005ff8: e000 b.n 8005ffc <find_volume+0x1a8>
  14683. 8005ffa: 2303 movs r3, #3
  14684. 8005ffc: f887 3057 strb.w r3, [r7, #87] ; 0x57
  14685. } while (LD2PT(vol) == 0 && fmt >= 2 && ++i < 4);
  14686. 8006000: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14687. 8006004: 2b01 cmp r3, #1
  14688. 8006006: d905 bls.n 8006014 <find_volume+0x1c0>
  14689. 8006008: 6c3b ldr r3, [r7, #64] ; 0x40
  14690. 800600a: 3301 adds r3, #1
  14691. 800600c: 643b str r3, [r7, #64] ; 0x40
  14692. 800600e: 6c3b ldr r3, [r7, #64] ; 0x40
  14693. 8006010: 2b03 cmp r3, #3
  14694. 8006012: d9e1 bls.n 8005fd8 <find_volume+0x184>
  14695. }
  14696. if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */
  14697. 8006014: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14698. 8006018: 2b04 cmp r3, #4
  14699. 800601a: d101 bne.n 8006020 <find_volume+0x1cc>
  14700. 800601c: 2301 movs r3, #1
  14701. 800601e: e195 b.n 800634c <find_volume+0x4f8>
  14702. if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */
  14703. 8006020: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14704. 8006024: 2b01 cmp r3, #1
  14705. 8006026: d901 bls.n 800602c <find_volume+0x1d8>
  14706. 8006028: 230d movs r3, #13
  14707. 800602a: e18f b.n 800634c <find_volume+0x4f8>
  14708. #endif
  14709. fmt = FS_EXFAT; /* FAT sub-type */
  14710. } else
  14711. #endif /* _FS_EXFAT */
  14712. {
  14713. if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_BytsPerSec must be equal to the physical sector size) */
  14714. 800602c: 6bbb ldr r3, [r7, #56] ; 0x38
  14715. 800602e: 3338 adds r3, #56 ; 0x38
  14716. 8006030: 330b adds r3, #11
  14717. 8006032: 4618 mov r0, r3
  14718. 8006034: f7fe f898 bl 8004168 <ld_word>
  14719. 8006038: 4603 mov r3, r0
  14720. 800603a: 461a mov r2, r3
  14721. 800603c: 6bbb ldr r3, [r7, #56] ; 0x38
  14722. 800603e: 899b ldrh r3, [r3, #12]
  14723. 8006040: 429a cmp r2, r3
  14724. 8006042: d001 beq.n 8006048 <find_volume+0x1f4>
  14725. 8006044: 230d movs r3, #13
  14726. 8006046: e181 b.n 800634c <find_volume+0x4f8>
  14727. fasize = ld_word(fs->win + BPB_FATSz16); /* Number of sectors per FAT */
  14728. 8006048: 6bbb ldr r3, [r7, #56] ; 0x38
  14729. 800604a: 3338 adds r3, #56 ; 0x38
  14730. 800604c: 3316 adds r3, #22
  14731. 800604e: 4618 mov r0, r3
  14732. 8006050: f7fe f88a bl 8004168 <ld_word>
  14733. 8006054: 4603 mov r3, r0
  14734. 8006056: 64fb str r3, [r7, #76] ; 0x4c
  14735. if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32);
  14736. 8006058: 6cfb ldr r3, [r7, #76] ; 0x4c
  14737. 800605a: 2b00 cmp r3, #0
  14738. 800605c: d106 bne.n 800606c <find_volume+0x218>
  14739. 800605e: 6bbb ldr r3, [r7, #56] ; 0x38
  14740. 8006060: 3338 adds r3, #56 ; 0x38
  14741. 8006062: 3324 adds r3, #36 ; 0x24
  14742. 8006064: 4618 mov r0, r3
  14743. 8006066: f7fe f897 bl 8004198 <ld_dword>
  14744. 800606a: 64f8 str r0, [r7, #76] ; 0x4c
  14745. fs->fsize = fasize;
  14746. 800606c: 6bbb ldr r3, [r7, #56] ; 0x38
  14747. 800606e: 6cfa ldr r2, [r7, #76] ; 0x4c
  14748. 8006070: 621a str r2, [r3, #32]
  14749. fs->n_fats = fs->win[BPB_NumFATs]; /* Number of FATs */
  14750. 8006072: 6bbb ldr r3, [r7, #56] ; 0x38
  14751. 8006074: f893 2048 ldrb.w r2, [r3, #72] ; 0x48
  14752. 8006078: 6bbb ldr r3, [r7, #56] ; 0x38
  14753. 800607a: 709a strb r2, [r3, #2]
  14754. if (fs->n_fats != 1 && fs->n_fats != 2) return FR_NO_FILESYSTEM; /* (Must be 1 or 2) */
  14755. 800607c: 6bbb ldr r3, [r7, #56] ; 0x38
  14756. 800607e: 789b ldrb r3, [r3, #2]
  14757. 8006080: 2b01 cmp r3, #1
  14758. 8006082: d005 beq.n 8006090 <find_volume+0x23c>
  14759. 8006084: 6bbb ldr r3, [r7, #56] ; 0x38
  14760. 8006086: 789b ldrb r3, [r3, #2]
  14761. 8006088: 2b02 cmp r3, #2
  14762. 800608a: d001 beq.n 8006090 <find_volume+0x23c>
  14763. 800608c: 230d movs r3, #13
  14764. 800608e: e15d b.n 800634c <find_volume+0x4f8>
  14765. fasize *= fs->n_fats; /* Number of sectors for FAT area */
  14766. 8006090: 6bbb ldr r3, [r7, #56] ; 0x38
  14767. 8006092: 789b ldrb r3, [r3, #2]
  14768. 8006094: 461a mov r2, r3
  14769. 8006096: 6cfb ldr r3, [r7, #76] ; 0x4c
  14770. 8006098: fb02 f303 mul.w r3, r2, r3
  14771. 800609c: 64fb str r3, [r7, #76] ; 0x4c
  14772. fs->csize = fs->win[BPB_SecPerClus]; /* Cluster size */
  14773. 800609e: 6bbb ldr r3, [r7, #56] ; 0x38
  14774. 80060a0: f893 3045 ldrb.w r3, [r3, #69] ; 0x45
  14775. 80060a4: b29a uxth r2, r3
  14776. 80060a6: 6bbb ldr r3, [r7, #56] ; 0x38
  14777. 80060a8: 815a strh r2, [r3, #10]
  14778. if (fs->csize == 0 || (fs->csize & (fs->csize - 1))) return FR_NO_FILESYSTEM; /* (Must be power of 2) */
  14779. 80060aa: 6bbb ldr r3, [r7, #56] ; 0x38
  14780. 80060ac: 895b ldrh r3, [r3, #10]
  14781. 80060ae: 2b00 cmp r3, #0
  14782. 80060b0: d008 beq.n 80060c4 <find_volume+0x270>
  14783. 80060b2: 6bbb ldr r3, [r7, #56] ; 0x38
  14784. 80060b4: 895b ldrh r3, [r3, #10]
  14785. 80060b6: 461a mov r2, r3
  14786. 80060b8: 6bbb ldr r3, [r7, #56] ; 0x38
  14787. 80060ba: 895b ldrh r3, [r3, #10]
  14788. 80060bc: 3b01 subs r3, #1
  14789. 80060be: 4013 ands r3, r2
  14790. 80060c0: 2b00 cmp r3, #0
  14791. 80060c2: d001 beq.n 80060c8 <find_volume+0x274>
  14792. 80060c4: 230d movs r3, #13
  14793. 80060c6: e141 b.n 800634c <find_volume+0x4f8>
  14794. fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt); /* Number of root directory entries */
  14795. 80060c8: 6bbb ldr r3, [r7, #56] ; 0x38
  14796. 80060ca: 3338 adds r3, #56 ; 0x38
  14797. 80060cc: 3311 adds r3, #17
  14798. 80060ce: 4618 mov r0, r3
  14799. 80060d0: f7fe f84a bl 8004168 <ld_word>
  14800. 80060d4: 4603 mov r3, r0
  14801. 80060d6: 461a mov r2, r3
  14802. 80060d8: 6bbb ldr r3, [r7, #56] ; 0x38
  14803. 80060da: 811a strh r2, [r3, #8]
  14804. if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM; /* (Must be sector aligned) */
  14805. 80060dc: 6bbb ldr r3, [r7, #56] ; 0x38
  14806. 80060de: 891b ldrh r3, [r3, #8]
  14807. 80060e0: 6bba ldr r2, [r7, #56] ; 0x38
  14808. 80060e2: 8992 ldrh r2, [r2, #12]
  14809. 80060e4: 0952 lsrs r2, r2, #5
  14810. 80060e6: b292 uxth r2, r2
  14811. 80060e8: fbb3 f1f2 udiv r1, r3, r2
  14812. 80060ec: fb02 f201 mul.w r2, r2, r1
  14813. 80060f0: 1a9b subs r3, r3, r2
  14814. 80060f2: b29b uxth r3, r3
  14815. 80060f4: 2b00 cmp r3, #0
  14816. 80060f6: d001 beq.n 80060fc <find_volume+0x2a8>
  14817. 80060f8: 230d movs r3, #13
  14818. 80060fa: e127 b.n 800634c <find_volume+0x4f8>
  14819. tsect = ld_word(fs->win + BPB_TotSec16); /* Number of sectors on the volume */
  14820. 80060fc: 6bbb ldr r3, [r7, #56] ; 0x38
  14821. 80060fe: 3338 adds r3, #56 ; 0x38
  14822. 8006100: 3313 adds r3, #19
  14823. 8006102: 4618 mov r0, r3
  14824. 8006104: f7fe f830 bl 8004168 <ld_word>
  14825. 8006108: 4603 mov r3, r0
  14826. 800610a: 64bb str r3, [r7, #72] ; 0x48
  14827. if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32);
  14828. 800610c: 6cbb ldr r3, [r7, #72] ; 0x48
  14829. 800610e: 2b00 cmp r3, #0
  14830. 8006110: d106 bne.n 8006120 <find_volume+0x2cc>
  14831. 8006112: 6bbb ldr r3, [r7, #56] ; 0x38
  14832. 8006114: 3338 adds r3, #56 ; 0x38
  14833. 8006116: 3320 adds r3, #32
  14834. 8006118: 4618 mov r0, r3
  14835. 800611a: f7fe f83d bl 8004198 <ld_dword>
  14836. 800611e: 64b8 str r0, [r7, #72] ; 0x48
  14837. nrsv = ld_word(fs->win + BPB_RsvdSecCnt); /* Number of reserved sectors */
  14838. 8006120: 6bbb ldr r3, [r7, #56] ; 0x38
  14839. 8006122: 3338 adds r3, #56 ; 0x38
  14840. 8006124: 330e adds r3, #14
  14841. 8006126: 4618 mov r0, r3
  14842. 8006128: f7fe f81e bl 8004168 <ld_word>
  14843. 800612c: 4603 mov r3, r0
  14844. 800612e: 85fb strh r3, [r7, #46] ; 0x2e
  14845. if (nrsv == 0) return FR_NO_FILESYSTEM; /* (Must not be 0) */
  14846. 8006130: 8dfb ldrh r3, [r7, #46] ; 0x2e
  14847. 8006132: 2b00 cmp r3, #0
  14848. 8006134: d104 bne.n 8006140 <find_volume+0x2ec>
  14849. 8006136: 230d movs r3, #13
  14850. 8006138: e108 b.n 800634c <find_volume+0x4f8>
  14851. 800613a: bf00 nop
  14852. 800613c: 20000044 .word 0x20000044
  14853. /* Determine the FAT sub type */
  14854. sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE); /* RSV + FAT + DIR */
  14855. 8006140: 8dfa ldrh r2, [r7, #46] ; 0x2e
  14856. 8006142: 6cfb ldr r3, [r7, #76] ; 0x4c
  14857. 8006144: 4413 add r3, r2
  14858. 8006146: 6bba ldr r2, [r7, #56] ; 0x38
  14859. 8006148: 8911 ldrh r1, [r2, #8]
  14860. 800614a: 6bba ldr r2, [r7, #56] ; 0x38
  14861. 800614c: 8992 ldrh r2, [r2, #12]
  14862. 800614e: 0952 lsrs r2, r2, #5
  14863. 8006150: b292 uxth r2, r2
  14864. 8006152: fbb1 f2f2 udiv r2, r1, r2
  14865. 8006156: b292 uxth r2, r2
  14866. 8006158: 4413 add r3, r2
  14867. 800615a: 62bb str r3, [r7, #40] ; 0x28
  14868. if (tsect < sysect) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
  14869. 800615c: 6cba ldr r2, [r7, #72] ; 0x48
  14870. 800615e: 6abb ldr r3, [r7, #40] ; 0x28
  14871. 8006160: 429a cmp r2, r3
  14872. 8006162: d201 bcs.n 8006168 <find_volume+0x314>
  14873. 8006164: 230d movs r3, #13
  14874. 8006166: e0f1 b.n 800634c <find_volume+0x4f8>
  14875. nclst = (tsect - sysect) / fs->csize; /* Number of clusters */
  14876. 8006168: 6cba ldr r2, [r7, #72] ; 0x48
  14877. 800616a: 6abb ldr r3, [r7, #40] ; 0x28
  14878. 800616c: 1ad3 subs r3, r2, r3
  14879. 800616e: 6bba ldr r2, [r7, #56] ; 0x38
  14880. 8006170: 8952 ldrh r2, [r2, #10]
  14881. 8006172: fbb3 f3f2 udiv r3, r3, r2
  14882. 8006176: 627b str r3, [r7, #36] ; 0x24
  14883. if (nclst == 0) return FR_NO_FILESYSTEM; /* (Invalid volume size) */
  14884. 8006178: 6a7b ldr r3, [r7, #36] ; 0x24
  14885. 800617a: 2b00 cmp r3, #0
  14886. 800617c: d101 bne.n 8006182 <find_volume+0x32e>
  14887. 800617e: 230d movs r3, #13
  14888. 8006180: e0e4 b.n 800634c <find_volume+0x4f8>
  14889. fmt = FS_FAT32;
  14890. 8006182: 2303 movs r3, #3
  14891. 8006184: f887 3057 strb.w r3, [r7, #87] ; 0x57
  14892. if (nclst <= MAX_FAT16) fmt = FS_FAT16;
  14893. 8006188: 6a7b ldr r3, [r7, #36] ; 0x24
  14894. 800618a: f64f 72f5 movw r2, #65525 ; 0xfff5
  14895. 800618e: 4293 cmp r3, r2
  14896. 8006190: d802 bhi.n 8006198 <find_volume+0x344>
  14897. 8006192: 2302 movs r3, #2
  14898. 8006194: f887 3057 strb.w r3, [r7, #87] ; 0x57
  14899. if (nclst <= MAX_FAT12) fmt = FS_FAT12;
  14900. 8006198: 6a7b ldr r3, [r7, #36] ; 0x24
  14901. 800619a: f640 72f5 movw r2, #4085 ; 0xff5
  14902. 800619e: 4293 cmp r3, r2
  14903. 80061a0: d802 bhi.n 80061a8 <find_volume+0x354>
  14904. 80061a2: 2301 movs r3, #1
  14905. 80061a4: f887 3057 strb.w r3, [r7, #87] ; 0x57
  14906. /* Boundaries and Limits */
  14907. fs->n_fatent = nclst + 2; /* Number of FAT entries */
  14908. 80061a8: 6a7b ldr r3, [r7, #36] ; 0x24
  14909. 80061aa: 1c9a adds r2, r3, #2
  14910. 80061ac: 6bbb ldr r3, [r7, #56] ; 0x38
  14911. 80061ae: 61da str r2, [r3, #28]
  14912. fs->volbase = bsect; /* Volume start sector */
  14913. 80061b0: 6bbb ldr r3, [r7, #56] ; 0x38
  14914. 80061b2: 6d3a ldr r2, [r7, #80] ; 0x50
  14915. 80061b4: 625a str r2, [r3, #36] ; 0x24
  14916. fs->fatbase = bsect + nrsv; /* FAT start sector */
  14917. 80061b6: 8dfa ldrh r2, [r7, #46] ; 0x2e
  14918. 80061b8: 6d3b ldr r3, [r7, #80] ; 0x50
  14919. 80061ba: 441a add r2, r3
  14920. 80061bc: 6bbb ldr r3, [r7, #56] ; 0x38
  14921. 80061be: 629a str r2, [r3, #40] ; 0x28
  14922. fs->database = bsect + sysect; /* Data start sector */
  14923. 80061c0: 6d3a ldr r2, [r7, #80] ; 0x50
  14924. 80061c2: 6abb ldr r3, [r7, #40] ; 0x28
  14925. 80061c4: 441a add r2, r3
  14926. 80061c6: 6bbb ldr r3, [r7, #56] ; 0x38
  14927. 80061c8: 631a str r2, [r3, #48] ; 0x30
  14928. if (fmt == FS_FAT32) {
  14929. 80061ca: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14930. 80061ce: 2b03 cmp r3, #3
  14931. 80061d0: d11e bne.n 8006210 <find_volume+0x3bc>
  14932. if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM; /* (Must be FAT32 revision 0.0) */
  14933. 80061d2: 6bbb ldr r3, [r7, #56] ; 0x38
  14934. 80061d4: 3338 adds r3, #56 ; 0x38
  14935. 80061d6: 332a adds r3, #42 ; 0x2a
  14936. 80061d8: 4618 mov r0, r3
  14937. 80061da: f7fd ffc5 bl 8004168 <ld_word>
  14938. 80061de: 4603 mov r3, r0
  14939. 80061e0: 2b00 cmp r3, #0
  14940. 80061e2: d001 beq.n 80061e8 <find_volume+0x394>
  14941. 80061e4: 230d movs r3, #13
  14942. 80061e6: e0b1 b.n 800634c <find_volume+0x4f8>
  14943. if (fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */
  14944. 80061e8: 6bbb ldr r3, [r7, #56] ; 0x38
  14945. 80061ea: 891b ldrh r3, [r3, #8]
  14946. 80061ec: 2b00 cmp r3, #0
  14947. 80061ee: d001 beq.n 80061f4 <find_volume+0x3a0>
  14948. 80061f0: 230d movs r3, #13
  14949. 80061f2: e0ab b.n 800634c <find_volume+0x4f8>
  14950. fs->dirbase = ld_dword(fs->win + BPB_RootClus32); /* Root directory start cluster */
  14951. 80061f4: 6bbb ldr r3, [r7, #56] ; 0x38
  14952. 80061f6: 3338 adds r3, #56 ; 0x38
  14953. 80061f8: 332c adds r3, #44 ; 0x2c
  14954. 80061fa: 4618 mov r0, r3
  14955. 80061fc: f7fd ffcc bl 8004198 <ld_dword>
  14956. 8006200: 4602 mov r2, r0
  14957. 8006202: 6bbb ldr r3, [r7, #56] ; 0x38
  14958. 8006204: 62da str r2, [r3, #44] ; 0x2c
  14959. szbfat = fs->n_fatent * 4; /* (Needed FAT size) */
  14960. 8006206: 6bbb ldr r3, [r7, #56] ; 0x38
  14961. 8006208: 69db ldr r3, [r3, #28]
  14962. 800620a: 009b lsls r3, r3, #2
  14963. 800620c: 647b str r3, [r7, #68] ; 0x44
  14964. 800620e: e01f b.n 8006250 <find_volume+0x3fc>
  14965. } else {
  14966. if (fs->n_rootdir == 0) return FR_NO_FILESYSTEM;/* (BPB_RootEntCnt must not be 0) */
  14967. 8006210: 6bbb ldr r3, [r7, #56] ; 0x38
  14968. 8006212: 891b ldrh r3, [r3, #8]
  14969. 8006214: 2b00 cmp r3, #0
  14970. 8006216: d101 bne.n 800621c <find_volume+0x3c8>
  14971. 8006218: 230d movs r3, #13
  14972. 800621a: e097 b.n 800634c <find_volume+0x4f8>
  14973. fs->dirbase = fs->fatbase + fasize; /* Root directory start sector */
  14974. 800621c: 6bbb ldr r3, [r7, #56] ; 0x38
  14975. 800621e: 6a9a ldr r2, [r3, #40] ; 0x28
  14976. 8006220: 6cfb ldr r3, [r7, #76] ; 0x4c
  14977. 8006222: 441a add r2, r3
  14978. 8006224: 6bbb ldr r3, [r7, #56] ; 0x38
  14979. 8006226: 62da str r2, [r3, #44] ; 0x2c
  14980. szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */
  14981. fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
  14982. 8006228: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  14983. 800622c: 2b02 cmp r3, #2
  14984. 800622e: d103 bne.n 8006238 <find_volume+0x3e4>
  14985. 8006230: 6bbb ldr r3, [r7, #56] ; 0x38
  14986. 8006232: 69db ldr r3, [r3, #28]
  14987. 8006234: 005b lsls r3, r3, #1
  14988. 8006236: e00a b.n 800624e <find_volume+0x3fa>
  14989. 8006238: 6bbb ldr r3, [r7, #56] ; 0x38
  14990. 800623a: 69da ldr r2, [r3, #28]
  14991. 800623c: 4613 mov r3, r2
  14992. 800623e: 005b lsls r3, r3, #1
  14993. 8006240: 4413 add r3, r2
  14994. 8006242: 085a lsrs r2, r3, #1
  14995. 8006244: 6bbb ldr r3, [r7, #56] ; 0x38
  14996. 8006246: 69db ldr r3, [r3, #28]
  14997. 8006248: f003 0301 and.w r3, r3, #1
  14998. 800624c: 4413 add r3, r2
  14999. szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */
  15000. 800624e: 647b str r3, [r7, #68] ; 0x44
  15001. }
  15002. if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_FATSz must not be less than the size needed) */
  15003. 8006250: 6bbb ldr r3, [r7, #56] ; 0x38
  15004. 8006252: 6a1a ldr r2, [r3, #32]
  15005. 8006254: 6bbb ldr r3, [r7, #56] ; 0x38
  15006. 8006256: 899b ldrh r3, [r3, #12]
  15007. 8006258: 4619 mov r1, r3
  15008. 800625a: 6c7b ldr r3, [r7, #68] ; 0x44
  15009. 800625c: 440b add r3, r1
  15010. 800625e: 3b01 subs r3, #1
  15011. 8006260: 6bb9 ldr r1, [r7, #56] ; 0x38
  15012. 8006262: 8989 ldrh r1, [r1, #12]
  15013. 8006264: fbb3 f3f1 udiv r3, r3, r1
  15014. 8006268: 429a cmp r2, r3
  15015. 800626a: d201 bcs.n 8006270 <find_volume+0x41c>
  15016. 800626c: 230d movs r3, #13
  15017. 800626e: e06d b.n 800634c <find_volume+0x4f8>
  15018. #if !_FS_READONLY
  15019. /* Get FSINFO if available */
  15020. fs->last_clst = fs->free_clst = 0xFFFFFFFF; /* Initialize cluster allocation information */
  15021. 8006270: 6bbb ldr r3, [r7, #56] ; 0x38
  15022. 8006272: f04f 32ff mov.w r2, #4294967295
  15023. 8006276: 619a str r2, [r3, #24]
  15024. 8006278: 6bbb ldr r3, [r7, #56] ; 0x38
  15025. 800627a: 699a ldr r2, [r3, #24]
  15026. 800627c: 6bbb ldr r3, [r7, #56] ; 0x38
  15027. 800627e: 615a str r2, [r3, #20]
  15028. fs->fsi_flag = 0x80;
  15029. 8006280: 6bbb ldr r3, [r7, #56] ; 0x38
  15030. 8006282: 2280 movs r2, #128 ; 0x80
  15031. 8006284: 711a strb r2, [r3, #4]
  15032. #if (_FS_NOFSINFO & 3) != 3
  15033. if (fmt == FS_FAT32 /* Enable FSINFO only if FAT32 and BPB_FSInfo32 == 1 */
  15034. 8006286: f897 3057 ldrb.w r3, [r7, #87] ; 0x57
  15035. 800628a: 2b03 cmp r3, #3
  15036. 800628c: d149 bne.n 8006322 <find_volume+0x4ce>
  15037. && ld_word(fs->win + BPB_FSInfo32) == 1
  15038. 800628e: 6bbb ldr r3, [r7, #56] ; 0x38
  15039. 8006290: 3338 adds r3, #56 ; 0x38
  15040. 8006292: 3330 adds r3, #48 ; 0x30
  15041. 8006294: 4618 mov r0, r3
  15042. 8006296: f7fd ff67 bl 8004168 <ld_word>
  15043. 800629a: 4603 mov r3, r0
  15044. 800629c: 2b01 cmp r3, #1
  15045. 800629e: d140 bne.n 8006322 <find_volume+0x4ce>
  15046. && move_window(fs, bsect + 1) == FR_OK)
  15047. 80062a0: 6d3b ldr r3, [r7, #80] ; 0x50
  15048. 80062a2: 3301 adds r3, #1
  15049. 80062a4: 4619 mov r1, r3
  15050. 80062a6: 6bb8 ldr r0, [r7, #56] ; 0x38
  15051. 80062a8: f7fe fa0e bl 80046c8 <move_window>
  15052. 80062ac: 4603 mov r3, r0
  15053. 80062ae: 2b00 cmp r3, #0
  15054. 80062b0: d137 bne.n 8006322 <find_volume+0x4ce>
  15055. {
  15056. fs->fsi_flag = 0;
  15057. 80062b2: 6bbb ldr r3, [r7, #56] ; 0x38
  15058. 80062b4: 2200 movs r2, #0
  15059. 80062b6: 711a strb r2, [r3, #4]
  15060. if (ld_word(fs->win + BS_55AA) == 0xAA55 /* Load FSINFO data if available */
  15061. 80062b8: 6bbb ldr r3, [r7, #56] ; 0x38
  15062. 80062ba: 3338 adds r3, #56 ; 0x38
  15063. 80062bc: f503 73ff add.w r3, r3, #510 ; 0x1fe
  15064. 80062c0: 4618 mov r0, r3
  15065. 80062c2: f7fd ff51 bl 8004168 <ld_word>
  15066. 80062c6: 4603 mov r3, r0
  15067. 80062c8: 461a mov r2, r3
  15068. 80062ca: f64a 2355 movw r3, #43605 ; 0xaa55
  15069. 80062ce: 429a cmp r2, r3
  15070. 80062d0: d127 bne.n 8006322 <find_volume+0x4ce>
  15071. && ld_dword(fs->win + FSI_LeadSig) == 0x41615252
  15072. 80062d2: 6bbb ldr r3, [r7, #56] ; 0x38
  15073. 80062d4: 3338 adds r3, #56 ; 0x38
  15074. 80062d6: 4618 mov r0, r3
  15075. 80062d8: f7fd ff5e bl 8004198 <ld_dword>
  15076. 80062dc: 4602 mov r2, r0
  15077. 80062de: 4b1d ldr r3, [pc, #116] ; (8006354 <find_volume+0x500>)
  15078. 80062e0: 429a cmp r2, r3
  15079. 80062e2: d11e bne.n 8006322 <find_volume+0x4ce>
  15080. && ld_dword(fs->win + FSI_StrucSig) == 0x61417272)
  15081. 80062e4: 6bbb ldr r3, [r7, #56] ; 0x38
  15082. 80062e6: 3338 adds r3, #56 ; 0x38
  15083. 80062e8: f503 73f2 add.w r3, r3, #484 ; 0x1e4
  15084. 80062ec: 4618 mov r0, r3
  15085. 80062ee: f7fd ff53 bl 8004198 <ld_dword>
  15086. 80062f2: 4602 mov r2, r0
  15087. 80062f4: 4b18 ldr r3, [pc, #96] ; (8006358 <find_volume+0x504>)
  15088. 80062f6: 429a cmp r2, r3
  15089. 80062f8: d113 bne.n 8006322 <find_volume+0x4ce>
  15090. {
  15091. #if (_FS_NOFSINFO & 1) == 0
  15092. fs->free_clst = ld_dword(fs->win + FSI_Free_Count);
  15093. 80062fa: 6bbb ldr r3, [r7, #56] ; 0x38
  15094. 80062fc: 3338 adds r3, #56 ; 0x38
  15095. 80062fe: f503 73f4 add.w r3, r3, #488 ; 0x1e8
  15096. 8006302: 4618 mov r0, r3
  15097. 8006304: f7fd ff48 bl 8004198 <ld_dword>
  15098. 8006308: 4602 mov r2, r0
  15099. 800630a: 6bbb ldr r3, [r7, #56] ; 0x38
  15100. 800630c: 619a str r2, [r3, #24]
  15101. #endif
  15102. #if (_FS_NOFSINFO & 2) == 0
  15103. fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free);
  15104. 800630e: 6bbb ldr r3, [r7, #56] ; 0x38
  15105. 8006310: 3338 adds r3, #56 ; 0x38
  15106. 8006312: f503 73f6 add.w r3, r3, #492 ; 0x1ec
  15107. 8006316: 4618 mov r0, r3
  15108. 8006318: f7fd ff3e bl 8004198 <ld_dword>
  15109. 800631c: 4602 mov r2, r0
  15110. 800631e: 6bbb ldr r3, [r7, #56] ; 0x38
  15111. 8006320: 615a str r2, [r3, #20]
  15112. }
  15113. #endif /* (_FS_NOFSINFO & 3) != 3 */
  15114. #endif /* !_FS_READONLY */
  15115. }
  15116. fs->fs_type = fmt; /* FAT sub-type */
  15117. 8006322: 6bbb ldr r3, [r7, #56] ; 0x38
  15118. 8006324: f897 2057 ldrb.w r2, [r7, #87] ; 0x57
  15119. 8006328: 701a strb r2, [r3, #0]
  15120. fs->id = ++Fsid; /* File system mount ID */
  15121. 800632a: 4b0c ldr r3, [pc, #48] ; (800635c <find_volume+0x508>)
  15122. 800632c: 881b ldrh r3, [r3, #0]
  15123. 800632e: 3301 adds r3, #1
  15124. 8006330: b29a uxth r2, r3
  15125. 8006332: 4b0a ldr r3, [pc, #40] ; (800635c <find_volume+0x508>)
  15126. 8006334: 801a strh r2, [r3, #0]
  15127. 8006336: 4b09 ldr r3, [pc, #36] ; (800635c <find_volume+0x508>)
  15128. 8006338: 881a ldrh r2, [r3, #0]
  15129. 800633a: 6bbb ldr r3, [r7, #56] ; 0x38
  15130. 800633c: 80da strh r2, [r3, #6]
  15131. #if _USE_LFN == 1
  15132. fs->lfnbuf = LfnBuf; /* Static LFN working buffer */
  15133. 800633e: 6bbb ldr r3, [r7, #56] ; 0x38
  15134. 8006340: 4a07 ldr r2, [pc, #28] ; (8006360 <find_volume+0x50c>)
  15135. 8006342: 611a str r2, [r3, #16]
  15136. #endif
  15137. #if _FS_RPATH != 0
  15138. fs->cdir = 0; /* Initialize current directory */
  15139. #endif
  15140. #if _FS_LOCK != 0 /* Clear file lock semaphores */
  15141. clear_lock(fs);
  15142. 8006344: 6bb8 ldr r0, [r7, #56] ; 0x38
  15143. 8006346: f7fe f957 bl 80045f8 <clear_lock>
  15144. #endif
  15145. return FR_OK;
  15146. 800634a: 2300 movs r3, #0
  15147. }
  15148. 800634c: 4618 mov r0, r3
  15149. 800634e: 3758 adds r7, #88 ; 0x58
  15150. 8006350: 46bd mov sp, r7
  15151. 8006352: bd80 pop {r7, pc}
  15152. 8006354: 41615252 .word 0x41615252
  15153. 8006358: 61417272 .word 0x61417272
  15154. 800635c: 20000048 .word 0x20000048
  15155. 8006360: 2000006c .word 0x2000006c
  15156. 08006364 <validate>:
  15157. static
  15158. FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */
  15159. _FDID* obj, /* Pointer to the _OBJ, the 1st member in the FIL/DIR object, to check validity */
  15160. FATFS** fs /* Pointer to pointer to the owner file system object to return */
  15161. )
  15162. {
  15163. 8006364: b580 push {r7, lr}
  15164. 8006366: b084 sub sp, #16
  15165. 8006368: af00 add r7, sp, #0
  15166. 800636a: 6078 str r0, [r7, #4]
  15167. 800636c: 6039 str r1, [r7, #0]
  15168. FRESULT res = FR_INVALID_OBJECT;
  15169. 800636e: 2309 movs r3, #9
  15170. 8006370: 73fb strb r3, [r7, #15]
  15171. if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */
  15172. 8006372: 687b ldr r3, [r7, #4]
  15173. 8006374: 2b00 cmp r3, #0
  15174. 8006376: d01c beq.n 80063b2 <validate+0x4e>
  15175. 8006378: 687b ldr r3, [r7, #4]
  15176. 800637a: 681b ldr r3, [r3, #0]
  15177. 800637c: 2b00 cmp r3, #0
  15178. 800637e: d018 beq.n 80063b2 <validate+0x4e>
  15179. 8006380: 687b ldr r3, [r7, #4]
  15180. 8006382: 681b ldr r3, [r3, #0]
  15181. 8006384: 781b ldrb r3, [r3, #0]
  15182. 8006386: 2b00 cmp r3, #0
  15183. 8006388: d013 beq.n 80063b2 <validate+0x4e>
  15184. 800638a: 687b ldr r3, [r7, #4]
  15185. 800638c: 889a ldrh r2, [r3, #4]
  15186. 800638e: 687b ldr r3, [r7, #4]
  15187. 8006390: 681b ldr r3, [r3, #0]
  15188. 8006392: 88db ldrh r3, [r3, #6]
  15189. 8006394: 429a cmp r2, r3
  15190. 8006396: d10c bne.n 80063b2 <validate+0x4e>
  15191. }
  15192. } else {
  15193. res = FR_TIMEOUT;
  15194. }
  15195. #else
  15196. if (!(disk_status(obj->fs->drv) & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */
  15197. 8006398: 687b ldr r3, [r7, #4]
  15198. 800639a: 681b ldr r3, [r3, #0]
  15199. 800639c: 785b ldrb r3, [r3, #1]
  15200. 800639e: 4618 mov r0, r3
  15201. 80063a0: f7fd fe44 bl 800402c <disk_status>
  15202. 80063a4: 4603 mov r3, r0
  15203. 80063a6: f003 0301 and.w r3, r3, #1
  15204. 80063aa: 2b00 cmp r3, #0
  15205. 80063ac: d101 bne.n 80063b2 <validate+0x4e>
  15206. res = FR_OK;
  15207. 80063ae: 2300 movs r3, #0
  15208. 80063b0: 73fb strb r3, [r7, #15]
  15209. }
  15210. #endif
  15211. }
  15212. *fs = (res == FR_OK) ? obj->fs : 0; /* Corresponding filesystem object */
  15213. 80063b2: 7bfb ldrb r3, [r7, #15]
  15214. 80063b4: 2b00 cmp r3, #0
  15215. 80063b6: d102 bne.n 80063be <validate+0x5a>
  15216. 80063b8: 687b ldr r3, [r7, #4]
  15217. 80063ba: 681b ldr r3, [r3, #0]
  15218. 80063bc: e000 b.n 80063c0 <validate+0x5c>
  15219. 80063be: 2300 movs r3, #0
  15220. 80063c0: 683a ldr r2, [r7, #0]
  15221. 80063c2: 6013 str r3, [r2, #0]
  15222. return res;
  15223. 80063c4: 7bfb ldrb r3, [r7, #15]
  15224. }
  15225. 80063c6: 4618 mov r0, r3
  15226. 80063c8: 3710 adds r7, #16
  15227. 80063ca: 46bd mov sp, r7
  15228. 80063cc: bd80 pop {r7, pc}
  15229. ...
  15230. 080063d0 <f_mount>:
  15231. FRESULT f_mount (
  15232. FATFS* fs, /* Pointer to the file system object (NULL:unmount)*/
  15233. const TCHAR* path, /* Logical drive number to be mounted/unmounted */
  15234. BYTE opt /* Mode option 0:Do not mount (delayed mount), 1:Mount immediately */
  15235. )
  15236. {
  15237. 80063d0: b580 push {r7, lr}
  15238. 80063d2: b088 sub sp, #32
  15239. 80063d4: af00 add r7, sp, #0
  15240. 80063d6: 60f8 str r0, [r7, #12]
  15241. 80063d8: 60b9 str r1, [r7, #8]
  15242. 80063da: 4613 mov r3, r2
  15243. 80063dc: 71fb strb r3, [r7, #7]
  15244. FATFS *cfs;
  15245. int vol;
  15246. FRESULT res;
  15247. const TCHAR *rp = path;
  15248. 80063de: 68bb ldr r3, [r7, #8]
  15249. 80063e0: 613b str r3, [r7, #16]
  15250. /* Get logical drive number */
  15251. vol = get_ldnumber(&rp);
  15252. 80063e2: f107 0310 add.w r3, r7, #16
  15253. 80063e6: 4618 mov r0, r3
  15254. 80063e8: f7ff fc9a bl 8005d20 <get_ldnumber>
  15255. 80063ec: 61f8 str r0, [r7, #28]
  15256. if (vol < 0) return FR_INVALID_DRIVE;
  15257. 80063ee: 69fb ldr r3, [r7, #28]
  15258. 80063f0: 2b00 cmp r3, #0
  15259. 80063f2: da01 bge.n 80063f8 <f_mount+0x28>
  15260. 80063f4: 230b movs r3, #11
  15261. 80063f6: e02b b.n 8006450 <f_mount+0x80>
  15262. cfs = FatFs[vol]; /* Pointer to fs object */
  15263. 80063f8: 4a17 ldr r2, [pc, #92] ; (8006458 <f_mount+0x88>)
  15264. 80063fa: 69fb ldr r3, [r7, #28]
  15265. 80063fc: f852 3023 ldr.w r3, [r2, r3, lsl #2]
  15266. 8006400: 61bb str r3, [r7, #24]
  15267. if (cfs) {
  15268. 8006402: 69bb ldr r3, [r7, #24]
  15269. 8006404: 2b00 cmp r3, #0
  15270. 8006406: d005 beq.n 8006414 <f_mount+0x44>
  15271. #if _FS_LOCK != 0
  15272. clear_lock(cfs);
  15273. 8006408: 69b8 ldr r0, [r7, #24]
  15274. 800640a: f7fe f8f5 bl 80045f8 <clear_lock>
  15275. #endif
  15276. #if _FS_REENTRANT /* Discard sync object of the current volume */
  15277. if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR;
  15278. #endif
  15279. cfs->fs_type = 0; /* Clear old fs object */
  15280. 800640e: 69bb ldr r3, [r7, #24]
  15281. 8006410: 2200 movs r2, #0
  15282. 8006412: 701a strb r2, [r3, #0]
  15283. }
  15284. if (fs) {
  15285. 8006414: 68fb ldr r3, [r7, #12]
  15286. 8006416: 2b00 cmp r3, #0
  15287. 8006418: d002 beq.n 8006420 <f_mount+0x50>
  15288. fs->fs_type = 0; /* Clear new fs object */
  15289. 800641a: 68fb ldr r3, [r7, #12]
  15290. 800641c: 2200 movs r2, #0
  15291. 800641e: 701a strb r2, [r3, #0]
  15292. #if _FS_REENTRANT /* Create sync object for the new volume */
  15293. if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR;
  15294. #endif
  15295. }
  15296. FatFs[vol] = fs; /* Register new fs object */
  15297. 8006420: 68fa ldr r2, [r7, #12]
  15298. 8006422: 490d ldr r1, [pc, #52] ; (8006458 <f_mount+0x88>)
  15299. 8006424: 69fb ldr r3, [r7, #28]
  15300. 8006426: f841 2023 str.w r2, [r1, r3, lsl #2]
  15301. if (!fs || opt != 1) return FR_OK; /* Do not mount now, it will be mounted later */
  15302. 800642a: 68fb ldr r3, [r7, #12]
  15303. 800642c: 2b00 cmp r3, #0
  15304. 800642e: d002 beq.n 8006436 <f_mount+0x66>
  15305. 8006430: 79fb ldrb r3, [r7, #7]
  15306. 8006432: 2b01 cmp r3, #1
  15307. 8006434: d001 beq.n 800643a <f_mount+0x6a>
  15308. 8006436: 2300 movs r3, #0
  15309. 8006438: e00a b.n 8006450 <f_mount+0x80>
  15310. res = find_volume(&path, &fs, 0); /* Force mounted the volume */
  15311. 800643a: f107 010c add.w r1, r7, #12
  15312. 800643e: f107 0308 add.w r3, r7, #8
  15313. 8006442: 2200 movs r2, #0
  15314. 8006444: 4618 mov r0, r3
  15315. 8006446: f7ff fd05 bl 8005e54 <find_volume>
  15316. 800644a: 4603 mov r3, r0
  15317. 800644c: 75fb strb r3, [r7, #23]
  15318. LEAVE_FF(fs, res);
  15319. 800644e: 7dfb ldrb r3, [r7, #23]
  15320. }
  15321. 8006450: 4618 mov r0, r3
  15322. 8006452: 3720 adds r7, #32
  15323. 8006454: 46bd mov sp, r7
  15324. 8006456: bd80 pop {r7, pc}
  15325. 8006458: 20000044 .word 0x20000044
  15326. 0800645c <f_open>:
  15327. FRESULT f_open (
  15328. FIL* fp, /* Pointer to the blank file object */
  15329. const TCHAR* path, /* Pointer to the file name */
  15330. BYTE mode /* Access mode and file open mode flags */
  15331. )
  15332. {
  15333. 800645c: b580 push {r7, lr}
  15334. 800645e: b09a sub sp, #104 ; 0x68
  15335. 8006460: af00 add r7, sp, #0
  15336. 8006462: 60f8 str r0, [r7, #12]
  15337. 8006464: 60b9 str r1, [r7, #8]
  15338. 8006466: 4613 mov r3, r2
  15339. 8006468: 71fb strb r3, [r7, #7]
  15340. FSIZE_t ofs;
  15341. #endif
  15342. DEF_NAMBUF
  15343. if (!fp) return FR_INVALID_OBJECT;
  15344. 800646a: 68fb ldr r3, [r7, #12]
  15345. 800646c: 2b00 cmp r3, #0
  15346. 800646e: d101 bne.n 8006474 <f_open+0x18>
  15347. 8006470: 2309 movs r3, #9
  15348. 8006472: e1bb b.n 80067ec <f_open+0x390>
  15349. /* Get logical drive */
  15350. mode &= _FS_READONLY ? FA_READ : FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_CREATE_NEW | FA_OPEN_ALWAYS | FA_OPEN_APPEND | FA_SEEKEND;
  15351. 8006474: 79fb ldrb r3, [r7, #7]
  15352. 8006476: f003 033f and.w r3, r3, #63 ; 0x3f
  15353. 800647a: 71fb strb r3, [r7, #7]
  15354. res = find_volume(&path, &fs, mode);
  15355. 800647c: 79fa ldrb r2, [r7, #7]
  15356. 800647e: f107 0114 add.w r1, r7, #20
  15357. 8006482: f107 0308 add.w r3, r7, #8
  15358. 8006486: 4618 mov r0, r3
  15359. 8006488: f7ff fce4 bl 8005e54 <find_volume>
  15360. 800648c: 4603 mov r3, r0
  15361. 800648e: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15362. if (res == FR_OK) {
  15363. 8006492: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15364. 8006496: 2b00 cmp r3, #0
  15365. 8006498: f040 819f bne.w 80067da <f_open+0x37e>
  15366. dj.obj.fs = fs;
  15367. 800649c: 697b ldr r3, [r7, #20]
  15368. 800649e: 61bb str r3, [r7, #24]
  15369. INIT_NAMBUF(fs);
  15370. res = follow_path(&dj, path); /* Follow the file path */
  15371. 80064a0: 68ba ldr r2, [r7, #8]
  15372. 80064a2: f107 0318 add.w r3, r7, #24
  15373. 80064a6: 4611 mov r1, r2
  15374. 80064a8: 4618 mov r0, r3
  15375. 80064aa: f7ff fbc3 bl 8005c34 <follow_path>
  15376. 80064ae: 4603 mov r3, r0
  15377. 80064b0: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15378. #if !_FS_READONLY /* R/W configuration */
  15379. if (res == FR_OK) {
  15380. 80064b4: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15381. 80064b8: 2b00 cmp r3, #0
  15382. 80064ba: d11a bne.n 80064f2 <f_open+0x96>
  15383. if (dj.fn[NSFLAG] & NS_NONAME) { /* Origin directory itself? */
  15384. 80064bc: f897 3047 ldrb.w r3, [r7, #71] ; 0x47
  15385. 80064c0: b25b sxtb r3, r3
  15386. 80064c2: 2b00 cmp r3, #0
  15387. 80064c4: da03 bge.n 80064ce <f_open+0x72>
  15388. res = FR_INVALID_NAME;
  15389. 80064c6: 2306 movs r3, #6
  15390. 80064c8: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15391. 80064cc: e011 b.n 80064f2 <f_open+0x96>
  15392. }
  15393. #if _FS_LOCK != 0
  15394. else {
  15395. res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
  15396. 80064ce: 79fb ldrb r3, [r7, #7]
  15397. 80064d0: f023 0301 bic.w r3, r3, #1
  15398. 80064d4: 2b00 cmp r3, #0
  15399. 80064d6: bf14 ite ne
  15400. 80064d8: 2301 movne r3, #1
  15401. 80064da: 2300 moveq r3, #0
  15402. 80064dc: b2db uxtb r3, r3
  15403. 80064de: 461a mov r2, r3
  15404. 80064e0: f107 0318 add.w r3, r7, #24
  15405. 80064e4: 4611 mov r1, r2
  15406. 80064e6: 4618 mov r0, r3
  15407. 80064e8: f7fd ff3e bl 8004368 <chk_lock>
  15408. 80064ec: 4603 mov r3, r0
  15409. 80064ee: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15410. }
  15411. #endif
  15412. }
  15413. /* Create or Open a file */
  15414. if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
  15415. 80064f2: 79fb ldrb r3, [r7, #7]
  15416. 80064f4: f003 031c and.w r3, r3, #28
  15417. 80064f8: 2b00 cmp r3, #0
  15418. 80064fa: d07f beq.n 80065fc <f_open+0x1a0>
  15419. if (res != FR_OK) { /* No file, create new */
  15420. 80064fc: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15421. 8006500: 2b00 cmp r3, #0
  15422. 8006502: d017 beq.n 8006534 <f_open+0xd8>
  15423. if (res == FR_NO_FILE) { /* There is no file to open, create a new entry */
  15424. 8006504: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15425. 8006508: 2b04 cmp r3, #4
  15426. 800650a: d10e bne.n 800652a <f_open+0xce>
  15427. #if _FS_LOCK != 0
  15428. res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
  15429. 800650c: f7fd ff88 bl 8004420 <enq_lock>
  15430. 8006510: 4603 mov r3, r0
  15431. 8006512: 2b00 cmp r3, #0
  15432. 8006514: d006 beq.n 8006524 <f_open+0xc8>
  15433. 8006516: f107 0318 add.w r3, r7, #24
  15434. 800651a: 4618 mov r0, r3
  15435. 800651c: f7ff f8da bl 80056d4 <dir_register>
  15436. 8006520: 4603 mov r3, r0
  15437. 8006522: e000 b.n 8006526 <f_open+0xca>
  15438. 8006524: 2312 movs r3, #18
  15439. 8006526: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15440. #else
  15441. res = dir_register(&dj);
  15442. #endif
  15443. }
  15444. mode |= FA_CREATE_ALWAYS; /* File is created */
  15445. 800652a: 79fb ldrb r3, [r7, #7]
  15446. 800652c: f043 0308 orr.w r3, r3, #8
  15447. 8006530: 71fb strb r3, [r7, #7]
  15448. 8006532: e010 b.n 8006556 <f_open+0xfa>
  15449. }
  15450. else { /* Any object is already existing */
  15451. if (dj.obj.attr & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
  15452. 8006534: 7fbb ldrb r3, [r7, #30]
  15453. 8006536: f003 0311 and.w r3, r3, #17
  15454. 800653a: 2b00 cmp r3, #0
  15455. 800653c: d003 beq.n 8006546 <f_open+0xea>
  15456. res = FR_DENIED;
  15457. 800653e: 2307 movs r3, #7
  15458. 8006540: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15459. 8006544: e007 b.n 8006556 <f_open+0xfa>
  15460. } else {
  15461. if (mode & FA_CREATE_NEW) res = FR_EXIST; /* Cannot create as new file */
  15462. 8006546: 79fb ldrb r3, [r7, #7]
  15463. 8006548: f003 0304 and.w r3, r3, #4
  15464. 800654c: 2b00 cmp r3, #0
  15465. 800654e: d002 beq.n 8006556 <f_open+0xfa>
  15466. 8006550: 2308 movs r3, #8
  15467. 8006552: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15468. }
  15469. }
  15470. if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
  15471. 8006556: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15472. 800655a: 2b00 cmp r3, #0
  15473. 800655c: d168 bne.n 8006630 <f_open+0x1d4>
  15474. 800655e: 79fb ldrb r3, [r7, #7]
  15475. 8006560: f003 0308 and.w r3, r3, #8
  15476. 8006564: 2b00 cmp r3, #0
  15477. 8006566: d063 beq.n 8006630 <f_open+0x1d4>
  15478. dw = GET_FATTIME();
  15479. 8006568: f7fd fd02 bl 8003f70 <get_fattime>
  15480. 800656c: 65b8 str r0, [r7, #88] ; 0x58
  15481. }
  15482. } else
  15483. #endif
  15484. {
  15485. /* Clean directory info */
  15486. st_dword(dj.dir + DIR_CrtTime, dw); /* Set created time */
  15487. 800656e: 6bbb ldr r3, [r7, #56] ; 0x38
  15488. 8006570: 330e adds r3, #14
  15489. 8006572: 6db9 ldr r1, [r7, #88] ; 0x58
  15490. 8006574: 4618 mov r0, r3
  15491. 8006576: f7fd fe4d bl 8004214 <st_dword>
  15492. st_dword(dj.dir + DIR_ModTime, dw); /* Set modified time */
  15493. 800657a: 6bbb ldr r3, [r7, #56] ; 0x38
  15494. 800657c: 3316 adds r3, #22
  15495. 800657e: 6db9 ldr r1, [r7, #88] ; 0x58
  15496. 8006580: 4618 mov r0, r3
  15497. 8006582: f7fd fe47 bl 8004214 <st_dword>
  15498. dj.dir[DIR_Attr] = AM_ARC; /* Reset attribute */
  15499. 8006586: 6bbb ldr r3, [r7, #56] ; 0x38
  15500. 8006588: 330b adds r3, #11
  15501. 800658a: 2220 movs r2, #32
  15502. 800658c: 701a strb r2, [r3, #0]
  15503. cl = ld_clust(fs, dj.dir); /* Get cluster chain */
  15504. 800658e: 697b ldr r3, [r7, #20]
  15505. 8006590: 6bba ldr r2, [r7, #56] ; 0x38
  15506. 8006592: 4611 mov r1, r2
  15507. 8006594: 4618 mov r0, r3
  15508. 8006596: f7fe fe16 bl 80051c6 <ld_clust>
  15509. 800659a: 6578 str r0, [r7, #84] ; 0x54
  15510. st_clust(fs, dj.dir, 0); /* Reset file allocation info */
  15511. 800659c: 697b ldr r3, [r7, #20]
  15512. 800659e: 6bb9 ldr r1, [r7, #56] ; 0x38
  15513. 80065a0: 2200 movs r2, #0
  15514. 80065a2: 4618 mov r0, r3
  15515. 80065a4: f7fe fe2e bl 8005204 <st_clust>
  15516. st_dword(dj.dir + DIR_FileSize, 0);
  15517. 80065a8: 6bbb ldr r3, [r7, #56] ; 0x38
  15518. 80065aa: 331c adds r3, #28
  15519. 80065ac: 2100 movs r1, #0
  15520. 80065ae: 4618 mov r0, r3
  15521. 80065b0: f7fd fe30 bl 8004214 <st_dword>
  15522. fs->wflag = 1;
  15523. 80065b4: 697b ldr r3, [r7, #20]
  15524. 80065b6: 2201 movs r2, #1
  15525. 80065b8: 70da strb r2, [r3, #3]
  15526. if (cl) { /* Remove the cluster chain if exist */
  15527. 80065ba: 6d7b ldr r3, [r7, #84] ; 0x54
  15528. 80065bc: 2b00 cmp r3, #0
  15529. 80065be: d037 beq.n 8006630 <f_open+0x1d4>
  15530. dw = fs->winsect;
  15531. 80065c0: 697b ldr r3, [r7, #20]
  15532. 80065c2: 6b5b ldr r3, [r3, #52] ; 0x34
  15533. 80065c4: 65bb str r3, [r7, #88] ; 0x58
  15534. res = remove_chain(&dj.obj, cl, 0);
  15535. 80065c6: f107 0318 add.w r3, r7, #24
  15536. 80065ca: 2200 movs r2, #0
  15537. 80065cc: 6d79 ldr r1, [r7, #84] ; 0x54
  15538. 80065ce: 4618 mov r0, r3
  15539. 80065d0: f7fe fb1e bl 8004c10 <remove_chain>
  15540. 80065d4: 4603 mov r3, r0
  15541. 80065d6: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15542. if (res == FR_OK) {
  15543. 80065da: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15544. 80065de: 2b00 cmp r3, #0
  15545. 80065e0: d126 bne.n 8006630 <f_open+0x1d4>
  15546. res = move_window(fs, dw);
  15547. 80065e2: 697b ldr r3, [r7, #20]
  15548. 80065e4: 6db9 ldr r1, [r7, #88] ; 0x58
  15549. 80065e6: 4618 mov r0, r3
  15550. 80065e8: f7fe f86e bl 80046c8 <move_window>
  15551. 80065ec: 4603 mov r3, r0
  15552. 80065ee: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15553. fs->last_clst = cl - 1; /* Reuse the cluster hole */
  15554. 80065f2: 697b ldr r3, [r7, #20]
  15555. 80065f4: 6d7a ldr r2, [r7, #84] ; 0x54
  15556. 80065f6: 3a01 subs r2, #1
  15557. 80065f8: 615a str r2, [r3, #20]
  15558. 80065fa: e019 b.n 8006630 <f_open+0x1d4>
  15559. }
  15560. }
  15561. }
  15562. }
  15563. else { /* Open an existing file */
  15564. if (res == FR_OK) { /* Following succeeded */
  15565. 80065fc: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15566. 8006600: 2b00 cmp r3, #0
  15567. 8006602: d115 bne.n 8006630 <f_open+0x1d4>
  15568. if (dj.obj.attr & AM_DIR) { /* It is a directory */
  15569. 8006604: 7fbb ldrb r3, [r7, #30]
  15570. 8006606: f003 0310 and.w r3, r3, #16
  15571. 800660a: 2b00 cmp r3, #0
  15572. 800660c: d003 beq.n 8006616 <f_open+0x1ba>
  15573. res = FR_NO_FILE;
  15574. 800660e: 2304 movs r3, #4
  15575. 8006610: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15576. 8006614: e00c b.n 8006630 <f_open+0x1d4>
  15577. } else {
  15578. if ((mode & FA_WRITE) && (dj.obj.attr & AM_RDO)) { /* R/O violation */
  15579. 8006616: 79fb ldrb r3, [r7, #7]
  15580. 8006618: f003 0302 and.w r3, r3, #2
  15581. 800661c: 2b00 cmp r3, #0
  15582. 800661e: d007 beq.n 8006630 <f_open+0x1d4>
  15583. 8006620: 7fbb ldrb r3, [r7, #30]
  15584. 8006622: f003 0301 and.w r3, r3, #1
  15585. 8006626: 2b00 cmp r3, #0
  15586. 8006628: d002 beq.n 8006630 <f_open+0x1d4>
  15587. res = FR_DENIED;
  15588. 800662a: 2307 movs r3, #7
  15589. 800662c: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15590. }
  15591. }
  15592. }
  15593. }
  15594. if (res == FR_OK) {
  15595. 8006630: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15596. 8006634: 2b00 cmp r3, #0
  15597. 8006636: d128 bne.n 800668a <f_open+0x22e>
  15598. if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */
  15599. 8006638: 79fb ldrb r3, [r7, #7]
  15600. 800663a: f003 0308 and.w r3, r3, #8
  15601. 800663e: 2b00 cmp r3, #0
  15602. 8006640: d003 beq.n 800664a <f_open+0x1ee>
  15603. mode |= FA_MODIFIED;
  15604. 8006642: 79fb ldrb r3, [r7, #7]
  15605. 8006644: f043 0340 orr.w r3, r3, #64 ; 0x40
  15606. 8006648: 71fb strb r3, [r7, #7]
  15607. fp->dir_sect = fs->winsect; /* Pointer to the directory entry */
  15608. 800664a: 697b ldr r3, [r7, #20]
  15609. 800664c: 6b5a ldr r2, [r3, #52] ; 0x34
  15610. 800664e: 68fb ldr r3, [r7, #12]
  15611. 8006650: 625a str r2, [r3, #36] ; 0x24
  15612. fp->dir_ptr = dj.dir;
  15613. 8006652: 6bba ldr r2, [r7, #56] ; 0x38
  15614. 8006654: 68fb ldr r3, [r7, #12]
  15615. 8006656: 629a str r2, [r3, #40] ; 0x28
  15616. #if _FS_LOCK != 0
  15617. fp->obj.lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
  15618. 8006658: 79fb ldrb r3, [r7, #7]
  15619. 800665a: f023 0301 bic.w r3, r3, #1
  15620. 800665e: 2b00 cmp r3, #0
  15621. 8006660: bf14 ite ne
  15622. 8006662: 2301 movne r3, #1
  15623. 8006664: 2300 moveq r3, #0
  15624. 8006666: b2db uxtb r3, r3
  15625. 8006668: 461a mov r2, r3
  15626. 800666a: f107 0318 add.w r3, r7, #24
  15627. 800666e: 4611 mov r1, r2
  15628. 8006670: 4618 mov r0, r3
  15629. 8006672: f7fd fef7 bl 8004464 <inc_lock>
  15630. 8006676: 4602 mov r2, r0
  15631. 8006678: 68fb ldr r3, [r7, #12]
  15632. 800667a: 611a str r2, [r3, #16]
  15633. if (!fp->obj.lockid) res = FR_INT_ERR;
  15634. 800667c: 68fb ldr r3, [r7, #12]
  15635. 800667e: 691b ldr r3, [r3, #16]
  15636. 8006680: 2b00 cmp r3, #0
  15637. 8006682: d102 bne.n 800668a <f_open+0x22e>
  15638. 8006684: 2302 movs r3, #2
  15639. 8006686: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15640. }
  15641. }
  15642. }
  15643. #endif
  15644. if (res == FR_OK) {
  15645. 800668a: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15646. 800668e: 2b00 cmp r3, #0
  15647. 8006690: f040 80a3 bne.w 80067da <f_open+0x37e>
  15648. fp->obj.objsize = ld_qword(fs->dirbuf + XDIR_FileSize);
  15649. fp->obj.stat = fs->dirbuf[XDIR_GenFlags] & 2;
  15650. } else
  15651. #endif
  15652. {
  15653. fp->obj.sclust = ld_clust(fs, dj.dir); /* Get object allocation info */
  15654. 8006694: 697b ldr r3, [r7, #20]
  15655. 8006696: 6bba ldr r2, [r7, #56] ; 0x38
  15656. 8006698: 4611 mov r1, r2
  15657. 800669a: 4618 mov r0, r3
  15658. 800669c: f7fe fd93 bl 80051c6 <ld_clust>
  15659. 80066a0: 4602 mov r2, r0
  15660. 80066a2: 68fb ldr r3, [r7, #12]
  15661. 80066a4: 609a str r2, [r3, #8]
  15662. fp->obj.objsize = ld_dword(dj.dir + DIR_FileSize);
  15663. 80066a6: 6bbb ldr r3, [r7, #56] ; 0x38
  15664. 80066a8: 331c adds r3, #28
  15665. 80066aa: 4618 mov r0, r3
  15666. 80066ac: f7fd fd74 bl 8004198 <ld_dword>
  15667. 80066b0: 4602 mov r2, r0
  15668. 80066b2: 68fb ldr r3, [r7, #12]
  15669. 80066b4: 60da str r2, [r3, #12]
  15670. }
  15671. #if _USE_FASTSEEK
  15672. fp->cltbl = 0; /* Disable fast seek mode */
  15673. 80066b6: 68fb ldr r3, [r7, #12]
  15674. 80066b8: 2200 movs r2, #0
  15675. 80066ba: 62da str r2, [r3, #44] ; 0x2c
  15676. #endif
  15677. fp->obj.fs = fs; /* Validate the file object */
  15678. 80066bc: 697a ldr r2, [r7, #20]
  15679. 80066be: 68fb ldr r3, [r7, #12]
  15680. 80066c0: 601a str r2, [r3, #0]
  15681. fp->obj.id = fs->id;
  15682. 80066c2: 697b ldr r3, [r7, #20]
  15683. 80066c4: 88da ldrh r2, [r3, #6]
  15684. 80066c6: 68fb ldr r3, [r7, #12]
  15685. 80066c8: 809a strh r2, [r3, #4]
  15686. fp->flag = mode; /* Set file access mode */
  15687. 80066ca: 68fb ldr r3, [r7, #12]
  15688. 80066cc: 79fa ldrb r2, [r7, #7]
  15689. 80066ce: 751a strb r2, [r3, #20]
  15690. fp->err = 0; /* Clear error flag */
  15691. 80066d0: 68fb ldr r3, [r7, #12]
  15692. 80066d2: 2200 movs r2, #0
  15693. 80066d4: 755a strb r2, [r3, #21]
  15694. fp->sect = 0; /* Invalidate current data sector */
  15695. 80066d6: 68fb ldr r3, [r7, #12]
  15696. 80066d8: 2200 movs r2, #0
  15697. 80066da: 621a str r2, [r3, #32]
  15698. fp->fptr = 0; /* Set file pointer top of the file */
  15699. 80066dc: 68fb ldr r3, [r7, #12]
  15700. 80066de: 2200 movs r2, #0
  15701. 80066e0: 619a str r2, [r3, #24]
  15702. #if !_FS_READONLY
  15703. #if !_FS_TINY
  15704. mem_set(fp->buf, 0, _MAX_SS); /* Clear sector buffer */
  15705. 80066e2: 68fb ldr r3, [r7, #12]
  15706. 80066e4: 3330 adds r3, #48 ; 0x30
  15707. 80066e6: f44f 5280 mov.w r2, #4096 ; 0x1000
  15708. 80066ea: 2100 movs r1, #0
  15709. 80066ec: 4618 mov r0, r3
  15710. 80066ee: f7fd fdde bl 80042ae <mem_set>
  15711. #endif
  15712. if ((mode & FA_SEEKEND) && fp->obj.objsize > 0) { /* Seek to end of file if FA_OPEN_APPEND is specified */
  15713. 80066f2: 79fb ldrb r3, [r7, #7]
  15714. 80066f4: f003 0320 and.w r3, r3, #32
  15715. 80066f8: 2b00 cmp r3, #0
  15716. 80066fa: d06e beq.n 80067da <f_open+0x37e>
  15717. 80066fc: 68fb ldr r3, [r7, #12]
  15718. 80066fe: 68db ldr r3, [r3, #12]
  15719. 8006700: 2b00 cmp r3, #0
  15720. 8006702: d06a beq.n 80067da <f_open+0x37e>
  15721. fp->fptr = fp->obj.objsize; /* Offset to seek */
  15722. 8006704: 68fb ldr r3, [r7, #12]
  15723. 8006706: 68da ldr r2, [r3, #12]
  15724. 8006708: 68fb ldr r3, [r7, #12]
  15725. 800670a: 619a str r2, [r3, #24]
  15726. bcs = (DWORD)fs->csize * SS(fs); /* Cluster size in byte */
  15727. 800670c: 697b ldr r3, [r7, #20]
  15728. 800670e: 895b ldrh r3, [r3, #10]
  15729. 8006710: 461a mov r2, r3
  15730. 8006712: 697b ldr r3, [r7, #20]
  15731. 8006714: 899b ldrh r3, [r3, #12]
  15732. 8006716: fb03 f302 mul.w r3, r3, r2
  15733. 800671a: 653b str r3, [r7, #80] ; 0x50
  15734. clst = fp->obj.sclust; /* Follow the cluster chain */
  15735. 800671c: 68fb ldr r3, [r7, #12]
  15736. 800671e: 689b ldr r3, [r3, #8]
  15737. 8006720: 663b str r3, [r7, #96] ; 0x60
  15738. for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) {
  15739. 8006722: 68fb ldr r3, [r7, #12]
  15740. 8006724: 68db ldr r3, [r3, #12]
  15741. 8006726: 65fb str r3, [r7, #92] ; 0x5c
  15742. 8006728: e016 b.n 8006758 <f_open+0x2fc>
  15743. clst = get_fat(&fp->obj, clst);
  15744. 800672a: 68fb ldr r3, [r7, #12]
  15745. 800672c: 6e39 ldr r1, [r7, #96] ; 0x60
  15746. 800672e: 4618 mov r0, r3
  15747. 8006730: f7fe f887 bl 8004842 <get_fat>
  15748. 8006734: 6638 str r0, [r7, #96] ; 0x60
  15749. if (clst <= 1) res = FR_INT_ERR;
  15750. 8006736: 6e3b ldr r3, [r7, #96] ; 0x60
  15751. 8006738: 2b01 cmp r3, #1
  15752. 800673a: d802 bhi.n 8006742 <f_open+0x2e6>
  15753. 800673c: 2302 movs r3, #2
  15754. 800673e: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15755. if (clst == 0xFFFFFFFF) res = FR_DISK_ERR;
  15756. 8006742: 6e3b ldr r3, [r7, #96] ; 0x60
  15757. 8006744: f1b3 3fff cmp.w r3, #4294967295
  15758. 8006748: d102 bne.n 8006750 <f_open+0x2f4>
  15759. 800674a: 2301 movs r3, #1
  15760. 800674c: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15761. for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) {
  15762. 8006750: 6dfa ldr r2, [r7, #92] ; 0x5c
  15763. 8006752: 6d3b ldr r3, [r7, #80] ; 0x50
  15764. 8006754: 1ad3 subs r3, r2, r3
  15765. 8006756: 65fb str r3, [r7, #92] ; 0x5c
  15766. 8006758: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15767. 800675c: 2b00 cmp r3, #0
  15768. 800675e: d103 bne.n 8006768 <f_open+0x30c>
  15769. 8006760: 6dfa ldr r2, [r7, #92] ; 0x5c
  15770. 8006762: 6d3b ldr r3, [r7, #80] ; 0x50
  15771. 8006764: 429a cmp r2, r3
  15772. 8006766: d8e0 bhi.n 800672a <f_open+0x2ce>
  15773. }
  15774. fp->clust = clst;
  15775. 8006768: 68fb ldr r3, [r7, #12]
  15776. 800676a: 6e3a ldr r2, [r7, #96] ; 0x60
  15777. 800676c: 61da str r2, [r3, #28]
  15778. if (res == FR_OK && ofs % SS(fs)) { /* Fill sector buffer if not on the sector boundary */
  15779. 800676e: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15780. 8006772: 2b00 cmp r3, #0
  15781. 8006774: d131 bne.n 80067da <f_open+0x37e>
  15782. 8006776: 697b ldr r3, [r7, #20]
  15783. 8006778: 899b ldrh r3, [r3, #12]
  15784. 800677a: 461a mov r2, r3
  15785. 800677c: 6dfb ldr r3, [r7, #92] ; 0x5c
  15786. 800677e: fbb3 f1f2 udiv r1, r3, r2
  15787. 8006782: fb02 f201 mul.w r2, r2, r1
  15788. 8006786: 1a9b subs r3, r3, r2
  15789. 8006788: 2b00 cmp r3, #0
  15790. 800678a: d026 beq.n 80067da <f_open+0x37e>
  15791. if ((sc = clust2sect(fs, clst)) == 0) {
  15792. 800678c: 697b ldr r3, [r7, #20]
  15793. 800678e: 6e39 ldr r1, [r7, #96] ; 0x60
  15794. 8006790: 4618 mov r0, r3
  15795. 8006792: f7fe f837 bl 8004804 <clust2sect>
  15796. 8006796: 64f8 str r0, [r7, #76] ; 0x4c
  15797. 8006798: 6cfb ldr r3, [r7, #76] ; 0x4c
  15798. 800679a: 2b00 cmp r3, #0
  15799. 800679c: d103 bne.n 80067a6 <f_open+0x34a>
  15800. res = FR_INT_ERR;
  15801. 800679e: 2302 movs r3, #2
  15802. 80067a0: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15803. 80067a4: e019 b.n 80067da <f_open+0x37e>
  15804. } else {
  15805. fp->sect = sc + (DWORD)(ofs / SS(fs));
  15806. 80067a6: 697b ldr r3, [r7, #20]
  15807. 80067a8: 899b ldrh r3, [r3, #12]
  15808. 80067aa: 461a mov r2, r3
  15809. 80067ac: 6dfb ldr r3, [r7, #92] ; 0x5c
  15810. 80067ae: fbb3 f2f2 udiv r2, r3, r2
  15811. 80067b2: 6cfb ldr r3, [r7, #76] ; 0x4c
  15812. 80067b4: 441a add r2, r3
  15813. 80067b6: 68fb ldr r3, [r7, #12]
  15814. 80067b8: 621a str r2, [r3, #32]
  15815. #if !_FS_TINY
  15816. if (disk_read(fs->drv, fp->buf, fp->sect, 1) != RES_OK) res = FR_DISK_ERR;
  15817. 80067ba: 697b ldr r3, [r7, #20]
  15818. 80067bc: 7858 ldrb r0, [r3, #1]
  15819. 80067be: 68fb ldr r3, [r7, #12]
  15820. 80067c0: f103 0130 add.w r1, r3, #48 ; 0x30
  15821. 80067c4: 68fb ldr r3, [r7, #12]
  15822. 80067c6: 6a1a ldr r2, [r3, #32]
  15823. 80067c8: 2301 movs r3, #1
  15824. 80067ca: f7fd fc6f bl 80040ac <disk_read>
  15825. 80067ce: 4603 mov r3, r0
  15826. 80067d0: 2b00 cmp r3, #0
  15827. 80067d2: d002 beq.n 80067da <f_open+0x37e>
  15828. 80067d4: 2301 movs r3, #1
  15829. 80067d6: f887 3067 strb.w r3, [r7, #103] ; 0x67
  15830. }
  15831. FREE_NAMBUF();
  15832. }
  15833. if (res != FR_OK) fp->obj.fs = 0; /* Invalidate file object on error */
  15834. 80067da: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15835. 80067de: 2b00 cmp r3, #0
  15836. 80067e0: d002 beq.n 80067e8 <f_open+0x38c>
  15837. 80067e2: 68fb ldr r3, [r7, #12]
  15838. 80067e4: 2200 movs r2, #0
  15839. 80067e6: 601a str r2, [r3, #0]
  15840. LEAVE_FF(fs, res);
  15841. 80067e8: f897 3067 ldrb.w r3, [r7, #103] ; 0x67
  15842. }
  15843. 80067ec: 4618 mov r0, r3
  15844. 80067ee: 3768 adds r7, #104 ; 0x68
  15845. 80067f0: 46bd mov sp, r7
  15846. 80067f2: bd80 pop {r7, pc}
  15847. 080067f4 <f_write>:
  15848. FIL* fp, /* Pointer to the file object */
  15849. const void* buff, /* Pointer to the data to be written */
  15850. UINT btw, /* Number of bytes to write */
  15851. UINT* bw /* Pointer to number of bytes written */
  15852. )
  15853. {
  15854. 80067f4: b580 push {r7, lr}
  15855. 80067f6: b08c sub sp, #48 ; 0x30
  15856. 80067f8: af00 add r7, sp, #0
  15857. 80067fa: 60f8 str r0, [r7, #12]
  15858. 80067fc: 60b9 str r1, [r7, #8]
  15859. 80067fe: 607a str r2, [r7, #4]
  15860. 8006800: 603b str r3, [r7, #0]
  15861. FRESULT res;
  15862. FATFS *fs;
  15863. DWORD clst, sect;
  15864. UINT wcnt, cc, csect;
  15865. const BYTE *wbuff = (const BYTE*)buff;
  15866. 8006802: 68bb ldr r3, [r7, #8]
  15867. 8006804: 61fb str r3, [r7, #28]
  15868. *bw = 0; /* Clear write byte counter */
  15869. 8006806: 683b ldr r3, [r7, #0]
  15870. 8006808: 2200 movs r2, #0
  15871. 800680a: 601a str r2, [r3, #0]
  15872. res = validate(&fp->obj, &fs); /* Check validity of the file object */
  15873. 800680c: 68fb ldr r3, [r7, #12]
  15874. 800680e: f107 0210 add.w r2, r7, #16
  15875. 8006812: 4611 mov r1, r2
  15876. 8006814: 4618 mov r0, r3
  15877. 8006816: f7ff fda5 bl 8006364 <validate>
  15878. 800681a: 4603 mov r3, r0
  15879. 800681c: f887 302f strb.w r3, [r7, #47] ; 0x2f
  15880. if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */
  15881. 8006820: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  15882. 8006824: 2b00 cmp r3, #0
  15883. 8006826: d107 bne.n 8006838 <f_write+0x44>
  15884. 8006828: 68fb ldr r3, [r7, #12]
  15885. 800682a: 7d5b ldrb r3, [r3, #21]
  15886. 800682c: f887 302f strb.w r3, [r7, #47] ; 0x2f
  15887. 8006830: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  15888. 8006834: 2b00 cmp r3, #0
  15889. 8006836: d002 beq.n 800683e <f_write+0x4a>
  15890. 8006838: f897 302f ldrb.w r3, [r7, #47] ; 0x2f
  15891. 800683c: e16a b.n 8006b14 <f_write+0x320>
  15892. if (!(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */
  15893. 800683e: 68fb ldr r3, [r7, #12]
  15894. 8006840: 7d1b ldrb r3, [r3, #20]
  15895. 8006842: f003 0302 and.w r3, r3, #2
  15896. 8006846: 2b00 cmp r3, #0
  15897. 8006848: d101 bne.n 800684e <f_write+0x5a>
  15898. 800684a: 2307 movs r3, #7
  15899. 800684c: e162 b.n 8006b14 <f_write+0x320>
  15900. /* Check fptr wrap-around (file size cannot reach 4GiB on FATxx) */
  15901. if ((!_FS_EXFAT || fs->fs_type != FS_EXFAT) && (DWORD)(fp->fptr + btw) < (DWORD)fp->fptr) {
  15902. 800684e: 68fb ldr r3, [r7, #12]
  15903. 8006850: 699a ldr r2, [r3, #24]
  15904. 8006852: 687b ldr r3, [r7, #4]
  15905. 8006854: 441a add r2, r3
  15906. 8006856: 68fb ldr r3, [r7, #12]
  15907. 8006858: 699b ldr r3, [r3, #24]
  15908. 800685a: 429a cmp r2, r3
  15909. 800685c: f080 814c bcs.w 8006af8 <f_write+0x304>
  15910. btw = (UINT)(0xFFFFFFFF - (DWORD)fp->fptr);
  15911. 8006860: 68fb ldr r3, [r7, #12]
  15912. 8006862: 699b ldr r3, [r3, #24]
  15913. 8006864: 43db mvns r3, r3
  15914. 8006866: 607b str r3, [r7, #4]
  15915. }
  15916. for ( ; btw; /* Repeat until all data written */
  15917. 8006868: e146 b.n 8006af8 <f_write+0x304>
  15918. wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) {
  15919. if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
  15920. 800686a: 68fb ldr r3, [r7, #12]
  15921. 800686c: 699b ldr r3, [r3, #24]
  15922. 800686e: 693a ldr r2, [r7, #16]
  15923. 8006870: 8992 ldrh r2, [r2, #12]
  15924. 8006872: fbb3 f1f2 udiv r1, r3, r2
  15925. 8006876: fb02 f201 mul.w r2, r2, r1
  15926. 800687a: 1a9b subs r3, r3, r2
  15927. 800687c: 2b00 cmp r3, #0
  15928. 800687e: f040 80f1 bne.w 8006a64 <f_write+0x270>
  15929. csect = (UINT)(fp->fptr / SS(fs)) & (fs->csize - 1); /* Sector offset in the cluster */
  15930. 8006882: 68fb ldr r3, [r7, #12]
  15931. 8006884: 699b ldr r3, [r3, #24]
  15932. 8006886: 693a ldr r2, [r7, #16]
  15933. 8006888: 8992 ldrh r2, [r2, #12]
  15934. 800688a: fbb3 f3f2 udiv r3, r3, r2
  15935. 800688e: 693a ldr r2, [r7, #16]
  15936. 8006890: 8952 ldrh r2, [r2, #10]
  15937. 8006892: 3a01 subs r2, #1
  15938. 8006894: 4013 ands r3, r2
  15939. 8006896: 61bb str r3, [r7, #24]
  15940. if (csect == 0) { /* On the cluster boundary? */
  15941. 8006898: 69bb ldr r3, [r7, #24]
  15942. 800689a: 2b00 cmp r3, #0
  15943. 800689c: d143 bne.n 8006926 <f_write+0x132>
  15944. if (fp->fptr == 0) { /* On the top of the file? */
  15945. 800689e: 68fb ldr r3, [r7, #12]
  15946. 80068a0: 699b ldr r3, [r3, #24]
  15947. 80068a2: 2b00 cmp r3, #0
  15948. 80068a4: d10c bne.n 80068c0 <f_write+0xcc>
  15949. clst = fp->obj.sclust; /* Follow from the origin */
  15950. 80068a6: 68fb ldr r3, [r7, #12]
  15951. 80068a8: 689b ldr r3, [r3, #8]
  15952. 80068aa: 62bb str r3, [r7, #40] ; 0x28
  15953. if (clst == 0) { /* If no cluster is allocated, */
  15954. 80068ac: 6abb ldr r3, [r7, #40] ; 0x28
  15955. 80068ae: 2b00 cmp r3, #0
  15956. 80068b0: d11a bne.n 80068e8 <f_write+0xf4>
  15957. clst = create_chain(&fp->obj, 0); /* create a new cluster chain */
  15958. 80068b2: 68fb ldr r3, [r7, #12]
  15959. 80068b4: 2100 movs r1, #0
  15960. 80068b6: 4618 mov r0, r3
  15961. 80068b8: f7fe fa0f bl 8004cda <create_chain>
  15962. 80068bc: 62b8 str r0, [r7, #40] ; 0x28
  15963. 80068be: e013 b.n 80068e8 <f_write+0xf4>
  15964. }
  15965. } else { /* On the middle or end of the file */
  15966. #if _USE_FASTSEEK
  15967. if (fp->cltbl) {
  15968. 80068c0: 68fb ldr r3, [r7, #12]
  15969. 80068c2: 6adb ldr r3, [r3, #44] ; 0x2c
  15970. 80068c4: 2b00 cmp r3, #0
  15971. 80068c6: d007 beq.n 80068d8 <f_write+0xe4>
  15972. clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
  15973. 80068c8: 68fb ldr r3, [r7, #12]
  15974. 80068ca: 699b ldr r3, [r3, #24]
  15975. 80068cc: 4619 mov r1, r3
  15976. 80068ce: 68f8 ldr r0, [r7, #12]
  15977. 80068d0: f7fe fa9b bl 8004e0a <clmt_clust>
  15978. 80068d4: 62b8 str r0, [r7, #40] ; 0x28
  15979. 80068d6: e007 b.n 80068e8 <f_write+0xf4>
  15980. } else
  15981. #endif
  15982. {
  15983. clst = create_chain(&fp->obj, fp->clust); /* Follow or stretch cluster chain on the FAT */
  15984. 80068d8: 68fa ldr r2, [r7, #12]
  15985. 80068da: 68fb ldr r3, [r7, #12]
  15986. 80068dc: 69db ldr r3, [r3, #28]
  15987. 80068de: 4619 mov r1, r3
  15988. 80068e0: 4610 mov r0, r2
  15989. 80068e2: f7fe f9fa bl 8004cda <create_chain>
  15990. 80068e6: 62b8 str r0, [r7, #40] ; 0x28
  15991. }
  15992. }
  15993. if (clst == 0) break; /* Could not allocate a new cluster (disk full) */
  15994. 80068e8: 6abb ldr r3, [r7, #40] ; 0x28
  15995. 80068ea: 2b00 cmp r3, #0
  15996. 80068ec: f000 8109 beq.w 8006b02 <f_write+0x30e>
  15997. if (clst == 1) ABORT(fs, FR_INT_ERR);
  15998. 80068f0: 6abb ldr r3, [r7, #40] ; 0x28
  15999. 80068f2: 2b01 cmp r3, #1
  16000. 80068f4: d104 bne.n 8006900 <f_write+0x10c>
  16001. 80068f6: 68fb ldr r3, [r7, #12]
  16002. 80068f8: 2202 movs r2, #2
  16003. 80068fa: 755a strb r2, [r3, #21]
  16004. 80068fc: 2302 movs r3, #2
  16005. 80068fe: e109 b.n 8006b14 <f_write+0x320>
  16006. if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
  16007. 8006900: 6abb ldr r3, [r7, #40] ; 0x28
  16008. 8006902: f1b3 3fff cmp.w r3, #4294967295
  16009. 8006906: d104 bne.n 8006912 <f_write+0x11e>
  16010. 8006908: 68fb ldr r3, [r7, #12]
  16011. 800690a: 2201 movs r2, #1
  16012. 800690c: 755a strb r2, [r3, #21]
  16013. 800690e: 2301 movs r3, #1
  16014. 8006910: e100 b.n 8006b14 <f_write+0x320>
  16015. fp->clust = clst; /* Update current cluster */
  16016. 8006912: 68fb ldr r3, [r7, #12]
  16017. 8006914: 6aba ldr r2, [r7, #40] ; 0x28
  16018. 8006916: 61da str r2, [r3, #28]
  16019. if (fp->obj.sclust == 0) fp->obj.sclust = clst; /* Set start cluster if the first write */
  16020. 8006918: 68fb ldr r3, [r7, #12]
  16021. 800691a: 689b ldr r3, [r3, #8]
  16022. 800691c: 2b00 cmp r3, #0
  16023. 800691e: d102 bne.n 8006926 <f_write+0x132>
  16024. 8006920: 68fb ldr r3, [r7, #12]
  16025. 8006922: 6aba ldr r2, [r7, #40] ; 0x28
  16026. 8006924: 609a str r2, [r3, #8]
  16027. }
  16028. #if _FS_TINY
  16029. if (fs->winsect == fp->sect && sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Write-back sector cache */
  16030. #else
  16031. if (fp->flag & FA_DIRTY) { /* Write-back sector cache */
  16032. 8006926: 68fb ldr r3, [r7, #12]
  16033. 8006928: 7d1b ldrb r3, [r3, #20]
  16034. 800692a: b25b sxtb r3, r3
  16035. 800692c: 2b00 cmp r3, #0
  16036. 800692e: da18 bge.n 8006962 <f_write+0x16e>
  16037. if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
  16038. 8006930: 693b ldr r3, [r7, #16]
  16039. 8006932: 7858 ldrb r0, [r3, #1]
  16040. 8006934: 68fb ldr r3, [r7, #12]
  16041. 8006936: f103 0130 add.w r1, r3, #48 ; 0x30
  16042. 800693a: 68fb ldr r3, [r7, #12]
  16043. 800693c: 6a1a ldr r2, [r3, #32]
  16044. 800693e: 2301 movs r3, #1
  16045. 8006940: f7fd fbd4 bl 80040ec <disk_write>
  16046. 8006944: 4603 mov r3, r0
  16047. 8006946: 2b00 cmp r3, #0
  16048. 8006948: d004 beq.n 8006954 <f_write+0x160>
  16049. 800694a: 68fb ldr r3, [r7, #12]
  16050. 800694c: 2201 movs r2, #1
  16051. 800694e: 755a strb r2, [r3, #21]
  16052. 8006950: 2301 movs r3, #1
  16053. 8006952: e0df b.n 8006b14 <f_write+0x320>
  16054. fp->flag &= (BYTE)~FA_DIRTY;
  16055. 8006954: 68fb ldr r3, [r7, #12]
  16056. 8006956: 7d1b ldrb r3, [r3, #20]
  16057. 8006958: f003 037f and.w r3, r3, #127 ; 0x7f
  16058. 800695c: b2da uxtb r2, r3
  16059. 800695e: 68fb ldr r3, [r7, #12]
  16060. 8006960: 751a strb r2, [r3, #20]
  16061. }
  16062. #endif
  16063. sect = clust2sect(fs, fp->clust); /* Get current sector */
  16064. 8006962: 693a ldr r2, [r7, #16]
  16065. 8006964: 68fb ldr r3, [r7, #12]
  16066. 8006966: 69db ldr r3, [r3, #28]
  16067. 8006968: 4619 mov r1, r3
  16068. 800696a: 4610 mov r0, r2
  16069. 800696c: f7fd ff4a bl 8004804 <clust2sect>
  16070. 8006970: 6178 str r0, [r7, #20]
  16071. if (!sect) ABORT(fs, FR_INT_ERR);
  16072. 8006972: 697b ldr r3, [r7, #20]
  16073. 8006974: 2b00 cmp r3, #0
  16074. 8006976: d104 bne.n 8006982 <f_write+0x18e>
  16075. 8006978: 68fb ldr r3, [r7, #12]
  16076. 800697a: 2202 movs r2, #2
  16077. 800697c: 755a strb r2, [r3, #21]
  16078. 800697e: 2302 movs r3, #2
  16079. 8006980: e0c8 b.n 8006b14 <f_write+0x320>
  16080. sect += csect;
  16081. 8006982: 697a ldr r2, [r7, #20]
  16082. 8006984: 69bb ldr r3, [r7, #24]
  16083. 8006986: 4413 add r3, r2
  16084. 8006988: 617b str r3, [r7, #20]
  16085. cc = btw / SS(fs); /* When remaining bytes >= sector size, */
  16086. 800698a: 693b ldr r3, [r7, #16]
  16087. 800698c: 899b ldrh r3, [r3, #12]
  16088. 800698e: 461a mov r2, r3
  16089. 8006990: 687b ldr r3, [r7, #4]
  16090. 8006992: fbb3 f3f2 udiv r3, r3, r2
  16091. 8006996: 623b str r3, [r7, #32]
  16092. if (cc) { /* Write maximum contiguous sectors directly */
  16093. 8006998: 6a3b ldr r3, [r7, #32]
  16094. 800699a: 2b00 cmp r3, #0
  16095. 800699c: d043 beq.n 8006a26 <f_write+0x232>
  16096. if (csect + cc > fs->csize) { /* Clip at cluster boundary */
  16097. 800699e: 69ba ldr r2, [r7, #24]
  16098. 80069a0: 6a3b ldr r3, [r7, #32]
  16099. 80069a2: 4413 add r3, r2
  16100. 80069a4: 693a ldr r2, [r7, #16]
  16101. 80069a6: 8952 ldrh r2, [r2, #10]
  16102. 80069a8: 4293 cmp r3, r2
  16103. 80069aa: d905 bls.n 80069b8 <f_write+0x1c4>
  16104. cc = fs->csize - csect;
  16105. 80069ac: 693b ldr r3, [r7, #16]
  16106. 80069ae: 895b ldrh r3, [r3, #10]
  16107. 80069b0: 461a mov r2, r3
  16108. 80069b2: 69bb ldr r3, [r7, #24]
  16109. 80069b4: 1ad3 subs r3, r2, r3
  16110. 80069b6: 623b str r3, [r7, #32]
  16111. }
  16112. if (disk_write(fs->drv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
  16113. 80069b8: 693b ldr r3, [r7, #16]
  16114. 80069ba: 7858 ldrb r0, [r3, #1]
  16115. 80069bc: 6a3b ldr r3, [r7, #32]
  16116. 80069be: 697a ldr r2, [r7, #20]
  16117. 80069c0: 69f9 ldr r1, [r7, #28]
  16118. 80069c2: f7fd fb93 bl 80040ec <disk_write>
  16119. 80069c6: 4603 mov r3, r0
  16120. 80069c8: 2b00 cmp r3, #0
  16121. 80069ca: d004 beq.n 80069d6 <f_write+0x1e2>
  16122. 80069cc: 68fb ldr r3, [r7, #12]
  16123. 80069ce: 2201 movs r2, #1
  16124. 80069d0: 755a strb r2, [r3, #21]
  16125. 80069d2: 2301 movs r3, #1
  16126. 80069d4: e09e b.n 8006b14 <f_write+0x320>
  16127. if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
  16128. mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs));
  16129. fs->wflag = 0;
  16130. }
  16131. #else
  16132. if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */
  16133. 80069d6: 68fb ldr r3, [r7, #12]
  16134. 80069d8: 6a1a ldr r2, [r3, #32]
  16135. 80069da: 697b ldr r3, [r7, #20]
  16136. 80069dc: 1ad3 subs r3, r2, r3
  16137. 80069de: 6a3a ldr r2, [r7, #32]
  16138. 80069e0: 429a cmp r2, r3
  16139. 80069e2: d918 bls.n 8006a16 <f_write+0x222>
  16140. mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs));
  16141. 80069e4: 68fb ldr r3, [r7, #12]
  16142. 80069e6: f103 0030 add.w r0, r3, #48 ; 0x30
  16143. 80069ea: 68fb ldr r3, [r7, #12]
  16144. 80069ec: 6a1a ldr r2, [r3, #32]
  16145. 80069ee: 697b ldr r3, [r7, #20]
  16146. 80069f0: 1ad3 subs r3, r2, r3
  16147. 80069f2: 693a ldr r2, [r7, #16]
  16148. 80069f4: 8992 ldrh r2, [r2, #12]
  16149. 80069f6: fb02 f303 mul.w r3, r2, r3
  16150. 80069fa: 69fa ldr r2, [r7, #28]
  16151. 80069fc: 18d1 adds r1, r2, r3
  16152. 80069fe: 693b ldr r3, [r7, #16]
  16153. 8006a00: 899b ldrh r3, [r3, #12]
  16154. 8006a02: 461a mov r2, r3
  16155. 8006a04: f7fd fc32 bl 800426c <mem_cpy>
  16156. fp->flag &= (BYTE)~FA_DIRTY;
  16157. 8006a08: 68fb ldr r3, [r7, #12]
  16158. 8006a0a: 7d1b ldrb r3, [r3, #20]
  16159. 8006a0c: f003 037f and.w r3, r3, #127 ; 0x7f
  16160. 8006a10: b2da uxtb r2, r3
  16161. 8006a12: 68fb ldr r3, [r7, #12]
  16162. 8006a14: 751a strb r2, [r3, #20]
  16163. }
  16164. #endif
  16165. #endif
  16166. wcnt = SS(fs) * cc; /* Number of bytes transferred */
  16167. 8006a16: 693b ldr r3, [r7, #16]
  16168. 8006a18: 899b ldrh r3, [r3, #12]
  16169. 8006a1a: 461a mov r2, r3
  16170. 8006a1c: 6a3b ldr r3, [r7, #32]
  16171. 8006a1e: fb02 f303 mul.w r3, r2, r3
  16172. 8006a22: 627b str r3, [r7, #36] ; 0x24
  16173. continue;
  16174. 8006a24: e04b b.n 8006abe <f_write+0x2ca>
  16175. if (fp->fptr >= fp->obj.objsize) { /* Avoid silly cache filling on the growing edge */
  16176. if (sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR);
  16177. fs->winsect = sect;
  16178. }
  16179. #else
  16180. if (fp->sect != sect && /* Fill sector cache with file data */
  16181. 8006a26: 68fb ldr r3, [r7, #12]
  16182. 8006a28: 6a1b ldr r3, [r3, #32]
  16183. 8006a2a: 697a ldr r2, [r7, #20]
  16184. 8006a2c: 429a cmp r2, r3
  16185. 8006a2e: d016 beq.n 8006a5e <f_write+0x26a>
  16186. fp->fptr < fp->obj.objsize &&
  16187. 8006a30: 68fb ldr r3, [r7, #12]
  16188. 8006a32: 699a ldr r2, [r3, #24]
  16189. 8006a34: 68fb ldr r3, [r7, #12]
  16190. 8006a36: 68db ldr r3, [r3, #12]
  16191. if (fp->sect != sect && /* Fill sector cache with file data */
  16192. 8006a38: 429a cmp r2, r3
  16193. 8006a3a: d210 bcs.n 8006a5e <f_write+0x26a>
  16194. disk_read(fs->drv, fp->buf, sect, 1) != RES_OK) {
  16195. 8006a3c: 693b ldr r3, [r7, #16]
  16196. 8006a3e: 7858 ldrb r0, [r3, #1]
  16197. 8006a40: 68fb ldr r3, [r7, #12]
  16198. 8006a42: f103 0130 add.w r1, r3, #48 ; 0x30
  16199. 8006a46: 2301 movs r3, #1
  16200. 8006a48: 697a ldr r2, [r7, #20]
  16201. 8006a4a: f7fd fb2f bl 80040ac <disk_read>
  16202. 8006a4e: 4603 mov r3, r0
  16203. fp->fptr < fp->obj.objsize &&
  16204. 8006a50: 2b00 cmp r3, #0
  16205. 8006a52: d004 beq.n 8006a5e <f_write+0x26a>
  16206. ABORT(fs, FR_DISK_ERR);
  16207. 8006a54: 68fb ldr r3, [r7, #12]
  16208. 8006a56: 2201 movs r2, #1
  16209. 8006a58: 755a strb r2, [r3, #21]
  16210. 8006a5a: 2301 movs r3, #1
  16211. 8006a5c: e05a b.n 8006b14 <f_write+0x320>
  16212. }
  16213. #endif
  16214. fp->sect = sect;
  16215. 8006a5e: 68fb ldr r3, [r7, #12]
  16216. 8006a60: 697a ldr r2, [r7, #20]
  16217. 8006a62: 621a str r2, [r3, #32]
  16218. }
  16219. wcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */
  16220. 8006a64: 693b ldr r3, [r7, #16]
  16221. 8006a66: 899b ldrh r3, [r3, #12]
  16222. 8006a68: 4618 mov r0, r3
  16223. 8006a6a: 68fb ldr r3, [r7, #12]
  16224. 8006a6c: 699b ldr r3, [r3, #24]
  16225. 8006a6e: 693a ldr r2, [r7, #16]
  16226. 8006a70: 8992 ldrh r2, [r2, #12]
  16227. 8006a72: fbb3 f1f2 udiv r1, r3, r2
  16228. 8006a76: fb02 f201 mul.w r2, r2, r1
  16229. 8006a7a: 1a9b subs r3, r3, r2
  16230. 8006a7c: 1ac3 subs r3, r0, r3
  16231. 8006a7e: 627b str r3, [r7, #36] ; 0x24
  16232. if (wcnt > btw) wcnt = btw; /* Clip it by btw if needed */
  16233. 8006a80: 6a7a ldr r2, [r7, #36] ; 0x24
  16234. 8006a82: 687b ldr r3, [r7, #4]
  16235. 8006a84: 429a cmp r2, r3
  16236. 8006a86: d901 bls.n 8006a8c <f_write+0x298>
  16237. 8006a88: 687b ldr r3, [r7, #4]
  16238. 8006a8a: 627b str r3, [r7, #36] ; 0x24
  16239. #if _FS_TINY
  16240. if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
  16241. mem_cpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
  16242. fs->wflag = 1;
  16243. #else
  16244. mem_cpy(fp->buf + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */
  16245. 8006a8c: 68fb ldr r3, [r7, #12]
  16246. 8006a8e: f103 0130 add.w r1, r3, #48 ; 0x30
  16247. 8006a92: 68fb ldr r3, [r7, #12]
  16248. 8006a94: 699b ldr r3, [r3, #24]
  16249. 8006a96: 693a ldr r2, [r7, #16]
  16250. 8006a98: 8992 ldrh r2, [r2, #12]
  16251. 8006a9a: fbb3 f0f2 udiv r0, r3, r2
  16252. 8006a9e: fb02 f200 mul.w r2, r2, r0
  16253. 8006aa2: 1a9b subs r3, r3, r2
  16254. 8006aa4: 440b add r3, r1
  16255. 8006aa6: 6a7a ldr r2, [r7, #36] ; 0x24
  16256. 8006aa8: 69f9 ldr r1, [r7, #28]
  16257. 8006aaa: 4618 mov r0, r3
  16258. 8006aac: f7fd fbde bl 800426c <mem_cpy>
  16259. fp->flag |= FA_DIRTY;
  16260. 8006ab0: 68fb ldr r3, [r7, #12]
  16261. 8006ab2: 7d1b ldrb r3, [r3, #20]
  16262. 8006ab4: f063 037f orn r3, r3, #127 ; 0x7f
  16263. 8006ab8: b2da uxtb r2, r3
  16264. 8006aba: 68fb ldr r3, [r7, #12]
  16265. 8006abc: 751a strb r2, [r3, #20]
  16266. wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) {
  16267. 8006abe: 69fa ldr r2, [r7, #28]
  16268. 8006ac0: 6a7b ldr r3, [r7, #36] ; 0x24
  16269. 8006ac2: 4413 add r3, r2
  16270. 8006ac4: 61fb str r3, [r7, #28]
  16271. 8006ac6: 68fb ldr r3, [r7, #12]
  16272. 8006ac8: 699a ldr r2, [r3, #24]
  16273. 8006aca: 6a7b ldr r3, [r7, #36] ; 0x24
  16274. 8006acc: 441a add r2, r3
  16275. 8006ace: 68fb ldr r3, [r7, #12]
  16276. 8006ad0: 619a str r2, [r3, #24]
  16277. 8006ad2: 68fb ldr r3, [r7, #12]
  16278. 8006ad4: 68da ldr r2, [r3, #12]
  16279. 8006ad6: 68fb ldr r3, [r7, #12]
  16280. 8006ad8: 699b ldr r3, [r3, #24]
  16281. 8006ada: 429a cmp r2, r3
  16282. 8006adc: bf38 it cc
  16283. 8006ade: 461a movcc r2, r3
  16284. 8006ae0: 68fb ldr r3, [r7, #12]
  16285. 8006ae2: 60da str r2, [r3, #12]
  16286. 8006ae4: 683b ldr r3, [r7, #0]
  16287. 8006ae6: 681a ldr r2, [r3, #0]
  16288. 8006ae8: 6a7b ldr r3, [r7, #36] ; 0x24
  16289. 8006aea: 441a add r2, r3
  16290. 8006aec: 683b ldr r3, [r7, #0]
  16291. 8006aee: 601a str r2, [r3, #0]
  16292. 8006af0: 687a ldr r2, [r7, #4]
  16293. 8006af2: 6a7b ldr r3, [r7, #36] ; 0x24
  16294. 8006af4: 1ad3 subs r3, r2, r3
  16295. 8006af6: 607b str r3, [r7, #4]
  16296. for ( ; btw; /* Repeat until all data written */
  16297. 8006af8: 687b ldr r3, [r7, #4]
  16298. 8006afa: 2b00 cmp r3, #0
  16299. 8006afc: f47f aeb5 bne.w 800686a <f_write+0x76>
  16300. 8006b00: e000 b.n 8006b04 <f_write+0x310>
  16301. if (clst == 0) break; /* Could not allocate a new cluster (disk full) */
  16302. 8006b02: bf00 nop
  16303. #endif
  16304. }
  16305. fp->flag |= FA_MODIFIED; /* Set file change flag */
  16306. 8006b04: 68fb ldr r3, [r7, #12]
  16307. 8006b06: 7d1b ldrb r3, [r3, #20]
  16308. 8006b08: f043 0340 orr.w r3, r3, #64 ; 0x40
  16309. 8006b0c: b2da uxtb r2, r3
  16310. 8006b0e: 68fb ldr r3, [r7, #12]
  16311. 8006b10: 751a strb r2, [r3, #20]
  16312. LEAVE_FF(fs, FR_OK);
  16313. 8006b12: 2300 movs r3, #0
  16314. }
  16315. 8006b14: 4618 mov r0, r3
  16316. 8006b16: 3730 adds r7, #48 ; 0x30
  16317. 8006b18: 46bd mov sp, r7
  16318. 8006b1a: bd80 pop {r7, pc}
  16319. 08006b1c <f_sync>:
  16320. /*-----------------------------------------------------------------------*/
  16321. FRESULT f_sync (
  16322. FIL* fp /* Pointer to the file object */
  16323. )
  16324. {
  16325. 8006b1c: b580 push {r7, lr}
  16326. 8006b1e: b086 sub sp, #24
  16327. 8006b20: af00 add r7, sp, #0
  16328. 8006b22: 6078 str r0, [r7, #4]
  16329. #if _FS_EXFAT
  16330. DIR dj;
  16331. DEF_NAMBUF
  16332. #endif
  16333. res = validate(&fp->obj, &fs); /* Check validity of the file object */
  16334. 8006b24: 687b ldr r3, [r7, #4]
  16335. 8006b26: f107 0208 add.w r2, r7, #8
  16336. 8006b2a: 4611 mov r1, r2
  16337. 8006b2c: 4618 mov r0, r3
  16338. 8006b2e: f7ff fc19 bl 8006364 <validate>
  16339. 8006b32: 4603 mov r3, r0
  16340. 8006b34: 75fb strb r3, [r7, #23]
  16341. if (res == FR_OK) {
  16342. 8006b36: 7dfb ldrb r3, [r7, #23]
  16343. 8006b38: 2b00 cmp r3, #0
  16344. 8006b3a: d168 bne.n 8006c0e <f_sync+0xf2>
  16345. if (fp->flag & FA_MODIFIED) { /* Is there any change to the file? */
  16346. 8006b3c: 687b ldr r3, [r7, #4]
  16347. 8006b3e: 7d1b ldrb r3, [r3, #20]
  16348. 8006b40: f003 0340 and.w r3, r3, #64 ; 0x40
  16349. 8006b44: 2b00 cmp r3, #0
  16350. 8006b46: d062 beq.n 8006c0e <f_sync+0xf2>
  16351. #if !_FS_TINY
  16352. if (fp->flag & FA_DIRTY) { /* Write-back cached data if needed */
  16353. 8006b48: 687b ldr r3, [r7, #4]
  16354. 8006b4a: 7d1b ldrb r3, [r3, #20]
  16355. 8006b4c: b25b sxtb r3, r3
  16356. 8006b4e: 2b00 cmp r3, #0
  16357. 8006b50: da15 bge.n 8006b7e <f_sync+0x62>
  16358. if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR);
  16359. 8006b52: 68bb ldr r3, [r7, #8]
  16360. 8006b54: 7858 ldrb r0, [r3, #1]
  16361. 8006b56: 687b ldr r3, [r7, #4]
  16362. 8006b58: f103 0130 add.w r1, r3, #48 ; 0x30
  16363. 8006b5c: 687b ldr r3, [r7, #4]
  16364. 8006b5e: 6a1a ldr r2, [r3, #32]
  16365. 8006b60: 2301 movs r3, #1
  16366. 8006b62: f7fd fac3 bl 80040ec <disk_write>
  16367. 8006b66: 4603 mov r3, r0
  16368. 8006b68: 2b00 cmp r3, #0
  16369. 8006b6a: d001 beq.n 8006b70 <f_sync+0x54>
  16370. 8006b6c: 2301 movs r3, #1
  16371. 8006b6e: e04f b.n 8006c10 <f_sync+0xf4>
  16372. fp->flag &= (BYTE)~FA_DIRTY;
  16373. 8006b70: 687b ldr r3, [r7, #4]
  16374. 8006b72: 7d1b ldrb r3, [r3, #20]
  16375. 8006b74: f003 037f and.w r3, r3, #127 ; 0x7f
  16376. 8006b78: b2da uxtb r2, r3
  16377. 8006b7a: 687b ldr r3, [r7, #4]
  16378. 8006b7c: 751a strb r2, [r3, #20]
  16379. }
  16380. #endif
  16381. /* Update the directory entry */
  16382. tm = GET_FATTIME(); /* Modified time */
  16383. 8006b7e: f7fd f9f7 bl 8003f70 <get_fattime>
  16384. 8006b82: 6138 str r0, [r7, #16]
  16385. FREE_NAMBUF();
  16386. }
  16387. } else
  16388. #endif
  16389. {
  16390. res = move_window(fs, fp->dir_sect);
  16391. 8006b84: 68ba ldr r2, [r7, #8]
  16392. 8006b86: 687b ldr r3, [r7, #4]
  16393. 8006b88: 6a5b ldr r3, [r3, #36] ; 0x24
  16394. 8006b8a: 4619 mov r1, r3
  16395. 8006b8c: 4610 mov r0, r2
  16396. 8006b8e: f7fd fd9b bl 80046c8 <move_window>
  16397. 8006b92: 4603 mov r3, r0
  16398. 8006b94: 75fb strb r3, [r7, #23]
  16399. if (res == FR_OK) {
  16400. 8006b96: 7dfb ldrb r3, [r7, #23]
  16401. 8006b98: 2b00 cmp r3, #0
  16402. 8006b9a: d138 bne.n 8006c0e <f_sync+0xf2>
  16403. dir = fp->dir_ptr;
  16404. 8006b9c: 687b ldr r3, [r7, #4]
  16405. 8006b9e: 6a9b ldr r3, [r3, #40] ; 0x28
  16406. 8006ba0: 60fb str r3, [r7, #12]
  16407. dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
  16408. 8006ba2: 68fb ldr r3, [r7, #12]
  16409. 8006ba4: 330b adds r3, #11
  16410. 8006ba6: 781a ldrb r2, [r3, #0]
  16411. 8006ba8: 68fb ldr r3, [r7, #12]
  16412. 8006baa: 330b adds r3, #11
  16413. 8006bac: f042 0220 orr.w r2, r2, #32
  16414. 8006bb0: b2d2 uxtb r2, r2
  16415. 8006bb2: 701a strb r2, [r3, #0]
  16416. st_clust(fp->obj.fs, dir, fp->obj.sclust); /* Update file allocation info */
  16417. 8006bb4: 687b ldr r3, [r7, #4]
  16418. 8006bb6: 6818 ldr r0, [r3, #0]
  16419. 8006bb8: 687b ldr r3, [r7, #4]
  16420. 8006bba: 689b ldr r3, [r3, #8]
  16421. 8006bbc: 461a mov r2, r3
  16422. 8006bbe: 68f9 ldr r1, [r7, #12]
  16423. 8006bc0: f7fe fb20 bl 8005204 <st_clust>
  16424. st_dword(dir + DIR_FileSize, (DWORD)fp->obj.objsize); /* Update file size */
  16425. 8006bc4: 68fb ldr r3, [r7, #12]
  16426. 8006bc6: f103 021c add.w r2, r3, #28
  16427. 8006bca: 687b ldr r3, [r7, #4]
  16428. 8006bcc: 68db ldr r3, [r3, #12]
  16429. 8006bce: 4619 mov r1, r3
  16430. 8006bd0: 4610 mov r0, r2
  16431. 8006bd2: f7fd fb1f bl 8004214 <st_dword>
  16432. st_dword(dir + DIR_ModTime, tm); /* Update modified time */
  16433. 8006bd6: 68fb ldr r3, [r7, #12]
  16434. 8006bd8: 3316 adds r3, #22
  16435. 8006bda: 6939 ldr r1, [r7, #16]
  16436. 8006bdc: 4618 mov r0, r3
  16437. 8006bde: f7fd fb19 bl 8004214 <st_dword>
  16438. st_word(dir + DIR_LstAccDate, 0);
  16439. 8006be2: 68fb ldr r3, [r7, #12]
  16440. 8006be4: 3312 adds r3, #18
  16441. 8006be6: 2100 movs r1, #0
  16442. 8006be8: 4618 mov r0, r3
  16443. 8006bea: f7fd faf8 bl 80041de <st_word>
  16444. fs->wflag = 1;
  16445. 8006bee: 68bb ldr r3, [r7, #8]
  16446. 8006bf0: 2201 movs r2, #1
  16447. 8006bf2: 70da strb r2, [r3, #3]
  16448. res = sync_fs(fs); /* Restore it to the directory */
  16449. 8006bf4: 68bb ldr r3, [r7, #8]
  16450. 8006bf6: 4618 mov r0, r3
  16451. 8006bf8: f7fd fd94 bl 8004724 <sync_fs>
  16452. 8006bfc: 4603 mov r3, r0
  16453. 8006bfe: 75fb strb r3, [r7, #23]
  16454. fp->flag &= (BYTE)~FA_MODIFIED;
  16455. 8006c00: 687b ldr r3, [r7, #4]
  16456. 8006c02: 7d1b ldrb r3, [r3, #20]
  16457. 8006c04: f023 0340 bic.w r3, r3, #64 ; 0x40
  16458. 8006c08: b2da uxtb r2, r3
  16459. 8006c0a: 687b ldr r3, [r7, #4]
  16460. 8006c0c: 751a strb r2, [r3, #20]
  16461. }
  16462. }
  16463. }
  16464. }
  16465. LEAVE_FF(fs, res);
  16466. 8006c0e: 7dfb ldrb r3, [r7, #23]
  16467. }
  16468. 8006c10: 4618 mov r0, r3
  16469. 8006c12: 3718 adds r7, #24
  16470. 8006c14: 46bd mov sp, r7
  16471. 8006c16: bd80 pop {r7, pc}
  16472. 08006c18 <f_close>:
  16473. /*-----------------------------------------------------------------------*/
  16474. FRESULT f_close (
  16475. FIL* fp /* Pointer to the file object to be closed */
  16476. )
  16477. {
  16478. 8006c18: b580 push {r7, lr}
  16479. 8006c1a: b084 sub sp, #16
  16480. 8006c1c: af00 add r7, sp, #0
  16481. 8006c1e: 6078 str r0, [r7, #4]
  16482. FRESULT res;
  16483. FATFS *fs;
  16484. #if !_FS_READONLY
  16485. res = f_sync(fp); /* Flush cached data */
  16486. 8006c20: 6878 ldr r0, [r7, #4]
  16487. 8006c22: f7ff ff7b bl 8006b1c <f_sync>
  16488. 8006c26: 4603 mov r3, r0
  16489. 8006c28: 73fb strb r3, [r7, #15]
  16490. if (res == FR_OK)
  16491. 8006c2a: 7bfb ldrb r3, [r7, #15]
  16492. 8006c2c: 2b00 cmp r3, #0
  16493. 8006c2e: d118 bne.n 8006c62 <f_close+0x4a>
  16494. #endif
  16495. {
  16496. res = validate(&fp->obj, &fs); /* Lock volume */
  16497. 8006c30: 687b ldr r3, [r7, #4]
  16498. 8006c32: f107 0208 add.w r2, r7, #8
  16499. 8006c36: 4611 mov r1, r2
  16500. 8006c38: 4618 mov r0, r3
  16501. 8006c3a: f7ff fb93 bl 8006364 <validate>
  16502. 8006c3e: 4603 mov r3, r0
  16503. 8006c40: 73fb strb r3, [r7, #15]
  16504. if (res == FR_OK) {
  16505. 8006c42: 7bfb ldrb r3, [r7, #15]
  16506. 8006c44: 2b00 cmp r3, #0
  16507. 8006c46: d10c bne.n 8006c62 <f_close+0x4a>
  16508. #if _FS_LOCK != 0
  16509. res = dec_lock(fp->obj.lockid); /* Decrement file open counter */
  16510. 8006c48: 687b ldr r3, [r7, #4]
  16511. 8006c4a: 691b ldr r3, [r3, #16]
  16512. 8006c4c: 4618 mov r0, r3
  16513. 8006c4e: f7fd fc97 bl 8004580 <dec_lock>
  16514. 8006c52: 4603 mov r3, r0
  16515. 8006c54: 73fb strb r3, [r7, #15]
  16516. if (res == FR_OK)
  16517. 8006c56: 7bfb ldrb r3, [r7, #15]
  16518. 8006c58: 2b00 cmp r3, #0
  16519. 8006c5a: d102 bne.n 8006c62 <f_close+0x4a>
  16520. #endif
  16521. {
  16522. fp->obj.fs = 0; /* Invalidate file object */
  16523. 8006c5c: 687b ldr r3, [r7, #4]
  16524. 8006c5e: 2200 movs r2, #0
  16525. 8006c60: 601a str r2, [r3, #0]
  16526. #if _FS_REENTRANT
  16527. unlock_fs(fs, FR_OK); /* Unlock volume */
  16528. #endif
  16529. }
  16530. }
  16531. return res;
  16532. 8006c62: 7bfb ldrb r3, [r7, #15]
  16533. }
  16534. 8006c64: 4618 mov r0, r3
  16535. 8006c66: 3710 adds r7, #16
  16536. 8006c68: 46bd mov sp, r7
  16537. 8006c6a: bd80 pop {r7, pc}
  16538. 08006c6c <putc_bfd>:
  16539. static
  16540. void putc_bfd ( /* Buffered write with code conversion */
  16541. putbuff* pb,
  16542. TCHAR c
  16543. )
  16544. {
  16545. 8006c6c: b580 push {r7, lr}
  16546. 8006c6e: b084 sub sp, #16
  16547. 8006c70: af00 add r7, sp, #0
  16548. 8006c72: 6078 str r0, [r7, #4]
  16549. 8006c74: 460b mov r3, r1
  16550. 8006c76: 70fb strb r3, [r7, #3]
  16551. UINT bw;
  16552. int i;
  16553. if (_USE_STRFUNC == 2 && c == '\n') { /* LF -> CRLF conversion */
  16554. 8006c78: 78fb ldrb r3, [r7, #3]
  16555. 8006c7a: 2b0a cmp r3, #10
  16556. 8006c7c: d103 bne.n 8006c86 <putc_bfd+0x1a>
  16557. putc_bfd(pb, '\r');
  16558. 8006c7e: 210d movs r1, #13
  16559. 8006c80: 6878 ldr r0, [r7, #4]
  16560. 8006c82: f7ff fff3 bl 8006c6c <putc_bfd>
  16561. }
  16562. i = pb->idx; /* Write index of pb->buf[] */
  16563. 8006c86: 687b ldr r3, [r7, #4]
  16564. 8006c88: 685b ldr r3, [r3, #4]
  16565. 8006c8a: 60fb str r3, [r7, #12]
  16566. if (i < 0) return;
  16567. 8006c8c: 68fb ldr r3, [r7, #12]
  16568. 8006c8e: 2b00 cmp r3, #0
  16569. 8006c90: db25 blt.n 8006cde <putc_bfd+0x72>
  16570. if (c >= 0x100)
  16571. pb->buf[i++] = (BYTE)(c >> 8);
  16572. pb->buf[i++] = (BYTE)c;
  16573. #endif
  16574. #else /* Write a character without conversion */
  16575. pb->buf[i++] = (BYTE)c;
  16576. 8006c92: 68fb ldr r3, [r7, #12]
  16577. 8006c94: 1c5a adds r2, r3, #1
  16578. 8006c96: 60fa str r2, [r7, #12]
  16579. 8006c98: 687a ldr r2, [r7, #4]
  16580. 8006c9a: 4413 add r3, r2
  16581. 8006c9c: 78fa ldrb r2, [r7, #3]
  16582. 8006c9e: 731a strb r2, [r3, #12]
  16583. #endif
  16584. if (i >= (int)(sizeof pb->buf) - 3) { /* Write buffered characters to the file */
  16585. 8006ca0: 68fb ldr r3, [r7, #12]
  16586. 8006ca2: 2b3c cmp r3, #60 ; 0x3c
  16587. 8006ca4: dd12 ble.n 8006ccc <putc_bfd+0x60>
  16588. f_write(pb->fp, pb->buf, (UINT)i, &bw);
  16589. 8006ca6: 687b ldr r3, [r7, #4]
  16590. 8006ca8: 6818 ldr r0, [r3, #0]
  16591. 8006caa: 687b ldr r3, [r7, #4]
  16592. 8006cac: f103 010c add.w r1, r3, #12
  16593. 8006cb0: 68fa ldr r2, [r7, #12]
  16594. 8006cb2: f107 0308 add.w r3, r7, #8
  16595. 8006cb6: f7ff fd9d bl 80067f4 <f_write>
  16596. i = (bw == (UINT)i) ? 0 : -1;
  16597. 8006cba: 68ba ldr r2, [r7, #8]
  16598. 8006cbc: 68fb ldr r3, [r7, #12]
  16599. 8006cbe: 429a cmp r2, r3
  16600. 8006cc0: d101 bne.n 8006cc6 <putc_bfd+0x5a>
  16601. 8006cc2: 2300 movs r3, #0
  16602. 8006cc4: e001 b.n 8006cca <putc_bfd+0x5e>
  16603. 8006cc6: f04f 33ff mov.w r3, #4294967295
  16604. 8006cca: 60fb str r3, [r7, #12]
  16605. }
  16606. pb->idx = i;
  16607. 8006ccc: 687b ldr r3, [r7, #4]
  16608. 8006cce: 68fa ldr r2, [r7, #12]
  16609. 8006cd0: 605a str r2, [r3, #4]
  16610. pb->nchr++;
  16611. 8006cd2: 687b ldr r3, [r7, #4]
  16612. 8006cd4: 689b ldr r3, [r3, #8]
  16613. 8006cd6: 1c5a adds r2, r3, #1
  16614. 8006cd8: 687b ldr r3, [r7, #4]
  16615. 8006cda: 609a str r2, [r3, #8]
  16616. 8006cdc: e000 b.n 8006ce0 <putc_bfd+0x74>
  16617. if (i < 0) return;
  16618. 8006cde: bf00 nop
  16619. }
  16620. 8006ce0: 3710 adds r7, #16
  16621. 8006ce2: 46bd mov sp, r7
  16622. 8006ce4: bd80 pop {r7, pc}
  16623. 08006ce6 <putc_flush>:
  16624. static
  16625. int putc_flush ( /* Flush left characters in the buffer */
  16626. putbuff* pb
  16627. )
  16628. {
  16629. 8006ce6: b580 push {r7, lr}
  16630. 8006ce8: b084 sub sp, #16
  16631. 8006cea: af00 add r7, sp, #0
  16632. 8006cec: 6078 str r0, [r7, #4]
  16633. UINT nw;
  16634. if ( pb->idx >= 0 /* Flush buffered characters to the file */
  16635. 8006cee: 687b ldr r3, [r7, #4]
  16636. 8006cf0: 685b ldr r3, [r3, #4]
  16637. 8006cf2: 2b00 cmp r3, #0
  16638. 8006cf4: db17 blt.n 8006d26 <putc_flush+0x40>
  16639. && f_write(pb->fp, pb->buf, (UINT)pb->idx, &nw) == FR_OK
  16640. 8006cf6: 687b ldr r3, [r7, #4]
  16641. 8006cf8: 6818 ldr r0, [r3, #0]
  16642. 8006cfa: 687b ldr r3, [r7, #4]
  16643. 8006cfc: f103 010c add.w r1, r3, #12
  16644. 8006d00: 687b ldr r3, [r7, #4]
  16645. 8006d02: 685b ldr r3, [r3, #4]
  16646. 8006d04: 461a mov r2, r3
  16647. 8006d06: f107 030c add.w r3, r7, #12
  16648. 8006d0a: f7ff fd73 bl 80067f4 <f_write>
  16649. 8006d0e: 4603 mov r3, r0
  16650. 8006d10: 2b00 cmp r3, #0
  16651. 8006d12: d108 bne.n 8006d26 <putc_flush+0x40>
  16652. && (UINT)pb->idx == nw) return pb->nchr;
  16653. 8006d14: 687b ldr r3, [r7, #4]
  16654. 8006d16: 685b ldr r3, [r3, #4]
  16655. 8006d18: 461a mov r2, r3
  16656. 8006d1a: 68fb ldr r3, [r7, #12]
  16657. 8006d1c: 429a cmp r2, r3
  16658. 8006d1e: d102 bne.n 8006d26 <putc_flush+0x40>
  16659. 8006d20: 687b ldr r3, [r7, #4]
  16660. 8006d22: 689b ldr r3, [r3, #8]
  16661. 8006d24: e001 b.n 8006d2a <putc_flush+0x44>
  16662. return EOF;
  16663. 8006d26: f04f 33ff mov.w r3, #4294967295
  16664. }
  16665. 8006d2a: 4618 mov r0, r3
  16666. 8006d2c: 3710 adds r7, #16
  16667. 8006d2e: 46bd mov sp, r7
  16668. 8006d30: bd80 pop {r7, pc}
  16669. 08006d32 <putc_init>:
  16670. static
  16671. void putc_init ( /* Initialize write buffer */
  16672. putbuff* pb,
  16673. FIL* fp
  16674. )
  16675. {
  16676. 8006d32: b480 push {r7}
  16677. 8006d34: b083 sub sp, #12
  16678. 8006d36: af00 add r7, sp, #0
  16679. 8006d38: 6078 str r0, [r7, #4]
  16680. 8006d3a: 6039 str r1, [r7, #0]
  16681. pb->fp = fp;
  16682. 8006d3c: 687b ldr r3, [r7, #4]
  16683. 8006d3e: 683a ldr r2, [r7, #0]
  16684. 8006d40: 601a str r2, [r3, #0]
  16685. pb->nchr = pb->idx = 0;
  16686. 8006d42: 687b ldr r3, [r7, #4]
  16687. 8006d44: 2200 movs r2, #0
  16688. 8006d46: 605a str r2, [r3, #4]
  16689. 8006d48: 687b ldr r3, [r7, #4]
  16690. 8006d4a: 685a ldr r2, [r3, #4]
  16691. 8006d4c: 687b ldr r3, [r7, #4]
  16692. 8006d4e: 609a str r2, [r3, #8]
  16693. }
  16694. 8006d50: bf00 nop
  16695. 8006d52: 370c adds r7, #12
  16696. 8006d54: 46bd mov sp, r7
  16697. 8006d56: f85d 7b04 ldr.w r7, [sp], #4
  16698. 8006d5a: 4770 bx lr
  16699. 08006d5c <f_puts>:
  16700. int f_puts (
  16701. const TCHAR* str, /* Pointer to the string to be output */
  16702. FIL* fp /* Pointer to the file object */
  16703. )
  16704. {
  16705. 8006d5c: b580 push {r7, lr}
  16706. 8006d5e: b096 sub sp, #88 ; 0x58
  16707. 8006d60: af00 add r7, sp, #0
  16708. 8006d62: 6078 str r0, [r7, #4]
  16709. 8006d64: 6039 str r1, [r7, #0]
  16710. putbuff pb;
  16711. putc_init(&pb, fp);
  16712. 8006d66: f107 030c add.w r3, r7, #12
  16713. 8006d6a: 6839 ldr r1, [r7, #0]
  16714. 8006d6c: 4618 mov r0, r3
  16715. 8006d6e: f7ff ffe0 bl 8006d32 <putc_init>
  16716. while (*str) putc_bfd(&pb, *str++); /* Put the string */
  16717. 8006d72: e009 b.n 8006d88 <f_puts+0x2c>
  16718. 8006d74: 687b ldr r3, [r7, #4]
  16719. 8006d76: 1c5a adds r2, r3, #1
  16720. 8006d78: 607a str r2, [r7, #4]
  16721. 8006d7a: 781a ldrb r2, [r3, #0]
  16722. 8006d7c: f107 030c add.w r3, r7, #12
  16723. 8006d80: 4611 mov r1, r2
  16724. 8006d82: 4618 mov r0, r3
  16725. 8006d84: f7ff ff72 bl 8006c6c <putc_bfd>
  16726. 8006d88: 687b ldr r3, [r7, #4]
  16727. 8006d8a: 781b ldrb r3, [r3, #0]
  16728. 8006d8c: 2b00 cmp r3, #0
  16729. 8006d8e: d1f1 bne.n 8006d74 <f_puts+0x18>
  16730. return putc_flush(&pb);
  16731. 8006d90: f107 030c add.w r3, r7, #12
  16732. 8006d94: 4618 mov r0, r3
  16733. 8006d96: f7ff ffa6 bl 8006ce6 <putc_flush>
  16734. 8006d9a: 4603 mov r3, r0
  16735. }
  16736. 8006d9c: 4618 mov r0, r3
  16737. 8006d9e: 3758 adds r7, #88 ; 0x58
  16738. 8006da0: 46bd mov sp, r7
  16739. 8006da2: bd80 pop {r7, pc}
  16740. 08006da4 <FATFS_LinkDriverEx>:
  16741. * @param lun : only used for USB Key Disk to add multi-lun management
  16742. else the parameter must be equal to 0
  16743. * @retval Returns 0 in case of success, otherwise 1.
  16744. */
  16745. uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, uint8_t lun)
  16746. {
  16747. 8006da4: b480 push {r7}
  16748. 8006da6: b087 sub sp, #28
  16749. 8006da8: af00 add r7, sp, #0
  16750. 8006daa: 60f8 str r0, [r7, #12]
  16751. 8006dac: 60b9 str r1, [r7, #8]
  16752. 8006dae: 4613 mov r3, r2
  16753. 8006db0: 71fb strb r3, [r7, #7]
  16754. uint8_t ret = 1;
  16755. 8006db2: 2301 movs r3, #1
  16756. 8006db4: 75fb strb r3, [r7, #23]
  16757. uint8_t DiskNum = 0;
  16758. 8006db6: 2300 movs r3, #0
  16759. 8006db8: 75bb strb r3, [r7, #22]
  16760. if(disk.nbr < _VOLUMES)
  16761. 8006dba: 4b1f ldr r3, [pc, #124] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16762. 8006dbc: 7a5b ldrb r3, [r3, #9]
  16763. 8006dbe: b2db uxtb r3, r3
  16764. 8006dc0: 2b00 cmp r3, #0
  16765. 8006dc2: d131 bne.n 8006e28 <FATFS_LinkDriverEx+0x84>
  16766. {
  16767. disk.is_initialized[disk.nbr] = 0;
  16768. 8006dc4: 4b1c ldr r3, [pc, #112] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16769. 8006dc6: 7a5b ldrb r3, [r3, #9]
  16770. 8006dc8: b2db uxtb r3, r3
  16771. 8006dca: 461a mov r2, r3
  16772. 8006dcc: 4b1a ldr r3, [pc, #104] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16773. 8006dce: 2100 movs r1, #0
  16774. 8006dd0: 5499 strb r1, [r3, r2]
  16775. disk.drv[disk.nbr] = drv;
  16776. 8006dd2: 4b19 ldr r3, [pc, #100] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16777. 8006dd4: 7a5b ldrb r3, [r3, #9]
  16778. 8006dd6: b2db uxtb r3, r3
  16779. 8006dd8: 4a17 ldr r2, [pc, #92] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16780. 8006dda: 009b lsls r3, r3, #2
  16781. 8006ddc: 4413 add r3, r2
  16782. 8006dde: 68fa ldr r2, [r7, #12]
  16783. 8006de0: 605a str r2, [r3, #4]
  16784. disk.lun[disk.nbr] = lun;
  16785. 8006de2: 4b15 ldr r3, [pc, #84] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16786. 8006de4: 7a5b ldrb r3, [r3, #9]
  16787. 8006de6: b2db uxtb r3, r3
  16788. 8006de8: 461a mov r2, r3
  16789. 8006dea: 4b13 ldr r3, [pc, #76] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16790. 8006dec: 4413 add r3, r2
  16791. 8006dee: 79fa ldrb r2, [r7, #7]
  16792. 8006df0: 721a strb r2, [r3, #8]
  16793. DiskNum = disk.nbr++;
  16794. 8006df2: 4b11 ldr r3, [pc, #68] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16795. 8006df4: 7a5b ldrb r3, [r3, #9]
  16796. 8006df6: b2db uxtb r3, r3
  16797. 8006df8: 1c5a adds r2, r3, #1
  16798. 8006dfa: b2d1 uxtb r1, r2
  16799. 8006dfc: 4a0e ldr r2, [pc, #56] ; (8006e38 <FATFS_LinkDriverEx+0x94>)
  16800. 8006dfe: 7251 strb r1, [r2, #9]
  16801. 8006e00: 75bb strb r3, [r7, #22]
  16802. path[0] = DiskNum + '0';
  16803. 8006e02: 7dbb ldrb r3, [r7, #22]
  16804. 8006e04: 3330 adds r3, #48 ; 0x30
  16805. 8006e06: b2da uxtb r2, r3
  16806. 8006e08: 68bb ldr r3, [r7, #8]
  16807. 8006e0a: 701a strb r2, [r3, #0]
  16808. path[1] = ':';
  16809. 8006e0c: 68bb ldr r3, [r7, #8]
  16810. 8006e0e: 3301 adds r3, #1
  16811. 8006e10: 223a movs r2, #58 ; 0x3a
  16812. 8006e12: 701a strb r2, [r3, #0]
  16813. path[2] = '/';
  16814. 8006e14: 68bb ldr r3, [r7, #8]
  16815. 8006e16: 3302 adds r3, #2
  16816. 8006e18: 222f movs r2, #47 ; 0x2f
  16817. 8006e1a: 701a strb r2, [r3, #0]
  16818. path[3] = 0;
  16819. 8006e1c: 68bb ldr r3, [r7, #8]
  16820. 8006e1e: 3303 adds r3, #3
  16821. 8006e20: 2200 movs r2, #0
  16822. 8006e22: 701a strb r2, [r3, #0]
  16823. ret = 0;
  16824. 8006e24: 2300 movs r3, #0
  16825. 8006e26: 75fb strb r3, [r7, #23]
  16826. }
  16827. return ret;
  16828. 8006e28: 7dfb ldrb r3, [r7, #23]
  16829. }
  16830. 8006e2a: 4618 mov r0, r3
  16831. 8006e2c: 371c adds r7, #28
  16832. 8006e2e: 46bd mov sp, r7
  16833. 8006e30: f85d 7b04 ldr.w r7, [sp], #4
  16834. 8006e34: 4770 bx lr
  16835. 8006e36: bf00 nop
  16836. 8006e38: 2000026c .word 0x2000026c
  16837. 08006e3c <FATFS_LinkDriver>:
  16838. * @param drv: pointer to the disk IO Driver structure
  16839. * @param path: pointer to the logical drive path
  16840. * @retval Returns 0 in case of success, otherwise 1.
  16841. */
  16842. uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path)
  16843. {
  16844. 8006e3c: b580 push {r7, lr}
  16845. 8006e3e: b082 sub sp, #8
  16846. 8006e40: af00 add r7, sp, #0
  16847. 8006e42: 6078 str r0, [r7, #4]
  16848. 8006e44: 6039 str r1, [r7, #0]
  16849. return FATFS_LinkDriverEx(drv, path, 0);
  16850. 8006e46: 2200 movs r2, #0
  16851. 8006e48: 6839 ldr r1, [r7, #0]
  16852. 8006e4a: 6878 ldr r0, [r7, #4]
  16853. 8006e4c: f7ff ffaa bl 8006da4 <FATFS_LinkDriverEx>
  16854. 8006e50: 4603 mov r3, r0
  16855. }
  16856. 8006e52: 4618 mov r0, r3
  16857. 8006e54: 3708 adds r7, #8
  16858. 8006e56: 46bd mov sp, r7
  16859. 8006e58: bd80 pop {r7, pc}
  16860. ...
  16861. 08006e5c <ff_convert>:
  16862. WCHAR ff_convert ( /* Converted character, Returns zero on error */
  16863. WCHAR chr, /* Character code to be converted */
  16864. UINT dir /* 0: Unicode to OEM code, 1: OEM code to Unicode */
  16865. )
  16866. {
  16867. 8006e5c: b480 push {r7}
  16868. 8006e5e: b085 sub sp, #20
  16869. 8006e60: af00 add r7, sp, #0
  16870. 8006e62: 4603 mov r3, r0
  16871. 8006e64: 6039 str r1, [r7, #0]
  16872. 8006e66: 80fb strh r3, [r7, #6]
  16873. WCHAR c;
  16874. if (chr < 0x80) { /* ASCII */
  16875. 8006e68: 88fb ldrh r3, [r7, #6]
  16876. 8006e6a: 2b7f cmp r3, #127 ; 0x7f
  16877. 8006e6c: d802 bhi.n 8006e74 <ff_convert+0x18>
  16878. c = chr;
  16879. 8006e6e: 88fb ldrh r3, [r7, #6]
  16880. 8006e70: 81fb strh r3, [r7, #14]
  16881. 8006e72: e025 b.n 8006ec0 <ff_convert+0x64>
  16882. } else {
  16883. if (dir) { /* OEM code to Unicode */
  16884. 8006e74: 683b ldr r3, [r7, #0]
  16885. 8006e76: 2b00 cmp r3, #0
  16886. 8006e78: d00b beq.n 8006e92 <ff_convert+0x36>
  16887. c = (chr >= 0x100) ? 0 : Tbl[chr - 0x80];
  16888. 8006e7a: 88fb ldrh r3, [r7, #6]
  16889. 8006e7c: 2bff cmp r3, #255 ; 0xff
  16890. 8006e7e: d805 bhi.n 8006e8c <ff_convert+0x30>
  16891. 8006e80: 88fb ldrh r3, [r7, #6]
  16892. 8006e82: 3b80 subs r3, #128 ; 0x80
  16893. 8006e84: 4a12 ldr r2, [pc, #72] ; (8006ed0 <ff_convert+0x74>)
  16894. 8006e86: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
  16895. 8006e8a: e000 b.n 8006e8e <ff_convert+0x32>
  16896. 8006e8c: 2300 movs r3, #0
  16897. 8006e8e: 81fb strh r3, [r7, #14]
  16898. 8006e90: e016 b.n 8006ec0 <ff_convert+0x64>
  16899. } else { /* Unicode to OEM code */
  16900. for (c = 0; c < 0x80; c++) {
  16901. 8006e92: 2300 movs r3, #0
  16902. 8006e94: 81fb strh r3, [r7, #14]
  16903. 8006e96: e009 b.n 8006eac <ff_convert+0x50>
  16904. if (chr == Tbl[c]) break;
  16905. 8006e98: 89fb ldrh r3, [r7, #14]
  16906. 8006e9a: 4a0d ldr r2, [pc, #52] ; (8006ed0 <ff_convert+0x74>)
  16907. 8006e9c: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
  16908. 8006ea0: 88fa ldrh r2, [r7, #6]
  16909. 8006ea2: 429a cmp r2, r3
  16910. 8006ea4: d006 beq.n 8006eb4 <ff_convert+0x58>
  16911. for (c = 0; c < 0x80; c++) {
  16912. 8006ea6: 89fb ldrh r3, [r7, #14]
  16913. 8006ea8: 3301 adds r3, #1
  16914. 8006eaa: 81fb strh r3, [r7, #14]
  16915. 8006eac: 89fb ldrh r3, [r7, #14]
  16916. 8006eae: 2b7f cmp r3, #127 ; 0x7f
  16917. 8006eb0: d9f2 bls.n 8006e98 <ff_convert+0x3c>
  16918. 8006eb2: e000 b.n 8006eb6 <ff_convert+0x5a>
  16919. if (chr == Tbl[c]) break;
  16920. 8006eb4: bf00 nop
  16921. }
  16922. c = (c + 0x80) & 0xFF;
  16923. 8006eb6: 89fb ldrh r3, [r7, #14]
  16924. 8006eb8: 3380 adds r3, #128 ; 0x80
  16925. 8006eba: b29b uxth r3, r3
  16926. 8006ebc: b2db uxtb r3, r3
  16927. 8006ebe: 81fb strh r3, [r7, #14]
  16928. }
  16929. }
  16930. return c;
  16931. 8006ec0: 89fb ldrh r3, [r7, #14]
  16932. }
  16933. 8006ec2: 4618 mov r0, r3
  16934. 8006ec4: 3714 adds r7, #20
  16935. 8006ec6: 46bd mov sp, r7
  16936. 8006ec8: f85d 7b04 ldr.w r7, [sp], #4
  16937. 8006ecc: 4770 bx lr
  16938. 8006ece: bf00 nop
  16939. 8006ed0: 08007204 .word 0x08007204
  16940. 08006ed4 <ff_wtoupper>:
  16941. WCHAR ff_wtoupper ( /* Returns upper converted character */
  16942. WCHAR chr /* Unicode character to be upper converted (BMP only) */
  16943. )
  16944. {
  16945. 8006ed4: b480 push {r7}
  16946. 8006ed6: b087 sub sp, #28
  16947. 8006ed8: af00 add r7, sp, #0
  16948. 8006eda: 4603 mov r3, r0
  16949. 8006edc: 80fb strh r3, [r7, #6]
  16950. };
  16951. const WCHAR *p;
  16952. WCHAR bc, nc, cmd;
  16953. p = chr < 0x1000 ? cvt1 : cvt2;
  16954. 8006ede: 88fb ldrh r3, [r7, #6]
  16955. 8006ee0: f5b3 5f80 cmp.w r3, #4096 ; 0x1000
  16956. 8006ee4: d201 bcs.n 8006eea <ff_wtoupper+0x16>
  16957. 8006ee6: 4b3e ldr r3, [pc, #248] ; (8006fe0 <ff_wtoupper+0x10c>)
  16958. 8006ee8: e000 b.n 8006eec <ff_wtoupper+0x18>
  16959. 8006eea: 4b3e ldr r3, [pc, #248] ; (8006fe4 <ff_wtoupper+0x110>)
  16960. 8006eec: 617b str r3, [r7, #20]
  16961. for (;;) {
  16962. bc = *p++; /* Get block base */
  16963. 8006eee: 697b ldr r3, [r7, #20]
  16964. 8006ef0: 1c9a adds r2, r3, #2
  16965. 8006ef2: 617a str r2, [r7, #20]
  16966. 8006ef4: 881b ldrh r3, [r3, #0]
  16967. 8006ef6: 827b strh r3, [r7, #18]
  16968. if (!bc || chr < bc) break;
  16969. 8006ef8: 8a7b ldrh r3, [r7, #18]
  16970. 8006efa: 2b00 cmp r3, #0
  16971. 8006efc: d068 beq.n 8006fd0 <ff_wtoupper+0xfc>
  16972. 8006efe: 88fa ldrh r2, [r7, #6]
  16973. 8006f00: 8a7b ldrh r3, [r7, #18]
  16974. 8006f02: 429a cmp r2, r3
  16975. 8006f04: d364 bcc.n 8006fd0 <ff_wtoupper+0xfc>
  16976. nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */
  16977. 8006f06: 697b ldr r3, [r7, #20]
  16978. 8006f08: 1c9a adds r2, r3, #2
  16979. 8006f0a: 617a str r2, [r7, #20]
  16980. 8006f0c: 881b ldrh r3, [r3, #0]
  16981. 8006f0e: 823b strh r3, [r7, #16]
  16982. 8006f10: 8a3b ldrh r3, [r7, #16]
  16983. 8006f12: 0a1b lsrs r3, r3, #8
  16984. 8006f14: 81fb strh r3, [r7, #14]
  16985. 8006f16: 8a3b ldrh r3, [r7, #16]
  16986. 8006f18: b2db uxtb r3, r3
  16987. 8006f1a: 823b strh r3, [r7, #16]
  16988. if (chr < bc + nc) { /* In the block? */
  16989. 8006f1c: 88fa ldrh r2, [r7, #6]
  16990. 8006f1e: 8a79 ldrh r1, [r7, #18]
  16991. 8006f20: 8a3b ldrh r3, [r7, #16]
  16992. 8006f22: 440b add r3, r1
  16993. 8006f24: 429a cmp r2, r3
  16994. 8006f26: da49 bge.n 8006fbc <ff_wtoupper+0xe8>
  16995. switch (cmd) {
  16996. 8006f28: 89fb ldrh r3, [r7, #14]
  16997. 8006f2a: 2b08 cmp r3, #8
  16998. 8006f2c: d84f bhi.n 8006fce <ff_wtoupper+0xfa>
  16999. 8006f2e: a201 add r2, pc, #4 ; (adr r2, 8006f34 <ff_wtoupper+0x60>)
  17000. 8006f30: f852 f023 ldr.w pc, [r2, r3, lsl #2]
  17001. 8006f34: 08006f59 .word 0x08006f59
  17002. 8006f38: 08006f6b .word 0x08006f6b
  17003. 8006f3c: 08006f81 .word 0x08006f81
  17004. 8006f40: 08006f89 .word 0x08006f89
  17005. 8006f44: 08006f91 .word 0x08006f91
  17006. 8006f48: 08006f99 .word 0x08006f99
  17007. 8006f4c: 08006fa1 .word 0x08006fa1
  17008. 8006f50: 08006fa9 .word 0x08006fa9
  17009. 8006f54: 08006fb1 .word 0x08006fb1
  17010. case 0: chr = p[chr - bc]; break; /* Table conversion */
  17011. 8006f58: 88fa ldrh r2, [r7, #6]
  17012. 8006f5a: 8a7b ldrh r3, [r7, #18]
  17013. 8006f5c: 1ad3 subs r3, r2, r3
  17014. 8006f5e: 005b lsls r3, r3, #1
  17015. 8006f60: 697a ldr r2, [r7, #20]
  17016. 8006f62: 4413 add r3, r2
  17017. 8006f64: 881b ldrh r3, [r3, #0]
  17018. 8006f66: 80fb strh r3, [r7, #6]
  17019. 8006f68: e027 b.n 8006fba <ff_wtoupper+0xe6>
  17020. case 1: chr -= (chr - bc) & 1; break; /* Case pairs */
  17021. 8006f6a: 88fa ldrh r2, [r7, #6]
  17022. 8006f6c: 8a7b ldrh r3, [r7, #18]
  17023. 8006f6e: 1ad3 subs r3, r2, r3
  17024. 8006f70: b29b uxth r3, r3
  17025. 8006f72: f003 0301 and.w r3, r3, #1
  17026. 8006f76: b29b uxth r3, r3
  17027. 8006f78: 88fa ldrh r2, [r7, #6]
  17028. 8006f7a: 1ad3 subs r3, r2, r3
  17029. 8006f7c: 80fb strh r3, [r7, #6]
  17030. 8006f7e: e01c b.n 8006fba <ff_wtoupper+0xe6>
  17031. case 2: chr -= 16; break; /* Shift -16 */
  17032. 8006f80: 88fb ldrh r3, [r7, #6]
  17033. 8006f82: 3b10 subs r3, #16
  17034. 8006f84: 80fb strh r3, [r7, #6]
  17035. 8006f86: e018 b.n 8006fba <ff_wtoupper+0xe6>
  17036. case 3: chr -= 32; break; /* Shift -32 */
  17037. 8006f88: 88fb ldrh r3, [r7, #6]
  17038. 8006f8a: 3b20 subs r3, #32
  17039. 8006f8c: 80fb strh r3, [r7, #6]
  17040. 8006f8e: e014 b.n 8006fba <ff_wtoupper+0xe6>
  17041. case 4: chr -= 48; break; /* Shift -48 */
  17042. 8006f90: 88fb ldrh r3, [r7, #6]
  17043. 8006f92: 3b30 subs r3, #48 ; 0x30
  17044. 8006f94: 80fb strh r3, [r7, #6]
  17045. 8006f96: e010 b.n 8006fba <ff_wtoupper+0xe6>
  17046. case 5: chr -= 26; break; /* Shift -26 */
  17047. 8006f98: 88fb ldrh r3, [r7, #6]
  17048. 8006f9a: 3b1a subs r3, #26
  17049. 8006f9c: 80fb strh r3, [r7, #6]
  17050. 8006f9e: e00c b.n 8006fba <ff_wtoupper+0xe6>
  17051. case 6: chr += 8; break; /* Shift +8 */
  17052. 8006fa0: 88fb ldrh r3, [r7, #6]
  17053. 8006fa2: 3308 adds r3, #8
  17054. 8006fa4: 80fb strh r3, [r7, #6]
  17055. 8006fa6: e008 b.n 8006fba <ff_wtoupper+0xe6>
  17056. case 7: chr -= 80; break; /* Shift -80 */
  17057. 8006fa8: 88fb ldrh r3, [r7, #6]
  17058. 8006faa: 3b50 subs r3, #80 ; 0x50
  17059. 8006fac: 80fb strh r3, [r7, #6]
  17060. 8006fae: e004 b.n 8006fba <ff_wtoupper+0xe6>
  17061. case 8: chr -= 0x1C60; break; /* Shift -0x1C60 */
  17062. 8006fb0: 88fb ldrh r3, [r7, #6]
  17063. 8006fb2: f5a3 53e3 sub.w r3, r3, #7264 ; 0x1c60
  17064. 8006fb6: 80fb strh r3, [r7, #6]
  17065. 8006fb8: bf00 nop
  17066. }
  17067. break;
  17068. 8006fba: e008 b.n 8006fce <ff_wtoupper+0xfa>
  17069. }
  17070. if (!cmd) p += nc;
  17071. 8006fbc: 89fb ldrh r3, [r7, #14]
  17072. 8006fbe: 2b00 cmp r3, #0
  17073. 8006fc0: d195 bne.n 8006eee <ff_wtoupper+0x1a>
  17074. 8006fc2: 8a3b ldrh r3, [r7, #16]
  17075. 8006fc4: 005b lsls r3, r3, #1
  17076. 8006fc6: 697a ldr r2, [r7, #20]
  17077. 8006fc8: 4413 add r3, r2
  17078. 8006fca: 617b str r3, [r7, #20]
  17079. bc = *p++; /* Get block base */
  17080. 8006fcc: e78f b.n 8006eee <ff_wtoupper+0x1a>
  17081. break;
  17082. 8006fce: bf00 nop
  17083. }
  17084. return chr;
  17085. 8006fd0: 88fb ldrh r3, [r7, #6]
  17086. }
  17087. 8006fd2: 4618 mov r0, r3
  17088. 8006fd4: 371c adds r7, #28
  17089. 8006fd6: 46bd mov sp, r7
  17090. 8006fd8: f85d 7b04 ldr.w r7, [sp], #4
  17091. 8006fdc: 4770 bx lr
  17092. 8006fde: bf00 nop
  17093. 8006fe0: 08007304 .word 0x08007304
  17094. 8006fe4: 080074f8 .word 0x080074f8
  17095. 08006fe8 <__libc_init_array>:
  17096. 8006fe8: b570 push {r4, r5, r6, lr}
  17097. 8006fea: 4e0d ldr r6, [pc, #52] ; (8007020 <__libc_init_array+0x38>)
  17098. 8006fec: 4c0d ldr r4, [pc, #52] ; (8007024 <__libc_init_array+0x3c>)
  17099. 8006fee: 1ba4 subs r4, r4, r6
  17100. 8006ff0: 10a4 asrs r4, r4, #2
  17101. 8006ff2: 2500 movs r5, #0
  17102. 8006ff4: 42a5 cmp r5, r4
  17103. 8006ff6: d109 bne.n 800700c <__libc_init_array+0x24>
  17104. 8006ff8: 4e0b ldr r6, [pc, #44] ; (8007028 <__libc_init_array+0x40>)
  17105. 8006ffa: 4c0c ldr r4, [pc, #48] ; (800702c <__libc_init_array+0x44>)
  17106. 8006ffc: f000 f820 bl 8007040 <_init>
  17107. 8007000: 1ba4 subs r4, r4, r6
  17108. 8007002: 10a4 asrs r4, r4, #2
  17109. 8007004: 2500 movs r5, #0
  17110. 8007006: 42a5 cmp r5, r4
  17111. 8007008: d105 bne.n 8007016 <__libc_init_array+0x2e>
  17112. 800700a: bd70 pop {r4, r5, r6, pc}
  17113. 800700c: f856 3025 ldr.w r3, [r6, r5, lsl #2]
  17114. 8007010: 4798 blx r3
  17115. 8007012: 3501 adds r5, #1
  17116. 8007014: e7ee b.n 8006ff4 <__libc_init_array+0xc>
  17117. 8007016: f856 3025 ldr.w r3, [r6, r5, lsl #2]
  17118. 800701a: 4798 blx r3
  17119. 800701c: 3501 adds r5, #1
  17120. 800701e: e7f2 b.n 8007006 <__libc_init_array+0x1e>
  17121. 8007020: 080075bc .word 0x080075bc
  17122. 8007024: 080075bc .word 0x080075bc
  17123. 8007028: 080075bc .word 0x080075bc
  17124. 800702c: 080075c0 .word 0x080075c0
  17125. 08007030 <memset>:
  17126. 8007030: 4402 add r2, r0
  17127. 8007032: 4603 mov r3, r0
  17128. 8007034: 4293 cmp r3, r2
  17129. 8007036: d100 bne.n 800703a <memset+0xa>
  17130. 8007038: 4770 bx lr
  17131. 800703a: f803 1b01 strb.w r1, [r3], #1
  17132. 800703e: e7f9 b.n 8007034 <memset+0x4>
  17133. 08007040 <_init>:
  17134. 8007040: b5f8 push {r3, r4, r5, r6, r7, lr}
  17135. 8007042: bf00 nop
  17136. 8007044: bcf8 pop {r3, r4, r5, r6, r7}
  17137. 8007046: bc08 pop {r3}
  17138. 8007048: 469e mov lr, r3
  17139. 800704a: 4770 bx lr
  17140. 0800704c <_fini>:
  17141. 800704c: b5f8 push {r3, r4, r5, r6, r7, lr}
  17142. 800704e: bf00 nop
  17143. 8007050: bcf8 pop {r3, r4, r5, r6, r7}
  17144. 8007052: bc08 pop {r3}
  17145. 8007054: 469e mov lr, r3
  17146. 8007056: 4770 bx lr