example_test.py 935 B

1234567891011121314151617181920212223242526272829303132
  1. from __future__ import unicode_literals
  2. import re
  3. import ttfw_idf
  4. @ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32s2'])
  5. def test_examples_ulp_riscv(env, extra_data):
  6. dut = env.get_dut('ulp_riscv', 'examples/system/ulp_riscv')
  7. dut.start_app()
  8. dut.expect_all('Not a ULP-RISC-V wakeup, initializing it!',
  9. 'Entering in deep sleep',
  10. timeout=30)
  11. # Run two times to make sure device sleep
  12. # and wake up properly
  13. for i in range(0, 2):
  14. # Pulling GPIO0 low using DTR
  15. dut.port_inst.setDTR(True)
  16. dut.expect('ULP-RISC-V woke up the main CPU!', timeout=5)
  17. # We pulled GPIO0 low previously
  18. dut.expect(re.compile(r'ULP-RISC-V read changes in GPIO_0 current is: Low'), timeout=5)
  19. # Go back to sleep
  20. dut.expect('Entering in deep sleep', timeout=5)
  21. if __name__ == '__main__':
  22. test_examples_ulp_riscv()