forked from ARMmbed/mbed-os-tf-m-regression-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
60 lines (43 loc) · 1.39 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*/
#include "mbed.h"
#include "unity.h"
#if MBED_CONF_APP_REGRESSION_TEST
#include "test_framework_integ_test.h"
#include "tfm_peripherals_def.h"
extern "C" int tfm_log_printf(const char *fmt, ...)
{
return printf(fmt);
}
extern "C" void TIMER1_Handler(void);
int main(void)
{
// Use TF-M regression test TIMER1 IRQ handler for the TIMER1 IRQ. The TF-M
// IRQ test requires its own handler to be installed.
NVIC_SetVector(TFM_TIMER1_IRQ, (uint32_t)TIMER1_Handler);
tfm_log_printf("Starting TF-M regression tests\n");
// Disable deep sleep to avoid the TF-M IRQ test causing a hang, as the
// TF-M IRQ test currently uses an interrupt not necessarily capable of
// waking a target from deep sleep, depending on the target.
sleep_manager_lock_deep_sleep();
uint32_t retval = tfm_non_secure_client_run_tests();
TEST_ASSERT_EQUAL_UINT32(0, retval);
return 0;
}
#endif //MBED_CONF_APP_REGRESSION_TEST
#if MBED_CONF_APP_PSA_COMPLIANCE_TEST
extern "C" int32_t val_entry(void);
extern "C" int tfm_log_printf(const char *fmt, ...)
{
return printf(fmt);
}
int main(void)
{
// Disable deep sleep
sleep_manager_lock_deep_sleep();
tfm_log_printf("Starting TF-M PSA API tests\r\n");
return val_entry();
}
#endif //MBED_CONF_APP_PSA_COMPLIANCE_TEST