- Removed outdated comments in Microchip device header files

- Other bits of tidying
This commit is contained in:
Nav
2025-08-17 23:08:19 +01:00
parent f0dbe41d73
commit cc5562c1b5
13 changed files with 58 additions and 133 deletions

View File

@@ -7,22 +7,15 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Atmel-ICE device is an EDBG (Embedded Debugger) device.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2141 (8513)
*/
class AtmelIce: public EdbgDevice class AtmelIce: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2141; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2141;
static const inline std::uint8_t USB_CONFIGURATION_INDEX = 0; static constexpr std::uint8_t USB_CONFIGURATION_INDEX = 0;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
AtmelIce(const DebugToolConfig& debugToolConfig); explicit AtmelIce(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Atmel-ICE"; return "Atmel-ICE";

View File

@@ -7,21 +7,14 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Curiosity Nano is an evaluation board featuring an on-board debugger. The debugger is EDBG-based.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2175 (8565)
*/
class CuriosityNano: public EdbgDevice class CuriosityNano: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2175; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2175;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
CuriosityNano(const DebugToolConfig& debugToolConfig); explicit CuriosityNano(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Curiosity Nano"; return "Curiosity Nano";

View File

@@ -7,22 +7,15 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The JTAGICE3, from firmware version 3.x+, is an EDBG device.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2140 (8512)
*/
class JtagIce3: public EdbgDevice class JtagIce3: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2140; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2140;
static const inline std::uint8_t USB_CONFIGURATION_INDEX = 0; static constexpr std::uint8_t USB_CONFIGURATION_INDEX = 0;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
JtagIce3(const DebugToolConfig& debugToolConfig); explicit JtagIce3(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "JTAGICE3"; return "JTAGICE3";

View File

@@ -7,30 +7,18 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* Like the MPLAB Snap, the PICkit 4 is a hybrid device. It can present itself as an EDBG (Embedded Debugger)
* device via firmware configuration, actioned by Microchip software (the MPLAB IDE and IPE).
*
* This debug tool driver currently only supports the device when in AVR mode. Because the device uses different
* USB vendor and product IDs depending on the mode, it is trivial to determine which is which. In fact, Bloom will
* not even recognise the device if it's not in AVR mode.
*
* USB (when in Avr/EDBG mode):
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2177 (8567)
*/
class MplabPickit4: public EdbgDevice class MplabPickit4: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2177; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2177;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
static const inline std::uint16_t PIC_MODE_USB_VENDOR_ID = 0x04d8; static constexpr std::uint16_t PIC_MODE_USB_VENDOR_ID = 0x04d8;
static const inline std::uint16_t PIC_MODE_USB_PRODUCT_ID = 0x9012; static constexpr std::uint16_t PIC_MODE_USB_PRODUCT_ID = 0x9012;
static const inline std::uint16_t BL_MODE_USB_PRODUCT_ID = 0x9017; static constexpr std::uint16_t BL_MODE_USB_PRODUCT_ID = 0x9017;
MplabPickit4(const DebugToolConfig& debugToolConfig); explicit MplabPickit4(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "MPLAB PICkit 4"; return "MPLAB PICkit 4";

View File

@@ -7,32 +7,18 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The MPLAB Snap device is a hybrid device - that is, it can present itself as an "MPLAB Snap ICD" device, as well
* as an EDBG (Embedded Debugger) device. The device switches between these two modes via firmware configuration.
* It appears that it can only interface with AVR targets using the EDBG firmware, which, apparently, is why it is
* known to be in "AVR mode" when it presents itself as an EDBG device.
*
* This debug tool driver currently only supports the device when in AVR mode. Because the device uses different
* USB vendor and product IDs depending on the mode, it is trivial to determine which is which. In fact, Bloom will
* not even recognise the device if it's not in AVR mode.
*
* USB (when in Avr/EDBG mode):
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2180 (8576)
*/
class MplabSnap: public EdbgDevice class MplabSnap: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2180; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2180;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
static const inline std::uint16_t PIC_MODE_USB_VENDOR_ID = 0x04d8; static constexpr std::uint16_t PIC_MODE_USB_VENDOR_ID = 0x04d8;
static const inline std::uint16_t PIC_MODE_USB_PRODUCT_ID = 0x9018; static constexpr std::uint16_t PIC_MODE_USB_PRODUCT_ID = 0x9018;
static const inline std::uint16_t BL_MODE_USB_PRODUCT_ID = 0x9019; static constexpr std::uint16_t BL_MODE_USB_PRODUCT_ID = 0x9019;
MplabSnap(const DebugToolConfig& debugToolConfig); explicit MplabSnap(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "MPLAB Snap"; return "MPLAB Snap";

View File

@@ -7,22 +7,15 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Power Debugger device is very similar to the Atmel-ICE. It is an EDBG device.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2141 (8513)
*/
class PowerDebugger: public EdbgDevice class PowerDebugger: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2144; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2144;
static const inline std::uint8_t USB_CONFIGURATION_INDEX = 0; static constexpr std::uint8_t USB_CONFIGURATION_INDEX = 0;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
PowerDebugger(const DebugToolConfig& debugToolConfig); explicit PowerDebugger(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Power Debugger"; return "Power Debugger";

View File

@@ -7,21 +7,14 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Xplained Mini is an evaluation board featuring an on-board debugger. The debugger is EDBG-based.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2145 (8517)
*/
class XplainedMini: public EdbgDevice class XplainedMini: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2145; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2145;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
XplainedMini(const DebugToolConfig& debugToolConfig); explicit XplainedMini(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Xplained Mini"; return "Xplained Mini";

View File

@@ -7,21 +7,14 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Xplained Nano is an evaluation board featuring an on-board debugger. The debugger is EDBG-based.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2145 (8517)
*/
class XplainedNano: public EdbgDevice class XplainedNano: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2145; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2145;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
XplainedNano(const DebugToolConfig& debugToolConfig); explicit XplainedNano(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Xplained Nano"; return "Xplained Nano";

View File

@@ -7,21 +7,14 @@
namespace DebugToolDrivers::Microchip namespace DebugToolDrivers::Microchip
{ {
/**
* The Xplained Pro is an evaluation board featuring an on-board debugger. The debugger is EDBG-based.
*
* USB:
* Vendor ID: 0x03eb (1003)
* Product ID: 0x2111 (8465)
*/
class XplainedPro: public EdbgDevice class XplainedPro: public EdbgDevice
{ {
public: public:
static const inline std::uint16_t USB_VENDOR_ID = 0x03eb; static constexpr std::uint16_t USB_VENDOR_ID = 0x03eb;
static const inline std::uint16_t USB_PRODUCT_ID = 0x2111; static constexpr std::uint16_t USB_PRODUCT_ID = 0x2111;
static const inline std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0; static constexpr std::uint8_t CMSIS_HID_INTERFACE_NUMBER = 0;
XplainedPro(const DebugToolConfig& debugToolConfig); explicit XplainedPro(const DebugToolConfig& debugToolConfig);
std::string getName() override { std::string getName() override {
return "Xplained Pro"; return "Xplained Pro";

View File

@@ -15,7 +15,7 @@ namespace Widgets
this->refreshFlattenedItems(); this->refreshFlattenedItems();
} }
HexViewerItemIndex::ItemRangeType HexViewerItemIndex::items(int yStart, int yEnd) const { HexViewerItemIndex::ItemRange HexViewerItemIndex::items(int yStart, int yEnd) const {
assert(!this->byteItemGrid.empty()); assert(!this->byteItemGrid.empty());
const auto gridPointCount = this->byteItemGrid.size(); const auto gridPointCount = this->byteItemGrid.size();
@@ -32,7 +32,7 @@ namespace Widgets
); );
if (startGridPointIndex >= gridPointCount) { if (startGridPointIndex >= gridPointCount) {
return HexViewerItemIndex::ItemRangeType{}; return HexViewerItemIndex::ItemRange{};
} }
const auto endGridPointIndex = static_cast<decltype(this->byteItemGrid)::size_type>(std::min( const auto endGridPointIndex = static_cast<decltype(this->byteItemGrid)::size_type>(std::min(
@@ -44,7 +44,7 @@ namespace Widgets
gridPointCount - 1 gridPointCount - 1
)); ));
return HexViewerItemIndex::ItemRangeType{ return HexViewerItemIndex::ItemRange{
this->byteItemGrid[startGridPointIndex], this->byteItemGrid[startGridPointIndex],
endGridPointIndex == gridPointCount - 1 endGridPointIndex == gridPointCount - 1
? this->flattenedItems.end() ? this->flattenedItems.end()

View File

@@ -13,15 +13,15 @@
namespace Widgets namespace Widgets
{ {
/** /**
* This class maintains indices of hex viewer item positions and provides fast lookups for items within certain * This class maintains an index of hex viewer item positions and provides fast lookups for items within certain
* positions. * positions.
*/ */
class HexViewerItemIndex class HexViewerItemIndex
{ {
public: public:
using FlattenedItemType = std::vector<HexViewerItem*>; using FlattenedItems = std::vector<HexViewerItem*>;
using FlattenedItemItType = FlattenedItemType::const_iterator; using FlattenedItemIt = FlattenedItems::const_iterator;
using ItemRangeType = std::ranges::subrange<FlattenedItemItType>; using ItemRange = std::ranges::subrange<FlattenedItemIt>;
std::vector<const ByteItem*> byteItemLines; std::vector<const ByteItem*> byteItemLines;
std::unordered_map<Targets::TargetMemoryAddress, int> byteItemYStartPositionsByAddress; std::unordered_map<Targets::TargetMemoryAddress, int> byteItemYStartPositionsByAddress;
@@ -48,7 +48,7 @@ namespace Widgets
* *
* @return * @return
*/ */
ItemRangeType items(int yStart, int yEnd) const; ItemRange items(int yStart, int yEnd) const;
/** /**
* Returns the byte item at the given position. Byte items do not overlap. * Returns the byte item at the given position. Byte items do not overlap.
@@ -107,13 +107,13 @@ namespace Widgets
* *
* Some of the lookup member functions return subranges from this container. * Some of the lookup member functions return subranges from this container.
*/ */
FlattenedItemType flattenedItems; FlattenedItems flattenedItems;
/** /**
* Byte item Y-axis grid (one-dimensional index) * Byte item Y-axis grid (one-dimensional index)
* *
* Each element in this std::vector represents a point on the Y-axis grid. The distance between each point is * Each element in this std::vector represents a point on the Y-axis grid. The distance between each point is
* equal to HexViewerItemIndex::GRID_SIZE. * equal to HexViewerItemIndex::GRID_SIZE (pixels).
* *
* The value of each element is an iterator addressing the HexViewerItem* at that point on the grid. * The value of each element is an iterator addressing the HexViewerItem* at that point on the grid.
* *
@@ -122,6 +122,6 @@ namespace Widgets
* *
* We use an std::vector here because it provides constant-time access to any element. * We use an std::vector here because it provides constant-time access to any element.
*/ */
std::vector<FlattenedItemItType> byteItemGrid; std::vector<FlattenedItemIt> byteItemGrid;
}; };
} }

View File

@@ -12,7 +12,7 @@
<address-spaces> <address-spaces>
<address-space key="system" start="0x00000000" size="3759144960" endianness="little"> <address-space key="system" start="0x00000000" size="3759144960" endianness="little">
<memory-segment key="mapped_program_memory" name="Mapped Program Memory" type="aliased" start="0x00000000" size="16384" page-size="64" access="R" executable="1"/> <memory-segment key="mapped_program_memory" name="Mapped Program Memory" type="aliased" start="0x00000000" size="16384" page-size="64" access="R" executable="1"/>
<memory-segment key="main_program" name="Main Program Memory" type="flash" start="0x08000000" size="16384" access="RW" page-size="64" executable="1"/> <memory-segment key="main_program" name="Main Program Memory" type="flash" start="0x08000000" size="16384" page-size="64" access="RW" executable="1"/>
<memory-segment key="boot_program" name="Boot Program Memory" type="flash" start="0x1FFFF000" size="1920" page-size="64" access="RW" executable="1"/> <memory-segment key="boot_program" name="Boot Program Memory" type="flash" start="0x1FFFF000" size="1920" page-size="64" access="RW" executable="1"/>
<memory-segment key="vendor_config" name="Vendor Configuration" type="flash" start="0x1FFFF7C0" size="64" page-size="64" access="R" executable="0"/> <memory-segment key="vendor_config" name="Vendor Configuration" type="flash" start="0x1FFFF7C0" size="64" page-size="64" access="R" executable="0"/>
<memory-segment key="user_config" name="User Configuration" type="flash" start="0x1FFFF800" size="64" page-size="64" access="RW" executable="0"/> <memory-segment key="user_config" name="User Configuration" type="flash" start="0x1FFFF800" size="64" page-size="64" access="RW" executable="0"/>

View File

@@ -12,7 +12,7 @@
<address-spaces> <address-spaces>
<address-space key="system" start="0x00000000" size="3759144960" endianness="little"> <address-space key="system" start="0x00000000" size="3759144960" endianness="little">
<memory-segment key="mapped_program_memory" name="Mapped Program Memory" type="aliased" start="0x00000000" size="63488" page-size="256" access="R" executable="1"/> <memory-segment key="mapped_program_memory" name="Mapped Program Memory" type="aliased" start="0x00000000" size="63488" page-size="256" access="R" executable="1"/>
<memory-segment key="main_program" name="Main Program Memory" type="flash" start="0x08000000" size="63488" access="RW" page-size="256" executable="1"/> <memory-segment key="main_program" name="Main Program Memory" type="flash" start="0x08000000" size="63488" page-size="256" access="RW" executable="1"/>
<memory-segment key="boot_program" name="Boot Program Memory" type="flash" start="0x1FFF0000" size="3328" page-size="256" access="R" executable="1"/> <memory-segment key="boot_program" name="Boot Program Memory" type="flash" start="0x1FFF0000" size="3328" page-size="256" access="R" executable="1"/>
<memory-segment key="vendor_config" name="Vendor Configuration" type="flash" start="0x1FFFF700" size="256" page-size="256" access="R" executable="0"/> <memory-segment key="vendor_config" name="Vendor Configuration" type="flash" start="0x1FFFF700" size="256" page-size="256" access="R" executable="0"/>
<memory-segment key="user_config" name="User Configuration" type="flash" start="0x1FFFF800" size="256" page-size="256" access="RW" executable="0"/> <memory-segment key="user_config" name="User Configuration" type="flash" start="0x1FFFF800" size="256" page-size="256" access="RW" executable="0"/>