Transcription of Flash Programming Solutions for the …
1 1 IntroductionApplicationReportSPRAAL3 (DSC)developmentcycle:firmwaredebug,prot otyping,production, ,UsefulDocumentation, , , August2008 TMS320F28xxxDSCs1 SubmitDocumentationFeedbackUser sApplicationFlash APIF lash AlgosOTP/FlashArray ControlBoot ROMJTAGSARAMAPI CodeExecutionOTP andFlashArrayCPUCTMS320F28xxxI2C-AeCAN-A SCI-AParallelCode (write) ,theFlashmustgothroughanerase,program, (RAM).Thesealgorithmsmustbeconfiguredfor thepropercentralprocessingunit(CPU) (API)algorithmsat[1],[2],[7]and[8]. )JTAG,b)Serial,andc) :TIHome DigitalSignalProcessing ProcessorPlatforms C2000 HighPerformance32-BitControllers ,IEEES tandardTestAccessPortandBoundary-ScanArc hitecture(JTAG)solutionscanapplytoallsta gesofthedevelopmentcycle,butarepredomina telyusedinthefirmwaredebugandprototyping stagesasthismethodallowsadesignertoprogr amtheFlashandthendebugitwithintheCodeCom poserStudio ,SDFlash, developmentboard, , ,thisprogrammerisavailableatF281xFlashTo ols[1],F280xFlashTools[2] , (GUI).
2 , , , , , : LoadSymbols-Enables/DisablesCodeComposer StudiotoLoadSymbolsdirectlyafterprogramm ingFlashtoenabledebugging. DisplayTooltips Enables/Disablesdetailswithintheprogramm erwhenhoveringoveranoption. DisplayDiagnostics Enables/Disablesoutputscreenthatdisplays thestatusofprogramming. SaveClockSettings , : SpecifyingaCOFFFile , Erase,Program,andVerifyOperations Thesebuttonsallowtheerase,program,andver ifyoperationstosimultaneouslyrunorexecut eeachoperationindividually. DepletionRecovery Thisoptioninvokesthedepletionrecoveryalg orithmthatlooksforsectorsthatareindeplet ionandattemptstorecoverthem.
3 FrequencyTest (GPIO)pinofchoice. CalculateChecksums PerformsachecksumoftheFlash,one-timeprog rammable(OTP),andFlash+OTP. LoadRAMOnly Thisoptionloadsinitializedsectionsthatar especifiedtorunfromRAM. WaitStates Duringprogramming,theWaitStatesfortheFla shandOTParesetwiththeseoptions. ExecuteOperation Thisbuttonwillexecutewhateveroptionissel ected. Help (CSM) ,seetheCodeSecurityModule(CSM)sectionof[ 10],[11]and[12].Thisportionoftheprogramm ercontainsthefollowingelements: KEY0 KEY7-16-bitpasswordlocations. Unlock UnlocksFlashifCSMissecuredandpasswordsar ewritteninKEY0 KEY7.
4 Lock LockstheFlashiftheCSMhaspreviouslybeenpr ogrammedwiththepasswordswritteninKEY0 KEY7. ProgramPassword ProgramsthepasswordstotheCSMthatiswritte ninKEY0 , , ,theTMS320F28335eZdsp, ,andFlashexamplefromRunninganApplication fromInternalFlashMemoryontheTMS320F28xxx DSP(SPRA958)[3] OpenfollowedbyProject ,Program, ,theprogramisstoredontheFlashandtheboard isreadyforstandaloneoperationordebugging ,throughCodeComposerStudio, , , ,algorithms,exampleprojects,andfulldocum entationexplaininghowtousetheutilityarea vailableattheSDFlashUtilityhomepage[4].
5 TMS320F28xxxDSCs6 SPRAAL3 ,erase, Programming , ,thesettingsareconfiguredbyselectingProj ect-> : Driver SelectstheCodeComposerStudioemulationdri verusedtocommunicatewiththedevice. EmulatorAddress/ID BoardFile-ProvidesinformationtotheSDFlas hregardingthenumberofdevicesontheJTAG scanchain. ProcessorName : AlgorithmFile Timeout Settimeoutfortheeraseprocessintermsofsec onds. UserOptions2/UserOptions4 NotUsed. UserOptions3 Runfrequencytoggletest. ST0/ST1/PMST/PMSTA ddress : AlgorithmFile FlashDataFile Timeout Settimeoutfortheprogrammingprocessinterm sofseconds.
6 UserOptions3 Runfrequencytoggletest. UserOptions1/UserOptions2/UserOptions4 NotUsed. ST0/ST1/PMST/PMSTA ddress : AlgorithmFile Timeout Settimeoutfortheverifyprocessintermsofse conds. UserOptions1/UserOptions2 SpecifywaitstatesusedfortheFlashandOTPdu ringtheverifyoperation. UserOptions3-Runfrequencytoggletest. UserOptions4 NotUsed. ST0/ST1/PMST/PMSTA ddress ,theTMS320F28335eZdsp, (providedSDFlashproject),andFlashexample fromRunninganApplicationfromInternalFlas hMemoryontheTMS320F28xxxDSP(SPRA958)[3] [4].
7 , , , (Inthisexample, (SPRA958)[3].) , ,CSM,depletionrecovery, JTAGjet-TMS-C2000emulatorwithouttheneedo fCodeComposerStudio, [5]. (SCI) , ,theutility, [4].Someapplicationsrequirere-programmin gallorpartoftheFlashmemoryorOTPblocktore configuretheapplicationcodeortostoredata ( ,calibrationparameters) ;inthiscontext, , ,theFlashroutines(erase,writeoperations) , ,entireFlashAPIneedstobecopiedtoRAM; , , , , WhenusingtheFlashAPI,buildyourcodewithth elargememorymodel. TheAPIL ibraryisbuiltin28xObjectcode(OBJMODE=1,A MODE=1) (PLLCR) , (optional).
8 IftheAPIistobecopiedfromFlash/OTPintoint ernalSARAM memory, , (optional). (optional). (optional). : Thewatchdogtimerisdisabled. ChecksthePARTID(memorylocation0x0882)reg istertomakesurethepartisthecorrectdevice Performsthecalledoperationand: Disablesandrestoresglobalinterrupts(viaI NTM,DBGM,XNMICR)aroundtimecriticalcodese gments. InvokesthecallbackfunctionifFlash_Callba ckPtrisnotNULL (optional).12 TMS320F28xxxDSCsSPRAAL3 sandDon t s5 ProductionSolutions6 Debugging,UsefulDocumentation, APIDo s (L0-L3)andonewaitstateSARAM(L4-L7).
9 TheFlashAPIsshouldberunfromL0-L3 SARAM. ConfiguretheAPIforthecorrectCPUfrequency ofoperation. FollowthechecklistoftheFlashAPIdocumenta tiontointegratetheAPIintoanapplication. InitializethePLLCR andwaitforthePLLtolockbeforecallinganAPI function. InitializetheAPIcallbackfunctionpointer( Flash_CallbackPtr).Ifthecallbackfunction isnotgoingtobeused, CarefullyreviewtheAPIrestrictionsforthec allbackfunction,interrupts,andwatchdogth ataredescribedinthedocument. APIDon ts ,theymustfirstbecopiedtointernalzero-wai tstateSARAM beforetheyareexecuted.
10 Donotexecuteanyinterruptserviceroutines( ISRs)thatcanoccurduringanerase, ,programordepletionrecoveryroutine, Donotstoptheerase,programordepletionreco veryfunctionswhiletheyareexecuting(forex ample,don tstopthedebuggerwithinAPIcode,don tresetthepart,etc). DonotexecutecodeorfetchdatafromtheFlasha rrayorOTPwhiletheFlashand/orOTPisbeinger ased, , (runningonPC) (.out) (>1K).Forlargerquantities, [1]andF280xFlashtools[2]. , ,precautions,etc., ,UsefulDocumentation, , :Run,Halt,SingleStep,ResetCPU, LoadSymbols , (seeFigure14).
