本文整理汇总了Python中cortex_m.CortexM.resetStopOnReset方法的典型用法代码示例。如果您正苦于以下问题:Python CortexM.resetStopOnReset方法的具体用法?Python CortexM.resetStopOnReset怎么用?Python CortexM.resetStopOnReset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cortex_m.CortexM
的用法示例。
在下文中一共展示了CortexM.resetStopOnReset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resetStopOnReset
# 需要导入模块: from cortex_m import CortexM [as 别名]
# 或者: from cortex_m.CortexM import resetStopOnReset [as 别名]
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)
示例2: resetStopOnReset
# 需要导入模块: from cortex_m import CortexM [as 别名]
# 或者: from cortex_m.CortexM import resetStopOnReset [as 别名]
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)
示例3: resetStopOnReset
# 需要导入模块: from cortex_m import CortexM [as 别名]
# 或者: from cortex_m.CortexM import resetStopOnReset [as 别名]
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)
示例4: resetStopOnReset
# 需要导入模块: from cortex_m import CortexM [as 别名]
# 或者: from cortex_m.CortexM import resetStopOnReset [as 别名]
def resetStopOnReset(self):
# halt processor
self.halt()
# not remap 0x0000-0x0020 to anything but the flash
self.writeMemory(0x400FC040, 1)
CortexM.resetStopOnReset(self)