Module stm32f412g::flash::tests

source ·
Expand description

Tests for the STM32F4xx flash driver.

If any contributions are made to this driver, it is highly recommended to run these tests to ensure that everything still works as expected. The tests are chip agnostic. They can be run on any STM32F4 chips.

§Usage

First, the flash module must be imported:

// Change this line depending on the chip the board is using
use stm32f429zi::flash;

Then, get a reference to the peripheral:

// Inside the board main.rs
let flash = &peripherals.stm32f4.flash;

To run all tests:

flash::tests::run_all(flash);

The following output should be printed:

===============================================
Testing setting flash latency...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Testing number of wait cycles based on the system frequency...
Finished testing number of wait cycles based on the system clock frequency. Everything is alright!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Testing setting flash latency...
Finished testing setting flash latency. Everything is alright!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Finished testing flash. Everything is alright!
===============================================

To run individual tests, see the functions in this module.

§Errors

In case of any errors, open an issue ticket at https://github.com/tock/tock. Please provide the output of the test execution.

Functions§