added packet fuzzing
[goodfet] / client / GoodFETAT91SAM7S.py
1 from GoodFETARM7 import *
2
3 """
4 This is the ARM7 series of microcontrollers from Atmel, including:
5 * AT91SAM7S512
6 * AT91SAM7S256
7 * AT91SAM7S128
8 * AT91SAM7S64
9 * AT91SAM7S321
10 * AT91SAM7S32
11 * AT91SAM7S161
12 * AT91SAM7S16
13
14 SAM-BA boot-assistant can be used (not through this module) by setting PA0, PA1, and PA2 high for at least 10 seconds followed by a power cycle.  SAM-BA supports reprogramming through the DBGU port or USB port.
15
16 The System Controller peripherals are all mapped to the highest 4 Kbytes of address space,
17 between addresses 0xFFFF F000 and 0xFFFF FFFF.
18
19 """
20 #
21 # Base Memory Addresses
22 #
23 FLASH_BASE =    0x100000
24 TCx_BASE =      0xfffa0000      # Timer/Counter
25 UDP_BASE =      0xfffb0000      # USB Device Port
26 TWI_BASE =      0xfffb8000      # Two-Wire-Interface Controller
27 USART0_BASE =   0xfffc0000      # Universal Syncronous/Asyncronous Receiver/Transmitter 0
28 USART1_BASE =   0xfffc4000      # Universal Syncronous/Asyncronous Receiver/Transmitter 1
29 PWMC_BASE =     0xfffcc000      # PWM Controller
30 SSC_BASE =      0xfffd4000      # Syncronous Serial Controller
31 ADC_BASE =      0xfffd8000      # Analog-Digital Converter
32 SPI_BASE =      0xfffe0000      # Serial Peripheral Interface
33 SYSC_BASE =     0xfffff000      # System
34 AIC_BASE =      SYSC_BASE       # Advanced Interrupt Controller
35 DBGU_BASE =     0xfffff200      # Debug unit
36 PIOA_BASE =     0xfffff400      # Programmable IO
37 PMC_BASE =      0xfffffc00      # Power Management Controller
38 RSTC_BASE =     0xfffffd00      # Reset Controller
39 RTT_BASE =      0xfffffd20      # Real-Time Timer
40 PIT_BASE =      0xfffffd30      # Periodic Interval Timer
41 WDT_BASE =      0xfffffd40      # Watchdog Timer
42 VREG_BASE =     0xfffffd60      # Voltage Regulator
43 MC_BASE =       0xffffff00      # Memory Controller
44
45 PERIPHERAL_BASE=0xf0000000
46 PERIPH0_BASE =  0xf0004000
47 PERIPH1_BASE =  0xf0008000
48 # etc...
49
50
51 class GoodFETAT91SAM7S(GoodFETARM):
52     def getChipID(self):
53         chipid = self.ARMreadMem(SF_CIDR,1)
54         return chipid[0]
55
56     def FFPI_Read(self):
57         raise Exception("Not implemented yet...")
58     def FFPI_PageProgram(self):
59         raise Exception("Not implemented yet...")
60     def FFPI_PageErase(self):
61         raise Exception("Not implemented yet...")
62     def FFPI_FullErase(self):
63         raise Exception("Not implemented yet...")
64     def FFPI_Lock(self):
65         raise Exception("Not implemented yet...")
66     def FFPI_Unlock(self):
67         raise Exception("Not implemented yet...")
68     def FFPI_Protect(self):
69         raise Exception("Not implemented yet...")
70
71 # todo:
72 # * Test Pin, SAM-BA, Tri-state
73