comparison python/stm32.py @ 138:14e739ed03ab

Added halt stub
author Windel Bouwman
date Sat, 26 Jan 2013 10:04:32 +0100
parents 04e45faafd1d
children f254b87258e6
comparison
equal deleted inserted replaced
137:0a540ce31cd5 138:14e739ed03ab
1 import time 1 import time
2 from devices import Device, registerDevice, STLinkException, Interface 2 from devices import Device, registerDevice, STLinkException, Interface
3 import stlink
3 4
4 # F4 specifics: 5 # F4 specifics:
5 STM32_FLASH_BASE = 0x08000000 6 STM32_FLASH_BASE = 0x08000000
6 STM32_SRAM_BASE = 0x20000000 7 STM32_SRAM_BASE = 0x20000000
7 8
61 @property 62 @property
62 def FlashSize(self): 63 def FlashSize(self):
63 f_id = self.iface.read_debug32(0x1FFF7A22) 64 f_id = self.iface.read_debug32(0x1FFF7A22)
64 f_id = f_id >> 16 65 f_id = f_id >> 16
65 return f_id * 1024 66 return f_id * 1024
67 @property
68 def Running(self):
69 return self.iface.Status == stlink.CORE_RUNNING
66 # flashing commands: 70 # flashing commands:
67 def writeFlash(self, address, content): 71 def writeFlash(self, address, content):
68 flashsize = self.FlashSize 72 flashsize = self.FlashSize
69 pagesize = min(self.sectorsizes) 73 pagesize = min(self.sectorsizes)
70 74