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

partial support for SAML11D16A #1469

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ttt-t3r
Copy link
Contributor

@ttt-t3r ttt-t3r commented Nov 6, 2022

partial support for Microchip/Atmel SAML11D16A

SAML11 devices contain security features that block debugger access according to level (DAL).
To reset DAL level a mass erase command (CE2) must be issued with the correct key.

Upon reset the internal secure boot code runs before the cpu reaches the reset vector. I assume that
is why the jump to reset vector is not caught by the debugger. A breakpoint is set to halt the CPU.

I am using a custom board with cmsis-dap (v1) based debugger.

SAML11 datasheet reference

  • Added new target
  • Add svd file from cmsis-pack
  • Add support for mass erase when
    • key is accessible before mass erase command
    • key is the default value
  • Add core class and override reset_and_halt function

@lgtm-com
Copy link

lgtm-com bot commented Nov 6, 2022

This pull request introduces 14 alerts when merging a69beeb into 72299f5 - view on LGTM.com

new alerts:

  • 6 for Testing equality to None
  • 4 for Unused import
  • 2 for Variable defined multiple times
  • 1 for Unused local variable
  • 1 for Unreachable code

@lgtm-com
Copy link

lgtm-com bot commented Nov 6, 2022

This pull request introduces 1 alert when merging 0cad408 into 72299f5 - view on LGTM.com

new alerts:

  • 1 for Unused import

@flit
Copy link
Member

flit commented Nov 25, 2022

Thanks for the addition!

Regarding the assert-reset-with-clock-low API: On my feature/debug_sequences branch, there is a new debug probe API that provides full pin control (required for the DAP_SWJ_Pins() debug sequence function). Since this is a generic API available for all probes, currently implemented for CMSIS-DAP and JLink, it would be best to rebase this PR after the new API is merged in. I'll extract those changes into a separate PR so they can be merged before the rest of the debug sequence support is finalised (it's in final test and debug).

Fwiw, the SAML11 CMSIS-Pack does provide debug sequences for handling the security states and special flash programming requirements. In fact, the standard flash programming sequences were added specifically to support the SAML11. However, pyocd won't support the flash programming sequences in the first release of debug sequence support, so this PR will still be required.

@flit
Copy link
Member

flit commented Nov 26, 2022

@ttt-t3r Please see #1478 for the new debug probe pins API. If you have any issue with it or suggestions for improvement, please let me know!

@ttt-t3r
Copy link
Contributor Author

ttt-t3r commented Nov 27, 2022

I had a feeling the upcoming debug_sequences feature would allow support for debugging a wider range of MCUs, but I had an immediate need due to development of a client board so I went ahead and added the necessary code.

I haven't looked at the flash sequences support in the new branch yet but I'd like to note that the flash binary included in the CMSIS-Pack has different function entry point names, and the python conversion script included in pyocd was unable to find the required flash routines. The flash binary in this pull request is actually newly written.

@ttt-t3r
Copy link
Contributor Author

ttt-t3r commented Nov 27, 2022

@ttt-t3r Please see #1478 for the new debug probe pins API. If you have any issue with it or suggestions for improvement, please let me know!

Thank you for the PR, I will take a look and try to rebase this PR using the new API!

@flit
Copy link
Member

flit commented Nov 27, 2022

Thanks!

I'll merge #1478 once you say it's acceptable (or within a week or two). I think it'll be fine, but it'd be nice to have another set of eyes.

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

2 participants