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

prevents an overflowing subtraction when using JLink #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benbrittain
Copy link

When using JLink V762c on Linux with a Cortex-M4, I got a

thread 'main' panicked at 'attempt to subtract with overflow', humility-core/src/core.rs:597:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: humility failed

when issuing a cargo xtask humility <app> tasks command

This looks like it's caused by a spurious (or perhaps overlapping?) ack.

[2022-04-03T23:22:37Z TRACE humility_core::core] sending $m200022a8,20#ba
[2022-04-03T23:22:37Z TRACE humility_core::core] response: +
[2022-04-03T23:22:37Z TRACE humility_core::core] response: +$382300201000000001000000602300209cff0000a9830100f887010000000041#62

Checking that the responding message is larger or equal to the expected GDB packet fixes the problem.

humility: attached via JLink
system time = 352367
ID TASK                 GEN PRI STATE    
 0 idle                   0   5 RUNNING
 1 jefe                   0   0 recv, notif: bit0 bit1(T+33)
 2 hiffy                  0   3 notif: bit0(T+133)
 3 gpio                   0   2 recv
 4 blinky                 0   3 recv, notif: bit0(T+133)

humility-core/src/hubris.rs Outdated Show resolved Hide resolved
cmd/flash/src/lib.rs Outdated Show resolved Hide resolved
@benbrittain
Copy link
Author

benbrittain commented Sep 21, 2022

Removed the accidental code due to a making a pull request from master branch & rebased. Confirmed it still works as intended

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

Successfully merging this pull request may close these issues.

2 participants