Table of Contents
The test applications are in place to test new features, interfaces and sensors and to validate that they are functional during use. The number of tests is constantly growing, to get an up to date list, type:
nsh> tests help Available tests: led int float sensors gpio hrt ppm servo adc jig_voltages eeproms uart_loopback uart_baudchange uart_send uart_console tone sleep time perf all jig help
To run the test, type:
nsh> tests sensors
It will read out and print the values of all onboard sensors.
The GPIO test will toggle the onboard GPIOs. Use a scope to watch it.
nsh> tests gpio
High Resolution Timer (HRT) Tests
The HRT test validates the high resolution timer. It first prints the statistics of half-second measurements and then measures a few one-second ticks.
nsh> tests hrt start-time (hrt, sec/usec), end-time (hrt, sec/usec), microseconds per half second 2767860351 (38382717/966000), 2768359205 (38382718/467000), 498856 2768359704 (38382718/467000), 2768858807 (38382718/968000), 499105 2768859275 (38382718/968000), 2769359402 (38382719/470000), 500128 2769359894 (38382719/470000), 2769859000 (38382719/971000), 499108 2769859497 (38382719/971000), 2770358640 (38382720/472000), 499145 2770359108 (38382720/472000), 2770859358 (38382720/974000), 500251 2770859855 (38382720/974000), 2771358794 (38382721/475000), 498941 2771359262 (38382721/475000), 2771860309 (38382721/977000), 501049 2771860798 (38382721/978000), 2772360005 (38382722/479000), 499209 2772360487 (38382722/479000), 2772863830 (38382722/984000), 503345 one-second ticks tick tick tick tick tick tick tick tick tick tick
PPM Receiver Input Test
The PPM test tries to read the PPM sum signal provided by a PPM-sum-signal enabled RC receiver (such as the Futaba R6107SP). If no RC receiver is connected, it will print only zeroes.
The servo test will try to operate four servo channels connected on the USART2 pins (RX, TX, CTS, RTS).
The tone test plays a tune you'll definitely recognize on the alarm speaker (if one is connected to FMU)
The LED test will light the internal LEDs a few times
nsh> tests led LED test successful.
The float test validates the correct execution of
double functions, the trigonometric functions (sin(), cos(), atan2(), etc.) and printf(“%f”).
nsh> tests float --- SINGLE PRECISION TESTS --- The single precision test involves calls to fabsf(), if test fails check this function as well. success: sinf(0.0f) == 0.0f success: sinf(1.0f) == 0.84147f success: asinf(1.0f) == 1.57079f success: cosf(1.0f) == 0.54030f success: acosf(1.0f) == 0.0f success: sinf(0.1f) == 0.09983f success: sqrt(2.0f) == 1.41421f success: atan2f(1.0f, 1.0f) == 0.78539f success: printf("%8.4f", 0.553415f) == 0.5534 --- DOUBLE PRECISION TESTS --- success: 1.0111 * 2.0 == 2.0222 success: (float) 1.55f == 1.55 (double) success: sin(0.0) == 0.0 success: sin(1.0) == 0.84147098480 success: atan2(1.0, 1.0) == 0.785398 testing pow() with magic value (44330.0 * (1.0 - pow((96286LL / 101325.0), 0.190295))); success: result: 428.2293 success: printf("%8.4f", 0.553415) == 0.5534 SUCCESS: All float and double tests passed.