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

wait-serial with custom chip output #15

Open
rafaelcorsi opened this issue Apr 6, 2024 · 3 comments
Open

wait-serial with custom chip output #15

rafaelcorsi opened this issue Apr 6, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rafaelcorsi
Copy link

hello @urish !

overview: I created a custom chip that emulates the behavior of an I2C IMU, my idea is that I can check if students are correctly accessing the register bank to make settings on the sensor, or if they can read specific values and process them (with the aim of extracting information from the manual and implementing it correctly in code).

My original idea would be to put some printfs on the custom chip, when the student writes/reads and check this in test.yml with wait-serial, as illustrated below:

- wait-serial: '[chip-i2c-counter] mpu6050 write reg[0x6C]=128

But now I realized that wait-serial doesn't check the output of the custom chip, any suggestions on what we can do? Maybe create a wait-serial-custom-chip? Or add the custom chip log to the serial output?

The log is there, but we cant check!

image

@urish
Copy link
Contributor

urish commented Apr 7, 2024

Hi Rafael!

I was actually thinking about a different mechanism:

Provide an API for chips to declare some kind of output variables, which will complement the "controls" that provide inputs to the chip.

For instance, a chip implementing a servo controller could declare an "angle" output variable, and then the tests could read this variable and assert on its value. And like controls, these output variables will only support floating point values (at least initially).

Would that also be useful for your use case?

@rafaelcorsi
Copy link
Author

Hi! I think this is more complex than necessary because we will need to handle different variable types. What if the angle is a float, or what if it's an array? How would we check for these different kinds of data?

@urish urish self-assigned this Apr 9, 2024
@urish urish added the enhancement New feature or request label Apr 9, 2024
@urish
Copy link
Contributor

urish commented Apr 9, 2024

Make sense - output variables may still be useful for more constrained use cases (e.g. angle of a servo), but I agree that just looking for a specific pattern in the chip output can be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants