; --------------------------------------------------------------------------------- ; @Title: Flash declaration for Analog Devices ADuCM302x internal Flash derivatives ; ; @Description: ; Script arguments: ; DO aducm302x [PREPAREONLY] [CPU=] [DUALPORT=<0|1>] ; PREPAREONLY only declares Flash but does not execute Flash programming ; CPU= selects CPU derivative ; DUALPORT=<0|1> use dual port memory access, default 1 ; Example: ; DO ~~/demo/arm/flash/aducm302x PREPAREONLY ; Note: ; This file must NOT be modified. ; This file is intended to stay within TRACE32 installation. ; Usage examples are available in the ~~/demo/arm/hardware/... subdirectories. ; ; List of ADuCM302* derivatives: ; CPU-Type Flash Size ; [KB] ; -------------------------------- ; ADuCM3027 128 ; ADuCM3029 256 ; ; @Author: NEZ ; @Copyright: (C) 1989-2023 Lauterbach GmbH, licensed for use with TRACE32(R) only ; @Chip: ADuCM302* ; -------------------------------------------------------------------------------- ; $Rev: 12164 $ ; $Id: aducm302x.cmm 12164 2023-06-01 15:38:02Z nzouari $ PRIVATE ¶meters ENTRY %LINE ¶meters PRIVATE ¶m_prepareonly ¶m_cpu ¶m_dualport ¶meters=STRing.UPpeR("¶meters") ¶m_prepareonly=(STRing.SCAN("¶meters","PREPAREONLY",0)!=-1) ¶m_cpu=STRing.SCANAndExtract("¶meters","CPU=","") ¶m_dualport=STRing.SCANAndExtract("¶meters","DUALPORT=","1") ; -------------------------------------------------------------------------------- ; Initialize and start the debugger IF !SYStem.Up() ( SYStem.RESet IF "¶m_cpu"!="" SYStem.CPU ¶m_cpu IF (!CPUIS(ADUCM302*)) SYStem.CPU ADUCM302* SYStem.Option.ResBreak OFF SYStem.CONFIG.DEBUGPORTTYPE SWD SYStem.JtagClock 1MHz SYStem.Up ) ; -------------------------------------------------------------------------------- ; Flash declaration FLASH.RESet GOSUB FlashDeclaration "¶m_dualport" ; Flash script ends here if called with parameter PREPAREONLY IF ¶m_prepareonly ENDDO PREPAREDONE ; -------------------------------------------------------------------------------- ; Flash programming example DIALOG.YESNO "Program Flash memory?" PRIVATE &progflash ENTRY &progflash IF &progflash ( FLASH.ReProgram ALL /Erase Data.LOAD.auto * FLASH.ReProgram off ; Reset device SYStem.Down SYStem.Up ) ; -------------------------------------------------------------------------------- ; SUBROUTINES ; -------------------------------------------------------------------------------- ; Flash declaration depending on selected CPU ; ; Please do NOT modify the TRACE32 Flash declaration. ; ; Modifications can result in unpredictable behavior. ; Please contact support@lauterbach.com for any changes. FlashDeclaration: ;(param_dualport) ( PARAMETERS ¶m_dualport PRIVATE &SRAMAddress &FlashSize &PageSize &FlashDriver &FlashDriver="aducm3029.bin" &PageSize=0x800 ;ERASEPAGE=2KB ; Determine Flash size IF CPUIS(ADuCM3027) &FlashSize=0x20000 ELSE IF CPUIS(ADuCM3029) &FlashSize=0x40000 ELSE ( PRINT %ERROR "FLASH size of CPU type is not supported by the script" ENDDO ) FLASH.RESet FLASH.Create 1. 0x00000000--0x000007FF &PageSize NOP Quad /INFO "Info Space" IF CPUIS(ADuCM3027) FLASH.Create 2. 0x00000800--(&FlashSize-1) &PageSize TARGET Quad /CENSORSHIP 0x0001FFF0--0x0001FFFF /INFO "User Space" ELSE FLASH.Create 2. 0x00000800--(&FlashSize-1) &PageSize TARGET Quad /CENSORSHIP 0x0003FFF0--0x0003FFFF /INFO "User Space" FLASH.TARGET 0x20000000 0x20000800 0x400 ~~/demo/arm/flash/quad/&FlashDriver RETURN )