Hi Peter,
DeactivateSecureDebug() and ActivateSecureDebug() are functions defined by the customer, let me show you what has the customer done:
1. Set the JTAG Password and passwords of the Password Groups
WeoWang_0-1672718747468.png
2. Set the DBL of LOCK3_PG0 to 1
WeoWang_1-1672718854353.png
3. If we want to enable debug interface access feature, there are 4 conditions that we need to meet: 1) Life cycle is in or after OEM Production 2) DCF Client - Censorship 3) Set JTAG Password 4) LOCK3_PG0[DBL=1]
WeoWang_2-1672719329023.png
WeoWang_3-1672719342927.png
Modify the Censorship DCF client:
WeoWang_4-1672719380383.png
4. Modify the Lifecycle:
WeoWang_5-1672719473355.png
After this step, the LC in SSCM is OEM Production, and the JTAG is locked, JTAG Password is required if the customer wants to debug with S32DS and Multilink.
5. In the customer's test code, once the MCU receives messages for unlocking JTAG, DeactivateSecureDebug() will be called, inside this function, the code will unlock the password group 0 first:
WeoWang_6-1672719761526.png
Then set LOCK3_PG0[DBL=0]
WeoWang_7-1672719809635.png
6. After step 5, the customer continues to use S32DS and Multilink to connect to the MCU, while, JTAG Password is still required. After entering JTAG Password, the customer finds that LOCK3_PG0[DBL=0].