bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

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

Open lkoepsel opened 2 months ago

lkoepsel commented 2 months ago

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 commented 2 months ago

Hey Lief,

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

https://github.com/bloombloombloom/Bloom/blob/5473df0b280f63be24d1ec16acdf959403e680c0/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp#L480-L502

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 šŸ‘šŸ½