From 33e0c58d0a5bed8d9b4cc62519fe17f58b1feea0 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Tue, 23 Jan 2018 11:24:40 -0600 Subject: [PATCH] Add the MTB Murata-ABZ-078 board Add the file necessary for the MTB Murata-ABZ-078 board. --- projects.yaml | 4 ++ records/board/mtb_murata_abz_078.yaml | 11 ++++ source/board/mtb_murata_abz_078.c | 30 ++++++++++ source/target/st/stm32l082cz/flash_blob.c | 72 +++++++++++++++++++++++ source/target/st/stm32l082cz/target.c | 36 ++++++++++++ test/info.py | 1 + 6 files changed, 154 insertions(+) create mode 100644 records/board/mtb_murata_abz_078.yaml create mode 100644 source/board/mtb_murata_abz_078.c create mode 100644 source/target/st/stm32l082cz/flash_blob.c create mode 100644 source/target/st/stm32l082cz/target.c diff --git a/projects.yaml b/projects.yaml index 49834101b..1dcc6eb54 100644 --- a/projects.yaml +++ b/projects.yaml @@ -329,6 +329,10 @@ projects: - *module_if - *module_hic_lpc11u35 - records/board/mtb_mxchip_emw3166.yaml + lpc11u35_mtb_murata_abz_078_if: + - *module_if + - *module_hic_lpc11u35 + - records/board/mtb_murata_abz_078.yaml lpc11u35_mtb_wise1510_if: - *module_if - *module_hic_lpc11u35 diff --git a/records/board/mtb_murata_abz_078.yaml b/records/board/mtb_murata_abz_078.yaml new file mode 100644 index 000000000..27e677bdd --- /dev/null +++ b/records/board/mtb_murata_abz_078.yaml @@ -0,0 +1,11 @@ +common: + macros: + - IO_CONFIG_OVERRIDE + includes: + - source/board/override_mtb + sources: + board: + - source/board/mtb_murata_abz_078.c + target: + - source/target/st/stm32l082cz/target.c + - source/target/st/target_reset.c diff --git a/source/board/mtb_murata_abz_078.c b/source/board/mtb_murata_abz_078.c new file mode 100644 index 000000000..092cb4dd4 --- /dev/null +++ b/source/board/mtb_murata_abz_078.c @@ -0,0 +1,30 @@ +/** + * @file 96b_nitrogen.c + * @brief board ID for the Seeed Studio 96Boards Nitrogen board + * + * DAPLink Interface Firmware + * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdbool.h" +#include "flash_manager.h" + +const char *board_id = "0456"; + +void prerun_board_config(void) +{ + flash_manager_set_page_erase(true); +} diff --git a/source/target/st/stm32l082cz/flash_blob.c b/source/target/st/stm32l082cz/flash_blob.c new file mode 100644 index 000000000..95dfbf70c --- /dev/null +++ b/source/target/st/stm32l082cz/flash_blob.c @@ -0,0 +1,72 @@ +/* Flash OS Routines (Automagically Generated) + * Copyright (c) 2009-2015 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "flash_blob.h" + +static const uint32_t stm32l0xx_192_flash_prog_blob[] = { + 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, + 0x4603b510, 0x69804851, 0x0224240f, 0x4c4f4320, 0x484f61a0, 0x484f60e0, 0x484f60e0, 0x484f6120, + 0x46206120, 0x240169c0, 0x40200524, 0xd1062800, 0x4c4c484b, 0x20066020, 0x484b6060, 0x200060a0, + 0x4601bd10, 0x68404841, 0x43102202, 0x60504a3f, 0x68404610, 0x43102201, 0x60504a3c, 0x47702000, + 0x483a4601, 0x22016840, 0x43100252, 0x60504a37, 0x68404610, 0x43102208, 0x60504a34, 0x60082000, + 0x483ae002, 0x60104a37, 0x69804830, 0x0fc007c0, 0xd1f62800, 0x6840482d, 0x02522201, 0x4a2b4390, + 0x46106050, 0x22086840, 0x4a284390, 0x20006050, 0x46034770, 0x47702001, 0x4603b570, 0x303f4608, + 0x01890981, 0xe03b2500, 0x68404820, 0x02b62601, 0x4e1e4330, 0x46306070, 0x26086840, 0x4e1b4330, + 0x24406070, 0x6810e004, 0x1d1b6018, 0x1f241d12, 0xd1f82c00, 0x481de002, 0x60304e1a, 0x69804813, + 0x0fc007c0, 0xd1f62800, 0x69804810, 0x0236260f, 0x28004030, 0x480dd006, 0x43306980, 0x61b04e0b, + 0xbd702001, 0x68404809, 0x02b62601, 0x4e0743b0, 0x46306070, 0x26086840, 0x4e0443b0, 0x1c6d6070, + 0x42a80988, 0x2000d8c0, 0x0000e7eb, 0x40022000, 0x89abcdef, 0x02030405, 0x8c9daebf, 0x13141516, + 0x00005555, 0x40003000, 0x00000fff, 0x0000aaaa, 0x00000000 +}; + +// Start address of flash +static const uint32_t flash_start = 0x08000000; +// Size of flash +static const uint32_t flash_size = 0x00030000; + +/** +* List of start and size for each size of flash sector - even indexes are start, odd are size +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address flash_start + flash_size. +*/ +static const uint32_t sectors_info[] = { + 0x08000000, 0x00000080, +}; + +static const program_target_t flash = { + 0x20000021, // Init + 0x20000063, // UnInit + 0x00000000, // EraseChip - NOT SUPPORTED + 0x20000081, // EraseSector + 0x200000d9, // ProgramPage + + // BKPT : start of blob + 1 + // RSB : blob start + header + rw data offset + // RSP : stack pointer + { + 0x20000001, + 0x20000190, + 0x20000800 + }, + + 0x20000000 + 0x00000A00, // mem buffer location + 0x20000000, // location to write prog_blob in target RAM + sizeof(stm32l0xx_192_flash_prog_blob), // prog_blob size + stm32l0xx_192_flash_prog_blob, // address of prog_blob + 0x00000080 // ram_to_flash_bytes_to_be_written +}; diff --git a/source/target/st/stm32l082cz/target.c b/source/target/st/stm32l082cz/target.c new file mode 100644 index 000000000..b071eb49a --- /dev/null +++ b/source/target/st/stm32l082cz/target.c @@ -0,0 +1,36 @@ +/** + * @file target.c + * @brief Target information for the stm32l082cz + * + * DAPLink Interface Firmware + * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "target_config.h" + +// The file flash_blob.c must only be included in target.c +#include "flash_blob.c" + +// target information +target_cfg_t target_device = { + .sector_size = 0x80, + .sector_cnt = (0x30000 / 0x80), + .flash_start = 0x08000000, + .flash_end = 0x08030000, + .ram_start = 0x20000000, + .ram_end = 0x20005000, + .flash_algo = (program_target_t *) &flash +}; diff --git a/test/info.py b/test/info.py index 233eecf5b..5e02446a0 100644 --- a/test/info.py +++ b/test/info.py @@ -109,6 +109,7 @@ ( 0x311, 'k20dx_frdmk66f_if', 'k20dx_bl', None ), # TODO - set target to 'FRDM-K66F' when mbed-os supports this ( 0x350, 'k20dx_xdot_l151_if', 'k20dx_bl', None ), # TODO - set target to 'MTS-xDot-L151CC' when mbed-os supports this ( 0x0451, 'lpc11u35_mtb_mxchip_emw3166_if', None, None ), # TODO - set target when mbed-os supports this + ( 0x0456, 'lpc11u35_mtb_murata_abz_078_if', None, None ), # TODO - set target when mbed-os supports this ( 0x458, 'lpc11u35_mtb_wise1510_if', None, None ), # TODO - set target when mbed-os supports this ( 0x459, 'lpc11u35_mtb_wise1530_if', None, None ), # TODO - set target when mbed-os supports this ( 0x460, 'lpc11u35_mtb_wise1570_if', None, None ), # TODO - set target when mbed-os supports this