Skip to content

Commit 7ebb737

Browse files
Sadik.Ozermathias-arm
authored andcommitted
Add MAX78000FTHR
Signed-off-by: Sadik.Ozer <[email protected]>
1 parent 4086582 commit 7ebb737

File tree

6 files changed

+172
-0
lines changed

6 files changed

+172
-0
lines changed

projects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ projects:
654654
- *module_if
655655
- *module_hic_max32625
656656
- records/board/max32666fthr.yaml
657+
max32625_max78000fthr_if:
658+
- *module_if
659+
- *module_hic_max32625
660+
- records/board/max78000fthr.yaml
657661
sam3u2c_mkit_dk_dongle_nrf5x_if:
658662
- *module_if
659663
- *module_hic_sam3u2c

records/board/max78000fthr.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/max78000fthr.c
5+
family:
6+
- source/family/maxim/max78000/target.c
7+
- source/family/maxim/target_reset_max32xxx.c

source/board/max78000fthr.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @file max78000fthr.c
3+
* @brief board ID for the Maxim Integrated's MAX78000FTHR
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (C) Maxim Integrated Products, Inc., 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 = "0423",
28+
.family_id = kMaxim_MAX3266X_FamilyID,
29+
.flags = kEnablePageErase,
30+
.target_cfg = &target_device,
31+
.daplink_url_name = "MAX78000HTM",
32+
.daplink_target_url = "http://www.maximintegrated.com/max78000fthr",
33+
};
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* @file flash_blob.c
3+
* @brief Flash algorithm for the MAX78000
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (C) Maxim Integrated Products, Inc., 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 CLK_DIV 0x00000064
26+
#define BRST_SIZE 0x00000080
27+
#define FLASH_BASE 0x10000000
28+
#define FLASH_SIZE KB(512)
29+
#define FLASH_SECTOR KB(8)
30+
31+
#define DEV_CFG_TARGET_ADDRESS (0x0000025cUL) // From flash_algo map file
32+
#define FLASH_ALGO_GEN_ADDER 32
33+
#define DEV_CFG_LOCAL_ADDRESS ((uint8_t*)((unsigned int)flash_algo_blob + DEV_CFG_TARGET_ADDRESS + FLASH_ALGO_GEN_ADDER))
34+
35+
const uint32_t flash_algo_blob[] = {
36+
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
37+
0x4603b510, 0x4893460c, 0x68414448, 0xf0006888, 0xb1087080, 0xbd102001, 0x4448488e, 0x60486880,
38+
0xe7f82000, 0x488b4602, 0x68414448, 0xf0206888, 0x60884070, 0x47702000, 0x44484886, 0x68886841,
39+
0x7080f000, 0x2001b108, 0x6a484770, 0x2000b148, 0x6a486248, 0x2002b128, 0x6a486248, 0x2001b108,
40+
0x6888e7f2, 0x4070f020, 0x5000f040, 0x20006088, 0xb510e7ea, 0x44484877, 0xf7ff6844, 0xb108ffdd,
41+
0xbd102001, 0xf42068a0, 0xf440407f, 0x60a0402a, 0xf04068a0, 0x60a00002, 0x68a0bf00, 0x7080f000,
42+
0xd1fa2800, 0xf02068a0, 0x60a04070, 0xf0006a60, 0xb1080002, 0xe7e42001, 0xe7e22000, 0x4605b570,
43+
0x44484864, 0xf7ff6844, 0xb108ffb7, 0xbd702001, 0xf42068a0, 0xf440407f, 0x60a040aa, 0x68a06025,
44+
0x0004f040, 0xbf0060a0, 0xf00068a0, 0x28007080, 0x68a0d1fa, 0x4070f020, 0x6a6060a0, 0x0002f000,
45+
0x2001b108, 0x2000e7e3, 0xe92de7e1, 0x460747f0, 0x4690468a, 0x4448484f, 0x46566844, 0xf0084645,
46+
0xb1100003, 0xe8bd2001, 0x464587f0, 0xff84f7ff, 0x2001b108, 0x68a0e7f7, 0x6000f020, 0x68a060a0,
47+
0x0010f040, 0xe00e60a0, 0xcd016027, 0x68a06320, 0x0001f040, 0xbf0060a0, 0xf00068a0, 0x28007080,
48+
0x1d3fd1fa, 0x2e041f36, 0xf007d303, 0x2800001f, 0x4838d1ea, 0x68c04448, 0xd1212880, 0xd31f2e10,
49+
0xf02068a0, 0x60a00010, 0xf04068a0, 0x60a06000, 0x6027e014, 0x6320cd01, 0x6360cd01, 0x63a0cd01,
50+
0x63e0cd01, 0xf04068a0, 0x60a00001, 0x68a0bf00, 0x7080f000, 0xd1fa2800, 0x3e103710, 0xd2e82e10,
51+
0xd3192e04, 0xf02068a0, 0x60a06000, 0xf04068a0, 0x60a00010, 0x6027e00e, 0x6320cd01, 0xf04068a0,
52+
0x60a00001, 0x68a0bf00, 0x7080f000, 0xd1fa2800, 0x1f361d3f, 0xd2ee2e04, 0x68a2b306, 0x6200f022,
53+
0x68a260a2, 0x0210f042, 0xf04f60a2, 0x21ff30ff, 0x682ae005, 0x0201ea62, 0x02094010, 0x2e001e76,
54+
0x6027d1f7, 0x68a26320, 0x0201f042, 0xbf0060a2, 0xf00268a2, 0x2a007280, 0xbf00d1fa, 0xf02068a0,
55+
0x60a04070, 0xf0006a60, 0xb1080002, 0xe76a2001, 0xe7682000, 0x00000004, 0x00000000, 0x00000000,
56+
FLC_BASE, CLK_DIV, BRST_SIZE, FLASH_BASE, FLASH_SIZE, FLASH_SECTOR,
57+
};
58+
59+
/**
60+
* List of start and size for each size of flash sector
61+
* The size will apply to all sectors between the listed address and the next address
62+
* in the list.
63+
* The last pair in the list will have sectors starting at that address and ending
64+
* at address start + size.
65+
*/
66+
static const sector_info_t sectors_info[] = {
67+
{FLASH_BASE, FLASH_SECTOR},
68+
};
69+
70+
const program_target_t flash = {
71+
0x20000021, // Init
72+
0x20000045, // UnInit
73+
0x20000093, // EraseChip
74+
0x200000DD, // EraseSector
75+
0x2000012B, // ProgramPage
76+
0x00000000, // Verify
77+
78+
// RSB : base address is address of Execution Region PrgData in map file
79+
// to access global/static data
80+
// RSP : Initial stack pointer
81+
{0x20000001, 0x20000258 + FLASH_ALGO_GEN_ADDER, 0x20001000}, // {breakpoint, RSB, RSP}
82+
83+
0x20000400, // program_buffer
84+
0x20000000, // algo_start
85+
sizeof(flash_algo_blob), // algo_size
86+
flash_algo_blob, // image
87+
88+
512 // ram_to_flash_bytes_to_be_written
89+
};
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 MAX78000
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (C) Maxim Integrated Products, Inc., 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+
/* MAX78000 512KiB Flash, 128KiB 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(128),
36+
};

test/info.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
('max32625_max32630fthr_if', False, 0x0000, "bin" ),
133133
('max32625_max32660evsys_if', False, 0x0000, "bin" ),
134134
('max32625_max32666fthr_if', False, 0x0000, "bin" ),
135+
('max32625_max78000fthr_if', False, 0x0000, "bin" ),
135136
('kl26z_if', False, 0x0000, "bin" ),
136137
('k20dx_if', False, 0x0000, "bin" ),
137138
('k26f_if', False, 0x0000, "bin" ),
@@ -197,6 +198,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
197198
( 0x0418, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32620fthr_if', 'max32625_bl', 'MAX32620' ),
198199
( 0x0421, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32660evsys_if', 'max32625_bl', 'MAX32660' ),
199200
( 0x0422, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max32666fthr_if', 'max32625_bl', 'MAX32666' ),
201+
( 0x0423, VENDOR_TO_FAMILY('Stub', 1), 'max32625_max78000fthr_if', 'max32625_bl', 'MAX78000' ),
200202
( 0x0450, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_mtb_ublox_odin_w2_if', None, None ),
201203
( 0x0451, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_mtb_mxchip_emw3166_if', None, None ), # TODO - set target when mbed-os supports this
202204
( 0x0453, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_mtb_mts_xdot_if', None, None ),
@@ -365,6 +367,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
365367
0x0418, # MAX32620FTHR
366368
0x0421, # MAX32660EVSYS
367369
0x0422, # MAX32666FTHR
370+
0x0423, # MAX78000FTHR
368371
0x0450, # mtb_ublox_odin_w2
369372
0x0456, # lpc11u35_mtb_murata_abz_078_if
370373
0x0457, # lpc11u35_mtb_rak811_if

0 commit comments

Comments
 (0)