Skip to content

Commit 186d8e5

Browse files
Sadik.Ozermathias-arm
authored andcommitted
Add MAX32670EVKIT support
Signed-off-by: Sadik.Ozer <[email protected]>
1 parent 293647c commit 186d8e5

File tree

6 files changed

+167
-0
lines changed

6 files changed

+167
-0
lines changed

projects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ projects:
534534
- *module_if
535535
- *module_hic_max32625
536536
- records/board/max78000fthr.yaml
537+
max32625_max32670evkit_if:
538+
- *module_if
539+
- *module_hic_max32625
540+
- records/board/max32670evkit.yaml
537541
nrf52820_microbit_bl:
538542
- *module_bl
539543
- records/hic_hal/nrf52820.yaml

records/board/max32670evkit.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/max32670evkit.c
5+
family:
6+
- source/family/maxim/max32670/target.c
7+
- source/family/maxim/target_reset_max32xxx.c

source/board/max32670evkit.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @file max32670evkit.c
3+
* @brief board ID for the Maxim Integrated's max32670evkit
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "target_family.h"
23+
#include "target_board.h"
24+
25+
const board_info_t g_board_info = {
26+
.info_version = kBoardInfoVersion,
27+
.board_id = "0424",
28+
.family_id = kMaxim_MAX3266X_FamilyID,
29+
.flags = kEnablePageErase,
30+
.target_cfg = &target_device,
31+
.daplink_url_name = "MAX32670HTM",
32+
.daplink_target_url = "http://www.maximintegrated.com/max32670evkit",
33+
};
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/**
2+
* @file flash_blob.c
3+
* @brief Flash algorithm for the MAX32670
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "flash_blob.h"
23+
24+
#define FLC_BASE 0x40029000
25+
#define CLOCK_DIV 0x00000060
26+
#define BURST_SIZE 0x00000080
27+
#define FLASH_BASE 0x10000000
28+
#define FLASH_SIZE KB(384)
29+
#define FLASH_SECTOR KB(8)
30+
31+
static const uint32_t flash_algo_blob[] = {
32+
0xE00ABE00,
33+
0x44494975, 0x68826808, 0x0f07f012, 0x2001bf1c, 0x68494770, 0x20006041, 0x486f4770, 0x68004448,
34+
0xf0216881, 0x60814170, 0x47702000, 0xb510486a, 0x68044448, 0xf8b4f000, 0x68a0b9b0, 0x407ff420,
35+
0x402af440, 0x68a060a0, 0x0002f040, 0x68a060a0, 0x0f02f010, 0x68a0d1fb, 0x4070f020, 0x6a6060a0,
36+
0x0002f010, 0xbd10bf08, 0xbd102001, 0x4605b570, 0x44484859, 0xf0006804, 0xb9b8f893, 0xf42068a0,
37+
0xf440407f, 0x60a040aa, 0x68a06025, 0x0004f040, 0x68a060a0, 0x0f04f010, 0x68a0d1fb, 0x4070f020,
38+
0x6a6060a0, 0x0002f010, 0xbd70bf08, 0xbd702001, 0x41f0e92d, 0x8120f8df, 0x44c8460d, 0xf8d84606,
39+
0x46174000, 0x0f03f012, 0xf000d167, 0x2800f869, 0xe00dd163, 0xf8576026, 0x63200b04, 0xf04068a0,
40+
0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x1d361f2d, 0xd3022d04, 0x0f1ff016, 0xf8d8d1ec, 0x28800008,
41+
0x2d10d11a, 0x6026d318, 0x0b04f857, 0xf8576320, 0x63600b04, 0x0b04f857, 0xf85763a0, 0x63e00b04,
42+
0xf04068a0, 0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x36103d10, 0xd2e62d10, 0xd30f2d04, 0xf8576026,
43+
0x63200b04, 0xf04068a0, 0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x1d361f2d, 0xd2ef2d04, 0x683ab19d,
44+
0x31fff04f, 0xea6220ff, 0x40190300, 0x1e6d0200, 0x6026d1f9, 0x68a06321, 0x0001f040, 0x68a060a0,
45+
0x0f01f010, 0x68a0d1fb, 0x4070f020, 0x6a6060a0, 0x0002f010, 0xe8bdbf08, 0x200181f0, 0x81f0e8bd,
46+
0x4448480d, 0x68816800, 0x0f07f011, 0x6a41d109, 0x2100b149, 0x6a416241, 0x2102b129, 0x6a416241,
47+
0x2001b109, 0x68814770, 0x4170f021, 0x5100f041, 0x20006081, 0x00004770, 0x00000004, 0x00000000,
48+
FLC_BASE, CLOCK_DIV, BURST_SIZE,
49+
};
50+
51+
/**
52+
* List of start and size for each size of flash sector - even indexes are start, odd are size
53+
* The size will apply to all sectors between the listed address and the next address
54+
* in the list.
55+
* The last pair in the list will have sectors starting at that address and ending
56+
* at address flash_start + flash_size.
57+
*/
58+
static const sector_info_t sectors_info[] = {
59+
FLASH_BASE, FLASH_SECTOR,
60+
};
61+
62+
static const program_target_t flash = {
63+
0x20000005, // Init
64+
0x2000001f, // UnInit
65+
0x20000031, // EraseChip
66+
0x20000071, // EraseSector
67+
0x200000b5, // ProgramPage
68+
0x00000000, // Verify
69+
70+
// BKPT : start of blob + 1
71+
// RSB : blob start + header + rw data offset
72+
// RSP : stack pointer
73+
{
74+
0x20000001,
75+
0x200001e0,
76+
0x20000400
77+
},
78+
79+
0x20000000 + 0x00000A00, // mem buffer location
80+
0x20000000, // location to write prog_blob in target RAM
81+
sizeof(flash_algo_blob), // prog_blob size
82+
flash_algo_blob, // address of prog_blob
83+
0x00002000 // ram_to_flash_bytes_to_be_written
84+
};

source/family/maxim/max32670/target.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @file target.c
3+
* @brief Target information for the MAX32670
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "target_config.h"
23+
24+
#include "flash_blob.c"
25+
26+
/* MAX32670 384KiB Flash, 160KiB RAM */
27+
target_cfg_t target_device = {
28+
.sectors_info = sectors_info,
29+
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
30+
.flash_regions[0].start = FLASH_BASE,
31+
.flash_regions[0].end = FLASH_BASE + FLASH_SIZE,
32+
.flash_regions[0].flags = kRegionIsDefault,
33+
.flash_regions[0].flash_algo = (program_target_t *) &flash,
34+
.ram_regions[0].start = 0x20000000,
35+
.ram_regions[0].end = 0x20000000 + KB(160),
36+
};

test/info.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
('max32625_max32660evsys_if', False, 0x0000, "bin" ),
9797
('max32625_max32666fthr_if', False, 0x0000, "bin" ),
9898
('max32625_max78000fthr_if', False, 0x0000, "bin" ),
99+
('max32625_max32670evkit_if', False, 0x0000, "bin" ),
99100
('kl26z_if', False, 0x0000, "bin" ),
100101
('k20dx_if', False, 0x0000, "bin" ),
101102
('k26f_if', False, 0x0000, "bin" ),
@@ -173,6 +174,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
173174
( 0x0421, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32660evsys_if', 'max32625_bl', 'MAX32660' ),
174175
( 0x0422, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32666fthr_if', 'max32625_bl', 'MAX32666' ),
175176
( 0x0423, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max78000fthr_if', 'max32625_bl', 'MAX78000' ),
177+
( 0x0424, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32670evkit_if', 'max32625_bl', 'MAX32670' ),
176178
( 0x0700, VENDOR_TO_FAMILY('Stub', 1), 'stm32f103xb_stm32f103rb_if', 'stm32f103xb_bl', 'ST-Nucleo-F103RB' ),
177179
( 0x0720, VENDOR_TO_FAMILY('Stub', 1), 'stm32f103xb_stm32f401re_if', 'stm32f103xb_bl', 'ST-Nucleo-F401RE' ),
178180
( 0x0720, VENDOR_TO_FAMILY('Stub', 1), 'stm32f103xb_stm32f072rb_if', 'stm32f103xb_bl', 'ST-Nucleo-F072RB' ),
@@ -305,6 +307,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
305307
0x0421, # MAX32660EVSYS
306308
0x0422, # MAX32666FTHR
307309
0x0423, # MAX78000FTHR
310+
0x0424, # MAX32670EVKIT
308311
0x0460, # WISE-1570
309312
0x1101, # Nordic-nRF52-DK
310313
0x1102, # Nordic-nRF52840-DK

0 commit comments

Comments
 (0)