Example #1
0
    def resetStopOnReset(self, software_reset=False):
        if self.ignoreReset:
            return

        # Set core up to run some code in RAM that is guaranteed to be valid
        # since FLASH could be corrupted and that is what user is trying to fix.
        self.writeMemory(0x10000000, 0x10087ff0)    # Initial SP
        self.writeMemory(0x10000004, 0x1000000d)    # Reset Handler
        self.writeMemory(0x10000008, 0x1000000d)    # Hard Fault Handler
        self.writeMemory(0x1000000c, 0xe7fee7fe)    # Infinite loop
        self.writeMemory(0x40043100, 0x10000000)    # Shadow 0x0 to RAM

        # Always use software reset for LPC4330 since the hardware version
        # will reset the DAP.
        CortexM.resetStopOnReset(self, True)

        # Map shadow memory to SPIFI FLASH
        self.writeMemory(0x40043100, 0x80000000)

        # The LPC4330 flash init routine can be used to remount FLASH.
        self.ignoreReset = True
        self.flash.init()
        self.ignoreReset = False

        # Set SP and PC based on interrupt vector in SPIFI_FLASH
        sp = self.readMemory(0x14000000)
        pc = self.readMemory(0x14000004)
        self.writeCoreRegisterRaw('sp', sp)
        self.writeCoreRegisterRaw('pc', pc)
Example #2
0
 def resetStopOnReset(self, software_reset = True):
     """
     perform a reset and stop the core on the reset handler
     """
     # Keep call to CortexM version of resetStopOnReset but make 
     # the default a software reset since a hardware reset does 
     # not work when debugging is enabled
     CortexM.resetStopOnReset(self, software_reset)
Example #3
0
    def resetStopOnReset(self, software_reset = None, map_to_user = True):
        CortexM.resetStopOnReset(self, software_reset)

        # Remap to use flash and set SP and SP accordingly
        if map_to_user:
            self.writeMemory(0x40048000, 0x2, 32)
            sp = self.readMemory(0x0)
            pc = self.readMemory(0x4)
            self.writeCoreRegisterRaw('sp', sp)
            self.writeCoreRegisterRaw('pc', pc)
Example #4
0
    def resetStopOnReset(self, software_reset=False, map_to_user=True):
        CortexM.resetStopOnReset(self)

        # Remap to use flash and set SP and SP accordingly
        if map_to_user:
            self.writeMemory(0x400FC040, 1)
            sp = self.readMemory(0x0)
            pc = self.readMemory(0x4)
            self.writeCoreRegisterRaw("sp", sp)
            self.writeCoreRegisterRaw("pc", pc)
Example #5
0
 def resetStopOnReset(self, software_reset=False):
     # halt processor
     self.halt()
     # not remap 0x0000-0x0020 to anything but the flash
     self.writeMemory(0x400FC040, 1)
     CortexM.resetStopOnReset(self)
Example #6
0
 def resetStopOnReset(self):
     # halt processor
     self.halt()
     # not remap 0x0000-0x0020 to anything but the flash
     self.writeMemory(0x400FC040, 1)
     CortexM.resetStopOnReset(self)