mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ff525eb354
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> |
||
---|---|---|
.. | ||
periph_i2c_if.py | ||
README.md | ||
test.py |
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
- Flash the periph_i2c firmware on the nucleo-f401 with
make BOARD=nucleo-f401 flash
in the periph_i2c directory - Connect the BPT to the cpu using a USB to Serial converter
(BPT IF_TX = PA9)
(BPT IF_RX = PA10) - Connect the BPT to the DUT
(DUT SCL/D15 <=> BPT SCL1/PB6)
(DUT SDA/D14 <=> BPT SDA1/PB7)
(DUT NRST <=> BPT PB1) - 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