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

Use two DWT channels for software tasks instead #47

Closed
tmplt opened this issue Aug 19, 2021 · 1 comment · Fixed by #57
Closed

Use two DWT channels for software tasks instead #47

tmplt opened this issue Aug 19, 2021 · 1 comment · Fixed by #57
Labels
enhancement New feature or request robustness
Milestone

Comments

@tmplt
Copy link
Member

tmplt commented Aug 19, 2021

At present (read: when implemented correctly; #43) we rely on a single DWT channel to communicate that a task has entered/exited. If we have

#[trace]
sw_task1() { ... }

#[trace]
sw_task2() { ... }

then we will receive the value 0 on the used DWT comparator when sw_task1 enters/exits and 1 for sw_task2. This is not very stable. Instead, two channels should be used: the first one for tasks that are entered, and the other for tasks that exits. This approach does not require us to record the state of the software tasks because we need only forward the events, just like for hardware tasks.

@tmplt tmplt added this to the v0.3.0 milestone Aug 19, 2021
@tmplt tmplt added the enhancement New feature or request label Aug 19, 2021
@tmplt
Copy link
Member Author

tmplt commented Aug 19, 2021

Additionally — once implemented, and assuming RTIC Scope is correct — a software task that is entered twice before exited would highlight a reentrant error in RTIC or a hardware issue.

tmplt added a commit that referenced this issue Oct 31, 2021
As per #47, using a single DWT channel is less robust than using two. By
using two, a state must not be kept on the host-side, and it allows us
to catch re-entry errors.
tmplt added a commit that referenced this issue Oct 31, 2021
As per #47, using a single DWT channel is less robust than using two. By
using two, a state must not be kept on the host-side, and it allows us
to catch re-entry errors.

Do we really need to use two DWT units here? We should be able to watch
both the enter and exit addresses, and when one of them writes, the ITM
package should indicate which variable was written to.
tmplt added a commit that referenced this issue Oct 31, 2021
As per #47, using a single DWT channel is less robust than using two. By
using two, a state must not be kept on the host-side, and it allows us
to catch re-entry errors.

Do we really need to use two DWT units here? We should be able to watch
both the enter and exit addresses, and when one of them writes, the ITM
package should indicate which variable was written to.
@tmplt tmplt closed this as completed in #57 Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request robustness
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant