Skip to content

Commit

Permalink
Merge branch 'ARM-software:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutig-arm authored Oct 28, 2024
2 parents 9f9b87b + 076d073 commit 2e7f078
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
9 changes: 8 additions & 1 deletion secure-debug/platform/common/include/adac_util.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2021-2024, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -106,4 +106,11 @@ int request_packet_send(request_packet_t *packet);
**/
response_packet_t *response_packet_receive();

/**
* @brief - Reset the connection between pyocd and target.
* @param - None
* @return - None
**/
void psa_adac_reset_debugger_target_session();

#endif /* _PSA_ADAC_UTIL_H_ */
17 changes: 16 additions & 1 deletion secure-debug/platform/common/src/adac_command_util.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2021-2023, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2021-2024, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -336,3 +336,18 @@ psa_status_t psa_adac_check_cryptosystem_support(response_packet_t *packet, uint
}
return r;
}


/**
* @brief - Reset the connection between pyocd and target.
* @param - None
* @return - None
**/
void psa_adac_reset_debugger_target_session()
{
uint8_t reset[] = {0x12,0x34,0x56,0x78};
request_packet_t packet = {0,};
memcpy(packet.data,&reset,4);
packet.data_count = 1;
request_packet_send(&packet);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#/** @file
# * Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved.
# * Copyright (c) 2022-2024, Arm Limited or its affiliates. All rights reserved.
# * SPDX-License-Identifier : Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -129,7 +129,10 @@ def send(self, data):
try:
data_received, address = adac_acs.server_socket.recvfrom(4096)
length = len(data_received)
print("Data received from adac acs : length : %d, data : %s"%(length, str(data_received.hex())))
received_string = str(data_received.hex())
print("Data received from adac acs : length : %d, data : %s"%(length, received_string))
if received_string[len(received_string)-8:] == '12345678':
break
adac_acs.send(data_received)
head, data = adac_acs.receive()
adac_acs.server_socket.sendto(head, address)
Expand Down
2 changes: 2 additions & 0 deletions secure-debug/tests/adac/test_a002/test_a002.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ void test_entry(val_api_t *val_api)
goto test_end;
}
response_packet_release(response);
//reset session
psa_adac_reset_debugger_target_session();

// Set device in locked state.
ret = psa_adac_issue_command(ADAC_LOCK_DEBUG_CMD, request, NULL, 0);
Expand Down

0 comments on commit 2e7f078

Please sign in to comment.