1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/periph_i2c/tests
Yegor Yefremov ff525eb354 dist/tests/if_lib: move testing infrastructure files to a stand-alone package
Create if_lib package containing all the modules and adapt the *.py files
to import each other using the intra-package references.

The idea behind a package is to invoke test.py either by permanently
modifying PYTHONPATH in user profile via adding path to $RIOTBASE/dist/tests
or make temporary PYTHONPATH changes during the invocation:

PYTHONPATH=$PYTHONPATH:$RIOTBASE/dist/tests python3 test.py

Leave periph_i2c_if.py in the same folder as test.py as this file is
just a Python wrapper around periph specific main.c.

Update BPT memory map. Use definitions generated with the latest code
generator. Both routine names and mapping have changed.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2018-08-02 13:34:47 +02:00
..
periph_i2c_if.py dist/tests/if_lib: move testing infrastructure files to a stand-alone package 2018-08-02 13:34:47 +02:00
README.md tests/periph_i2c: Add automated testing script 2018-07-25 12:01:40 +02:00
test.py dist/tests/if_lib: move testing infrastructure files to a stand-alone package 2018-08-02 13:34:47 +02:00

How To Run

Connect the DUT (device under test) I2C0 to the BPT (bluepill tester). Information for BPT setup can be found here.

Example Test With Nucleo-F401RE

  1. Flash the periph_i2c firmware on the nucleo-f401 with make BOARD=nucleo-f401 flash in the periph_i2c directory
  2. Connect the BPT to the cpu using a USB to Serial converter
    (BPT IF_TX = PA9)
    (BPT IF_RX = PA10)
  3. Connect the BPT to the DUT
    (DUT SCL/D15 <=> BPT SCL1/PB6)
    (DUT SDA/D14 <=> BPT SDA1/PB7)
    (DUT NRST <=> BPT PB1)
  4. Run the test.py from the periph_i2c/tests directory (with various options)
    python test.py for basic tests with autoconnect
    python3 test.py for python 3
    python test.py --log=DEBUG to see all debug messages
    python test.py --dut_port="/dev/ttyACM0" to specify the port
    python test.py --log=DEBUG --dut_port="/dev/ttyACM0" --dut_baud=9600 --bpt_port="/dev/ttyACM1" > nucleo-f401_test.txt for all the fix'ns

Flags

--log=DEBUG -> allows for debug output
--dut_port -> the port name of the DUT
--dut_baud -> the baud rate of the DUT
--bpt_port -> the port name of the BPT

Notes

  • If no serial connection to the BPT the test should still be able to run, it just will not be able to reset.
  • Connect the SDA, SCL and if possible the DUT reset pin.
  • Autoconnect may work if no ports are specified.
  • Default baud rate is 115200