27#include "porting_assistant.h"
28#include "mmhal_core.h"
32#if defined(ENABLE_EXT_XTAL_INIT) && ENABLE_EXT_XTAL_INIT
35#error "With ENABLE_EXT_XTAL_INIT defined this device is not supported by porting assistant."
98 return F_GREEN(
"PASS");
100 return F_BLUE(
"SKIP");
102 return F_RED(
"FAIL");
103 case TEST_FAILED_NON_CRITICAL:
104 return F_YELLOW(
"FAIL");
121 static char log_buf[1024];
124 for (ii = 0; ii < num_steps; ii++)
126 const struct test_step *step = steps[ii];
127 size_t log_buf_len =
sizeof(log_buf);
133 enum test_result result = step->
exec(log_buf, log_buf_len);
134 if (result != TEST_NO_RESULT)
140 if (log_buf[0] !=
'\0')
159 case TEST_FAILED_NON_CRITICAL:
164 if (result == TEST_FAILED)
184 char hw_version_string[32] = { 0 };
189 snprintf(hw_version_string,
sizeof(hw_version_string),
"%s",
"Unknown");
192 LOG_WRITE(F_BOLD(
"\n\nMM-IoT-SDK Porting Assistant\n"));
193 LOG_WRITE(
"----------------------------\n");
194 LOG_PRINTF(
" HW Version: %s\n", hw_version_string);
196 LOG_WRITE(
"----------------------------\n\n");
200 LOG_PRINTF(
"\n\n%u total test steps. %u passed, %u failed, %u no result, %u skipped\n",
bool mmhal_get_hardware_version(char *version_buffer, size_t version_buffer_length)
Reads information that can be used to identify the hardware platform, such as hardware ID and version...
void mmhal_set_deep_sleep_veto(uint8_t veto_id)
Sets a deep sleep veto that will prevent the device from entering deep sleep.
@ MMHAL_VETO_ID_APP_MIN
Start of deep sleep veto ID range that is available for application use.
#define MMOSAL_ASSERT(expr)
Assert that the given expression evaluates to true and abort execution if not.
#define MM_VERSION_BUILDID
Build identifier string.
const struct test_step test_step_mmhal_wlan_validate_bcf
Test definition.
const struct test_step test_step_read_chip_id
Test definition.
const struct test_step test_step_os_malloc
Test definition.
const struct test_step test_step_verify_busy_pin
Test definition.
const struct test_step test_step_os_realloc
Test definition.
const struct test_step test_step_mmhal_wlan_sdio_startup
Test definition.
const struct test_step test_step_raw_tput
Test definition.
const struct test_step test_step_mmhal_wlan_validate_fw
Test definition.
const struct test_step test_step_bulk_write_read
Test definition.
const struct test_step test_step_os_time
Test definition.
const struct test_step test_step_mmhal_wlan_hard_reset
Test definition.
static void run_test_steps(const struct test_step *const steps[], size_t num_steps, struct test_counters *ctrs)
Iterate through the given list of test steps and execute until complete or until a critical failure o...
const struct test_step test_step_os_task_creation
Test definition.
void app_init(void)
Main entry point to the application.
static const struct test_step *const test_steps[]
Array of test steps.
const struct test_step test_step_mmhal_wlan_init
Test definition.
static const char * result_code_to_string(enum test_result result)
Convert a test_result code to string.
Counters to track test runs.
unsigned no_result
Number of tests that did not return a pass/fail result.
unsigned pass
Number of tests that passed.
unsigned fail
Number of tests that failed.
const char * description
Short, user friendly description of the test step.
enum test_result(* exec)(char *log_buf, size_t log_buf_len)
Test step execution function.