Morse Micro IoT SDK  2.9.7
porting_assistant.c File Reference

Detailed Description

Porting assistant self test tool to validate hardware and HALs.

Note
It is assumed that you have followed the steps in the Getting Started guide and are therefore familiar with how to build, flash, and monitor an application using the MM-IoT-SDK framework.

The Morse Micro Porting Assistant is a tool that assists with validating OSAL, HALs, and platform hardware necessary for communicating with a Morse Micro chip. It runs a sequence of tests and displays the results of each along with information about potential causes on failure.

This tool has been provided as an example application on the Morse Micro reference platforms. Running this application on a known-good platform should result in a 100% pass rate.

When bringing up a new platform, it is recommended to first port this example application to your new platform. It will then assist in diagnosing fundamental issues that may be more difficult to identify or debug when using other example applications.

Definition in file porting_assistant.c.

#include "porting_assistant.h"
Include dependency graph for porting_assistant.c:

Go to the source code of this file.

Data Structures

struct  test_counters
 Counters to track test runs. More...
 

Functions

static const char * result_code_to_string (enum test_result result)
 Convert a test_result code to string. More...
 
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 occurs. More...
 
void app_init (void)
 Main entry point to the application. More...
 

Variables

const struct test_step test_step_os_malloc
 Test definition.
 
const struct test_step test_step_os_realloc
 Test definition.
 
const struct test_step test_step_os_time
 Test definition.
 
const struct test_step test_step_os_task_creation
 Test definition.
 
const struct test_step test_step_mmhal_wlan_init
 Test definition.
 
const struct test_step test_step_mmhal_wlan_hard_reset
 Test definition.
 
const struct test_step test_step_mmhal_wlan_sdio_startup
 Test definition.
 
const struct test_step test_step_read_chip_id
 Test definition.
 
const struct test_step test_step_bulk_write_read
 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_mmhal_wlan_validate_bcf
 Test definition.
 
const struct test_step test_step_verify_busy_pin
 Test definition.
 
static const struct test_step *const test_steps []
 Array of test steps. More...
 

Function Documentation

◆ app_init()

void app_init ( void  )

Main entry point to the application.

This will be invoked in a thread once operating system and hardware initialization has completed. It may return, but it does not have to.

Definition at line 158 of file porting_assistant.c.

◆ result_code_to_string()

static const char * result_code_to_string ( enum test_result  result)
static

Convert a test_result code to string.

Parameters
resultThe result code.
Returns
the string representation of the result code (including color if enabled).

Definition at line 89 of file porting_assistant.c.

◆ run_test_steps()

static void run_test_steps ( const struct test_step *const  steps[],
size_t  num_steps,
struct test_counters ctrs 
)
static

Iterate through the given list of test steps and execute until complete or until a critical failure occurs.

Parameters
stepsTest steps to execute.
num_stepsNumber of steps to execute.
ctrsTest count state to be updated by this function.

Definition at line 110 of file porting_assistant.c.

Variable Documentation

◆ test_steps

const struct test_step* const test_steps[]
static
Initial value:
= {
}
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.
const struct test_step test_step_os_task_creation
Test definition.
const struct test_step test_step_mmhal_wlan_init
Test definition.

Array of test steps.

Definition at line 55 of file porting_assistant.c.