analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
60 stars 76 forks source link

feat(PeriphDrivers): Add API to lock Debug Access Port #845

Closed Jacob-Scheiffler closed 6 months ago

Jacob-Scheiffler commented 8 months ago

Adding a new function which will PERMANENTLY lock the debug access port. This was requested by Jim, otherwise I think it would be unwise to expose this to customers.

github-actions[bot] commented 7 months ago

This pull request is stale because it has been open for 30 days with no activity. Remove stale label, commit, or comment or this will be closed in 7 days.

EricB-ADI commented 6 months ago

Just a recommendation. If the code is compiled in debug mode, it should probably just return.

BrentK-ADI commented 6 months ago

Just came across this looking at open PRs. A recommendation as an end user: Add the word Permanent to the function name. Two reasons:

  1. Developers tend to look at function names and implement and only read the documentation later when stuff doesn't work
  2. Some devices have both temporary and permanent locking features

The MAX32672 for example has the ability to both lock the DAP with unlock capabilities, and permanently lock it. It might be nice to expose the "temporary" lock capabilities of devices the MXC_SYS_LockDAP & MXC_SYS_UnlockDAP calls. And explicitly call out Permanent in this implementation.

Jake-Carter commented 6 months ago

Just a recommendation. If the code is compiled in debug mode, it should probably just return.

https://github.com/Analog-Devices-MSDK/msdk/pull/845/commits/aac870444e42b2f006e6266073d5c42dd37683bd

Jake-Carter commented 6 months ago

Just came across this looking at open PRs. A recommendation as an end user: Add the word Permanent to the function name. Two reasons:

  1. Developers tend to look at function names and implement and only read the documentation later when stuff doesn't work
  2. Some devices have both temporary and permanent locking features

The MAX32672 for example has the ability to both lock the DAP with unlock capabilities, and permanently lock it. It might be nice to expose the "temporary" lock capabilities of devices the MXC_SYS_LockDAP & MXC_SYS_UnlockDAP calls. And explicitly call out Permanent in this implementation.

https://github.com/Analog-Devices-MSDK/msdk/pull/845/commits/80adb214d79bd6e074e6885604c755894eaecab3

Will take a stab at the MAX32672 in a future PR