; -------------------------------------------------------------------------------- ; @Title: TMS570PSFC61A internal flash setup ; ; @Description: ; Script arguments: ; ; DO tms570psfc61a [PREPAREONLY] ; ; PREPAREONLY only declares flash but does not execute flash programming ; ; Example: ; ; DO ~~/demo/arm/flash/tms570psfc61a PREPAREONLY ; ; @Author: WRD ; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only ; @Chip: TMS570PSFC61A ; -------------------------------------------------------------------------------- ; $Rev: 10516 $ ; $Id: tms570psfc61a.cmm 10516 2022-02-02 11:39:30Z bschroefel $ ; LOCAL ¶meters ¶m_prepareonly ENTRY %LINE ¶meters ¶m_prepareonly=(STRing.SCAN(STRing.UPpeR("¶meters"),"PREPAREONLY",0)!=-1) ; -------------------------------------------------------------------------------- ; Init script variables DO ~~~~/tms470-func Init ; -------------------------------------------------------------------------------- ; Setup CPU IF SYStem.MODE()<5 ( SYStem.RESet SYStem.CPU TMS570PSFC61 SYStem.Up IF VERSION.BUILD()<15283. ( SYStem.Up ; preliminary work around for endianess problem ) ELSE IF VERSION.BUILD.BASE()<15283. ( SYStem.Up ; preliminary work around for endianess problem ) ) ; -------------------------------------------------------------------------------- ; Flash configuration and declaration generated out of flash470.cfg file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Config for TMS570PSFC61A ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; actual device ID is 0x801C6D05 <- Rev 0, 0x801C6D0D <- Rev A, ; 0x801C6D15 <- Rev B, 0x801C6D1D <- Rev C ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Device ID: 0x000E TMS570PSFC61A ; ProgVersion: 1.03 ; Library Version ; ProgRoutines: pf035a.x70 ; Platform library archive &ProgRoutines="pf035a" ; Frequency: 160.0 Range: 10.0 - 160.0 ; Minor Revisions: 4 ; 0 "TMS570PSFC61A Rev 0" ; 1 "TMS570PSFC61A Rev A" ; 2 "TMS570PSFC61A Rev B" ; 3 "TMS570PSFC61A Rev C" ; Ram Config: 0x08000000 0x00020000 ; 128KB LOCAL &RamStart &RamSize &RamStart=0x08000000 &RamSize=0x00020000 ; Initialization: 14 ; 0xfffff538: 0x00000005 ; reset ESM ; 0xffffffd0: 0x01010000 ; Disable peripherals ; 0xffffffd0: 0x01010100 ; Enable peripherals ; 0xfffffa00: 0x00070085 ; disable RTP ; 0xfffff700: 0x00010005 ; disable DMM ; 0xfffff000: 0x00000000 ; Disable DMA ; 0xffffff00: 0x00000000 ; Disable ECLK Output ; 0xfff7A400: 0x00000000 ; Disable HTU ; 0xfff7A014: 0x00000000 ; Disable FTU ; 0xffffffc0: 0x00000000 ; Set RAM wait states to 0 ; 0xfff87000: 0x00000311 ; enable pipeline mode and RWAIT=3 and Address WS=1 ; 0xfff87008: 0x00000005 ; disable flash parity ; 0xfff87040: 0x0000ffff ; force active mode for all banks ; 0xffffffc4: 0x0000000a ; MEMSW='1010' => Flash at 0x00000000, RAM at 0x08000000) Data.Set 0xfffff538 %Long 0x00000005 ; reset ESM Data.Set 0xffffffd0 %Long 0x01010000 ; Disable peripherals Data.Set 0xffffffd0 %Long 0x01010100 ; Enable peripherals Data.Set 0xfffffa00 %Long 0x00070085 ; disable RTP Data.Set 0xfffff700 %Long 0x00010005 ; disable DMM Data.Set 0xfffff000 %Long 0x00000000 ; Disable DMA Data.Set 0xffffff00 %Long 0x00000000 ; Disable ECLK Output Data.Set 0xfff7A400 %Long 0x00000000 ; Disable HTU Data.Set 0xfff7A014 %Long 0x00000000 ; Disable FTU Data.Set 0xffffffc0 %Long 0x00000000 ; Set RAM wait states to 0 Data.Set 0xfff87000 %Long 0x00000311 ; enable pipeline mode and RWAIT=3 and Address WS=1 Data.Set 0xfff87008 %Long 0x00000005 ; disable flash parity Data.Set 0xfff87040 %Long 0x0000ffff ; force active mode for all banks Data.Set 0xffffffc4 %Long 0x0000000a ; MEMSW='1010' => Flash at 0x00000000, RAM at 0x08000000) Data.Set 0xfffffe40 %Long 0xffffffff ; disable interrupts in REQMASKSET0 Data.Set 0xfffffe44 %Long 0xffffffff ; disable interrupts in REQMASKSET1 ; Initialization Code: 5 ; S00600004844521B ; S32208000300477846C0E92D0001EE110F30E3C00402E3800001EE010F30EE1F0F10E36E ; S3220800031DC00005EE0F0F10EE110F30E3C00303E3800006EE010F30EE1F0F10E380C7 ; S31B0800033A0002E3C00008EE0F0F10E3A00000E8BD0001E12FFF1E80 ; S70500000000FA AREA.OPEN A000 ~~~/InitializationCode.s3 PRINT "S00600004844521B" PRINT "S32208000300477846C0E92D0001EE110F30E3C00402E3800001EE010F30EE1F0F10E36E" PRINT "S3220800031DC00005EE0F0F10EE110F30E3C00303E3800006EE010F30EE1F0F10E380C7" PRINT "S31B0800033A0002E3C00008EE0F0F10E3A00000E8BD0001E12FFF1E80" PRINT "S70500000000FA" AREA.CLOSE Data.LOAD.auto ~~~/InitializationCode.s3 Register.Set PC 0x08000300 Register.Set R14 0x080002fc Go.direct Register(R14) WAIT !STATE.RUN() Register.RESet ; PLL Config: 0xffffff70 0x20046300 0xffbfffff 0xffffff74 0x3FC0023D 0xffffffff ; configure 160Mhz (assuming 16.0 Mhz OSCIN) Data.Set 0xffffff70 %Long 0x20046300|(Data.Long(SD:0xffffff70)&~0xffbfffff) Data.Set 0xffffff74 %Long 0x3FC0023D|(Data.Long(SD:0xffffff74)&~0xffffffff) &FlashClock_Frequency="160MHz" ; Engr ID: 0xfff87000 0x00604000 ; Number of Blocks: 52 FLASH.RESet &FlashType="FLASHECC" DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00000000 Length: 0x00008000 Control: 0xfff87000 Core: 0x00 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00008000 Length: 0x00008000 Control: 0xfff87000 Core: 0x00 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00010000 Length: 0x00008000 Control: 0xfff87000 Core: 0x00 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00018000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0001A000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x04 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x0001C000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x05 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00020000 Length: 0x00010000 Control: 0xfff87000 Core: 0x00 Sector: 0x06 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00030000 Length: 0x00010000 Control: 0xfff87000 Core: 0x00 Sector: 0x07 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00040000 Length: 0x00020000 Control: 0xfff87000 Core: 0x00 Sector: 0x08 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00060000 Length: 0x00020000 Control: 0xfff87000 Core: 0x00 Sector: 0x09 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00080000 Length: 0x00020000 Control: 0xfff87000 Core: 0x01 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000A0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x01 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000C0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x01 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x000E0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x01 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00100000 Length: 0x00020000 Control: 0xfff87000 Core: 0x02 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00120000 Length: 0x00020000 Control: 0xfff87000 Core: 0x02 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00140000 Length: 0x00020000 Control: 0xfff87000 Core: 0x02 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00160000 Length: 0x00020000 Control: 0xfff87000 Core: 0x02 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x00180000 Length: 0x00020000 Control: 0xfff87000 Core: 0x03 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x001A0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x03 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x001C0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x03 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASH Start: 0x001E0000 Length: 0x00020000 Control: 0xfff87000 Core: 0x03 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00400000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00404000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00408000 Length: 0x00004000 Control: 0xfff87000 Core: 0x00 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x0040c000 Length: 0x00001000 Control: 0xfff87000 Core: 0x00 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x0040d000 Length: 0x00001000 Control: 0xfff87000 Core: 0x00 Sector: 0x04 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x0040e000 Length: 0x00002000 Control: 0xfff87000 Core: 0x00 Sector: 0x05 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00410000 Length: 0x00008000 Control: 0xfff87000 Core: 0x00 Sector: 0x06 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00418000 Length: 0x00008000 Control: 0xfff87000 Core: 0x00 Sector: 0x07 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00420000 Length: 0x00010000 Control: 0xfff87000 Core: 0x00 Sector: 0x08 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00430000 Length: 0x00010000 Control: 0xfff87000 Core: 0x00 Sector: 0x09 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00440000 Length: 0x00010000 Control: 0xfff87000 Core: 0x01 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00450000 Length: 0x00010000 Control: 0xfff87000 Core: 0x01 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00460000 Length: 0x00010000 Control: 0xfff87000 Core: 0x01 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00470000 Length: 0x00010000 Control: 0xfff87000 Core: 0x01 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00480000 Length: 0x00010000 Control: 0xfff87000 Core: 0x02 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x00490000 Length: 0x00010000 Control: 0xfff87000 Core: 0x02 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004a0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x02 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004b0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x02 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004c0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x03 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004d0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x03 Sector: 0x01 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004e0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x03 Sector: 0x02 DO ~~~~/tms470-func DeclareSector Type: FLASHECC Start: 0x004f0000 Length: 0x00010000 Control: 0xfff87000 Core: 0x03 Sector: 0x03 DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00600000 Length: 0x00000800 Control: 0xfff87000 Core: 0x00 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00600800 Length: 0x00000800 Control: 0xfff87000 Core: 0x01 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00601000 Length: 0x00000800 Control: 0xfff87000 Core: 0x02 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTP Start: 0x00601800 Length: 0x00000800 Control: 0xfff87000 Core: 0x03 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTPECC Start: 0x00608000 Length: 0x00000400 Control: 0xfff87000 Core: 0x00 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTPECC Start: 0x00608400 Length: 0x00000400 Control: 0xfff87000 Core: 0x01 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTPECC Start: 0x00608800 Length: 0x00000400 Control: 0xfff87000 Core: 0x02 Sector: 0x00 DO ~~~~/tms470-func DeclareSector Type: OTPECC Start: 0x00608c00 Length: 0x00000400 Control: 0xfff87000 Core: 0x03 Sector: 0x00 DO ~~~~/tms470-func DeclareFlashAlgortihm &ProgRoutines &RamStart &RamSize &FlashClock_Frequency ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; End of flash.cfg ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Flash script ends here if called with parameter PREPAREONLY IF ¶m_prepareonly ENDDO PREPAREDONE ; -------------------------------------------------------------------------------- ; Flash programming example ; FLASH.List ; DIALOG.YESNO "Program flash memory?" LOCAL &progflash ENTRY &progflash IF &progflash ( FLASH.ReProgram ALL /Erase Data.LOAD.auto * FLASH.ReProgram.off ; Data.LOAD.auto * /ComPare ) ENDDO