Skip to content

Commit 38f84aa

Browse files
committed
Added MBED_22 Semihost test automation to test suite
1 parent 4362956 commit 38f84aa

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed
Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
#include "test_env.h"
22

3+
#define MAC_VENDOR_ARM_0 0x00
4+
#define MAC_VENDOR_ARM_1 0x02
5+
#define MAC_VENDOR_ARM_2 0xF7
6+
37
int main() {
4-
char uid[DEVICE_ID_LENGTH + 1];
5-
6-
if (mbed_interface_uid(uid) == 0) {
7-
printf("UID: %s\n", uid);
8-
} else{
9-
printf("Error\n");
8+
char uid[DEVICE_ID_LENGTH + 1] = {0};
9+
bool result = true;
10+
11+
const int ret = mbed_interface_uid(uid);
12+
if (ret == 0) {
13+
printf("UID: %s\r\n", uid);
1014
}
11-
12-
char mac[16];
15+
else {
16+
result = false;
17+
}
18+
19+
char mac[6] = {0}; // @param mac A 6-byte array to write the MAC address
1320
mbed_mac_address(mac);
14-
printf("mac address: %02x,%02x,%02x,%02x,%02x,%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
15-
16-
notify_completion(true);
21+
printf("MAC Address: %02X:%02X:%02X:%02X:%02X:%02X\r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
22+
23+
if (mac[0] == MAC_VENDOR_ARM_0 &&
24+
mac[1] == MAC_VENDOR_ARM_1 &&
25+
mac[2] == MAC_VENDOR_ARM_2) {
26+
printf("MAC Address Prefix: 00:02:F7, Vendor: ARM\r\n");
27+
}
28+
29+
notify_completion(result);
30+
return 0;
1731
}

workspace_tools/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@
393393
"id": "MBED_22", "description": "Semihost",
394394
"source_dir": join(TEST_DIR, "mbed", "semihost"),
395395
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
396+
"automated": True,
396397
},
397398
{
398399
"id": "MBED_23", "description": "Ticker Int us",

0 commit comments

Comments
 (0)