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

Add target support for MSP432E4 series #1139

Merged
merged 2 commits into from
Jul 16, 2023
Merged

Conversation

9names
Copy link
Contributor

@9names 9names commented Jun 18, 2022

Adding support for MSP432E4 targets (MSP432E401Y and MSP432E411Y) .
Generated via target-gen from https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/msp432cmsis/latest/exports/TexasInstruments.MSP432E4_DFP.3.2.6.pack

Tested with probe-rs-cli download and hs-probe - working!

Tested via the onboard XDS110 CMSIS-DAP compatible debugger on MSP-EXP432E401Y - not functional.
XDS110 also fails with known good targets (STM32H7, RP2040) so I expect the issue lies with the debugger, not the algo.

XDS110 actually works fine, but the probe defaults to JTAG which probe-rs doesn't support.
Works fine when specifying protocol as SWD

@prabhpreet
Copy link
Contributor

prabhpreet commented Aug 13, 2022

@9names Thanks for your help over the Rust-Embedded matrix channel when I was initially setting up EXP432E401Y. I found this PR and thought I'd comment here for future reference regarding XDS110 support. The chipset description file worked well for me with XDS110.

When using cargo-flash I saw in the logs that probe-rs was using the JTAG over CMSIS-DAP protocol. I got confirmation from @Yatekii over the probe-rs matrix channel that JTAG over CMSIS-DAP is not supported yet. cargo-embed on the other hand uses SWD by default majority of the times, and works well with XDS110.

For cargo-flash, the argument I had to pass to force the protocol was --protocol=swd.

For cargo-embed, I had to append the following to Embed.toml:

[default.probe]
protocol="Swd"

TL;DR XDS110 works with SWD over CMSIS-DAP with probe-rs as JTAG over CMSIS-DAP is not supported yet.

@9names
Copy link
Contributor Author

9names commented Aug 13, 2022

You are correct, it does work when swd is specified on the command-line. fascinating.

$ ./release/probe-rs-cli dump 0x0 4 --chip MSP432E411Y --protocol swd
Addr 0x00000000: 0x20040000
Addr 0x00000004: 0x000001fd
Addr 0x00000008: 0x000003d7
Addr 0x0000000c: 0x0000070b
Read 4 words in 3.998451ms

probe-rs tooling used to always default to SWD, which caught me out at first when targeting RISCV targets.
but now... it seems to depend on the probe which one is used? makes sense for my probes that only support SWD, but hsprobe supports both. I don't get it.

@prabhpreet
Copy link
Contributor

prabhpreet commented Aug 13, 2022

I haven't completely hammered down the specifics in the probe-rs source code but I think I have a clue.
Through tracing some of the commands exchanged using the CMSIS-DAP protocol is DAP_Connect (https://arm-software.github.io/CMSIS_5/DAP/html/group__DAP__Connect.html)

When a protocol is not specified, the logs show sending a request to connect with the Default Port of the device. The response from XDS110 shows it selects the JTAG mode as default. But probe-rs doesn't have support for JTAG specific commands further down the road for JTAG mode. That's probably why it fails.

I'm not sure though why it is only specifically cargo-flash which is failing and cargo-embed defaults to SWD. Once I have more specifics, I'll file an issue.

@9names 9names force-pushed the MSP432E4_target branch 3 times, most recently from 9c3ab80 to a9ddad2 Compare July 15, 2023 23:01
@9names
Copy link
Contributor Author

9names commented Jul 16, 2023

I've rebased this and updated this using the latest git target-gen since the target format has changed while this PR has been waiting for review.
Tested it again with the MSP432E411Y launchpad, still works fine.

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.

Thanks a lot!

@Yatekii Yatekii added this pull request to the merge queue Jul 16, 2023
Merged via the queue into probe-rs:master with commit c547f75 Jul 16, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants