本文整理匯總了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)