Skip to content

Commit 2226f0c

Browse files
committed
More Axoloti/STM32F427xG tweaks.
1 parent 550bc47 commit 2226f0c

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Python Based ARM CoreSight Debug and Trace Tools
1919

2020
$ ./pycs -l
2121
supported targets:
22+
axoloti : Axoloti Synth Board (STM32F427xx)
2223
efm32lg : EFM32 Leopard Gecko Starter Kit (EFM32LG990F256)
2324
frdm_k64f : FRDM-K64F Kinetis Development Board (MK64FN1M0VLL12)
2425
mb1035b : STM32F3 Discovery Board (STM32F303xC)
@@ -54,6 +55,7 @@ It has an interactive CLI.
5455
* display peripheral registers
5556
* halt/go the cpu
5657
* program flash
58+
* Segger RTT client
5759
* measure counter frequencies
5860
* etc. etc.
5961

cortexm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __init__(self, target, ui, dbgio, device):
117117
self.menu = (
118118
('cpuid', self.cmd_cpuid),
119119
('rate', self.cmd_systick_rate),
120-
('test', self.cmd_test),
120+
#('test', self.cmd_test),
121121
)
122122

123123
def cmd_test(self, ui, args):

target/axoloti.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# -----------------------------------------------------------------------------
3131

32-
soc_name = 'STM32F427xx'
32+
soc_name = 'STM32F427xG'
3333
prompt = 'axoloti'
3434

3535
# -----------------------------------------------------------------------------
@@ -171,6 +171,8 @@ def __init__(self, ui, dbgio):
171171
self.ui = ui
172172
self.dbgio = dbgio
173173
self.device = vendor.get_device(self.ui, soc_name)
174+
# add the 8MiB SDRAM
175+
self.device.insert(soc.make_peripheral('sdram', 0xc0000000, 8 << 20, None, 'external sdram'))
174176
self.dbgio.connect(self.device.cpu_info.name, 'swd')
175177
self.cpu = cortexm.cortexm(self, ui, self.dbgio, self.device)
176178
self.device.bind_cpu(self.cpu)
@@ -182,16 +184,13 @@ def __init__(self, ui, dbgio):
182184
# setup the rtt client
183185
ram = self.device.sram
184186
self.rtt = rtt.rtt(self.cpu, mem.region('ram', ram.address, ram.size))
185-
# setup the gdb server
186-
self.gdb = gdb.gdb(self.cpu)
187187

188188
self.menu_root = (
189189
('cpu', self.cpu.menu, 'cpu functions'),
190190
('da', self.cpu.cmd_disassemble, cortexm.help_disassemble),
191191
('debugger', self.dbgio.menu, 'debugger functions'),
192192
('exit', self.cmd_exit),
193193
('flash', self.flash.menu, 'flash functions'),
194-
('gdb', self.gdb.run),
195194
('go', self.cpu.cmd_go),
196195
('gpio', self.gpio.menu, 'gpio functions'),
197196
('halt', self.cpu.cmd_halt),

vendor/st/flash.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ def __str__(self):
6464
('flash_option', (16,)),
6565
)
6666

67-
# STM32F42xxx 2MiB dual bank
68-
STM32F42xxx_flash = (
67+
# STM32F42xxx
68+
69+
STM32F429xI_flash = (
6970
('flash_main', (16<<10,16<<10,16<<10,16<<10,64<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10,
7071
16<<10,16<<10,16<<10,16<<10,64<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10),
7172
(meta(0,1),meta(1,1),meta(2,1),meta(3,1),meta(4,1),meta(5,1),meta(6,1),meta(7,1),meta(8,1),meta(9,1),meta(10,1),meta(11,1),
@@ -76,6 +77,15 @@ def __str__(self):
7677
('flash_opt_bank2', (16,),(meta(None,2),)),
7778
)
7879

80+
STM32F427xG_flash = (
81+
('flash_main', (16<<10,16<<10,16<<10,16<<10,64<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10,128<<10),
82+
(meta(0,1),meta(1,1),meta(2,1),meta(3,1),meta(4,1),meta(5,1),meta(6,1),meta(7,1),meta(8,1),meta(9,1),meta(10,1),meta(11,1))),
83+
('flash_system', (30<<10,) * 1),
84+
('flash_otp', (528,)),
85+
('flash_opt_bank1', (16,),(meta(None,1),)),
86+
('flash_opt_bank2', (16,),(meta(None,2),)),
87+
)
88+
7989
#STM32F303xD/E: Up to 512KiB
8090
#STM32F303x6/8, STM32F328x8: up to 64 KiB
8191

@@ -103,8 +113,8 @@ def __str__(self):
103113
flash_map = {
104114
'STM32F303xC': STM32F303xC_flash,
105115
'STM32F407xx': STM32F40x_flash,
106-
'STM32F427xx': STM32F42xxx_flash,
107-
'STM32F429xI': STM32F42xxx_flash,
116+
'STM32F427xG': STM32F427xG_flash,
117+
'STM32F429xI': STM32F429xI_flash,
108118
'STM32L432KC': STM32L432KC_flash,
109119
'STM32F091xC': STM32F091xC_flash,
110120
}

vendor/st/gpio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'STM32F303xC': (('A','B','C','D','E','F'), 'AHBENR', 17),
2121
'STM32L432KC': (('A','B','C','D','E','H'), 'AHB2ENR', 0),
2222
'STM32F407xx': (('A','B','C','D','E','F','G','H','I'), 'AHB1ENR', 0),
23-
'STM32F427xx': (('A','B','C','D','E','F','G','H','I'), 'AHB1ENR', 0),
23+
'STM32F427xG': (('A','B','C','D','E','F','G','H','I'), 'AHB1ENR', 0),
2424
'STM32F429xI': (('A','B','C','D','E','F','G','H','I','J','K'), 'AHB1ENR', 0),
2525
'STM32F091xC': (('A','B','C','D','E','F'), 'AHBENR', 17),
2626
}

vendor/st/st.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ def STM32F407xx_fixup(d):
491491
#-----------------------------------------------------------------------------
492492

493493
def STM32F427xx_fixup(d):
494-
# TODO - review and modify
495-
d.soc_name = 'STM32F427xx'
496494
d.cpu_info.nvicPrioBits = 4
497495
d.cpu_info.deviceNumInterrupts = 106
498496
# remove some core peripherals - we'll replace them in the cpu fixup
@@ -504,14 +502,11 @@ def STM32F427xx_fixup(d):
504502
f.enumvals = soc.make_enumvals(f, _dev_id_enumset)
505503
# more decode for the GPIO registers
506504
gpio_decodes(d, ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'), _STM32F427xx_altfunc)
507-
# additional interrupts
508-
d.insert(soc.make_interrupt('DMA2D_IRQn', 90, 'DMA2D global Interrupt'))
509505
# sram
510506
d.insert(soc.make_peripheral('sram', 0x20000000, 256 << 10, None, 'sram'))
511507
d.insert(soc.make_peripheral('ccm_sram', 0x10000000, 64 << 10, None, 'core coupled memory sram'))
512508
d.insert(soc.make_peripheral('BKPSRAM', 0x40024000, 4 << 10, None, 'backup sram'))
513509
# flash (rm0090 3.4 table 6))
514-
d.insert(soc.make_peripheral('flash_main', 0x08000000, 2 << 20, None, 'flash main memory'))
515510
d.insert(soc.make_peripheral('flash_otp', 0x1fff7800, 528, None, 'flash otp memory'))
516511
d.insert(soc.make_peripheral('flash_system', 0x1fff0000, 30 << 10, None, 'flash system memory'))
517512
d.insert(soc.make_peripheral('flash_opt_bank1', 0x1fffc000, 16, None, 'flash option memory'))
@@ -524,10 +519,15 @@ def STM32F427xx_fixup(d):
524519
# ram buffer for flash writing
525520
d.rambuf = mem.region('rambuf', 0x20000000 + 512, 32 << 10)
526521

522+
def STM32F427xG_fixup(d):
523+
d.soc_name = 'STM32F427xG'
524+
# 1 MiB of flash for G devices
525+
d.insert(soc.make_peripheral('flash_main', 0x08000000, 1 << 20, None, 'flash main memory'))
526+
527527
s = soc_info()
528-
s.name = 'STM32F427xx'
528+
s.name = 'STM32F427xG'
529529
s.svd = 'STM32F427x'
530-
s.fixups = (STM32F427xx_fixup, cmregs.cm4_fixup)
530+
s.fixups = (STM32F427xx_fixup, STM32F427xG_fixup, cmregs.cm4_fixup)
531531
soc_db[s.name] = s
532532

533533
#-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)