Skip to content

Commit 03e6b46

Browse files
Merge pull request #3 from ARMmbed/master
merge from master repo
2 parents d393e15 + 7f05a61 commit 03e6b46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9741
-22
lines changed

projects.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ module:
5858
hic_max32620: &module_hic_max32620
5959
- records/rtos/rtos-cm4.yaml
6060
- records/hic_hal/max32620.yaml
61+
hic_max32625: &module_hic_max32625
62+
- records/rtos/rtos-cm4.yaml
63+
- records/hic_hal/max32625.yaml
6164

6265
projects:
6366
kl26z_bl:
@@ -100,6 +103,10 @@ projects:
100103
- *module_bl
101104
- *module_hic_stm32f103xb
102105
- records/board/stm32f103xb_bl.yaml
106+
max32625_bl:
107+
- *module_bl
108+
- *module_hic_max32625
109+
- records/board/max32625_bl.yaml
103110
stm32f103xb_if:
104111
- *module_if
105112
- *module_hic_stm32f103xb
@@ -560,3 +567,11 @@ projects:
560567
- *module_if
561568
- *module_hic_max32620
562569
- records/family/all_family.yaml
570+
max32625_max32620fthr_if:
571+
- *module_if
572+
- *module_hic_max32625
573+
- records/board/max32620fthr.yaml
574+
max32625_if:
575+
- *module_if
576+
- *module_hic_max32625
577+
- records/family/all_family.yaml

records/board/max32620fthr.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/max32620fthr.c
5+
family:
6+
- source/family/maxim/max32620/target.c
7+
- source/family/maxim/max32620/flash_blob.c

records/board/max32625_bl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/max32625_bl.c

records/hic_hal/max32625.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
common:
2+
target:
3+
- max32625
4+
core:
5+
- Cortex-M4F
6+
macros:
7+
- INTERFACE_MAX32625
8+
- DAPLINK_HIC_ID=0x97969906 # DAPLINK_HIC_ID_MAX32625
9+
includes:
10+
- source/hic_hal/maxim/max32625
11+
sources:
12+
hic_hal:
13+
- source/hic_hal/maxim/max32625
14+
- source/hic_hal/maxim/max32625/armcc
15+
16+
tool_specific:
17+
uvision:
18+
misc:
19+
ld_flags:
20+
- --predefine="-I..\..\..\source\hic_hal\maxim\max32625"
21+
make_armcc:
22+
misc:
23+
ld_flags:
24+
- --predefine="-Isource\hic_hal\maxim\max32625"

source/board/max32620fthr.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* @file max32620fthr.c
3+
* @brief board ID for the Maxim Integrated's MAX32620FTHR
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+
.board_id = "0418",
27+
.family_id = kStub_HWReset_FamilyID,
28+
.flags = kEnablePageErase,
29+
.target_cfg = &target_device,
30+
};

source/board/max32625_bl.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* @file max32625_bl.c
3+
* @brief board ID and meta-data for the hardware interface circuit (HIC) based on MAX32625
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_config.h"
23+
#include "target_board.h"
24+
#include "target_family.h"
25+
26+
const char *board_id = "0000";
27+
28+
/* ME03 -- MAX32625 512KiB Flash, 160KiB RAM */
29+
target_cfg_t target_device = {
30+
.sector_size = 0x2000,
31+
// Assume memory is regions are same size. Flash algo should ignore requests
32+
// when variable sized sectors exist
33+
// .sector_cnt = ((.flash_end - .flash_start) / .sector_size);
34+
.sector_cnt = ((KB(512) - 0x10000) / 0x2000),
35+
.flash_start = 0x00000000 + 0x10000,
36+
.flash_end = 0x00000000 + KB(512),
37+
.ram_start = 0x20000000,
38+
.ram_end = 0x20028000
39+
/* .flash_algo not needed for bootloader */
40+
};
41+
42+
//bootloader has no family
43+
const target_family_descriptor_t *g_target_family = NULL;
44+
45+
const board_info_t g_board_info = {
46+
.infoVersion = 0x0,
47+
.board_id = "0000",
48+
.daplink_url_name = "HELP_FAQHTM",
49+
.daplink_drive_name = "MAINTENANCE",
50+
.daplink_target_url = "https://mbed.com/daplink",
51+
.target_cfg = &target_device,
52+
};

source/daplink/RTX_Config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
#define OS_CLOCK 96000000
9494
#elif defined(INTERFACE_STM32F103XB)
9595
#define OS_CLOCK 72000000
96-
#elif defined(INTERFACE_MAX32620)
96+
#elif defined(INTERFACE_MAX32620) || defined(INTERFACE_MAX32625)
9797
#define OS_CLOCK 96000000
9898
#endif
9999
#endif

source/daplink/drag-n-drop/vfs_manager.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ static void transfer_update_file_info(vfs_file_t file, uint32_t start_sector, ui
609609
}
610610

611611
// Check - stream must be the same
612-
if (stream != file_transfer_state.stream) {
613-
vfs_mngr_printf(" error: changed types during transfer from %i to %i\r\n", stream, file_transfer_state.stream);
612+
if ((stream != STREAM_TYPE_NONE) && (stream != file_transfer_state.stream)) {
613+
vfs_mngr_printf(" error: changed types during transfer from %i to %i\r\n", file_transfer_state.stream, stream);
614614
transfer_update_state(ERROR_ERROR_DURING_TRANSFER);
615615
return;
616616
}
@@ -675,7 +675,7 @@ static void transfer_stream_open(stream_type_t stream, uint32_t start_sector)
675675

676676
// Check - stream must be the same
677677
if (stream != file_transfer_state.stream) {
678-
vfs_mngr_printf(" error: changed types during tranfer from %i to %i\r\n", stream, file_transfer_state.stream);
678+
vfs_mngr_printf(" error: changed types during transfer from %i to %i\r\n", file_transfer_state.stream, stream);
679679
transfer_update_state(ERROR_ERROR_DURING_TRANSFER);
680680
return;
681681
}

source/daplink/drag-n-drop/vfs_user.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static uint32_t read_file_details_txt(uint32_t sector_offset, uint8_t *data, uin
233233
if (sector_offset != 0) {
234234
return 0;
235235
}
236-
236+
237237
return update_details_txt_file(data, VFS_SECTOR_SIZE);
238238
}
239239

@@ -353,7 +353,7 @@ static uint32_t read_file_need_bl_txt(uint32_t sector_offset, uint8_t *data, uin
353353

354354

355355
static uint32_t update_html_file(uint8_t *data, uint32_t datasize)
356-
{
356+
{
357357
char *buf = (char *)data;
358358
//Needed by expand_info strlen
359359
memset(buf, 0, datasize);
@@ -366,12 +366,12 @@ static uint32_t update_details_txt_file(uint8_t *data, uint32_t datasize)
366366
{
367367
uint32_t pos=0;
368368
const char *mode_str;
369-
369+
370370
char *buf = (char *)data;
371-
371+
372372
//Needed by expand_info strlen
373373
memset(buf, 0, datasize);
374-
374+
375375
pos += util_write_string(buf + pos, "# DAPLink Firmware - see https://mbed.com/daplink\r\n");
376376
// Unique ID
377377
pos += util_write_string(buf + pos, "Unique ID: @U\r\n");
@@ -449,16 +449,16 @@ static uint32_t update_details_txt_file(uint8_t *data, uint32_t datasize)
449449
pos += util_write_string(buf + pos, "Remount count: ");
450450
pos += util_write_uint32(buf + pos, remount_count);
451451
pos += util_write_string(buf + pos, "\r\n");
452-
452+
453453
//Target URL
454454
pos += util_write_string(buf + pos, "URL: @R\r\n");
455-
455+
456456
return expand_info(data, datasize);
457457
}
458458

459459
// Fill buf with the contents of the mbed redirect file by
460460
// expanding the special characters in mbed_redirect_file.
461-
static uint32_t expand_info(uint8_t *buf, uint32_t bufsize)
461+
static uint32_t expand_info(uint8_t *buf, uint32_t bufsize)
462462
{
463463
uint8_t *orig_buf = buf;
464464
uint8_t *insert_string;
@@ -529,13 +529,13 @@ static uint32_t expand_info(uint8_t *buf, uint32_t bufsize)
529529
memcpy(buf, insert_string, str_len);
530530
}else{
531531
//stop the string expansion and leave as it is
532-
buf += buf_len;
532+
buf += buf_len;
533533
break;
534534
}
535-
535+
536536
}
537537
} while (*buf != '\0');
538-
538+
539539
return (buf - orig_buf);
540540
}
541541

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/**
2+
* @file flash_blob.c
3+
* @brief Flash algorithm for the MAX32620
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 "flash_blob.h"
23+
24+
#define FLC_BASE 0x40002000
25+
#define CLK_DIV 0x00000060
26+
#define BRST_SIZE 0x00000020
27+
#define FLASH_BASE 0x00000000
28+
#define FLASH_SIZE 0x00200000
29+
#define FLASH_SECTOR 0x00002000
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+
const program_target_t flash = {
60+
0x20000021, // Init
61+
0x20000045, // UnInit
62+
0x20000093, // EraseChip
63+
0x200000DD, // EraseSector
64+
0x2000012B, // ProgramPage
65+
0x00000000, // Verify
66+
67+
// RSB : base address is address of Execution Region PrgData in map file
68+
// to access global/static data
69+
// RSP : Initial stack pointer
70+
{0x20000001, 0x20000258 + FLASH_ALGO_GEN_ADDER, 0x20001000}, // {breakpoint, RSB, RSP}
71+
72+
0x20000400, // program_buffer
73+
0x20000000, // algo_start
74+
sizeof(flash_algo_blob), // algo_size
75+
flash_algo_blob, // image
76+
77+
512 // ram_to_flash_bytes_to_be_written
78+
};

0 commit comments

Comments
 (0)