OpenOCD
msp432.c File Reference
Include dependency graph for msp432.c:

Go to the source code of this file.

Data Structures

struct  msp432_bank
 

Macros

#define E4_DID0_REG   0x400FE000
 
#define E4_DID1_REG   0x400FE004
 
#define FLASH_TIMEOUT   8000
 
#define P4_DEVICE_ID_REG   0x0020100C
 
#define P4_FLASH_INFO_SIZE_REG   0xE0043024
 
#define P4_FLASH_MAIN_SIZE_REG   0xE0043020
 
#define P4_HARDWARE_REV_REG   0x00201010
 
#define SUPPORT_MESSAGE
 

Functions

 COMMAND_HANDLER (msp432_bsl_command)
 
 COMMAND_HANDLER (msp432_mass_erase_command)
 
 FLASH_BANK_COMMAND_HANDLER (msp432_flash_bank_command)
 
static int msp432_auto_probe (struct flash_bank *bank)
 
static int msp432_device_type (uint32_t family_type, uint32_t device_id, uint32_t hardware_rev)
 
static int msp432_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int msp432_exec_cmd (struct target *target, struct msp432_algo_params *algo_params, uint32_t command)
 
static void msp432_flash_free_driver_priv (struct flash_bank *bank)
 
static int msp432_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static int msp432_init (struct flash_bank *bank)
 
static void msp432_init_params (struct msp432_algo_params *algo_params)
 
static int msp432_mass_erase (struct flash_bank *bank, bool all)
 
static int msp432_probe (struct flash_bank *bank)
 
static int msp432_protect_check (struct flash_bank *bank)
 
static int msp432_quit (struct flash_bank *bank)
 
static const char * msp432_return_text (uint32_t return_code)
 
static int msp432_wait_inactive (struct target *target, uint32_t buffer)
 
static int msp432_wait_return_code (struct target *target)
 
static int msp432_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 

Variables

static const struct command_registration msp432_command_handlers []
 
static const struct command_registration msp432_exec_command_handlers []
 
const struct flash_driver msp432_flash
 
static const uint8_t msp432e4x_algo []
 
static const uint8_t msp432p401x_algo []
 
static const uint8_t msp432p411x_algo []
 

Macro Definition Documentation

◆ E4_DID0_REG

#define E4_DID0_REG   0x400FE000

Definition at line 26 of file msp432.c.

◆ E4_DID1_REG

#define E4_DID1_REG   0x400FE004

Definition at line 27 of file msp432.c.

◆ FLASH_TIMEOUT

#define FLASH_TIMEOUT   8000

Definition at line 29 of file msp432.c.

◆ P4_DEVICE_ID_REG

#define P4_DEVICE_ID_REG   0x0020100C

Definition at line 22 of file msp432.c.

◆ P4_FLASH_INFO_SIZE_REG

#define P4_FLASH_INFO_SIZE_REG   0xE0043024

Definition at line 21 of file msp432.c.

◆ P4_FLASH_MAIN_SIZE_REG

#define P4_FLASH_MAIN_SIZE_REG   0xE0043020

Definition at line 20 of file msp432.c.

◆ P4_HARDWARE_REV_REG

#define P4_HARDWARE_REV_REG   0x00201010

Definition at line 23 of file msp432.c.

◆ SUPPORT_MESSAGE

#define SUPPORT_MESSAGE
Value:
"Your pre-production MSP432P401x silicon is not fully supported\n" \
"You can find more information at www.ti.com/product/MSP432P401R"

Definition at line 31 of file msp432.c.

Function Documentation

◆ COMMAND_HANDLER() [1/2]

COMMAND_HANDLER ( msp432_bsl_command  )

◆ COMMAND_HANDLER() [2/2]

COMMAND_HANDLER ( msp432_mass_erase_command  )

◆ FLASH_BANK_COMMAND_HANDLER()

◆ msp432_auto_probe()

static int msp432_auto_probe ( struct flash_bank bank)
static

◆ msp432_device_type()

static int msp432_device_type ( uint32_t  family_type,
uint32_t  device_id,
uint32_t  hardware_rev 
)
static

◆ msp432_erase()

◆ msp432_exec_cmd()

◆ msp432_flash_free_driver_priv()

static void msp432_flash_free_driver_priv ( struct flash_bank bank)
static

Definition at line 1036 of file msp432.c.

◆ msp432_info()

◆ msp432_init()

◆ msp432_init_params()

◆ msp432_mass_erase()

◆ msp432_probe()

◆ msp432_protect_check()

static int msp432_protect_check ( struct flash_bank bank)
static

Definition at line 1030 of file msp432.c.

References ERROR_OK.

◆ msp432_quit()

◆ msp432_return_text()

static const char* msp432_return_text ( uint32_t  return_code)
static

◆ msp432_wait_inactive()

static int msp432_wait_inactive ( struct target target,
uint32_t  buffer 
)
static

◆ msp432_wait_return_code()

static int msp432_wait_return_code ( struct target target)
static

◆ msp432_write()

Variable Documentation

◆ msp432_command_handlers

const struct command_registration msp432_command_handlers[]
static
Initial value:
= {
{
.name = "msp432",
.mode = COMMAND_EXEC,
.help = "MSP432 flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_EXEC
Definition: command.h:40
static const struct command_registration msp432_exec_command_handlers[]
Definition: msp432.c:1049

Definition at line 1036 of file msp432.c.

◆ msp432_exec_command_handlers

const struct command_registration msp432_exec_command_handlers[]
static
Initial value:
= {
{
.name = "mass_erase",
.handler = msp432_mass_erase_command,
.mode = COMMAND_EXEC,
.help = "Erase entire flash memory on device.",
.usage = "bank_id ['main' | 'all']",
},
{
.name = "bsl",
.handler = msp432_bsl_command,
.mode = COMMAND_EXEC,
.help = "Allow BSL to be erased or written by flash commands.",
.usage = "bank_id ['unlock' | 'lock']",
},
}

Definition at line 1036 of file msp432.c.

◆ msp432_flash

const struct flash_driver msp432_flash
Initial value:
= {
.name = "msp432",
.flash_bank_command = msp432_flash_bank_command,
.erase = msp432_erase,
.write = msp432_write,
.probe = msp432_probe,
.auto_probe = msp432_auto_probe,
.erase_check = default_flash_blank_check,
.protect_check = msp432_protect_check,
.info = msp432_info,
.free_driver_priv = msp432_flash_free_driver_priv,
}
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
static int msp432_protect_check(struct flash_bank *bank)
Definition: msp432.c:1030
static int msp432_probe(struct flash_bank *bank)
Definition: msp432.c:808
static int msp432_auto_probe(struct flash_bank *bank)
Definition: msp432.c:964
static const struct command_registration msp432_command_handlers[]
Definition: msp432.c:1067
static int msp432_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: msp432.c:598
static int msp432_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: msp432.c:983
static int msp432_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: msp432.c:673
static void msp432_flash_free_driver_priv(struct flash_bank *bank)
Definition: msp432.c:1036

Definition at line 1036 of file msp432.c.

◆ msp432e4x_algo

const uint8_t msp432e4x_algo[]
static
Initial value:
= {
}

Definition at line 59 of file msp432.c.

Referenced by msp432_init().

◆ msp432p401x_algo

const uint8_t msp432p401x_algo[]
static
Initial value:
= {
}

Definition at line 49 of file msp432.c.

Referenced by msp432_init().

◆ msp432p411x_algo

const uint8_t msp432p411x_algo[]
static
Initial value:
= {
}

Definition at line 54 of file msp432.c.

Referenced by msp432_init().