Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with example Code in ReadMe: Getting Started with CI Scripts #65

Open
MarcelStenzel opened this issue Feb 11, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MarcelStenzel
Copy link
Contributor

I had some problems while executing the Script. The syntax to calculate elapse_time was not correct since the 'data' key was not used.
Then the DEBUG0 pin needs a pull-up resistor. Otherwise there were weird timings in the trace or the reset was toggled multiple times. The assert line would not succeed like this.
I used the nucleo-f103rb Board for this.

This is the version of the code that worked for me:

from philip_pal import Phil

phil = Phil()
print("interface version: {}".format(phil.if_version))

# Reset philip to a clean state
assert phil.reset_mcu()['result'] == phil.RESULT_SUCCESS

# Setup DEBUG0 pin to log trace events with interrupt
for result in phil.write_and_execute('gpio[0].mode.io_type', 3):
    # Check each result for success
    assert result['result'] == phil.RESULT_SUCCESS

# Setup DEBUG0 pin to pullup
for result in phil.write_and_execute('gpio[0].mode.pull', 1):
    # Check each result for success
    assert result['result'] == phil.RESULT_SUCCESS

# Toggle the DUT_RST pin for the default period
phil.dut_reset()

# Toggle the DUT_RST pin for 1 second
phil.dut_reset(1.0)

trace = phil.read_trace()

# Assert the second toggle was in fact about 1 second
elapse_time = trace['data'][3]['time'] - trace['data'][2]['time']
assert elapse_time > 0.9 and elapse_time < 1.1

print("Trace Results")
print(trace)

@MrKevinWeiss MrKevinWeiss self-assigned this Feb 21, 2020
@MrKevinWeiss MrKevinWeiss added the bug Something isn't working label Feb 21, 2020
@MrKevinWeiss
Copy link
Collaborator

Thanks, I will look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants