Skip to content

Commit 56d4f92

Browse files
author
wuze
committed
HDSC MCU updated targets and added new PNs.
- Updated targets HC32F448/45x/460/4A0(2). - New targets HC32F115/155/334/467/472. - New PNs: hc32a448, hc32f4a2, hc32f115, hc32f155, hc32f334, hc32f467, hc32f472.
1 parent c684bdf commit 56d4f92

18 files changed

+334488
-138923
lines changed

pyocd/debug/svd/data/HC32F115.svd

Lines changed: 15255 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F155.svd

Lines changed: 18047 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F334.svd

Lines changed: 58136 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F448.svd

Lines changed: 2290 additions & 5768 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F460.svd

Lines changed: 20285 additions & 22451 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F467.svd

Lines changed: 96316 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F472.svd

Lines changed: 73876 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/HC32F4A0.svd

Lines changed: 48916 additions & 110411 deletions
Large diffs are not rendered by default.

pyocd/target/builtin/__init__.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,16 @@
111111
from . import target_M460
112112
from . import target_M480
113113
from . import target_M2354
114+
from . import target_HC32F334
114115
from . import target_HC32F448
115116
from . import target_HC32F45x
116117
from . import target_HC32F460
118+
from . import target_HC32F467
119+
from . import target_HC32F472
117120
from . import target_HC32F4A0
118121
from . import target_HC32M423
122+
from . import target_HC32F115
123+
from . import target_HC32F155
119124
from . import target_HC32F160
120125
from . import target_HC32x120
121126
from . import target_HC32L110
@@ -267,25 +272,52 @@
267272
'm467hjhae' : target_M460.M467HJHAE,
268273
'm487jidae' : target_M480.M487JIDAE,
269274
'm2354kjfae' : target_M2354.M2354KJFAE,
275+
'hc32f334x8' : target_HC32F334.HC32F334x8,
276+
'hc32f334xa' : target_HC32F334.HC32F334xA,
277+
'hc32f334' : target_HC32F334.HC32F334xA,
270278
'hc32f448xa' : target_HC32F448.HC32F448xA,
271279
'hc32f448xc' : target_HC32F448.HC32F448xC,
280+
'hc32f448' : target_HC32F448.HC32F448xC,
281+
'hc32a448xa' : target_HC32F448.HC32F448xA,
282+
'hc32a448xc' : target_HC32F448.HC32F448xC,
283+
'hc32a448' : target_HC32F448.HC32F448xC,
272284
'hc32f451xc' : target_HC32F45x.HC32F451xC,
273285
'hc32f451xe' : target_HC32F45x.HC32F451xE,
286+
'hc32f451' : target_HC32F45x.HC32F451xE,
274287
'hc32f452xc' : target_HC32F45x.HC32F452xC,
275288
'hc32f452xe' : target_HC32F45x.HC32F452xE,
289+
'hc32f452' : target_HC32F45x.HC32F452xE,
276290
'hc32f460xc' : target_HC32F460.HC32F460xC,
277291
'hc32f460xe' : target_HC32F460.HC32F460xE,
292+
'hc32f460' : target_HC32F460.HC32F460xE,
278293
'hc32a460xe' : target_HC32F460.HC32F460xE,
294+
'hc32a460' : target_HC32F460.HC32F460xE,
295+
'hc32f467xg' : target_HC32F467.HC32F467xG,
296+
'hc32f467' : target_HC32F467.HC32F467xG,
297+
'hc32f472xc' : target_HC32F472.HC32F472xC,
298+
'hc32f472xe' : target_HC32F472.HC32F472xE,
299+
'hc32f472' : target_HC32F472.HC32F472xE,
279300
'hc32f4a0xg' : target_HC32F4A0.HC32F4A0xG,
280301
'hc32f4a0xi' : target_HC32F4A0.HC32F4A0xI,
302+
'hc32f4a0' : target_HC32F4A0.HC32F4A0xI,
281303
'hc32a4a0xi' : target_HC32F4A0.HC32F4A0xI,
304+
'hc32a4a0' : target_HC32F4A0.HC32F4A0xI,
305+
'hc32f4a2xi' : target_HC32F4A0.HC32F4A0xI,
306+
'hc32f4a2' : target_HC32F4A0.HC32F4A0xI,
282307
'hc32m423xa' : target_HC32M423.HC32M423xA,
283308
'hc32f120x6' : target_HC32x120.HC32F120x6TA,
284309
'hc32f120x8' : target_HC32x120.HC32F120x8TA,
285-
'hc32m120' : target_HC32x120.HC32M120,
310+
'hc32f120' : target_HC32x120.HC32F120x8TA,
286311
'hc32m120x6' : target_HC32x120.HC32M120,
312+
'hc32m120' : target_HC32x120.HC32M120,
313+
'hc32f115x8' : target_HC32F115.HC32F115x8,
314+
'hc32f115' : target_HC32F115.HC32F115x8,
315+
'hc32f155xa' : target_HC32F155.HC32F155xA,
316+
'hc32f155xc' : target_HC32F155.HC32F155xC,
317+
'hc32f155' : target_HC32F155.HC32F155xC,
287318
'hc32f160xa' : target_HC32F160.HC32F160xA,
288319
'hc32f160xc' : target_HC32F160.HC32F160xC,
320+
'hc32f160' : target_HC32F160.HC32F160xC,
289321
'hc32l110' : target_HC32L110.HC32L110,
290322
'hc32f003' : target_HC32L110.HC32F003,
291323
'hc32f005' : target_HC32L110.HC32F005,
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# pyOCD debugger
2+
# Copyright (c) 2024 Huada Semiconductor Corporation
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
from ...coresight.coresight_target import CoreSightTarget
18+
from ...core.memory_map import (FlashRegion, RamRegion, MemoryMap)
19+
from ...debug.svd.loader import SVDFile
20+
21+
22+
class DBGMCU:
23+
MCUSTPCTL = 0x40015004
24+
MCUSTPCTL_VALUE = 0x09
25+
26+
27+
FLASH_ALGO = {
28+
'load_address' : 0x20000000,
29+
30+
# Flash algorithm as a hex string
31+
'instructions': [
32+
0xE00ABE00,
33+
0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x49022001, 0x49026088,
34+
0x47707088, 0x40000800, 0x40000a80, 0xf000b510, 0xbd10f817, 0x4604b510, 0xf0004620, 0xbd10f845,
35+
0x49052000, 0x608860c8, 0x49042007, 0x20007088, 0x490143c0, 0x47706008, 0x40000800, 0x40000a80,
36+
0x2400b510, 0x49162001, 0x460860c8, 0x21ff68c0, 0x43083151, 0x60c84912, 0x60002000, 0x1c64e007,
37+
0x42844810, 0xf000d303, 0x2001f945, 0x480cbd10, 0x21ff6900, 0x40083101, 0xd1f04288, 0x4808e005,
38+
0x21106940, 0x49064308, 0x48056148, 0x21106900, 0x28004008, 0x4902d1f3, 0xbf0060c8, 0x0000e7e6,
39+
0x40000800, 0x00061a80, 0x4604b570, 0xf0002500, 0x2001f921, 0x60c84915, 0x68c04608, 0x314121ff,
40+
0x49124308, 0x200060c8, 0xe0076020, 0x48101c6d, 0xd3034285, 0xf90ef000, 0xbd702001, 0x6900480b,
41+
0x310121ff, 0x42884008, 0xe005d1f0, 0x69404807, 0x43082110, 0x61484905, 0x69004804, 0x40082110,
42+
0xd1f32800, 0x60c84901, 0xe7e6bf00, 0x40000800, 0x00061a80, 0x20ffb510, 0x49033024, 0x48036008,
43+
0xf7ff6008, 0xbd10ff69, 0x40000800, 0x00003210, 0xb082b5f7, 0x2000460c, 0x9f049001, 0xf8daf000,
44+
0x49432001, 0x460860c8, 0x21ff68c0, 0x43083131, 0x60c8493f, 0x26009d02, 0x6838e026, 0x20006028,
45+
0xe00b9001, 0x1c409801, 0x493a9001, 0x42889801, 0xf000d304, 0x2001f8bf, 0xbdf0b005, 0x69004834,
46+
0x40082110, 0xd1ed2810, 0x4831e005, 0x21106940, 0x492f4308, 0x482e6148, 0x21106900, 0x28104008,
47+
0x1d3fd0f3, 0x1c761d2d, 0x42b008a0, 0x07a0d8d5, 0x28000f80, 0x9700d030, 0xe0282600, 0x78009800,
48+
0x20007028, 0xe00a9001, 0x1c409801, 0x49219001, 0x42889801, 0xf000d303, 0x2001f88d, 0x481ce7cc,
49+
0x21106900, 0x28104008, 0xe005d1ee, 0x69404818, 0x43082110, 0x61484916, 0x69004815, 0x40082110,
50+
0xd0f32810, 0x1c409800, 0x1c6d9000, 0x07a01c76, 0x42b00f80, 0xbf00d8d2, 0x490d2000, 0x900160c8,
51+
0x9801e00a, 0x90011c40, 0x9801490a, 0xd3034288, 0xf860f000, 0xe79f2001, 0x69004805, 0x310121ff,
52+
0x42884008, 0xf000d1ed, 0x2000f855, 0x0000e794, 0x40000800, 0x00009c40, 0x4604b570, 0x4616460d,
53+
0xff58f7ff, 0xbd702000, 0x4604b570, 0x4616460d, 0x46294632, 0xf7ff4620, 0xbd70ff5b, 0x49034802,
54+
0x48036088, 0x47706088, 0xffff0123, 0x4000cc00, 0xffff3210, 0x4604b510, 0xfec2f7ff, 0xbd102000,
55+
0x4603b5f8, 0x2100460c, 0x20002600, 0x461e9000, 0xe0062500, 0x6817ce01, 0xd00042b8, 0x1d12e004,
56+
0x08a01c6d, 0xd8f542a8, 0x9600bf00, 0xe0082100, 0x78079800, 0x90001c40, 0x42875c50, 0xe004d000,
57+
0x07a01c49, 0x42880f80, 0xbf00d8f2, 0x18c000a8, 0xbdf81840, 0x4804b510, 0x07c06800, 0x28000fc0,
58+
0xf000d101, 0xbd10f803, 0x40000a80, 0x4823b570, 0xb2846840, 0x68004822, 0x4008210c, 0x48200886,
59+
0x210f6800, 0x40080209, 0x2e000a05, 0x11a4d101, 0x2e01e008, 0x12a4d101, 0x2e02e004, 0x1324d101,
60+
0x13a4e000, 0xd0012d00, 0xd1022d0f, 0xff96f7ff, 0x07e8e022, 0x28000fc0, 0x2c00d004, 0xf7ffd11c,
61+
0xe019ff8d, 0x40282002, 0xd1042802, 0xd1132c01, 0xff84f7ff, 0x2004e010, 0x28044028, 0x2c02d104,
62+
0xf7ffd10a, 0xe007ff7b, 0x40282008, 0xd1032808, 0xd1012c03, 0xff72f7ff, 0x0000bd70, 0x4000cc00,
63+
0x40000a80, 0x00000000
64+
],
65+
66+
# Relative function addresses
67+
'pc_init': 0x2000027d,
68+
'pc_unInit': 0x200002b9,
69+
'pc_program_page': 0x2000028d,
70+
'pc_erase_sector': 0x20000039,
71+
'pc_eraseAll': 0x20000031,
72+
73+
'static_base' : 0x20000000 + 0x00000004 + 0x000003c4,
74+
'begin_stack' : 0x20000600,
75+
'begin_data' : 0x20000000 + 0xA00,
76+
'page_size' : 0x200,
77+
'analyzer_supported' : False,
78+
'analyzer_address' : 0x00000000,
79+
'page_buffers' : [0x20000A00, 0x20000C00], # Enable double buffering
80+
'min_program_length' : 0x200,
81+
82+
# Flash information
83+
'flash_start': 0x0,
84+
'flash_size': 0x10000,
85+
'sector_sizes': (
86+
(0x0, 0x200),
87+
)
88+
}
89+
90+
91+
class HC32F115x8(CoreSightTarget):
92+
93+
VENDOR = "HDSC"
94+
95+
MEMORY_MAP = MemoryMap(
96+
FlashRegion( start=0x00000000, length=0x10000, page_size=0x200, sector_size=0x200,
97+
is_boot_memory=True,
98+
algo=FLASH_ALGO),
99+
RamRegion( start=0x20000000, length=0x1000)
100+
)
101+
102+
def __init__(self, session):
103+
super(HC32F115x8, self).__init__(session, self.MEMORY_MAP)
104+
self._svd_location = SVDFile.from_builtin("HC32F115.svd")
105+
106+
def post_connect_hook(self):
107+
self.write32(DBGMCU.MCUSTPCTL, DBGMCU.MCUSTPCTL_VALUE)
108+

0 commit comments

Comments
 (0)