Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

probe-rs info improvements & corrections #2461

Merged
merged 9 commits into from
May 17, 2024
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented May 12, 2024

According to the Cortex M23 reference manual, the processor has an FPB, not a BPU. This is sligthly interesting since the FPB's IDs are close enough to the M33's BPU, but I think we should remain consistent with the documentation.

That being said the M23/33 components are slightly off. The reference manual lists the following components for M23:

  • SCS
  • DWT
  • FPB (corrected the name in this PR)
  • ETM
  • CTI (added in this PR)
  • MTB (missing)

M33 also lists TPUI instead of MTB but I didn't go further than to note this.


The PR also prints more info about the devices.

ATSAMD51 before:

ARM Chip with debug port Default:
Debug Port: DPv1, DP Designer: ARM Ltd
├── 0 MemoryAP
│   └── ROM Table (Class 1)
│       └── ROM Table (Class 1)
│           ├── Cortex-M4 SCS   (Generic IP component)
│           │   └── CPUID
│           │       ├── IMPLEMENTER: ARM Ltd
│           │       ├── VARIANT: 0
│           │       ├── PARTNO: 3108
│           │       └── REVISION: 1
│           ├── Cortex-M3 DWT   (Generic IP component)
│           ├── Cortex-M3 FBP   (Generic IP component)
│           ├── Cortex-M3 ITM   (Generic IP component)
│           ├── Cortex-M4 TPIU  (Coresight Component)
│           ├── Cortex-M4 ETM   (Coresight Component)
│           └── CoreSight ETB   (Coresight Component)
└── 1 MemoryAP
    └── Error during access: Error using access port

ATSAMD51 after:

ARM Chip with debug port Default:
Debug Port: DPv1, DP Designer: ARM Ltd
├── 0 MemoryAP
│   └── Atmel DSU (ROM Table, Class 1)
│       ├── Atmel device (DID = 0x60060001
│       └── ROM Table (Class 1), Designer: ARM Ltd
│           ├── Cortex-M4 SCS   (Generic IP component)
│           │   └── CPUID
│           │       ├── IMPLEMENTER: ARM Ltd
│           │       ├── VARIANT: 0
│           │       ├── PARTNO: Cortex-M4
│           │       └── REVISION: 1
│           ├── Cortex-M3 DWT   (Generic IP component)
│           ├── Cortex-M3 FBP   (Generic IP component)
│           ├── Cortex-M3 ITM   (Generic IP component)
│           ├── Cortex-M4 TPIU  (Coresight Component)
│           ├── Cortex-M4 ETM   (Coresight Component)
│           └── CoreSight ETB   (Coresight Component)
└── 1 MemoryAP
    └── Error during access: Error using access port

ATSAML10 before:

ARM Chip with debug port Default:
Debug Port: DPv1, MINDP, DP Designer: ARM Ltd
└── 0 MemoryAP
    └── ROM Table (Class 1)
        └── ROM Table (Class 1)
            ├── Cortex-M23 SCS  (Coresight Component)
            ├── Cortex-M23 DWT  (Coresight Component)
            └── Cortex-M23 BPU  (Coresight Component)

ATSAML10 after:

ARM Chip with debug port Default:
Debug Port: DPv1, MINDP, DP Designer: ARM Ltd
└── 0 MemoryAP
    └── Atmel DSU (ROM Table, Class 1)
        ├── Atmel device (DID = 0x20840103)
        └── ROM Table (Class 1), Designer: ARM Ltd
            ├── Cortex-M23 SCS  (Coresight Component)
            │   └── CPUID
            │       ├── IMPLEMENTER: ARM Ltd
            │       ├── VARIANT: 1
            │       ├── PARTNO: Cortex-M23
            │       └── REVISION: 0
            ├── Cortex-M23 DWT  (Coresight Component)
            └── Cortex-M23 FBP  (Coresight Component)

@bugadani bugadani marked this pull request as draft May 12, 2024 08:38
@bugadani bugadani added the skip-changelog This PR does not require a changelog entry on release label May 12, 2024
@bugadani bugadani changed the title Print ROM table designer, correct M23 breakpoint unit info: Print ROM table designer, correct M23 breakpoint unit, recognise Atmel DSU May 12, 2024
@bugadani bugadani marked this pull request as ready for review May 12, 2024 09:39
@bugadani bugadani marked this pull request as draft May 13, 2024 06:46
@bugadani bugadani changed the title info: Print ROM table designer, correct M23 breakpoint unit, recognise Atmel DSU Atmel device identification May 14, 2024
@bugadani bugadani changed the title Atmel device identification Atmel device identification & corrections May 14, 2024
@bugadani bugadani marked this pull request as ready for review May 14, 2024 20:12
@bugadani bugadani changed the title Atmel device identification & corrections Partial Atmel/STM32 device identification in info & corrections May 15, 2024
@bugadani bugadani requested a review from Yatekii May 15, 2024 16:40
@bugadani bugadani marked this pull request as draft May 17, 2024 07:22
@bugadani bugadani force-pushed the fbp branch 2 times, most recently from dc1a334 to 739e63b Compare May 17, 2024 07:41
@bugadani bugadani changed the title Partial Atmel/STM32 device identification in info & corrections probe-rs info improvements & corrections May 17, 2024
@bugadani
Copy link
Contributor Author

This PR went in a big circle. I ended up removing the half-baked part identification parts, I have a better idea how to approach that problem now.

@bugadani bugadani marked this pull request as ready for review May 17, 2024 07:44
return Ok(());
};

if part_info.peripheral_type() == PeripheralType::Custom && part_info.name() == "Atmel DSU" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the kind of thing I do not want :/ Special casing per chip in random places. It will deteriorate as quick as OpenOCD :/
Do we have any plans to make this more generic? I am not against special casing (we need it) but we should have a system for it where one can add any number of cases without littering the code. Similar to let's say a service router (not exactly like that ofc :D).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any plans to make this more generic?

This isn't per chip, this is per manufacturer :) I hear your concern and we'll see what I can do here. I have plans for chip identification but that idea isn't very well integrated into the "parse random ROM tables and print their data" idea of info.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok :) I am fine with having this for now, but let's put emphasis on cleaning it up rather soon :)

Copy link
Member

@Yatekii Yatekii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I like this, thanks! I added some comments that are a bit more than nitpicks for me :)

@bugadani bugadani added this pull request to the merge queue May 17, 2024
Merged via the queue into probe-rs:master with commit cb4d761 May 17, 2024
19 checks passed
@bugadani bugadani deleted the fbp branch May 17, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog This PR does not require a changelog entry on release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants