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

variantName doesn't appear to work on atmega328p-pu #108

Open
lkoepsel opened this issue Apr 24, 2024 · 1 comment
Open

variantName doesn't appear to work on atmega328p-pu #108

lkoepsel opened this issue Apr 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lkoepsel
Copy link

Hi Nav,

I've been working with an Uno on the RPi version of bloom. I have added variantName, to my bloom.yaml config:

    target:
      name: "atmega328p"
      physicalInterface: "debug-wire"
      hardwareBreakpoints: true
      manageDwenFuseBit: true
      variantName: "atmega328p-pu"

I enabled debug logging and have this from the beginning of invoking insight: (the last command is manually setting the variant, which works)

2024-04-24 07:13:52.627 PDT [DS]: [DEBUG] Read GDB packet: $qRcmd,696e7369676874#4c
2024-04-24 07:13:52.627 PDT [DS]: [INFO] Handling ActivateInsight packet
2024-04-24 07:13:52.627 PDT [DS]: [DEBUG] Event "InsightActivationRequested" (10) registered for listener ApplicationEventListener
2024-04-24 07:13:52.627 PDT [DS]: [DEBUG] Writing GDB packet: $54686520496e7369676874204755492077696c6c206265207769746820796f752073686f72746c792e0a#e2
2024-04-24 07:13:52.648 PDT [MT]: [DEBUG] Dispatching event InsightActivationRequested (10).
2024-04-24 07:13:52.649 PDT [MT]: [DEBUG] Issuing GetTargetDescriptor command (ID: 15) to TargetController
2024-04-24 07:13:52.650 PDT [MT]: [DEBUG] Delivering response for GetTargetDescriptor command (ID: 15)
2024-04-24 07:13:52.651 PDT [MT]: [INFO] Starting Insight
2024-04-24 07:13:52.674 PDT [MT]: [DEBUG] Starting InsightWorker1
2024-04-24 07:13:52.674 PDT [MT]: [DEBUG] Starting InsightWorker2
2024-04-24 07:13:52.675 PDT [MT]: [DEBUG] Starting InsightWorker3
2024-04-24 07:13:52.675 PDT [IW1]: [DEBUG] InsightWorker1 ready
2024-04-24 07:13:52.675 PDT [IW2]: [DEBUG] InsightWorker2 ready
2024-04-24 07:13:52.675 PDT [IW3]: [DEBUG] InsightWorker3 ready
2024-04-24 07:13:52.724 PDT [MT]: [DEBUG] Number of target variants supported by Insight: 4
2024-04-24 07:13:53.144 PDT [IW3]: [DEBUG] Issuing GetTargetState command (ID: 16) to TargetController
2024-04-24 07:13:53.144 PDT [IW3]: [DEBUG] Delivering response for GetTargetState command (ID: 16)
2024-04-24 07:13:53.427 PDT [IW2]: [DEBUG] Issuing GetTargetPinStates command (ID: 17) to TargetController
2024-04-24 07:13:53.661 PDT [IW2]: [DEBUG] Delivering response for GetTargetPinStates command (ID: 17)
2024-04-24 07:13:53.661 PDT [IW2]: [DEBUG] Issuing ReadTargetRegisters command (ID: 18) to TargetController
2024-04-24 07:13:53.945 PDT [IW2]: [DEBUG] Delivering response for ReadTargetRegisters command (ID: 18)
2024-04-24 07:13:53.946 PDT [IW2]: [DEBUG] Issuing GetTargetProgramCounter command (ID: 19) to TargetController
2024-04-24 07:13:53.988 PDT [IW2]: [DEBUG] Delivering response for GetTargetProgramCounter command (ID: 19)
2024-04-24 07:13:53.989 PDT [IW3]: [DEBUG] Issuing GetTargetDescriptor command (ID: 20) to TargetController
2024-04-24 07:13:53.990 PDT [IW3]: [DEBUG] Delivering response for GetTargetDescriptor command (ID: 20)
2024-04-24 07:13:53.990 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 21) to TargetController
2024-04-24 07:13:54.190 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 21)
2024-04-24 07:13:54.190 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 22) to TargetController
2024-04-24 07:13:54.415 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 22)
2024-04-24 07:13:54.415 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 23) to TargetController
2024-04-24 07:13:54.609 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 23)
2024-04-24 07:13:54.609 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 24) to TargetController
2024-04-24 07:13:54.836 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 24)
2024-04-24 07:13:54.836 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 25) to TargetController
2024-04-24 07:13:55.031 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 25)
2024-04-24 07:13:55.031 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 26) to TargetController
2024-04-24 07:13:55.257 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 26)
2024-04-24 07:13:55.257 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 27) to TargetController
2024-04-24 07:13:55.451 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 27)
2024-04-24 07:13:55.452 PDT [IW3]: [DEBUG] Issuing ReadTargetMemory command (ID: 28) to TargetController
2024-04-24 07:13:55.676 PDT [IW3]: [DEBUG] Delivering response for ReadTargetMemory command (ID: 28)
2024-04-24 07:13:55.677 PDT [IW1]: [DEBUG] Issuing GetTargetStackPointer command (ID: 29) to TargetController
2024-04-24 07:13:55.715 PDT [IW1]: [DEBUG] Delivering response for GetTargetStackPointer command (ID: 29)
2024-04-24 07:14:19.826 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:19.886 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:19.958 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.024 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.091 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.159 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.232 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.591 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.662 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.732 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.807 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:20.890 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.295 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.345 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.425 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.762 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.828 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.903 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:21.988 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.105 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.220 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.307 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.380 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.480 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.564 PDT [SH]: [DEBUG] SIGNAL 28 received
2024-04-24 07:14:23.691 PDT [SH]: [DEBUG] SIGNAL 28 received
^[[B2024-04-24 07:15:18.772 PDT [IW1]: [DEBUG] Issuing GetTargetPinStates command (ID: 30) to TargetController
2024-04-24 07:15:19.002 PDT [IW1]: [DEBUG] Delivering response for GetTargetPinStates command (ID: 30)

When insight is initially invoked, I have the AU variant, I am able to set the PU variant manually, however, variantName doesn't appear to work in the config file.

Thanks,
Lief

@navnavnav
Copy link
Member

Hey Lief,

I see what's happened here. There's a bug in the Insight window's default variant selection routine:

if (this->targetConfig.variantName.has_value()) {
const auto variantIt = this->supportedVariantsByName.find(
QString::fromStdString(*this->targetConfig.variantName)
);
if (variantIt != this->supportedVariantsByName.end()) {
// The user has specified a valid variant name in their config file, so use that as the default
this->selectVariant(&(variantIt->second));
} else {
Logger::error(
"Invalid target variant name \"" + this->targetConfig.variantName.value()
+ "\" - no such variant with the given name was found."
);
}
}
/*
* Given that we haven't been able to select a variant at this point, we will just fall back to the first
* one that is available.
*/
this->selectVariant(&(this->supportedVariantsByName.begin()->second));
}

Missing a return statement on line 488 - it's selecting the correct variant, but then immediately selecting another one. Doh!

I will fix this in the next release, but there's still a lot of work that needs doing before that release will be published, so won't be any time soon I'm afraid.

I will keep this ticket updated 👍🏽

@navnavnav navnavnav self-assigned this Apr 24, 2024
@navnavnav navnavnav added the bug Something isn't working label Apr 24, 2024
@navnavnav navnavnav added this to the v1.1.0 milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants