15.3.4 keil-mcbstm32e.py スクリプトについて

Keil MCBSTM32E プラットフォーム用の keil-mcbstm32e.py ファイルの完全な内容は、DTSLExampleConfigdb プロジェクトの DTSLExamples.zip に含まれています。以下に、このスクリプトの重要な点について述べます。

from com.arm.debug.dtsl.configurations import DTSLv1

[snip]
class ResetHookedDevice(Device):
    def __init__(self, root, devNo, name):
        Device.__init__(self, root, devNo, name)
        self.parent = root
    def systemReset(self, resetType):
        Device.systemReset(self, resetType)
        # Notify root configuration
        self.parent.postReset()


class DSTREAMDebugAndTrace(DTSLv1):
    '''A top level configuration class which supports debug and trace'''

    @staticmethod
    def getOptionList():
        '''The method which specifies the configuration options which
           the user can edit via the launcher panel |Edit...| button
        '''
        return [
            DTSLv1.tabSet(
                name='options',
                displayName='Options',
                childOptions=[
                    DSTREAMDebugAndTrace.getTraceBufferOptionsPage(),
                    DSTREAMDebugAndTrace.getETMOptionsPage(),
                    DSTREAMDebugAndTrace.getITMOptionsPage()
                ]
            )
        ]
    
    @staticmethod
    def getTraceBufferOptionsPage():
        # If you change the position or name of the traceCapture
        # device option you MUST modify the project_types.xml to
        # tell the debugger about the new location/name
        return DTSLv1.tabPage(
            name='traceBuffer',
            displayName='Trace Buffer',
            childOptions=[
                DTSLv1.enumOption(
                    name='traceCaptureDevice',
                    displayName='Trace capture method',
                    defaultValue='DSTREAM',
                    values=[
                        ('none', 'No trace capture device'),
                        ('DSTREAM', 'DSTREAM 4GB Trace Buffer')
                    ]
                ),
                DTSLv1.booleanOption(
                    name='clearTraceOnConnect',
                    displayName='Clear Trace Buffer on connect',
                    defaultValue=True
                ),
                DTSLv1.booleanOption(
                    name='startTraceOnConnect',
                    displayName='Start Trace Buffer on connect',
                    defaultValue=True
                ),
                DTSLv1.enumOption(
                    name='traceWrapMode',
                    displayName='Trace full action',
                    defaultValue='wrap',
                    values=[
                        ('wrap', 'Trace wraps on full and continues to store data'),
                        ('stop', 'Trace halts on full')
                    ]
                )
            ]
        )
    	
[snip]
    def __init__(self, root):
        '''The class constructor'''
        # base class construction
        DTSLv1.__init__(self, root)
        # create the devices in the platform
        self.cores = []
        self.traceSources = []
        self.reservedATBIDs = {}
        self.createDevices()
        self.setupDSTREAMTrace()
        for core in self.cores:
            self.addDeviceInterface(core)

    def createDevices(self):
# create MEMAP
    devID = self.findDevice("CSMEMAP")
        self.AHB = CortexM_AHBAP(self, devID, "CSMEMAP")
        # create core
        devID = self.findDevice("Cortex-M3")
        self.cortexM3 = ResetHookedDevice(self, devID, "Cortex-M3")
        self.cortexM3.registerAddressFilters(
                [AHBCortexMMemAPAccessor("AHB", self.AHB, "AHB bus accessed via AP_0")])
        self.cores.append(self.cortexM3)
        # create the ETM disabled by default - will enable with option
        devID = self.findDevice("CSETM")
        self.ETM = V7M_ETMTraceSource(self, devID, 1, "ETM")
        self.ETM.setEnabled(False)
        self.traceSources.append(self.ETM)
        # ITM disabled by default - will enable with option
        devID = self.findDevice("CSITM")
        self.ITM = V7M_ITMTraceSource(self, devID, 2, "ITM")
        #self.ITM = M3_ITM(self, devID, 2, "ITM")
        self.ITM.setEnabled(False)
        self.traceSources.append(self.ITM)
        # TPIU
        devID = self.findDevice("CSTPIU")
        self.TPIU = V7M_CSTPIU(self, devID, "TPIU", self.AHB)
        # DSTREAM
        self.DSTREAM = DSTREAMTraceCapture(self, "DSTREAM")
        self.DSTREAM.setTraceMode(DSTREAMTraceCapture.TraceMode.Continuous)
非機密扱いPDF file icon PDF 版ARM DUI0446ZJ
Copyright © 2010–2016 ARM.All rights reserved.