gerrit
2017-06-03 03:32:19 UTC
This is an automated email from Gerrit.
Edward Fewell (***@ti.com) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4153
-- gerrit
commit 0a11b7f20fd8756d9dccfac4a09e412bcfd95c1b
Author: Edward Fewell <***@ti.com>
Date: Fri Jun 2 21:20:26 2017 -0500
flash/nor: add support for TI MSP432P4 devices
Added msp432p4 flash driver to support the TI MSP432P4xx microcontrollers.
Implemented the same flash algo helper as used in the TI debug and flash
tools. Implemention supports both the Falcon and Falcon 2M variants of
these devices. Added command to mass erase device for consistency with TI
tools and added command to unlock the protected BSL region.
Tested using MSP432P401R and MSP432P4111 Launchpads. Tested with embedded
XDS110 debug probe in CMSIS-DAP mode and with external SEGGER J-Link probe.
Also tested in both JTAG and SWD modes with each probe/board combination.
Change-Id: I3b29d39ccc492524ef2c4a1733f7f9942c2684c0
Signed-off-by: Edward Fewell <***@ti.com>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 59d2d4f..f0861a0 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -5689,6 +5689,39 @@ if @{ [info exists IMEMORY] && [string equal $IMEMORY true] @} @{
@end example
@end deffn
+@deffn {Flash Driver} msp432p4
+All versions of the SimpleLink MSP432P4xx microcontrollers from Texas
+Instruments include internal flash. The msp432p4 flash driver automatically
+recognizes the specific version's flash parameters and autoconfigures itself.
+Main program flash (starting at address 0) is flash bank 0. Information flash
+region (starting at address 0x200000) is flash bank 1.
+
+@example
+flash bank $_FLASHNAME msp432p4 0 0 0 0 $_TARGETNAME
+@end example
+
+@deffn Command {msp432p4 mass_erase} [main|all]
+Performs a complete erase of flash. By default, @command{mass_erase} will erase
+only the main program flash. Using @command{mass_erase all} will erase both the
+main program and information flash regions. To also erase the BSL in information
+flash, the user must first use the @command{unlock_bsl} command.
+@end deffn
+
+@deffn Command {msp432p4 unlock_bsl}
+Unlocks the bootstrap loader (BSL) region in information flash so that the
+next flash command can erase or write the BSL. After each flash command, the
+BSL is automatically locked.
+
+To erase and program the BSL:
+@example
+msp432p4 unlock_bsl
+flash erase_address 0x202000 0x2000
+msp432p4 unlock_bsl
+flash write_image bsl.bin 0x202000
+@end example
+@end deffn
+@end deffn
+
@deffn {Flash Driver} niietcm4
This drivers handles the integrated NOR flash on NIIET Cortex-M4
based controllers. Flash size and sector layout are auto-configured by the driver.
diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am
index 5a992fe..fb2e4f2 100644
--- a/src/flash/nor/Makefile.am
+++ b/src/flash/nor/Makefile.am
@@ -33,6 +33,7 @@ NOR_DRIVERS = \
%D%/lpc2900.c \
%D%/lpcspifi.c \
%D%/mdr.c \
+ %D%/msp432p4.c \
%D%/mrvlqspi.c \
%D%/niietcm4.c \
%D%/non_cfi.c \
diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c
index 4ad1d92..95ee493 100644
--- a/src/flash/nor/drivers.c
+++ b/src/flash/nor/drivers.c
@@ -47,6 +47,7 @@ extern struct flash_driver lpc2900_flash;
extern struct flash_driver lpcspifi_flash;
extern struct flash_driver mdr_flash;
extern struct flash_driver mrvlqspi_flash;
+extern struct flash_driver msp432p4_flash;
extern struct flash_driver niietcm4_flash;
extern struct flash_driver nrf51_flash;
extern struct flash_driver numicro_flash;
@@ -100,6 +101,7 @@ static struct flash_driver *flash_drivers[] = {
&lpcspifi_flash,
&mdr_flash,
&mrvlqspi_flash,
+ &msp432p4_flash,
&niietcm4_flash,
&nrf51_flash,
&numicro_flash,
diff --git a/src/flash/nor/msp432p4.c b/src/flash/nor/msp432p4.c
new file mode 100644
index 0000000..7de5e33
--- /dev/null
+++ b/src/flash/nor/msp432p4.c
@@ -0,0 +1,787 @@
+/***************************************************************************
+ * Copyright (C) 2017 by Texas Instruments, Inc. *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "imp.h"
+#include "msp432p4.h"
+#include <helper/binarybuffer.h>
+#include <helper/time_support.h>
+#include <target/algorithm.h>
+#include <target/armv7m.h>
+#include <target/image.h>
+
+#define SECTOR_LENGTH 0x1000
+#define FLASH_MAIN_SIZE_REG 0xE0043020
+#define FLASH_INFO_SIZE_REG 0xE0043024
+#define FLASH_2M_SIZE 0x00201008
+#define DEVICE_ID_ADDR 0x0020100C
+#define HARDWARE_REV_ADDR 0x00201010
+#define FLASH_TIMEOUT 8000
+
+struct msp432p4_bank {
+ uint32_t device_id;
+ uint32_t hardware_rev;
+ bool probed[2];
+ bool unlock_bsl;
+ struct working_area *working_area;
+ struct armv7m_algorithm armv7m_info;
+};
+
+static int msp432p4_auto_probe(struct flash_bank *bank);
+
+static char* msp432p4_return_text(uint32_t return_code)
+{
+ switch (return_code) {
+ case FLASH_BUSY:
+ return "FLASH_BUSY";
+ case FLASH_SUCCESS:
+ return "FLASH_SUCCESS";
+ case FLASH_ERROR:
+ return "FLASH_ERROR";
+ case FLASH_TIMEOUT_ERROR:
+ return "FLASH_TIMEOUT_ERROR";
+ case FLASH_VERIFY_ERROR:
+ return "FLASH_VERIFY_WRONG";
+ case FLASH_WRONG_COMMAND:
+ return "FLASH_WRONG_COMMAND";
+ case FLASH_POWER_ERROR:
+ return "FLASH_POWER_ERROR";
+ default:
+ return "UNDEFINED_RETURN_CODE";
+ }
+}
+
+static void msp432p4_init_params(struct msp432p4_algo_params *algo_params)
+{
+ algo_params->flash_command = FLASH_NO_COMMAND;
+ algo_params->return_code = 0;
+ algo_params->_reserved0 = 0;
+ algo_params->address = 0;
+ algo_params->length = 0;
+ algo_params->buffer1_status = BUFFER_INACTIVE;
+ algo_params->buffer2_status = BUFFER_INACTIVE;
+ algo_params->erase_param = FLASH_ERASE_MAIN;
+ algo_params->unlock_bsl = FLASH_LOCK_BSL;
+}
+
+static int msp432p4_exec_cmd(struct target *target, struct msp432p4_algo_params
+ *algo_params, uint32_t command)
+{
+ int retval;
+
+ // Make sure the given params do not include the command
+ algo_params->flash_command = FLASH_NO_COMMAND;
+ algo_params->return_code = 0;
+ algo_params->buffer1_status = BUFFER_INACTIVE;
+ algo_params->buffer2_status = BUFFER_INACTIVE;
+
+ // Write out parameters to target memory
+ retval = target_write_buffer(target, ALGO_PARAMS_BASE_ADDR,
+ sizeof(struct msp432p4_algo_params), (uint8_t*)algo_params);
+ if (ERROR_OK != retval) return retval;
+
+ // Write out command to target memory
+ retval = target_write_buffer(target, ALGO_FLASH_COMMAND_ADDR,
+ sizeof(command), (uint8_t*)&command);
+
+ return retval;
+}
+
+static int msp432p4_wait_return_code(struct target *target)
+{
+ uint32_t return_code = 0;
+ long long start_ms;
+ long long elapsed_ms;
+
+ int retval = ERROR_OK;
+
+ start_ms = timeval_ms();
+ while (0 == return_code || FLASH_BUSY == return_code) {
+ retval = target_read_buffer(target, ALGO_RETURN_CODE_ADDR,
+ sizeof(return_code), (uint8_t*)&return_code);
+ if (ERROR_OK != retval) return retval;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ if (elapsed_ms > FLASH_TIMEOUT) break;
+ };
+
+ if (FLASH_SUCCESS != return_code) {
+ LOG_ERROR("Flash operation failed: %s",
+ msp432p4_return_text(return_code));
+ return ERROR_FAIL;
+ }
+
+ return ERROR_OK;
+}
+
+static int msp432p4_wait_inactive(struct target *target, uint32_t buffer)
+{
+ uint32_t status_code = BUFFER_ACTIVE;
+ uint32_t status_addr;
+ long long start_ms;
+ long long elapsed_ms;
+
+ int retval;
+
+ switch (buffer) {
+ case 1: // Buffer 1
+ status_addr = ALGO_BUFFER1_STATUS_ADDR;
+ break;
+ case 2: // Buffer 2
+ status_addr = ALGO_BUFFER2_STATUS_ADDR;
+ break;
+ default:
+ return ERROR_FAIL;
+ }
+
+ start_ms = timeval_ms();
+ while (BUFFER_INACTIVE != status_code) {
+ retval = target_read_buffer(target, status_addr, sizeof(status_code),
+ (uint8_t*)&status_code);
+ if (ERROR_OK != retval) return retval;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ if (elapsed_ms > FLASH_TIMEOUT) break;
+ };
+
+ if (BUFFER_INACTIVE != status_code) {
+ LOG_ERROR("Flash operation failed: buffer not written to flash");
+ return ERROR_FAIL;
+ }
+
+ return ERROR_OK;
+}
+
+static int msp432p4_init(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+ struct reg_param reg_params[1];
+
+ const uint8_t *loader_code;
+ uint32_t loader_size;
+ bool unlock_bsl;
+ int retval;
+
+ // Make sure we've probed the flash to get the device and size
+ unlock_bsl = msp432p4_bank->unlock_bsl;
+ retval = msp432p4_auto_probe(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Preserve current BSL setting across the probe call
+ msp432p4_bank->unlock_bsl = unlock_bsl;
+
+ // Choose appropriate flash helper algorithm
+ loader_size = 0;
+ switch (msp432p4_bank->device_id) {
+ case 0xA000:
+ case 0xA001:
+ case 0xA002:
+ case 0xA003:
+ case 0xA004:
+ case 0xA005:
+ // Device is Falcon, check revision
+ if (msp432p4_bank->hardware_rev >= 0x43 &&
+ msp432p4_bank->hardware_rev <= 0x49) {
+ loader_code = msp432p4_algo;
+ loader_size = sizeof(msp432p4_algo);
+ }
+ break;
+ case 0xA010:
+ case 0xA012:
+ case 0xA016:
+ case 0xA019:
+ case 0xA01F:
+ case 0xA020:
+ case 0xA022:
+ case 0xA026:
+ case 0xA029:
+ case 0xA02F:
+ // Device is Falcon 2M, check revision
+ if (msp432p4_bank->hardware_rev >= 0x41 &&
+ msp432p4_bank->hardware_rev <= 0x49) {
+ loader_code = msp432p4_2m_algo;
+ loader_size = sizeof(msp432p4_2m_algo);
+ }
+ break;
+ default:
+ // Fall through to check that loader_size wasn't set
+ break;
+ }
+ if (0 == loader_size) {
+ // Explicit device check failed. Report this and
+ // then guess at which algo is best to use.
+ LOG_INFO("msp432p4.flash: Unrecognized Device ID and Rev (%04x, %02x)",
+ msp432p4_bank->device_id, msp432p4_bank->hardware_rev);
+ if (msp432p4_bank->device_id < 0xA010) {
+ // Assume this device is a Falcon
+ loader_code = msp432p4_algo;
+ loader_size = sizeof(msp432p4_algo);
+ } else {
+ // Assume this device is a Falcon 2M
+ loader_code = msp432p4_2m_algo;
+ loader_size = sizeof(msp432p4_2m_algo);
+ }
+ }
+
+ // Check for working area to use for flash helper algorithm
+ if (0 != msp432p4_bank->working_area) {
+ target_free_working_area(target, msp432p4_bank->working_area);
+ }
+ retval = target_alloc_working_area(target, ALGO_WORKING_SIZE,
+ &msp432p4_bank->working_area);
+ if (ERROR_OK != retval) return retval;
+
+ // Confirm the defined working address is the area we need to use
+ if (ALGO_BASE_ADDR != msp432p4_bank->working_area->address) {
+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ }
+
+ // Write flash helper algorithm into target memory
+ retval = target_write_buffer(target, ALGO_BASE_ADDR, loader_size,
+ loader_code);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize the ARMv7 specific info to run the algorithm
+ msp432p4_bank->armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
+ msp432p4_bank->armv7m_info.core_mode = ARM_MODE_THREAD;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Write out parameters to target memory
+ retval = target_write_buffer(target, ALGO_PARAMS_BASE_ADDR,
+ sizeof(algo_params), (uint8_t*)&algo_params);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize stack pointer for flash helper algorithm
+ init_reg_param(®_params[0], "sp", 32, PARAM_OUT);
+ buf_set_u32(reg_params[0].value, 0, 32, ALGO_STACK_POINTER_ADDR);
+
+ // Begin executing the flash helper algorithm
+ retval = target_start_algorithm(target, 0, 0, 1, reg_params,
+ ALGO_ENTRY_ADDR, 0, &msp432p4_bank->armv7m_info);
+ if (ERROR_OK != retval) {
+ LOG_ERROR("ERROR: Failed to start flash helper algorithm");
+ return retval;
+ }
+
+ // At this point, the algorithm is running on the target and
+ // ready to receive commands and data to flash the target
+
+ // Issue the init command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_INIT);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+
+ // Mark erased status of sectors as "unknown"
+ if (0 != bank->sectors) {
+ for (int i = 0; i < bank->num_sectors; i++) {
+ bank->sectors[i].is_erased = -1;
+ }
+ }
+
+ return retval;
+}
+
+static int msp432p4_quit(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ // At the end of any flash operation, lock the BSL
+ msp432p4_bank->unlock_bsl = false;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Issue the exit command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_EXIT);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+
+ // Regardless of the return code, attempt to halt the target
+ (void)target_halt(target);
+
+ // Now confirm target halted and clean up from flash helper algorithm
+ retval = target_wait_algorithm(target, 0, 0, 0, 0, 0, FLASH_TIMEOUT,
+ &msp432p4_bank->armv7m_info);
+
+ target_free_working_area(target, msp432p4_bank->working_area);
+ msp432p4_bank->working_area = 0;
+
+ return retval;
+}
+
+static int msp432p4_mass_erase(struct flash_bank *bank, bool all)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+ if (all) {
+ algo_params.erase_param = FLASH_ERASE_MAIN | FLASH_ERASE_INFO;
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Issue the mass erase command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_MASS_ERASE);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark all sectors erased
+ if (0 != bank->sectors) {
+ for (int i = 0; i < bank->num_sectors; i++) {
+ bank->sectors[i].is_erased = 1;
+ }
+ }
+
+ return retval;
+}
+
+COMMAND_HANDLER(msp432p4_mass_erase_command)
+{
+ struct flash_bank *bank;
+ bool all;
+ int retval;
+
+ if (0 == CMD_ARGC) {
+ all = false;
+ } else if (1 == CMD_ARGC) {
+ // Check argument for how much to erase
+ if (0 == strcmp(CMD_ARGV[0], "main")) {
+ all = false;
+ } else if (0 == strcmp(CMD_ARGV[0], "all")) {
+ all = true;
+ } else {
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+ } else {
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+
+ retval = get_flash_bank_by_num(0, &bank);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_mass_erase(bank, all);
+ if (ERROR_OK != retval) return retval;
+
+ LOG_INFO("msp432p4: Mass erase of %s is complete.",
+ all ? "main + info flash" : "main flash");
+
+ return ERROR_OK;
+}
+
+COMMAND_HANDLER(msp432p4_unlock_bsl_command)
+{
+ struct flash_bank *bank;
+ struct msp432p4_bank *msp432p4_bank;
+ int retval;
+
+ if (0 != CMD_ARGC) return ERROR_COMMAND_SYNTAX_ERROR;
+
+ retval = get_flash_bank_by_num(0, &bank);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank = bank->driver_priv;
+ msp432p4_bank->unlock_bsl = true;
+
+ LOG_INFO("msp432p4: BSL unlocked until end of next flash command.");
+
+ return ERROR_OK;
+}
+
+FLASH_BANK_COMMAND_HANDLER(msp432p4_flash_bank_command)
+{
+ struct msp432p4_bank *msp432p4_bank;
+ struct flash_bank *info_bank;
+
+ if (CMD_ARGC < 6) return ERROR_COMMAND_SYNTAX_ERROR;
+
+ msp432p4_bank = malloc(sizeof(struct msp432p4_bank));
+ if (0 == msp432p4_bank) return ERROR_FAIL;
+
+ info_bank = malloc(sizeof(struct flash_bank));
+ if (0 == info_bank) {
+ free((void*)msp432p4_bank);
+ return ERROR_FAIL;
+ }
+
+ // Initialize private flash information
+ msp432p4_bank->device_id = 0;
+ msp432p4_bank->hardware_rev = 0;
+ msp432p4_bank->probed[0] = false;
+ msp432p4_bank->probed[1] = false;
+ msp432p4_bank->unlock_bsl = false;
+ msp432p4_bank->working_area = 0;
+
+ // Finish initialization of bank 0 (main flash)
+ bank->driver_priv = msp432p4_bank;
+ bank->next = info_bank;
+
+ // Initialize bank 1 (info region)
+ info_bank->name = bank->name;
+ info_bank->target = bank->target;
+ info_bank->driver = bank->driver;
+ info_bank->driver_priv = bank->driver_priv;
+ info_bank->bank_number = 1;
+ info_bank->base = 0x00200000;
+ info_bank->size = 0;
+ info_bank->chip_width = 0;
+ info_bank->bus_width = 0;
+ info_bank->default_padded_value = 0xff;
+ info_bank->num_sectors = 0;
+ info_bank->sectors = 0;
+ info_bank->next = 0;
+
+ return ERROR_OK;
+}
+
+static int msp432p4_erase(struct flash_bank *bank, int first, int last)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ // Do a mass erase if user requested all sectors of main flash
+ if ((0 == bank->bank_number) && (first == 0) &&
+ (last == (bank->num_sectors - 1))) {
+ // Request mass erase of main flash
+ return msp432p4_mass_erase(bank, false);
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Adjust params if this is the info bank
+ if (1 == bank->bank_number) {
+ algo_params.erase_param = FLASH_ERASE_INFO;
+ // And flag if BSL is unlocked
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Erase requested sectors one by one
+ for (int i = first; i <= last; i++) {
+
+ // Convert sector number to starting address of sector
+ algo_params.address = i * SECTOR_LENGTH;
+
+ // Issue the sector erase command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_SECTOR_ERASE);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark the sector as erased
+ if (0 != bank->sectors) bank->sectors[i].is_erased = 1;
+ }
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ return retval;
+}
+
+static int msp432p4_protect(struct flash_bank *bank, int set, int first,
+ int last)
+{
+ return ERROR_OK;
+}
+
+static int msp432p4_write(struct flash_bank *bank, const uint8_t *buffer,
+ uint32_t offset, uint32_t count)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+ uint32_t size;
+ uint32_t data_ready = BUFFER_DATA_READY;
+ long long start_ms;
+ long long elapsed_ms;
+ uint32_t end_address = offset + count - 1;
+ uint32_t sector;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Set up parameters for requested flash write operation
+ algo_params.address = offset;
+ algo_params.length = count;
+
+ // Check if this is the info bank
+ if (1 == bank->bank_number) {
+ // And flag if BSL is unlocked
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Set up flash helper algorithm to continuous flash mode
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_CONTINUOUS);
+ if (ERROR_OK != retval) return retval;
+
+ // Write requested data, one buffer at a time
+ start_ms = timeval_ms();
+ while (count > 0) {
+
+ if (count > ALGO_BUFFER_SIZE) {
+ size = ALGO_BUFFER_SIZE;
+ } else {
+ size = count;
+ }
+
+ // Put next block of data to flash into buffer
+ retval = target_write_buffer(target, ALGO_BUFFER1_ADDR, size, buffer);
+ if (ERROR_OK != retval) {
+ LOG_ERROR("Unable to write data to target memory");
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+
+ // Signal the flash helper algorithm that data is ready to flash
+ retval = target_write_buffer(target, ALGO_BUFFER1_STATUS_ADDR,
+ sizeof(data_ready), (uint8_t*)&data_ready);
+ if (ERROR_OK != retval) return ERROR_FLASH_OPERATION_FAILED;
+
+ retval = msp432p4_wait_inactive(target, 1);
+ if (ERROR_OK != retval) return retval;
+
+ count -= size;
+ buffer += size;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ }
+
+ // Confirm that the flash helper algorithm is finished
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark flashed sectors as "not erased"
+ while (offset <= end_address) {
+ sector = offset / SECTOR_LENGTH;
+ bank->sectors[sector].is_erased = 0;
+ offset += SECTOR_LENGTH;
+ }
+
+ return retval;
+}
+
+static int msp432p4_probe(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+
+ uint32_t device_id;
+ uint32_t hardware_rev;
+
+ uint32_t base;
+ uint32_t size;
+ int num_sectors;
+ int bank_id;
+
+ int retval;
+
+ bank_id = bank->bank_number;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = target_read_u32(target, DEVICE_ID_ADDR, &device_id);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank->device_id = device_id & 0xFFFF;
+
+ retval = target_read_u32(target, HARDWARE_REV_ADDR, &hardware_rev);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank->hardware_rev = hardware_rev & 0xFF;
+
+ if (0 == bank_id) {
+ retval = target_read_u32(target, FLASH_MAIN_SIZE_REG, &size);
+ if (ERROR_OK != retval) return retval;
+
+ base = FLASH_MAIN_BASE;
+ num_sectors = size / SECTOR_LENGTH;
+ } else if (1 == bank_id) {
+ retval = target_read_u32(target, FLASH_INFO_SIZE_REG, &size);
+ if (ERROR_OK != retval) return retval;
+
+ base = FLASH_INFO_BASE;
+ num_sectors = size / SECTOR_LENGTH;
+ } else {
+ // Invalid bank number somehow
+ return ERROR_FAIL;
+ }
+
+ if (0 != bank->sectors) {
+ free(bank->sectors);
+ bank->sectors = 0;
+ }
+
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
+ if (0 == bank->sectors) return ERROR_FAIL;
+
+ bank->base = base;
+ bank->size = size;
+ bank->num_sectors = num_sectors;
+
+ for (int i = 0; i < num_sectors; i++) {
+ bank->sectors[i].offset = i * SECTOR_LENGTH;
+ bank->sectors[i].size = SECTOR_LENGTH;
+ bank->sectors[i].is_erased = -1;
+ bank->sectors[i].is_protected = 0;
+ }
+
+ // We've successfully determined the stats on this flash bank
+ msp432p4_bank->probed[bank_id] = true;
+
+ // If we fall through to here, then all went well
+
+ return ERROR_OK;
+}
+
+static int msp432p4_auto_probe(struct flash_bank *bank)
+{
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+
+ int retval = ERROR_OK;
+
+ if (bank->bank_number < 0 || bank->bank_number > 1) {
+ // Invalid bank number somehow
+ return ERROR_FAIL;
+ }
+
+ if (!msp432p4_bank->probed[bank->bank_number]) {
+ retval = msp432p4_probe(bank);
+ }
+
+ return retval;
+}
+
+static int msp432p4_protect_check(struct flash_bank *bank)
+{
+ return ERROR_OK;
+}
+
+static int msp432p4_info(struct flash_bank *bank, char *buf, int buf_size)
+{
+ return ERROR_OK;
+}
+
+static const struct command_registration msp432p4_exec_command_handlers[] = {
+ {
+ .name = "mass_erase",
+ .handler = msp432p4_mass_erase_command,
+ .mode = COMMAND_EXEC,
+ .help = "Erase entire flash memory on device.",
+ .usage = "['main' | 'all']",
+ },
+ {
+ .name = "unlock_bsl",
+ .handler = msp432p4_unlock_bsl_command,
+ .mode = COMMAND_EXEC,
+ .help = "Allow BSL to be erased or written in next flash command.",
+ .usage = "",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+static const struct command_registration msp432p4_command_handlers[] = {
+ {
+ .name = "msp432p4",
+ .mode = COMMAND_EXEC,
+ .help = "MSP432p4 flash command group",
+ .usage = "",
+ .chain = msp432p4_exec_command_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+struct flash_driver msp432p4_flash = {
+ .name = "msp432p4",
+ .commands = msp432p4_command_handlers,
+ .flash_bank_command = msp432p4_flash_bank_command,
+ .erase = msp432p4_erase,
+ .protect = msp432p4_protect,
+ .write = msp432p4_write,
+ .read = default_flash_read,
+ .probe = msp432p4_probe,
+ .auto_probe = msp432p4_auto_probe,
+ .erase_check = default_flash_blank_check,
+ .protect_check = msp432p4_protect_check,
+ .info = msp432p4_info,
+};
diff --git a/src/flash/nor/msp432p4.h b/src/flash/nor/msp432p4.h
new file mode 100644
index 0000000..926e72b
--- /dev/null
+++ b/src/flash/nor/msp432p4.h
@@ -0,0 +1,593 @@
+/***************************************************************************
+ * Copyright (C) 2017 by Texas Instruments, Inc. *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ ***************************************************************************/
+
+#ifndef OPENOCD_SRC_FLASH_NOR_MSP432P4_H
+#define OPENOCD_SRC_FLASH_NOR_MSP432P4_H
+
+// Flash base addresses
+#define FLASH_MAIN_BASE 0x00000000
+#define FLASH_INFO_BASE 0x00200000
+
+// Flash helper algorithm key addresses
+#define ALGO_ENTRY_ADDR 0x01000140
+#define ALGO_BASE_ADDR 0x20000000
+#define ALGO_BUFFER1_ADDR 0x20002000
+#define ALGO_BUFFER2_ADDR 0x20003000
+#define ALGO_PARAMS_BASE_ADDR 0x20000150
+#define ALGO_FLASH_COMMAND_ADDR 0x20000150
+#define ALGO_RETURN_CODE_ADDR 0x20000154
+#define ALGO_FLASH_DEST_ADDR 0x2000015c
+#define ALGO_FLASH_LENGTH_ADDR 0x20000160
+#define ALGO_BUFFER1_STATUS_ADDR 0x20000164
+#define ALGO_BUFFER2_STATUS_ADDR 0x20000168
+#define ALGO_ERASE_PARAM_ADDR 0x2000016c
+#define ALGO_UNLOCK_BSL_ADDR 0x20000170
+#define ALGO_STACK_POINTER_ADDR 0x20002000
+
+// Flash helper algorithm key sizes
+#define ALGO_BUFFER_SIZE 0x1000
+#define ALGO_WORKING_SIZE (ALGO_BUFFER2_ADDR + 0x1000 - ALGO_BASE_ADDR)
+
+// Flash helper algorithm flash commands
+#define FLASH_NO_COMMAND 0
+#define FLASH_MASS_ERASE 1
+#define FLASH_SECTOR_ERASE 2
+#define FLASH_PROGRAM 4
+#define FLASH_INIT 8
+#define FLASH_EXIT 16
+#define FLASH_CONTINUOUS 32
+
+// Flash helper algorithm return codes
+#define FLASH_BUSY 0x00000001
+#define FLASH_SUCCESS 0x00000ACE
+#define FLASH_ERROR 0x0000DEAD
+#define FLASH_TIMEOUT_ERROR 0xDEAD0000
+#define FLASH_VERIFY_ERROR 0xDEADDEAD
+#define FLASH_WRONG_COMMAND 0x00000BAD
+#define FLASH_POWER_ERROR 0x00DEAD00
+
+// Flash helper algorithm buffer status values
+#define BUFFER_INACTIVE 0x00
+#define BUFFER_ACTIVE 0x01
+#define BUFFER_DATA_READY 0x10
+
+// Flash helper algorithm erase parameters
+#define FLASH_ERASE_MAIN 0x01
+#define FLASH_ERASE_INFO 0x02
+
+// Flash helper algorithm lock/unlock BSL options
+#define FLASH_LOCK_BSL 0x00;
+#define FLASH_UNLOCK_BSL 0x0b;
+
+// Flash helper algorithm parameter block struct
+struct msp432p4_algo_params {
+ volatile uint32_t flash_command;
+ volatile uint32_t return_code;
+ volatile uint32_t _reserved0;
+ volatile uint32_t address;
+ volatile uint32_t length;
+ volatile uint32_t buffer1_status;
+ volatile uint32_t buffer2_status;
+ volatile uint32_t erase_param;
+ volatile uint32_t unlock_bsl;
+};
+
+// Flash helper algorithm for MSP432P401 - Falcon targets
+const uint8_t msp432p4_algo[] =
+{
+ 0x00, 0x10, 0x00, 0x01, 0x41, 0x01, 0x00, 0x01, 0xC1, 0x08, 0x00, 0x01,
+ 0xC3, 0x08, 0x00, 0x01, 0xC5, 0x08, 0x00, 0x01, 0xC5, 0x08, 0x00, 0x01,
+ 0xC5, 0x08, 0x00, 0x01, 0xFF, 0xFF, 0x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0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x28, 0xBB,
+ 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x38, 0xB5, 0xDC, 0x4C, 0x20, 0x68, 0x40, 0x08,
+ 0x0F, 0xD3, 0x4F, 0xF0, 0x00, 0x75, 0xD5, 0xF8, 0x1C, 0x08, 0x02, 0x69,
+ 0x4F, 0xF0, 0xFF, 0x31, 0x01, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08,
+ 0x02, 0x69, 0x4F, 0xF0, 0xFF, 0x31, 0x02, 0x20, 0x90, 0x47, 0x20, 0x68,
+ 0x80, 0x08, 0x12, 0xD3, 0x4F, 0xF0, 0x00, 0x70, 0x00, 0xF6, 0x1C, 0x05,
+ 0xD0, 0xF8, 0x1C, 0x08, 0x02, 0x69, 0x03, 0x20, 0x01, 0x46, 0x90, 0x47,
+ 0x24, 0x1D, 0x20, 0x68, 0x0B, 0x28, 0x04, 0xD1, 0x28, 0x68, 0x02, 0x69,
+ 0x03, 0x21, 0x04, 0x20, 0x90, 0x47, 0x38, 0xBD, 0x38, 0xB5, 0x4F, 0xF0,
+ 0x00, 0x75, 0x05, 0xF6, 0x1C, 0x04, 0x20, 0x68, 0x02, 0x69, 0x4F, 0xF0,
+ 0xFF, 0x31, 0x01, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08, 0x02, 0x69,
+ 0x4F, 0xF0, 0xFF, 0x31, 0x02, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08,
+ 0x02, 0x69, 0x03, 0x20, 0x01, 0x46, 0x90, 0x47, 0xBA, 0x48, 0x00, 0x1D,
+ 0x00, 0x68, 0x0B, 0x28, 0x04, 0xD1, 0x20, 0x68, 0x02, 0x69, 0x03, 0x21,
+ 0x04, 0x20, 0x90, 0x47, 0x38, 0xBD, 0x08, 0xB5, 0xD1, 0x4B, 0x1B, 0x68,
+ 0x9B, 0x6A, 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, 0xFF, 0xFF, 0xFF, 0x03, 0x49, 0x08, 0x60, 0x70, 0x47, 0x02, 0x49,
+ 0x09, 0x1F, 0x08, 0x60, 0x70, 0x47, 0x70, 0x47, 0xD0, 0x08, 0x00, 0x01,
+ 0xD0, 0xF8, 0x03, 0x20, 0xC3, 0x1D, 0x08, 0x46, 0x19, 0x46, 0xFF, 0xF7,
+ 0x7B, 0xBE, 0xEF, 0xF3, 0x10, 0x80, 0x72, 0xB6, 0x70, 0x47, 0x00, 0x20,
+ 0x70, 0x47, 0x01, 0x22, 0xFF, 0xF7, 0x34, 0xBF, 0xFE, 0xE7, 0xFE, 0xE7,
+ 0xFE, 0xE7, 0x01, 0x20, 0x70, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x02, 0x9B, 0x08, 0x00, 0x01, 0x9B, 0x08, 0x00, 0x01, 0x02, 0x0D,
+ 0x00, 0x20, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0xBB, 0x08, 0x00, 0x01,
+ 0xA1, 0x08, 0x00, 0x01, 0xE8, 0x08, 0x00, 0x01, 0xCC, 0x08, 0x00, 0x01,
+};
+
+// Flash helper algorithm for MSP432p411 - Falcon 2M targets
+const uint8_t msp432p4_2m_algo[] =
+{
+ 0x00, 0x10, 0x00, 0x01, 0x41, 0x01, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00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0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x22, 0xBC,
+ 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0xB5, 0x96, 0x48, 0x00, 0x68, 0x00, 0x68,
+ 0x80, 0x47, 0x00, 0xF0, 0x8C, 0xFC, 0x40, 0xE0, 0x94, 0x48, 0x93, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x4C, 0xF8, 0x92, 0x49, 0x00, 0x20,
+ 0x08, 0x60, 0x36, 0xE0, 0x8F, 0x48, 0x8E, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x00, 0xF0, 0x93, 0xF8, 0x8D, 0x49, 0x00, 0x20, 0x08, 0x60, 0x2C, 0xE0,
+ 0x8A, 0x48, 0x89, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0xAF, 0xF8,
+ 0x88, 0x49, 0x00, 0x20, 0x08, 0x60, 0x22, 0xE0, 0x85, 0x48, 0x84, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0xCE, 0xF8, 0x83, 0x49, 0x00, 0x20,
+ 0x08, 0x60, 0x18, 0xE0, 0x80, 0x48, 0x7F, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x00, 0xF0, 0x08, 0xF9, 0x7E, 0x49, 0x00, 0x20, 0x08, 0x60, 0x0E, 0xE0,
+ 0x7B, 0x48, 0x7A, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x3E, 0xFA,
+ 0x79, 0x49, 0x00, 0x20, 0x08, 0x60, 0x04, 0xE0, 0x78, 0x48, 0x75, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0xFF, 0xE7, 0x75, 0x48, 0x00, 0x68, 0x00, 0x28,
+ 0xFB, 0xD0, 0x40, 0x1E, 0xC2, 0xD0, 0x40, 0x1E, 0xCA, 0xD0, 0x80, 0x1E,
+ 0xD2, 0xD0, 0x00, 0x1F, 0xB2, 0xD0, 0x08, 0x38, 0xE2, 0xD0, 0x10, 0x38,
+ 0xD6, 0xD0, 0xE9, 0xE7, 0x08, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00,
+ 0x6C, 0x49, 0x4F, 0xF0, 0x80, 0x70, 0x08, 0x60, 0x6C, 0x48, 0x00, 0x68,
+ 0x80, 0x6D, 0x01, 0x46, 0x00, 0x20, 0x88, 0x47, 0x68, 0x49, 0x08, 0x60,
+ 0x68, 0x48, 0x00, 0x68, 0x80, 0x6D, 0x01, 0x46, 0x01, 0x20, 0x88, 0x47,
+ 0xBA, 0x49, 0x08, 0x60, 0xBB, 0x48, 0x00, 0x68, 0x40, 0x68, 0x80, 0x47,
+ 0xB8, 0x49, 0x08, 0x70, 0xB8, 0x48, 0x00, 0x68, 0x00, 0x6A, 0x80, 0x47,
+ 0xB7, 0x49, 0x08, 0x70, 0xB8, 0x48, 0xB7, 0x49, 0x00, 0x68, 0x00, 0xF4,
+ 0xE0, 0x20, 0x08, 0x60, 0xB2, 0x48, 0x00, 0x68, 0x80, 0x69, 0x01, 0x46,
+ 0x00, 0x20, 0x88, 0x47, 0x8D, 0xF8, 0x00, 0x00, 0x57, 0x48, 0x00, 0x68,
+ 0x40, 0x6D, 0x02, 0x21, 0x02, 0x46, 0x00, 0x20, 0x90, 0x47, 0x54, 0x48,
+ 0x00, 0x68, 0x40, 0x6D, 0x02, 0x21, 0x02, 0x46, 0x01, 0x20, 0x90, 0x47,
+ 0x4F, 0xF4, 0x80, 0x20, 0x00, 0xF0, 0xC0, 0xF9, 0x9D, 0xF8, 0x00, 0x00,
+ 0x20, 0xB9, 0xA8, 0x48, 0x46, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0xA6, 0x48, 0x44, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD, 0x0E, 0xB5,
+ 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x45, 0xF9, 0x05, 0x20,
+ 0x01, 0x90, 0x08, 0xE0, 0x43, 0x48, 0x00, 0x68, 0x00, 0x6A, 0x80, 0x47,
+ 0x8D, 0xF8, 0x00, 0x00, 0x01, 0x98, 0x40, 0x1E, 0x01, 0x90, 0x9D, 0xF8,
+ 0x00, 0x00, 0x10, 0xB9, 0x01, 0x98, 0x00, 0x28, 0xF0, 0xDC, 0x01, 0x98,
+ 0x20, 0xB9, 0xBF, 0x48, 0x34, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0x94, 0x48, 0x32, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x76, 0xF9,
+ 0x0E, 0xBD, 0x0E, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0,
+ 0x4C, 0xF9, 0x05, 0x20, 0x01, 0x90, 0x0B, 0xE0, 0x30, 0x48, 0x00, 0x68,
+ 0xBF, 0x4A, 0x40, 0x6A, 0x01, 0x46, 0x10, 0x68, 0x88, 0x47, 0x8D, 0xF8,
+ 0x00, 0x00, 0x01, 0x98, 0x40, 0x1E, 0x01, 0x90, 0x9D, 0xF8, 0x00, 0x00,
+ 0x10, 0xB9, 0x01, 0x98, 0x00, 0x28, 0xED, 0xDC, 0x01, 0x98, 0x20, 0xB9,
+ 0xC1, 0x48, 0x20, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0, 0x80, 0x48,
+ 0x1D, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x4D, 0xF9, 0x0E, 0xBD,
+ 0x08, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x23, 0xF9,
+ 0xBA, 0x48, 0xB9, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42, 0xF9, 0xD0,
+ 0xB7, 0x49, 0xB8, 0x48, 0x0A, 0x68, 0x00, 0x68, 0x10, 0x43, 0x08, 0x60,
+ 0xB6, 0x4B, 0xA7, 0x48, 0xB6, 0x4A, 0x01, 0x68, 0x18, 0x68, 0x12, 0x68,
+ 0x00, 0xF0, 0xAE, 0xF9, 0x8D, 0xF8, 0x00, 0x00, 0xB0, 0x49, 0xAE, 0x48,
+ 0xAE, 0x4A, 0x0B, 0x68, 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43,
+ 0x11, 0x60, 0x00, 0xF0, 0x25, 0xF9, 0x9D, 0xF8, 0x00, 0x00, 0x20, 0xB9,
+ 0xA6, 0x48, 0x05, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0, 0x65, 0x48,
+ 0x02, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD, 0x64, 0x08, 0x00, 0x02,
+ 0x54, 0x01, 0x00, 0x20, 0xF0, 0x0A, 0x00, 0x01, 0x50, 0x01, 0x00, 0x20,
+ 0x00, 0x0B, 0x00, 0x01, 0x08, 0xED, 0x00, 0xE0, 0x80, 0x01, 0x00, 0x20,
+ 0x6C, 0x08, 0x00, 0x02, 0x00, 0xB5, 0xAD, 0xF1, 0x1C, 0x0D, 0x00, 0x20,
+ 0x8D, 0xF8, 0x00, 0x00, 0x00, 0x20, 0x8D, 0xF8, 0x01, 0x00, 0x00, 0x20,
+ 0x01, 0x90, 0x00, 0x20, 0x8D, 0xF8, 0x08, 0x00, 0x97, 0x48, 0x00, 0x68,
+ 0x03, 0x90, 0x00, 0x20, 0x04, 0x90, 0x85, 0x48, 0x00, 0x68, 0x05, 0x90,
+ 0x03, 0x98, 0x00, 0x28, 0x00, 0xF0, 0x84, 0x80, 0xBB, 0x48, 0x03, 0x99,
+ 0x00, 0x68, 0x88, 0x42, 0x07, 0xD2, 0xB9, 0x48, 0x00, 0x68, 0x04, 0x90,
+ 0x04, 0x99, 0x03, 0x98, 0x40, 0x1A, 0x03, 0x90, 0x05, 0xE0, 0x03, 0x98,
+ 0x04, 0x90, 0x04, 0x99, 0x03, 0x98, 0x40, 0x1A, 0x03, 0x90, 0x00, 0xF0,
+ 0xB6, 0xF8, 0x84, 0x48, 0x82, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x05, 0xD1, 0xAF, 0x48, 0x7F, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0xF3, 0xD0, 0x7E, 0x48, 0x7C, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x0C, 0xD0, 0x7B, 0x49, 0x7B, 0x48, 0x0A, 0x68, 0x00, 0x68, 0x10, 0x43,
+ 0x08, 0x60, 0x7A, 0x48, 0x00, 0x68, 0x01, 0x90, 0x01, 0x20, 0x8D, 0xF8,
+ 0x00, 0x00, 0x11, 0xE0, 0xA2, 0x48, 0x73, 0x49, 0x00, 0x68, 0x09, 0x68,
+ 0x01, 0x42, 0x0B, 0xD0, 0x9F, 0x49, 0x72, 0x48, 0x0A, 0x68, 0x00, 0x68,
+ 0x10, 0x43, 0x08, 0x60, 0x9D, 0x48, 0x00, 0x68, 0x01, 0x90, 0x01, 0x20,
+ 0x8D, 0xF8, 0x01, 0x00, 0x9D, 0xF8, 0x00, 0x00, 0x10, 0xB9, 0x9D, 0xF8,
+ 0x01, 0x00, 0x50, 0xB1, 0x05, 0x99, 0x01, 0x98, 0x04, 0x9A, 0x00, 0xF0,
+ 0x19, 0xF9, 0x8D, 0xF8, 0x08, 0x00, 0x05, 0x99, 0x04, 0x98, 0x40, 0x18,
+ 0x05, 0x90, 0x9D, 0xF8, 0x00, 0x00, 0x60, 0xB1, 0x62, 0x49, 0x60, 0x48,
+ 0x60, 0x4A, 0x0B, 0x68, 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43,
+ 0x11, 0x60, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x0E, 0xE0, 0x9D, 0xF8,
+ 0x01, 0x00, 0x58, 0xB1, 0x5A, 0x49, 0x58, 0x48, 0x86, 0x4A, 0x0B, 0x68,
+ 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43, 0x11, 0x60, 0x00, 0x20,
+ 0x8D, 0xF8, 0x01, 0x00, 0x00, 0xF0, 0x76, 0xF8, 0x9D, 0xF8, 0x08, 0x00,
+ 0x20, 0xB9, 0x4F, 0x48, 0x80, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0x03, 0x98, 0x00, 0x28, 0x7F, 0xF4, 0x7C, 0xAF, 0x9D, 0xF8, 0x08, 0x00,
+ 0x18, 0xB1, 0x0A, 0x48, 0x7A, 0x49, 0x00, 0x68, 0x08, 0x60, 0x07, 0xB0,
+ 0x00, 0xBD, 0xC0, 0x46, 0x84, 0x01, 0x00, 0x20, 0x8C, 0x01, 0x00, 0x20,
+ 0x34, 0x08, 0x00, 0x02, 0x8D, 0x01, 0x00, 0x20, 0x88, 0x01, 0x00, 0x20,
+ 0x04, 0x04, 0x01, 0x40, 0x04, 0x0B, 0x00, 0x01, 0xF4, 0x0A, 0x00, 0x01,
+ 0x08, 0xB5, 0x71, 0x48, 0x6F, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x09, 0xD0, 0x6F, 0x48, 0x00, 0x68, 0x40, 0x68, 0x80, 0x47, 0x74, 0x49,
+ 0x09, 0x68, 0x0A, 0x69, 0x41, 0x1E, 0x00, 0x20, 0x90, 0x47, 0x69, 0x48,
+ 0x6A, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42, 0x14, 0xD0, 0x6E, 0x48,
+ 0x00, 0x68, 0x68, 0x49, 0x00, 0x69, 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10,
+ 0x90, 0x47, 0x67, 0x48, 0x65, 0x49, 0x00, 0x68, 0x09, 0x68, 0x88, 0x42,
+ 0x06, 0xD1, 0x67, 0x48, 0x00, 0x68, 0x65, 0x49, 0x00, 0x69, 0x02, 0x46,
+ 0x62, 0x48, 0x90, 0x47, 0x08, 0xBD, 0x08, 0xB5, 0x5B, 0x48, 0x00, 0x68,
+ 0x40, 0x68, 0x80, 0x47, 0x60, 0x49, 0x09, 0x68, 0x0A, 0x69, 0x41, 0x1E,
+ 0x00, 0x20, 0x90, 0x47, 0x5D, 0x48, 0x00, 0x68, 0x57, 0x49, 0x00, 0x69,
+ 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10, 0x90, 0x47, 0x56, 0x48, 0x55, 0x49,
+ 0x00, 0x68, 0x09, 0x68, 0x88, 0x42, 0x06, 0xD1, 0x56, 0x48, 0x00, 0x68,
+ 0x54, 0x49, 0x00, 0x69, 0x02, 0x46, 0x52, 0x48, 0x90, 0x47, 0x08, 0xBD,
+ 0xFC, 0x0A, 0x00, 0x01, 0x08, 0xB5, 0x4A, 0x48, 0x00, 0x68, 0x40, 0x68,
+ 0x80, 0x47, 0x4F, 0x49, 0x09, 0x68, 0x4A, 0x69, 0x41, 0x1E, 0x00, 0x20,
+ 0x90, 0x47, 0x4C, 0x48, 0x00, 0x68, 0x40, 0x69, 0x4F, 0xF4, 0x01, 0x11,
+ 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10, 0x90, 0x47, 0x08, 0xBD, 0xC0, 0x46,
+ 0x5C, 0x01, 0x00, 0x20, 0xAD, 0xF1, 0x08, 0x0D, 0x00, 0x90, 0x45, 0x49,
+ 0x46, 0xF6, 0x5A, 0x10, 0x08, 0x60, 0x44, 0x48, 0x43, 0x4A, 0x00, 0x99,
+ 0x00, 0x68, 0x20, 0xF4, 0xE0, 0x20, 0x01, 0x43, 0x11, 0x60, 0x3F, 0x49,
+ 0x00, 0x20, 0x08, 0x60, 0x02, 0xB0, 0x70, 0x47, 0xF8, 0x0A, 0x00, 0x01,
+ 0xDC, 0x0A, 0x00, 0x01, 0x64, 0x01, 0x00, 0x20, 0xD8, 0x0A, 0x00, 0x01,
+ 0xD0, 0x0A, 0x00, 0x01, 0x60, 0x01, 0x00, 0x20, 0x08, 0xB5, 0x00, 0x20,
+ 0x8D, 0xF8, 0x00, 0x00, 0x4F, 0xF4, 0x80, 0x30, 0xFF, 0xF7, 0xD8, 0xFF,
+ 0x31, 0x48, 0x34, 0x49, 0x00, 0x68, 0x09, 0x68, 0x40, 0x6D, 0x02, 0x46,
+ 0x00, 0x20, 0x90, 0x47, 0x2D, 0x48, 0x31, 0x49, 0x00, 0x68, 0x09, 0x68,
+ 0x40, 0x6D, 0x02, 0x46, 0x01, 0x20, 0x90, 0x47, 0x2E, 0x48, 0x00, 0x68,
+ 0x2E, 0x4A, 0x80, 0x69, 0x01, 0x46, 0x10, 0x78, 0x88, 0x47, 0x8D, 0xF8,
+ 0x00, 0x00, 0x2A, 0x48, 0x00, 0x68, 0x2B, 0x4A, 0x00, 0x68, 0x01, 0x46,
+ 0x10, 0x78, 0x88, 0x47, 0x9D, 0xF8, 0x00, 0x20, 0x00, 0x21, 0x10, 0x42,
+ 0x00, 0xD0, 0x01, 0x21, 0x8D, 0xF8, 0x00, 0x10, 0x25, 0x48, 0x00, 0x68,
+ 0xFF, 0xF7, 0xAC, 0xFF, 0x24, 0x49, 0x00, 0x20, 0x08, 0x60, 0x9D, 0xF8,
+ 0x00, 0x00, 0x20, 0xB9, 0x22, 0x48, 0x0E, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x03, 0xE0, 0x21, 0x48, 0x0B, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD,
+ 0x0E, 0xB5, 0x02, 0x92, 0x01, 0x91, 0x00, 0x90, 0x11, 0x48, 0x00, 0x68,
+ 0x01, 0x99, 0x02, 0x9A, 0x80, 0x6A, 0x03, 0x46, 0x00, 0x98, 0x98, 0x47,
+ 0x0E, 0xBD, 0xC0, 0x46, 0xE0, 0x0A, 0x00, 0x01, 0x68, 0x01, 0x00, 0x20,
+ 0xD4, 0x0A, 0x00, 0x01, 0x54, 0x01, 0x00, 0x20, 0xE4, 0x0A, 0x00, 0x01,
+ 0x6C, 0x01, 0x00, 0x20, 0x68, 0x08, 0x00, 0x02, 0xE8, 0x0A, 0x00, 0x01,
+ 0xFF, 0x0F, 0x20, 0x00, 0x70, 0x01, 0x00, 0x20, 0xEC, 0x0A, 0x00, 0x01,
+ 0x00, 0x20, 0x20, 0x00, 0xFF, 0x3F, 0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, 0xF8, 0xB5, 0x06, 0x46, 0x0F, 0x4D, 0x10, 0x4F,
+ 0x73, 0x88, 0x00, 0x24, 0x17, 0xE0, 0xA0, 0x00, 0x00, 0xEB, 0xC4, 0x00,
+ 0x32, 0x18, 0x51, 0x68, 0x90, 0x68, 0xD2, 0x68, 0x52, 0xB9, 0xAF, 0x42,
+ 0x0B, 0xD0, 0x0A, 0x78, 0x55, 0xF8, 0x22, 0x20, 0x03, 0x46, 0x49, 0x1C,
+ 0x08, 0x46, 0x19, 0x46, 0x90, 0x47, 0x01, 0xE0, 0xFF, 0xF7, 0x96, 0xFE,
+ 0x73, 0x88, 0x64, 0x1C, 0xA4, 0xB2, 0xA3, 0x42, 0xE5, 0xDC, 0xF8, 0xBD,
+ 0x38, 0x0B, 0x00, 0x01, 0x40, 0x0B, 0x00, 0x01, 0x04, 0x49, 0xB1, 0xF1,
+ 0xFF, 0x3F, 0x07, 0xBF, 0x00, 0x21, 0x08, 0x1C, 0x08, 0x68, 0x09, 0x1D,
+ 0xFF, 0xF7, 0x80, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x49, 0x08, 0x60,
+ 0x70, 0x47, 0x02, 0x49, 0x09, 0x1F, 0x08, 0x60, 0x70, 0x47, 0x70, 0x47,
+ 0x18, 0x0B, 0x00, 0x01, 0xD0, 0xF8, 0x03, 0x20, 0xC3, 0x1D, 0x08, 0x46,
+ 0x19, 0x46, 0xFF, 0xF7, 0x6F, 0xBE, 0xEF, 0xF3, 0x10, 0x80, 0x72, 0xB6,
+ 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x01, 0x22, 0xFF, 0xF7, 0x2A, 0xBF,
+ 0x01, 0x20, 0x70, 0x47, 0xFE, 0xE7, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20,
+ 0x00, 0x30, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x0A, 0x00, 0x00,
+ 0xAD, 0xDE, 0x00, 0x00, 0xAD, 0xDE, 0xAD, 0xDE, 0xAD, 0x0B, 0x00, 0x00,
+ 0x00, 0xAD, 0xDE, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x02, 0x02, 0x08, 0x00, 0x01, 0x00, 0x00,
+ 0x00, 0xA3, 0x0A, 0x00, 0x01, 0xA3, 0x0A, 0x00, 0x01, 0x02, 0x04, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xC3, 0x0A, 0x00, 0x01, 0xA9, 0x0A, 0x00, 0x01,
+ 0x20, 0x0B, 0x00, 0x01, 0x08, 0x0B, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+#endif // OPENOCD_SRC_FLASH_NOR_MSP432P4_H
diff --git a/tcl/target/ti_msp432p4xx.cfg b/tcl/target/ti_msp432p4xx.cfg
index 8600867..15680d0 100644
--- a/tcl/target/ti_msp432p4xx.cfg
+++ b/tcl/target/ti_msp432p4xx.cfg
@@ -38,15 +38,24 @@ target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
- # On MSP432P401x Bank0 (8k) is always powered
- set _WORKAREASIZE 0x2000
+ set _WORKAREASIZE 0x4000
}
$_TARGETNAME configure -work-area-phys 0x20000000 \
-work-area-size $_WORKAREASIZE -work-area-backup 0
+set _FLASHNAME $_CHIPNAME.flash
+flash bank $_FLASHNAME msp432p4 0 0 0 0 $_TARGETNAME
+
if { ![using_hla] } {
cortex_m reset_config sysresetreq
}
+gdb_memory_map enable
+gdb_flash_program enable
+
+$_TARGETNAME configure -event gdb-attach {
+ halt
+}
+
adapter_khz 500
--
Edward Fewell (***@ti.com) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4153
-- gerrit
commit 0a11b7f20fd8756d9dccfac4a09e412bcfd95c1b
Author: Edward Fewell <***@ti.com>
Date: Fri Jun 2 21:20:26 2017 -0500
flash/nor: add support for TI MSP432P4 devices
Added msp432p4 flash driver to support the TI MSP432P4xx microcontrollers.
Implemented the same flash algo helper as used in the TI debug and flash
tools. Implemention supports both the Falcon and Falcon 2M variants of
these devices. Added command to mass erase device for consistency with TI
tools and added command to unlock the protected BSL region.
Tested using MSP432P401R and MSP432P4111 Launchpads. Tested with embedded
XDS110 debug probe in CMSIS-DAP mode and with external SEGGER J-Link probe.
Also tested in both JTAG and SWD modes with each probe/board combination.
Change-Id: I3b29d39ccc492524ef2c4a1733f7f9942c2684c0
Signed-off-by: Edward Fewell <***@ti.com>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 59d2d4f..f0861a0 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -5689,6 +5689,39 @@ if @{ [info exists IMEMORY] && [string equal $IMEMORY true] @} @{
@end example
@end deffn
+@deffn {Flash Driver} msp432p4
+All versions of the SimpleLink MSP432P4xx microcontrollers from Texas
+Instruments include internal flash. The msp432p4 flash driver automatically
+recognizes the specific version's flash parameters and autoconfigures itself.
+Main program flash (starting at address 0) is flash bank 0. Information flash
+region (starting at address 0x200000) is flash bank 1.
+
+@example
+flash bank $_FLASHNAME msp432p4 0 0 0 0 $_TARGETNAME
+@end example
+
+@deffn Command {msp432p4 mass_erase} [main|all]
+Performs a complete erase of flash. By default, @command{mass_erase} will erase
+only the main program flash. Using @command{mass_erase all} will erase both the
+main program and information flash regions. To also erase the BSL in information
+flash, the user must first use the @command{unlock_bsl} command.
+@end deffn
+
+@deffn Command {msp432p4 unlock_bsl}
+Unlocks the bootstrap loader (BSL) region in information flash so that the
+next flash command can erase or write the BSL. After each flash command, the
+BSL is automatically locked.
+
+To erase and program the BSL:
+@example
+msp432p4 unlock_bsl
+flash erase_address 0x202000 0x2000
+msp432p4 unlock_bsl
+flash write_image bsl.bin 0x202000
+@end example
+@end deffn
+@end deffn
+
@deffn {Flash Driver} niietcm4
This drivers handles the integrated NOR flash on NIIET Cortex-M4
based controllers. Flash size and sector layout are auto-configured by the driver.
diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am
index 5a992fe..fb2e4f2 100644
--- a/src/flash/nor/Makefile.am
+++ b/src/flash/nor/Makefile.am
@@ -33,6 +33,7 @@ NOR_DRIVERS = \
%D%/lpc2900.c \
%D%/lpcspifi.c \
%D%/mdr.c \
+ %D%/msp432p4.c \
%D%/mrvlqspi.c \
%D%/niietcm4.c \
%D%/non_cfi.c \
diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c
index 4ad1d92..95ee493 100644
--- a/src/flash/nor/drivers.c
+++ b/src/flash/nor/drivers.c
@@ -47,6 +47,7 @@ extern struct flash_driver lpc2900_flash;
extern struct flash_driver lpcspifi_flash;
extern struct flash_driver mdr_flash;
extern struct flash_driver mrvlqspi_flash;
+extern struct flash_driver msp432p4_flash;
extern struct flash_driver niietcm4_flash;
extern struct flash_driver nrf51_flash;
extern struct flash_driver numicro_flash;
@@ -100,6 +101,7 @@ static struct flash_driver *flash_drivers[] = {
&lpcspifi_flash,
&mdr_flash,
&mrvlqspi_flash,
+ &msp432p4_flash,
&niietcm4_flash,
&nrf51_flash,
&numicro_flash,
diff --git a/src/flash/nor/msp432p4.c b/src/flash/nor/msp432p4.c
new file mode 100644
index 0000000..7de5e33
--- /dev/null
+++ b/src/flash/nor/msp432p4.c
@@ -0,0 +1,787 @@
+/***************************************************************************
+ * Copyright (C) 2017 by Texas Instruments, Inc. *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "imp.h"
+#include "msp432p4.h"
+#include <helper/binarybuffer.h>
+#include <helper/time_support.h>
+#include <target/algorithm.h>
+#include <target/armv7m.h>
+#include <target/image.h>
+
+#define SECTOR_LENGTH 0x1000
+#define FLASH_MAIN_SIZE_REG 0xE0043020
+#define FLASH_INFO_SIZE_REG 0xE0043024
+#define FLASH_2M_SIZE 0x00201008
+#define DEVICE_ID_ADDR 0x0020100C
+#define HARDWARE_REV_ADDR 0x00201010
+#define FLASH_TIMEOUT 8000
+
+struct msp432p4_bank {
+ uint32_t device_id;
+ uint32_t hardware_rev;
+ bool probed[2];
+ bool unlock_bsl;
+ struct working_area *working_area;
+ struct armv7m_algorithm armv7m_info;
+};
+
+static int msp432p4_auto_probe(struct flash_bank *bank);
+
+static char* msp432p4_return_text(uint32_t return_code)
+{
+ switch (return_code) {
+ case FLASH_BUSY:
+ return "FLASH_BUSY";
+ case FLASH_SUCCESS:
+ return "FLASH_SUCCESS";
+ case FLASH_ERROR:
+ return "FLASH_ERROR";
+ case FLASH_TIMEOUT_ERROR:
+ return "FLASH_TIMEOUT_ERROR";
+ case FLASH_VERIFY_ERROR:
+ return "FLASH_VERIFY_WRONG";
+ case FLASH_WRONG_COMMAND:
+ return "FLASH_WRONG_COMMAND";
+ case FLASH_POWER_ERROR:
+ return "FLASH_POWER_ERROR";
+ default:
+ return "UNDEFINED_RETURN_CODE";
+ }
+}
+
+static void msp432p4_init_params(struct msp432p4_algo_params *algo_params)
+{
+ algo_params->flash_command = FLASH_NO_COMMAND;
+ algo_params->return_code = 0;
+ algo_params->_reserved0 = 0;
+ algo_params->address = 0;
+ algo_params->length = 0;
+ algo_params->buffer1_status = BUFFER_INACTIVE;
+ algo_params->buffer2_status = BUFFER_INACTIVE;
+ algo_params->erase_param = FLASH_ERASE_MAIN;
+ algo_params->unlock_bsl = FLASH_LOCK_BSL;
+}
+
+static int msp432p4_exec_cmd(struct target *target, struct msp432p4_algo_params
+ *algo_params, uint32_t command)
+{
+ int retval;
+
+ // Make sure the given params do not include the command
+ algo_params->flash_command = FLASH_NO_COMMAND;
+ algo_params->return_code = 0;
+ algo_params->buffer1_status = BUFFER_INACTIVE;
+ algo_params->buffer2_status = BUFFER_INACTIVE;
+
+ // Write out parameters to target memory
+ retval = target_write_buffer(target, ALGO_PARAMS_BASE_ADDR,
+ sizeof(struct msp432p4_algo_params), (uint8_t*)algo_params);
+ if (ERROR_OK != retval) return retval;
+
+ // Write out command to target memory
+ retval = target_write_buffer(target, ALGO_FLASH_COMMAND_ADDR,
+ sizeof(command), (uint8_t*)&command);
+
+ return retval;
+}
+
+static int msp432p4_wait_return_code(struct target *target)
+{
+ uint32_t return_code = 0;
+ long long start_ms;
+ long long elapsed_ms;
+
+ int retval = ERROR_OK;
+
+ start_ms = timeval_ms();
+ while (0 == return_code || FLASH_BUSY == return_code) {
+ retval = target_read_buffer(target, ALGO_RETURN_CODE_ADDR,
+ sizeof(return_code), (uint8_t*)&return_code);
+ if (ERROR_OK != retval) return retval;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ if (elapsed_ms > FLASH_TIMEOUT) break;
+ };
+
+ if (FLASH_SUCCESS != return_code) {
+ LOG_ERROR("Flash operation failed: %s",
+ msp432p4_return_text(return_code));
+ return ERROR_FAIL;
+ }
+
+ return ERROR_OK;
+}
+
+static int msp432p4_wait_inactive(struct target *target, uint32_t buffer)
+{
+ uint32_t status_code = BUFFER_ACTIVE;
+ uint32_t status_addr;
+ long long start_ms;
+ long long elapsed_ms;
+
+ int retval;
+
+ switch (buffer) {
+ case 1: // Buffer 1
+ status_addr = ALGO_BUFFER1_STATUS_ADDR;
+ break;
+ case 2: // Buffer 2
+ status_addr = ALGO_BUFFER2_STATUS_ADDR;
+ break;
+ default:
+ return ERROR_FAIL;
+ }
+
+ start_ms = timeval_ms();
+ while (BUFFER_INACTIVE != status_code) {
+ retval = target_read_buffer(target, status_addr, sizeof(status_code),
+ (uint8_t*)&status_code);
+ if (ERROR_OK != retval) return retval;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ if (elapsed_ms > FLASH_TIMEOUT) break;
+ };
+
+ if (BUFFER_INACTIVE != status_code) {
+ LOG_ERROR("Flash operation failed: buffer not written to flash");
+ return ERROR_FAIL;
+ }
+
+ return ERROR_OK;
+}
+
+static int msp432p4_init(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+ struct reg_param reg_params[1];
+
+ const uint8_t *loader_code;
+ uint32_t loader_size;
+ bool unlock_bsl;
+ int retval;
+
+ // Make sure we've probed the flash to get the device and size
+ unlock_bsl = msp432p4_bank->unlock_bsl;
+ retval = msp432p4_auto_probe(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Preserve current BSL setting across the probe call
+ msp432p4_bank->unlock_bsl = unlock_bsl;
+
+ // Choose appropriate flash helper algorithm
+ loader_size = 0;
+ switch (msp432p4_bank->device_id) {
+ case 0xA000:
+ case 0xA001:
+ case 0xA002:
+ case 0xA003:
+ case 0xA004:
+ case 0xA005:
+ // Device is Falcon, check revision
+ if (msp432p4_bank->hardware_rev >= 0x43 &&
+ msp432p4_bank->hardware_rev <= 0x49) {
+ loader_code = msp432p4_algo;
+ loader_size = sizeof(msp432p4_algo);
+ }
+ break;
+ case 0xA010:
+ case 0xA012:
+ case 0xA016:
+ case 0xA019:
+ case 0xA01F:
+ case 0xA020:
+ case 0xA022:
+ case 0xA026:
+ case 0xA029:
+ case 0xA02F:
+ // Device is Falcon 2M, check revision
+ if (msp432p4_bank->hardware_rev >= 0x41 &&
+ msp432p4_bank->hardware_rev <= 0x49) {
+ loader_code = msp432p4_2m_algo;
+ loader_size = sizeof(msp432p4_2m_algo);
+ }
+ break;
+ default:
+ // Fall through to check that loader_size wasn't set
+ break;
+ }
+ if (0 == loader_size) {
+ // Explicit device check failed. Report this and
+ // then guess at which algo is best to use.
+ LOG_INFO("msp432p4.flash: Unrecognized Device ID and Rev (%04x, %02x)",
+ msp432p4_bank->device_id, msp432p4_bank->hardware_rev);
+ if (msp432p4_bank->device_id < 0xA010) {
+ // Assume this device is a Falcon
+ loader_code = msp432p4_algo;
+ loader_size = sizeof(msp432p4_algo);
+ } else {
+ // Assume this device is a Falcon 2M
+ loader_code = msp432p4_2m_algo;
+ loader_size = sizeof(msp432p4_2m_algo);
+ }
+ }
+
+ // Check for working area to use for flash helper algorithm
+ if (0 != msp432p4_bank->working_area) {
+ target_free_working_area(target, msp432p4_bank->working_area);
+ }
+ retval = target_alloc_working_area(target, ALGO_WORKING_SIZE,
+ &msp432p4_bank->working_area);
+ if (ERROR_OK != retval) return retval;
+
+ // Confirm the defined working address is the area we need to use
+ if (ALGO_BASE_ADDR != msp432p4_bank->working_area->address) {
+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+ }
+
+ // Write flash helper algorithm into target memory
+ retval = target_write_buffer(target, ALGO_BASE_ADDR, loader_size,
+ loader_code);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize the ARMv7 specific info to run the algorithm
+ msp432p4_bank->armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
+ msp432p4_bank->armv7m_info.core_mode = ARM_MODE_THREAD;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Write out parameters to target memory
+ retval = target_write_buffer(target, ALGO_PARAMS_BASE_ADDR,
+ sizeof(algo_params), (uint8_t*)&algo_params);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize stack pointer for flash helper algorithm
+ init_reg_param(®_params[0], "sp", 32, PARAM_OUT);
+ buf_set_u32(reg_params[0].value, 0, 32, ALGO_STACK_POINTER_ADDR);
+
+ // Begin executing the flash helper algorithm
+ retval = target_start_algorithm(target, 0, 0, 1, reg_params,
+ ALGO_ENTRY_ADDR, 0, &msp432p4_bank->armv7m_info);
+ if (ERROR_OK != retval) {
+ LOG_ERROR("ERROR: Failed to start flash helper algorithm");
+ return retval;
+ }
+
+ // At this point, the algorithm is running on the target and
+ // ready to receive commands and data to flash the target
+
+ // Issue the init command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_INIT);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+
+ // Mark erased status of sectors as "unknown"
+ if (0 != bank->sectors) {
+ for (int i = 0; i < bank->num_sectors; i++) {
+ bank->sectors[i].is_erased = -1;
+ }
+ }
+
+ return retval;
+}
+
+static int msp432p4_quit(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ // At the end of any flash operation, lock the BSL
+ msp432p4_bank->unlock_bsl = false;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Issue the exit command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_EXIT);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+
+ // Regardless of the return code, attempt to halt the target
+ (void)target_halt(target);
+
+ // Now confirm target halted and clean up from flash helper algorithm
+ retval = target_wait_algorithm(target, 0, 0, 0, 0, 0, FLASH_TIMEOUT,
+ &msp432p4_bank->armv7m_info);
+
+ target_free_working_area(target, msp432p4_bank->working_area);
+ msp432p4_bank->working_area = 0;
+
+ return retval;
+}
+
+static int msp432p4_mass_erase(struct flash_bank *bank, bool all)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+ if (all) {
+ algo_params.erase_param = FLASH_ERASE_MAIN | FLASH_ERASE_INFO;
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Issue the mass erase command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_MASS_ERASE);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark all sectors erased
+ if (0 != bank->sectors) {
+ for (int i = 0; i < bank->num_sectors; i++) {
+ bank->sectors[i].is_erased = 1;
+ }
+ }
+
+ return retval;
+}
+
+COMMAND_HANDLER(msp432p4_mass_erase_command)
+{
+ struct flash_bank *bank;
+ bool all;
+ int retval;
+
+ if (0 == CMD_ARGC) {
+ all = false;
+ } else if (1 == CMD_ARGC) {
+ // Check argument for how much to erase
+ if (0 == strcmp(CMD_ARGV[0], "main")) {
+ all = false;
+ } else if (0 == strcmp(CMD_ARGV[0], "all")) {
+ all = true;
+ } else {
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+ } else {
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+
+ retval = get_flash_bank_by_num(0, &bank);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_mass_erase(bank, all);
+ if (ERROR_OK != retval) return retval;
+
+ LOG_INFO("msp432p4: Mass erase of %s is complete.",
+ all ? "main + info flash" : "main flash");
+
+ return ERROR_OK;
+}
+
+COMMAND_HANDLER(msp432p4_unlock_bsl_command)
+{
+ struct flash_bank *bank;
+ struct msp432p4_bank *msp432p4_bank;
+ int retval;
+
+ if (0 != CMD_ARGC) return ERROR_COMMAND_SYNTAX_ERROR;
+
+ retval = get_flash_bank_by_num(0, &bank);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank = bank->driver_priv;
+ msp432p4_bank->unlock_bsl = true;
+
+ LOG_INFO("msp432p4: BSL unlocked until end of next flash command.");
+
+ return ERROR_OK;
+}
+
+FLASH_BANK_COMMAND_HANDLER(msp432p4_flash_bank_command)
+{
+ struct msp432p4_bank *msp432p4_bank;
+ struct flash_bank *info_bank;
+
+ if (CMD_ARGC < 6) return ERROR_COMMAND_SYNTAX_ERROR;
+
+ msp432p4_bank = malloc(sizeof(struct msp432p4_bank));
+ if (0 == msp432p4_bank) return ERROR_FAIL;
+
+ info_bank = malloc(sizeof(struct flash_bank));
+ if (0 == info_bank) {
+ free((void*)msp432p4_bank);
+ return ERROR_FAIL;
+ }
+
+ // Initialize private flash information
+ msp432p4_bank->device_id = 0;
+ msp432p4_bank->hardware_rev = 0;
+ msp432p4_bank->probed[0] = false;
+ msp432p4_bank->probed[1] = false;
+ msp432p4_bank->unlock_bsl = false;
+ msp432p4_bank->working_area = 0;
+
+ // Finish initialization of bank 0 (main flash)
+ bank->driver_priv = msp432p4_bank;
+ bank->next = info_bank;
+
+ // Initialize bank 1 (info region)
+ info_bank->name = bank->name;
+ info_bank->target = bank->target;
+ info_bank->driver = bank->driver;
+ info_bank->driver_priv = bank->driver_priv;
+ info_bank->bank_number = 1;
+ info_bank->base = 0x00200000;
+ info_bank->size = 0;
+ info_bank->chip_width = 0;
+ info_bank->bus_width = 0;
+ info_bank->default_padded_value = 0xff;
+ info_bank->num_sectors = 0;
+ info_bank->sectors = 0;
+ info_bank->next = 0;
+
+ return ERROR_OK;
+}
+
+static int msp432p4_erase(struct flash_bank *bank, int first, int last)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ // Do a mass erase if user requested all sectors of main flash
+ if ((0 == bank->bank_number) && (first == 0) &&
+ (last == (bank->num_sectors - 1))) {
+ // Request mass erase of main flash
+ return msp432p4_mass_erase(bank, false);
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Adjust params if this is the info bank
+ if (1 == bank->bank_number) {
+ algo_params.erase_param = FLASH_ERASE_INFO;
+ // And flag if BSL is unlocked
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Erase requested sectors one by one
+ for (int i = first; i <= last; i++) {
+
+ // Convert sector number to starting address of sector
+ algo_params.address = i * SECTOR_LENGTH;
+
+ // Issue the sector erase command to the flash helper algorithm
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_SECTOR_ERASE);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark the sector as erased
+ if (0 != bank->sectors) bank->sectors[i].is_erased = 1;
+ }
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ return retval;
+}
+
+static int msp432p4_protect(struct flash_bank *bank, int set, int first,
+ int last)
+{
+ return ERROR_OK;
+}
+
+static int msp432p4_write(struct flash_bank *bank, const uint8_t *buffer,
+ uint32_t offset, uint32_t count)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+ struct msp432p4_algo_params algo_params;
+ uint32_t size;
+ uint32_t data_ready = BUFFER_DATA_READY;
+ long long start_ms;
+ long long elapsed_ms;
+ uint32_t end_address = offset + count - 1;
+ uint32_t sector;
+
+ int retval;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = msp432p4_init(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Initialize algorithm parameters to default values
+ msp432p4_init_params(&algo_params);
+
+ // Set up parameters for requested flash write operation
+ algo_params.address = offset;
+ algo_params.length = count;
+
+ // Check if this is the info bank
+ if (1 == bank->bank_number) {
+ // And flag if BSL is unlocked
+ if (msp432p4_bank->unlock_bsl) {
+ algo_params.unlock_bsl = FLASH_UNLOCK_BSL;
+ }
+ }
+
+ // Set up flash helper algorithm to continuous flash mode
+ retval = msp432p4_exec_cmd(target, &algo_params, FLASH_CONTINUOUS);
+ if (ERROR_OK != retval) return retval;
+
+ // Write requested data, one buffer at a time
+ start_ms = timeval_ms();
+ while (count > 0) {
+
+ if (count > ALGO_BUFFER_SIZE) {
+ size = ALGO_BUFFER_SIZE;
+ } else {
+ size = count;
+ }
+
+ // Put next block of data to flash into buffer
+ retval = target_write_buffer(target, ALGO_BUFFER1_ADDR, size, buffer);
+ if (ERROR_OK != retval) {
+ LOG_ERROR("Unable to write data to target memory");
+ return ERROR_FLASH_OPERATION_FAILED;
+ }
+
+ // Signal the flash helper algorithm that data is ready to flash
+ retval = target_write_buffer(target, ALGO_BUFFER1_STATUS_ADDR,
+ sizeof(data_ready), (uint8_t*)&data_ready);
+ if (ERROR_OK != retval) return ERROR_FLASH_OPERATION_FAILED;
+
+ retval = msp432p4_wait_inactive(target, 1);
+ if (ERROR_OK != retval) return retval;
+
+ count -= size;
+ buffer += size;
+
+ elapsed_ms = timeval_ms() - start_ms;
+ if (elapsed_ms > 500) keep_alive();
+ }
+
+ // Confirm that the flash helper algorithm is finished
+ retval = msp432p4_wait_return_code(target);
+ if (ERROR_OK != retval) return retval;
+
+ retval = msp432p4_quit(bank);
+ if (ERROR_OK != retval) return retval;
+
+ // Mark flashed sectors as "not erased"
+ while (offset <= end_address) {
+ sector = offset / SECTOR_LENGTH;
+ bank->sectors[sector].is_erased = 0;
+ offset += SECTOR_LENGTH;
+ }
+
+ return retval;
+}
+
+static int msp432p4_probe(struct flash_bank *bank)
+{
+ struct target *target = bank->target;
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+
+ uint32_t device_id;
+ uint32_t hardware_rev;
+
+ uint32_t base;
+ uint32_t size;
+ int num_sectors;
+ int bank_id;
+
+ int retval;
+
+ bank_id = bank->bank_number;
+
+ if (TARGET_HALTED != target->state) {
+ LOG_ERROR("Target not halted");
+ return ERROR_TARGET_NOT_HALTED;
+ }
+
+ retval = target_read_u32(target, DEVICE_ID_ADDR, &device_id);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank->device_id = device_id & 0xFFFF;
+
+ retval = target_read_u32(target, HARDWARE_REV_ADDR, &hardware_rev);
+ if (ERROR_OK != retval) return retval;
+
+ msp432p4_bank->hardware_rev = hardware_rev & 0xFF;
+
+ if (0 == bank_id) {
+ retval = target_read_u32(target, FLASH_MAIN_SIZE_REG, &size);
+ if (ERROR_OK != retval) return retval;
+
+ base = FLASH_MAIN_BASE;
+ num_sectors = size / SECTOR_LENGTH;
+ } else if (1 == bank_id) {
+ retval = target_read_u32(target, FLASH_INFO_SIZE_REG, &size);
+ if (ERROR_OK != retval) return retval;
+
+ base = FLASH_INFO_BASE;
+ num_sectors = size / SECTOR_LENGTH;
+ } else {
+ // Invalid bank number somehow
+ return ERROR_FAIL;
+ }
+
+ if (0 != bank->sectors) {
+ free(bank->sectors);
+ bank->sectors = 0;
+ }
+
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
+ if (0 == bank->sectors) return ERROR_FAIL;
+
+ bank->base = base;
+ bank->size = size;
+ bank->num_sectors = num_sectors;
+
+ for (int i = 0; i < num_sectors; i++) {
+ bank->sectors[i].offset = i * SECTOR_LENGTH;
+ bank->sectors[i].size = SECTOR_LENGTH;
+ bank->sectors[i].is_erased = -1;
+ bank->sectors[i].is_protected = 0;
+ }
+
+ // We've successfully determined the stats on this flash bank
+ msp432p4_bank->probed[bank_id] = true;
+
+ // If we fall through to here, then all went well
+
+ return ERROR_OK;
+}
+
+static int msp432p4_auto_probe(struct flash_bank *bank)
+{
+ struct msp432p4_bank *msp432p4_bank = bank->driver_priv;
+
+ int retval = ERROR_OK;
+
+ if (bank->bank_number < 0 || bank->bank_number > 1) {
+ // Invalid bank number somehow
+ return ERROR_FAIL;
+ }
+
+ if (!msp432p4_bank->probed[bank->bank_number]) {
+ retval = msp432p4_probe(bank);
+ }
+
+ return retval;
+}
+
+static int msp432p4_protect_check(struct flash_bank *bank)
+{
+ return ERROR_OK;
+}
+
+static int msp432p4_info(struct flash_bank *bank, char *buf, int buf_size)
+{
+ return ERROR_OK;
+}
+
+static const struct command_registration msp432p4_exec_command_handlers[] = {
+ {
+ .name = "mass_erase",
+ .handler = msp432p4_mass_erase_command,
+ .mode = COMMAND_EXEC,
+ .help = "Erase entire flash memory on device.",
+ .usage = "['main' | 'all']",
+ },
+ {
+ .name = "unlock_bsl",
+ .handler = msp432p4_unlock_bsl_command,
+ .mode = COMMAND_EXEC,
+ .help = "Allow BSL to be erased or written in next flash command.",
+ .usage = "",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+static const struct command_registration msp432p4_command_handlers[] = {
+ {
+ .name = "msp432p4",
+ .mode = COMMAND_EXEC,
+ .help = "MSP432p4 flash command group",
+ .usage = "",
+ .chain = msp432p4_exec_command_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+struct flash_driver msp432p4_flash = {
+ .name = "msp432p4",
+ .commands = msp432p4_command_handlers,
+ .flash_bank_command = msp432p4_flash_bank_command,
+ .erase = msp432p4_erase,
+ .protect = msp432p4_protect,
+ .write = msp432p4_write,
+ .read = default_flash_read,
+ .probe = msp432p4_probe,
+ .auto_probe = msp432p4_auto_probe,
+ .erase_check = default_flash_blank_check,
+ .protect_check = msp432p4_protect_check,
+ .info = msp432p4_info,
+};
diff --git a/src/flash/nor/msp432p4.h b/src/flash/nor/msp432p4.h
new file mode 100644
index 0000000..926e72b
--- /dev/null
+++ b/src/flash/nor/msp432p4.h
@@ -0,0 +1,593 @@
+/***************************************************************************
+ * Copyright (C) 2017 by Texas Instruments, Inc. *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ ***************************************************************************/
+
+#ifndef OPENOCD_SRC_FLASH_NOR_MSP432P4_H
+#define OPENOCD_SRC_FLASH_NOR_MSP432P4_H
+
+// Flash base addresses
+#define FLASH_MAIN_BASE 0x00000000
+#define FLASH_INFO_BASE 0x00200000
+
+// Flash helper algorithm key addresses
+#define ALGO_ENTRY_ADDR 0x01000140
+#define ALGO_BASE_ADDR 0x20000000
+#define ALGO_BUFFER1_ADDR 0x20002000
+#define ALGO_BUFFER2_ADDR 0x20003000
+#define ALGO_PARAMS_BASE_ADDR 0x20000150
+#define ALGO_FLASH_COMMAND_ADDR 0x20000150
+#define ALGO_RETURN_CODE_ADDR 0x20000154
+#define ALGO_FLASH_DEST_ADDR 0x2000015c
+#define ALGO_FLASH_LENGTH_ADDR 0x20000160
+#define ALGO_BUFFER1_STATUS_ADDR 0x20000164
+#define ALGO_BUFFER2_STATUS_ADDR 0x20000168
+#define ALGO_ERASE_PARAM_ADDR 0x2000016c
+#define ALGO_UNLOCK_BSL_ADDR 0x20000170
+#define ALGO_STACK_POINTER_ADDR 0x20002000
+
+// Flash helper algorithm key sizes
+#define ALGO_BUFFER_SIZE 0x1000
+#define ALGO_WORKING_SIZE (ALGO_BUFFER2_ADDR + 0x1000 - ALGO_BASE_ADDR)
+
+// Flash helper algorithm flash commands
+#define FLASH_NO_COMMAND 0
+#define FLASH_MASS_ERASE 1
+#define FLASH_SECTOR_ERASE 2
+#define FLASH_PROGRAM 4
+#define FLASH_INIT 8
+#define FLASH_EXIT 16
+#define FLASH_CONTINUOUS 32
+
+// Flash helper algorithm return codes
+#define FLASH_BUSY 0x00000001
+#define FLASH_SUCCESS 0x00000ACE
+#define FLASH_ERROR 0x0000DEAD
+#define FLASH_TIMEOUT_ERROR 0xDEAD0000
+#define FLASH_VERIFY_ERROR 0xDEADDEAD
+#define FLASH_WRONG_COMMAND 0x00000BAD
+#define FLASH_POWER_ERROR 0x00DEAD00
+
+// Flash helper algorithm buffer status values
+#define BUFFER_INACTIVE 0x00
+#define BUFFER_ACTIVE 0x01
+#define BUFFER_DATA_READY 0x10
+
+// Flash helper algorithm erase parameters
+#define FLASH_ERASE_MAIN 0x01
+#define FLASH_ERASE_INFO 0x02
+
+// Flash helper algorithm lock/unlock BSL options
+#define FLASH_LOCK_BSL 0x00;
+#define FLASH_UNLOCK_BSL 0x0b;
+
+// Flash helper algorithm parameter block struct
+struct msp432p4_algo_params {
+ volatile uint32_t flash_command;
+ volatile uint32_t return_code;
+ volatile uint32_t _reserved0;
+ volatile uint32_t address;
+ volatile uint32_t length;
+ volatile uint32_t buffer1_status;
+ volatile uint32_t buffer2_status;
+ volatile uint32_t erase_param;
+ volatile uint32_t unlock_bsl;
+};
+
+// Flash helper algorithm for MSP432P401 - Falcon targets
+const uint8_t msp432p4_algo[] =
+{
+ 0x00, 0x10, 0x00, 0x01, 0x41, 0x01, 0x00, 0x01, 0xC1, 0x08, 0x00, 0x01,
+ 0xC3, 0x08, 0x00, 0x01, 0xC5, 0x08, 0x00, 0x01, 0xC5, 0x08, 0x00, 0x01,
+ 0xC5, 0x08, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x28, 0xBB,
+ 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x38, 0xB5, 0xDC, 0x4C, 0x20, 0x68, 0x40, 0x08,
+ 0x0F, 0xD3, 0x4F, 0xF0, 0x00, 0x75, 0xD5, 0xF8, 0x1C, 0x08, 0x02, 0x69,
+ 0x4F, 0xF0, 0xFF, 0x31, 0x01, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08,
+ 0x02, 0x69, 0x4F, 0xF0, 0xFF, 0x31, 0x02, 0x20, 0x90, 0x47, 0x20, 0x68,
+ 0x80, 0x08, 0x12, 0xD3, 0x4F, 0xF0, 0x00, 0x70, 0x00, 0xF6, 0x1C, 0x05,
+ 0xD0, 0xF8, 0x1C, 0x08, 0x02, 0x69, 0x03, 0x20, 0x01, 0x46, 0x90, 0x47,
+ 0x24, 0x1D, 0x20, 0x68, 0x0B, 0x28, 0x04, 0xD1, 0x28, 0x68, 0x02, 0x69,
+ 0x03, 0x21, 0x04, 0x20, 0x90, 0x47, 0x38, 0xBD, 0x38, 0xB5, 0x4F, 0xF0,
+ 0x00, 0x75, 0x05, 0xF6, 0x1C, 0x04, 0x20, 0x68, 0x02, 0x69, 0x4F, 0xF0,
+ 0xFF, 0x31, 0x01, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08, 0x02, 0x69,
+ 0x4F, 0xF0, 0xFF, 0x31, 0x02, 0x20, 0x90, 0x47, 0xD5, 0xF8, 0x1C, 0x08,
+ 0x02, 0x69, 0x03, 0x20, 0x01, 0x46, 0x90, 0x47, 0xBA, 0x48, 0x00, 0x1D,
+ 0x00, 0x68, 0x0B, 0x28, 0x04, 0xD1, 0x20, 0x68, 0x02, 0x69, 0x03, 0x21,
+ 0x04, 0x20, 0x90, 0x47, 0x38, 0xBD, 0x08, 0xB5, 0xD1, 0x4B, 0x1B, 0x68,
+ 0x9B, 0x6A, 0x98, 0x47, 0x08, 0xBD, 0x10, 0xB5, 0x4F, 0xF0, 0x00, 0x74,
+ 0xD4, 0xF8, 0x1C, 0x08, 0x42, 0x69, 0x4F, 0xF0, 0xFF, 0x31, 0x01, 0x20,
+ 0x90, 0x47, 0xD4, 0xF8, 0x1C, 0x08, 0x42, 0x69, 0x4F, 0xF0, 0xFF, 0x31,
+ 0x02, 0x20, 0x90, 0x47, 0xD4, 0xF8, 0x1C, 0x08, 0x42, 0x69, 0x03, 0x20,
+ 0x01, 0x46, 0x90, 0x47, 0xD4, 0xF8, 0x1C, 0x08, 0x42, 0x69, 0x03, 0x21,
+ 0x04, 0x20, 0x90, 0x47, 0x10, 0xBD, 0x98, 0xB5, 0xFF, 0xF7, 0xB6, 0xFF,
+ 0xA1, 0x4C, 0x18, 0x3C, 0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FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x02, 0x9B, 0x08, 0x00, 0x01, 0x9B, 0x08, 0x00, 0x01, 0x02, 0x0D,
+ 0x00, 0x20, 0x00, 0x20, 0x02, 0x00, 0x00, 0x00, 0xBB, 0x08, 0x00, 0x01,
+ 0xA1, 0x08, 0x00, 0x01, 0xE8, 0x08, 0x00, 0x01, 0xCC, 0x08, 0x00, 0x01,
+};
+
+// Flash helper algorithm for MSP432p411 - Falcon 2M targets
+const uint8_t msp432p4_2m_algo[] =
+{
+ 0x00, 0x10, 0x00, 0x01, 0x41, 0x01, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01, 0xCD, 0x0A, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x22, 0xBC,
+ 0x70, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0xB5, 0x96, 0x48, 0x00, 0x68, 0x00, 0x68,
+ 0x80, 0x47, 0x00, 0xF0, 0x8C, 0xFC, 0x40, 0xE0, 0x94, 0x48, 0x93, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x4C, 0xF8, 0x92, 0x49, 0x00, 0x20,
+ 0x08, 0x60, 0x36, 0xE0, 0x8F, 0x48, 0x8E, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x00, 0xF0, 0x93, 0xF8, 0x8D, 0x49, 0x00, 0x20, 0x08, 0x60, 0x2C, 0xE0,
+ 0x8A, 0x48, 0x89, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0xAF, 0xF8,
+ 0x88, 0x49, 0x00, 0x20, 0x08, 0x60, 0x22, 0xE0, 0x85, 0x48, 0x84, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0xCE, 0xF8, 0x83, 0x49, 0x00, 0x20,
+ 0x08, 0x60, 0x18, 0xE0, 0x80, 0x48, 0x7F, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x00, 0xF0, 0x08, 0xF9, 0x7E, 0x49, 0x00, 0x20, 0x08, 0x60, 0x0E, 0xE0,
+ 0x7B, 0x48, 0x7A, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x3E, 0xFA,
+ 0x79, 0x49, 0x00, 0x20, 0x08, 0x60, 0x04, 0xE0, 0x78, 0x48, 0x75, 0x49,
+ 0x00, 0x68, 0x08, 0x60, 0xFF, 0xE7, 0x75, 0x48, 0x00, 0x68, 0x00, 0x28,
+ 0xFB, 0xD0, 0x40, 0x1E, 0xC2, 0xD0, 0x40, 0x1E, 0xCA, 0xD0, 0x80, 0x1E,
+ 0xD2, 0xD0, 0x00, 0x1F, 0xB2, 0xD0, 0x08, 0x38, 0xE2, 0xD0, 0x10, 0x38,
+ 0xD6, 0xD0, 0xE9, 0xE7, 0x08, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00,
+ 0x6C, 0x49, 0x4F, 0xF0, 0x80, 0x70, 0x08, 0x60, 0x6C, 0x48, 0x00, 0x68,
+ 0x80, 0x6D, 0x01, 0x46, 0x00, 0x20, 0x88, 0x47, 0x68, 0x49, 0x08, 0x60,
+ 0x68, 0x48, 0x00, 0x68, 0x80, 0x6D, 0x01, 0x46, 0x01, 0x20, 0x88, 0x47,
+ 0xBA, 0x49, 0x08, 0x60, 0xBB, 0x48, 0x00, 0x68, 0x40, 0x68, 0x80, 0x47,
+ 0xB8, 0x49, 0x08, 0x70, 0xB8, 0x48, 0x00, 0x68, 0x00, 0x6A, 0x80, 0x47,
+ 0xB7, 0x49, 0x08, 0x70, 0xB8, 0x48, 0xB7, 0x49, 0x00, 0x68, 0x00, 0xF4,
+ 0xE0, 0x20, 0x08, 0x60, 0xB2, 0x48, 0x00, 0x68, 0x80, 0x69, 0x01, 0x46,
+ 0x00, 0x20, 0x88, 0x47, 0x8D, 0xF8, 0x00, 0x00, 0x57, 0x48, 0x00, 0x68,
+ 0x40, 0x6D, 0x02, 0x21, 0x02, 0x46, 0x00, 0x20, 0x90, 0x47, 0x54, 0x48,
+ 0x00, 0x68, 0x40, 0x6D, 0x02, 0x21, 0x02, 0x46, 0x01, 0x20, 0x90, 0x47,
+ 0x4F, 0xF4, 0x80, 0x20, 0x00, 0xF0, 0xC0, 0xF9, 0x9D, 0xF8, 0x00, 0x00,
+ 0x20, 0xB9, 0xA8, 0x48, 0x46, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0xA6, 0x48, 0x44, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD, 0x0E, 0xB5,
+ 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x45, 0xF9, 0x05, 0x20,
+ 0x01, 0x90, 0x08, 0xE0, 0x43, 0x48, 0x00, 0x68, 0x00, 0x6A, 0x80, 0x47,
+ 0x8D, 0xF8, 0x00, 0x00, 0x01, 0x98, 0x40, 0x1E, 0x01, 0x90, 0x9D, 0xF8,
+ 0x00, 0x00, 0x10, 0xB9, 0x01, 0x98, 0x00, 0x28, 0xF0, 0xDC, 0x01, 0x98,
+ 0x20, 0xB9, 0xBF, 0x48, 0x34, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0x94, 0x48, 0x32, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x76, 0xF9,
+ 0x0E, 0xBD, 0x0E, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0,
+ 0x4C, 0xF9, 0x05, 0x20, 0x01, 0x90, 0x0B, 0xE0, 0x30, 0x48, 0x00, 0x68,
+ 0xBF, 0x4A, 0x40, 0x6A, 0x01, 0x46, 0x10, 0x68, 0x88, 0x47, 0x8D, 0xF8,
+ 0x00, 0x00, 0x01, 0x98, 0x40, 0x1E, 0x01, 0x90, 0x9D, 0xF8, 0x00, 0x00,
+ 0x10, 0xB9, 0x01, 0x98, 0x00, 0x28, 0xED, 0xDC, 0x01, 0x98, 0x20, 0xB9,
+ 0xC1, 0x48, 0x20, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0, 0x80, 0x48,
+ 0x1D, 0x49, 0x00, 0x68, 0x08, 0x60, 0x00, 0xF0, 0x4D, 0xF9, 0x0E, 0xBD,
+ 0x08, 0xB5, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x00, 0xF0, 0x23, 0xF9,
+ 0xBA, 0x48, 0xB9, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42, 0xF9, 0xD0,
+ 0xB7, 0x49, 0xB8, 0x48, 0x0A, 0x68, 0x00, 0x68, 0x10, 0x43, 0x08, 0x60,
+ 0xB6, 0x4B, 0xA7, 0x48, 0xB6, 0x4A, 0x01, 0x68, 0x18, 0x68, 0x12, 0x68,
+ 0x00, 0xF0, 0xAE, 0xF9, 0x8D, 0xF8, 0x00, 0x00, 0xB0, 0x49, 0xAE, 0x48,
+ 0xAE, 0x4A, 0x0B, 0x68, 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43,
+ 0x11, 0x60, 0x00, 0xF0, 0x25, 0xF9, 0x9D, 0xF8, 0x00, 0x00, 0x20, 0xB9,
+ 0xA6, 0x48, 0x05, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0, 0x65, 0x48,
+ 0x02, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD, 0x64, 0x08, 0x00, 0x02,
+ 0x54, 0x01, 0x00, 0x20, 0xF0, 0x0A, 0x00, 0x01, 0x50, 0x01, 0x00, 0x20,
+ 0x00, 0x0B, 0x00, 0x01, 0x08, 0xED, 0x00, 0xE0, 0x80, 0x01, 0x00, 0x20,
+ 0x6C, 0x08, 0x00, 0x02, 0x00, 0xB5, 0xAD, 0xF1, 0x1C, 0x0D, 0x00, 0x20,
+ 0x8D, 0xF8, 0x00, 0x00, 0x00, 0x20, 0x8D, 0xF8, 0x01, 0x00, 0x00, 0x20,
+ 0x01, 0x90, 0x00, 0x20, 0x8D, 0xF8, 0x08, 0x00, 0x97, 0x48, 0x00, 0x68,
+ 0x03, 0x90, 0x00, 0x20, 0x04, 0x90, 0x85, 0x48, 0x00, 0x68, 0x05, 0x90,
+ 0x03, 0x98, 0x00, 0x28, 0x00, 0xF0, 0x84, 0x80, 0xBB, 0x48, 0x03, 0x99,
+ 0x00, 0x68, 0x88, 0x42, 0x07, 0xD2, 0xB9, 0x48, 0x00, 0x68, 0x04, 0x90,
+ 0x04, 0x99, 0x03, 0x98, 0x40, 0x1A, 0x03, 0x90, 0x05, 0xE0, 0x03, 0x98,
+ 0x04, 0x90, 0x04, 0x99, 0x03, 0x98, 0x40, 0x1A, 0x03, 0x90, 0x00, 0xF0,
+ 0xB6, 0xF8, 0x84, 0x48, 0x82, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x05, 0xD1, 0xAF, 0x48, 0x7F, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0xF3, 0xD0, 0x7E, 0x48, 0x7C, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x0C, 0xD0, 0x7B, 0x49, 0x7B, 0x48, 0x0A, 0x68, 0x00, 0x68, 0x10, 0x43,
+ 0x08, 0x60, 0x7A, 0x48, 0x00, 0x68, 0x01, 0x90, 0x01, 0x20, 0x8D, 0xF8,
+ 0x00, 0x00, 0x11, 0xE0, 0xA2, 0x48, 0x73, 0x49, 0x00, 0x68, 0x09, 0x68,
+ 0x01, 0x42, 0x0B, 0xD0, 0x9F, 0x49, 0x72, 0x48, 0x0A, 0x68, 0x00, 0x68,
+ 0x10, 0x43, 0x08, 0x60, 0x9D, 0x48, 0x00, 0x68, 0x01, 0x90, 0x01, 0x20,
+ 0x8D, 0xF8, 0x01, 0x00, 0x9D, 0xF8, 0x00, 0x00, 0x10, 0xB9, 0x9D, 0xF8,
+ 0x01, 0x00, 0x50, 0xB1, 0x05, 0x99, 0x01, 0x98, 0x04, 0x9A, 0x00, 0xF0,
+ 0x19, 0xF9, 0x8D, 0xF8, 0x08, 0x00, 0x05, 0x99, 0x04, 0x98, 0x40, 0x18,
+ 0x05, 0x90, 0x9D, 0xF8, 0x00, 0x00, 0x60, 0xB1, 0x62, 0x49, 0x60, 0x48,
+ 0x60, 0x4A, 0x0B, 0x68, 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43,
+ 0x11, 0x60, 0x00, 0x20, 0x8D, 0xF8, 0x00, 0x00, 0x0E, 0xE0, 0x9D, 0xF8,
+ 0x01, 0x00, 0x58, 0xB1, 0x5A, 0x49, 0x58, 0x48, 0x86, 0x4A, 0x0B, 0x68,
+ 0x00, 0x68, 0x11, 0x68, 0x18, 0x43, 0x81, 0x43, 0x11, 0x60, 0x00, 0x20,
+ 0x8D, 0xF8, 0x01, 0x00, 0x00, 0xF0, 0x76, 0xF8, 0x9D, 0xF8, 0x08, 0x00,
+ 0x20, 0xB9, 0x4F, 0x48, 0x80, 0x49, 0x00, 0x68, 0x08, 0x60, 0x03, 0xE0,
+ 0x03, 0x98, 0x00, 0x28, 0x7F, 0xF4, 0x7C, 0xAF, 0x9D, 0xF8, 0x08, 0x00,
+ 0x18, 0xB1, 0x0A, 0x48, 0x7A, 0x49, 0x00, 0x68, 0x08, 0x60, 0x07, 0xB0,
+ 0x00, 0xBD, 0xC0, 0x46, 0x84, 0x01, 0x00, 0x20, 0x8C, 0x01, 0x00, 0x20,
+ 0x34, 0x08, 0x00, 0x02, 0x8D, 0x01, 0x00, 0x20, 0x88, 0x01, 0x00, 0x20,
+ 0x04, 0x04, 0x01, 0x40, 0x04, 0x0B, 0x00, 0x01, 0xF4, 0x0A, 0x00, 0x01,
+ 0x08, 0xB5, 0x71, 0x48, 0x6F, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42,
+ 0x09, 0xD0, 0x6F, 0x48, 0x00, 0x68, 0x40, 0x68, 0x80, 0x47, 0x74, 0x49,
+ 0x09, 0x68, 0x0A, 0x69, 0x41, 0x1E, 0x00, 0x20, 0x90, 0x47, 0x69, 0x48,
+ 0x6A, 0x49, 0x00, 0x68, 0x09, 0x68, 0x01, 0x42, 0x14, 0xD0, 0x6E, 0x48,
+ 0x00, 0x68, 0x68, 0x49, 0x00, 0x69, 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10,
+ 0x90, 0x47, 0x67, 0x48, 0x65, 0x49, 0x00, 0x68, 0x09, 0x68, 0x88, 0x42,
+ 0x06, 0xD1, 0x67, 0x48, 0x00, 0x68, 0x65, 0x49, 0x00, 0x69, 0x02, 0x46,
+ 0x62, 0x48, 0x90, 0x47, 0x08, 0xBD, 0x08, 0xB5, 0x5B, 0x48, 0x00, 0x68,
+ 0x40, 0x68, 0x80, 0x47, 0x60, 0x49, 0x09, 0x68, 0x0A, 0x69, 0x41, 0x1E,
+ 0x00, 0x20, 0x90, 0x47, 0x5D, 0x48, 0x00, 0x68, 0x57, 0x49, 0x00, 0x69,
+ 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10, 0x90, 0x47, 0x56, 0x48, 0x55, 0x49,
+ 0x00, 0x68, 0x09, 0x68, 0x88, 0x42, 0x06, 0xD1, 0x56, 0x48, 0x00, 0x68,
+ 0x54, 0x49, 0x00, 0x69, 0x02, 0x46, 0x52, 0x48, 0x90, 0x47, 0x08, 0xBD,
+ 0xFC, 0x0A, 0x00, 0x01, 0x08, 0xB5, 0x4A, 0x48, 0x00, 0x68, 0x40, 0x68,
+ 0x80, 0x47, 0x4F, 0x49, 0x09, 0x68, 0x4A, 0x69, 0x41, 0x1E, 0x00, 0x20,
+ 0x90, 0x47, 0x4C, 0x48, 0x00, 0x68, 0x40, 0x69, 0x4F, 0xF4, 0x01, 0x11,
+ 0x02, 0x46, 0x4F, 0xF4, 0x00, 0x10, 0x90, 0x47, 0x08, 0xBD, 0xC0, 0x46,
+ 0x5C, 0x01, 0x00, 0x20, 0xAD, 0xF1, 0x08, 0x0D, 0x00, 0x90, 0x45, 0x49,
+ 0x46, 0xF6, 0x5A, 0x10, 0x08, 0x60, 0x44, 0x48, 0x43, 0x4A, 0x00, 0x99,
+ 0x00, 0x68, 0x20, 0xF4, 0xE0, 0x20, 0x01, 0x43, 0x11, 0x60, 0x3F, 0x49,
+ 0x00, 0x20, 0x08, 0x60, 0x02, 0xB0, 0x70, 0x47, 0xF8, 0x0A, 0x00, 0x01,
+ 0xDC, 0x0A, 0x00, 0x01, 0x64, 0x01, 0x00, 0x20, 0xD8, 0x0A, 0x00, 0x01,
+ 0xD0, 0x0A, 0x00, 0x01, 0x60, 0x01, 0x00, 0x20, 0x08, 0xB5, 0x00, 0x20,
+ 0x8D, 0xF8, 0x00, 0x00, 0x4F, 0xF4, 0x80, 0x30, 0xFF, 0xF7, 0xD8, 0xFF,
+ 0x31, 0x48, 0x34, 0x49, 0x00, 0x68, 0x09, 0x68, 0x40, 0x6D, 0x02, 0x46,
+ 0x00, 0x20, 0x90, 0x47, 0x2D, 0x48, 0x31, 0x49, 0x00, 0x68, 0x09, 0x68,
+ 0x40, 0x6D, 0x02, 0x46, 0x01, 0x20, 0x90, 0x47, 0x2E, 0x48, 0x00, 0x68,
+ 0x2E, 0x4A, 0x80, 0x69, 0x01, 0x46, 0x10, 0x78, 0x88, 0x47, 0x8D, 0xF8,
+ 0x00, 0x00, 0x2A, 0x48, 0x00, 0x68, 0x2B, 0x4A, 0x00, 0x68, 0x01, 0x46,
+ 0x10, 0x78, 0x88, 0x47, 0x9D, 0xF8, 0x00, 0x20, 0x00, 0x21, 0x10, 0x42,
+ 0x00, 0xD0, 0x01, 0x21, 0x8D, 0xF8, 0x00, 0x10, 0x25, 0x48, 0x00, 0x68,
+ 0xFF, 0xF7, 0xAC, 0xFF, 0x24, 0x49, 0x00, 0x20, 0x08, 0x60, 0x9D, 0xF8,
+ 0x00, 0x00, 0x20, 0xB9, 0x22, 0x48, 0x0E, 0x49, 0x00, 0x68, 0x08, 0x60,
+ 0x03, 0xE0, 0x21, 0x48, 0x0B, 0x49, 0x00, 0x68, 0x08, 0x60, 0x08, 0xBD,
+ 0x0E, 0xB5, 0x02, 0x92, 0x01, 0x91, 0x00, 0x90, 0x11, 0x48, 0x00, 0x68,
+ 0x01, 0x99, 0x02, 0x9A, 0x80, 0x6A, 0x03, 0x46, 0x00, 0x98, 0x98, 0x47,
+ 0x0E, 0xBD, 0xC0, 0x46, 0xE0, 0x0A, 0x00, 0x01, 0x68, 0x01, 0x00, 0x20,
+ 0xD4, 0x0A, 0x00, 0x01, 0x54, 0x01, 0x00, 0x20, 0xE4, 0x0A, 0x00, 0x01,
+ 0x6C, 0x01, 0x00, 0x20, 0x68, 0x08, 0x00, 0x02, 0xE8, 0x0A, 0x00, 0x01,
+ 0xFF, 0x0F, 0x20, 0x00, 0x70, 0x01, 0x00, 0x20, 0xEC, 0x0A, 0x00, 0x01,
+ 0x00, 0x20, 0x20, 0x00, 0xFF, 0x3F, 0x20, 0x00, 0x6C, 0x08, 0x00, 0x02,
+ 0x00, 0x04, 0x01, 0x40, 0x04, 0x04, 0x01, 0x40, 0x80, 0x01, 0x00, 0x20,
+ 0x84, 0x01, 0x00, 0x20, 0x34, 0x08, 0x00, 0x02, 0x8D, 0x01, 0x00, 0x20,
+ 0x8C, 0x01, 0x00, 0x20, 0x88, 0x01, 0x00, 0x20, 0x08, 0xED, 0x00, 0xE0,
+ 0xF8, 0x0A, 0x00, 0x01, 0xF4, 0x0A, 0x00, 0x01, 0x00, 0x2A, 0x4A, 0xD0,
+ 0x5F, 0xEA, 0x00, 0x0C, 0x8B, 0x07, 0x1C, 0xD1, 0x83, 0x07, 0x22, 0xD1,
+ 0x10, 0x2A, 0x08, 0xD3, 0x70, 0xB4, 0x10, 0x3A, 0x78, 0xC9, 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 0x00, 0x01, 0x02, 0x04, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0xC3, 0x0A, 0x00, 0x01, 0xA9, 0x0A, 0x00, 0x01,
+ 0x20, 0x0B, 0x00, 0x01, 0x08, 0x0B, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+#endif // OPENOCD_SRC_FLASH_NOR_MSP432P4_H
diff --git a/tcl/target/ti_msp432p4xx.cfg b/tcl/target/ti_msp432p4xx.cfg
index 8600867..15680d0 100644
--- a/tcl/target/ti_msp432p4xx.cfg
+++ b/tcl/target/ti_msp432p4xx.cfg
@@ -38,15 +38,24 @@ target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
- # On MSP432P401x Bank0 (8k) is always powered
- set _WORKAREASIZE 0x2000
+ set _WORKAREASIZE 0x4000
}
$_TARGETNAME configure -work-area-phys 0x20000000 \
-work-area-size $_WORKAREASIZE -work-area-backup 0
+set _FLASHNAME $_CHIPNAME.flash
+flash bank $_FLASHNAME msp432p4 0 0 0 0 $_TARGETNAME
+
if { ![using_hla] } {
cortex_m reset_config sysresetreq
}
+gdb_memory_map enable
+gdb_flash_program enable
+
+$_TARGETNAME configure -event gdb-attach {
+ halt
+}
+
adapter_khz 500
--