OpenOCD
bluenrg-x.c File Reference
Include dependency graph for bluenrg-x.c:

Go to the source code of this file.

Data Structures

struct  bluenrgx_flash_bank
 
struct  flash_ctrl_priv_data
 

Macros

#define BLUENRG2_JTAG_REG   (flash_priv_data_2.jtag_idcode_reg)
 
#define BLUENRGLP_JTAG_REG   (flash_priv_data_lp.jtag_idcode_reg)
 
#define BLUENRGLPF_JTAG_REG   (flash_priv_data_lpf.jtag_idcode_reg)
 
#define DIE_ID_REG(bluenrgx_info)   (bluenrgx_info->flash_ptr->die_id_reg)
 
#define FLASH_PAGE_SIZE(bluenrgx_info)   (bluenrgx_info->flash_ptr->flash_page_size)
 
#define FLASH_SIZE_REG_MASK   (0xFFFF)
 
#define JTAG_IDCODE_REG(bluenrgx_info)   (bluenrgx_info->flash_ptr->jtag_idcode_reg)
 

Functions

static int bluenrgx_auto_probe (struct flash_bank *bank)
 
static int bluenrgx_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static uint32_t bluenrgx_get_flash_reg (struct flash_bank *bank, uint32_t reg_offset)
 
static int bluenrgx_get_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static int bluenrgx_probe (struct flash_bank *bank)
 
static int bluenrgx_read_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t *value)
 
static int bluenrgx_wait_for_command (struct flash_bank *bank)
 
static int bluenrgx_wait_for_interrupt (struct flash_bank *bank, uint32_t interrupt_flag)
 
static int bluenrgx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int bluenrgx_write_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t value)
 
static int bluenrgx_write_with_loader (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int bluenrgx_write_without_loader (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
 FLASH_BANK_COMMAND_HANDLER (bluenrgx_flash_bank_command)
 

Variables

const struct flash_driver bluenrgx_flash
 
static const struct flash_ctrl_priv_dataflash_ctrl []
 
static const struct flash_ctrl_priv_data flash_priv_data_1
 
static const struct flash_ctrl_priv_data flash_priv_data_2
 
static const struct flash_ctrl_priv_data flash_priv_data_lp
 
static const struct flash_ctrl_priv_data flash_priv_data_lpf
 
static const struct flash_ctrl_priv_data flash_priv_data_lps
 

Macro Definition Documentation

◆ BLUENRG2_JTAG_REG

#define BLUENRG2_JTAG_REG   (flash_priv_data_2.jtag_idcode_reg)

Definition at line 20 of file bluenrg-x.c.

◆ BLUENRGLP_JTAG_REG

#define BLUENRGLP_JTAG_REG   (flash_priv_data_lp.jtag_idcode_reg)

Definition at line 21 of file bluenrg-x.c.

◆ BLUENRGLPF_JTAG_REG

#define BLUENRGLPF_JTAG_REG   (flash_priv_data_lpf.jtag_idcode_reg)

Definition at line 22 of file bluenrg-x.c.

◆ DIE_ID_REG

#define DIE_ID_REG (   bluenrgx_info)    (bluenrgx_info->flash_ptr->die_id_reg)

Definition at line 24 of file bluenrg-x.c.

◆ FLASH_PAGE_SIZE

#define FLASH_PAGE_SIZE (   bluenrgx_info)    (bluenrgx_info->flash_ptr->flash_page_size)

Definition at line 26 of file bluenrg-x.c.

◆ FLASH_SIZE_REG_MASK

#define FLASH_SIZE_REG_MASK   (0xFFFF)

Definition at line 28 of file bluenrg-x.c.

◆ JTAG_IDCODE_REG

#define JTAG_IDCODE_REG (   bluenrgx_info)    (bluenrgx_info->flash_ptr->jtag_idcode_reg)

Definition at line 25 of file bluenrg-x.c.

Function Documentation

◆ bluenrgx_auto_probe()

static int bluenrgx_auto_probe ( struct flash_bank bank)
static

Definition at line 522 of file bluenrg-x.c.

References bank, bluenrgx_probe(), ERROR_OK, and bluenrgx_flash_bank::probed.

◆ bluenrgx_erase()

◆ bluenrgx_get_flash_reg()

static uint32_t bluenrgx_get_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset 
)
inlinestatic

◆ bluenrgx_get_info()

static int bluenrgx_get_info ( struct flash_bank bank,
struct command_invocation cmd 
)
static

Definition at line 533 of file bluenrg-x.c.

◆ bluenrgx_probe()

◆ bluenrgx_read_flash_reg()

static int bluenrgx_read_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t *  value 
)
inlinestatic

Definition at line 136 of file bluenrg-x.c.

References bank, bluenrgx_get_flash_reg(), and target_read_u32().

Referenced by bluenrgx_probe(), and bluenrgx_wait_for_interrupt().

◆ bluenrgx_wait_for_command()

static int bluenrgx_wait_for_command ( struct flash_bank bank)
inlinestatic

◆ bluenrgx_wait_for_interrupt()

static int bluenrgx_wait_for_interrupt ( struct flash_bank bank,
uint32_t  interrupt_flag 
)
static

◆ bluenrgx_write()

◆ bluenrgx_write_flash_reg()

static int bluenrgx_write_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t  value 
)
inlinestatic

◆ bluenrgx_write_with_loader()

◆ bluenrgx_write_without_loader()

static int bluenrgx_write_without_loader ( struct flash_bank bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  count 
)
static

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( bluenrgx_flash_bank_command  )

Variable Documentation

◆ bluenrgx_flash

const struct flash_driver bluenrgx_flash
Initial value:
= {
.name = "bluenrg-x",
.flash_bank_command = bluenrgx_flash_bank_command,
.erase = bluenrgx_erase,
.protect = NULL,
.write = bluenrgx_write,
.probe = bluenrgx_probe,
.erase_check = default_flash_blank_check,
.protect_check = NULL,
.auto_probe = bluenrgx_auto_probe,
}
static int bluenrgx_probe(struct flash_bank *bank)
Definition: bluenrg-x.c:469
static int bluenrgx_get_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: bluenrg-x.c:533
static int bluenrgx_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: bluenrg-x.c:184
static int bluenrgx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: bluenrg-x.c:435
static int bluenrgx_auto_probe(struct flash_bank *bank)
Definition: bluenrg-x.c:522
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.
#define NULL
Definition: usb.h:16

Definition at line 533 of file bluenrg-x.c.

◆ flash_ctrl

const struct flash_ctrl_priv_data* flash_ctrl[]
static
Initial value:
= {
}
static const struct flash_ctrl_priv_data flash_priv_data_lp
Definition: bluenrg-x.c:60
static const struct flash_ctrl_priv_data flash_priv_data_2
Definition: bluenrg-x.c:50
static const struct flash_ctrl_priv_data flash_priv_data_lps
Definition: bluenrg-x.c:70
static const struct flash_ctrl_priv_data flash_priv_data_lpf
Definition: bluenrg-x.c:80
static const struct flash_ctrl_priv_data flash_priv_data_1
Definition: bluenrg-x.c:40

Definition at line 96 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_1

const struct flash_ctrl_priv_data flash_priv_data_1
static
Initial value:
= {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
.flash_regs_base = 0x40100000,
.flash_page_size = 2048,
.jtag_idcode = 0x00000000,
.part_name = "BLUENRG-1",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_2

const struct flash_ctrl_priv_data flash_priv_data_2
static
Initial value:
= {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
.flash_regs_base = 0x40100000,
.flash_page_size = 2048,
.jtag_idcode = 0x0200A041,
.part_name = "BLUENRG-2",
}

Definition at line 1 of file bluenrg-x.c.

◆ flash_priv_data_lp

const struct flash_ctrl_priv_data flash_priv_data_lp
static
Initial value:
= {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
.flash_regs_base = 0x40001000,
.flash_page_size = 2048,
.jtag_idcode = 0x0201E041,
.part_name = "STM32WB07 (BLUENRG-LP)",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_lpf

const struct flash_ctrl_priv_data flash_priv_data_lpf
static
Initial value:
= {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
.flash_regs_base = 0x40001000,
.flash_page_size = 2048,
.jtag_idcode = 0x02032041,
.part_name = "STM32WB09 (BLUENRG-LPF)",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_lps

const struct flash_ctrl_priv_data flash_priv_data_lps
static
Initial value:
= {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
.flash_regs_base = 0x40001000,
.flash_page_size = 2048,
.jtag_idcode = 0x02028041,
.part_name = "STM32WB05 (BLUENRG-LPS)",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().