Fix: target discovery logic in stm32l4 #2040
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Detailed description
target->priv
field behind typecasts totarget->target_storage
correct one.Dereferencing that
priv
and typecasting it to stm32l4_priv_s results in unpredictable CCM sizes in BMDA and large sizes in BMF. It's forcortexm_priv_s
, and the rest of this driver usestarget_storage
, so fix the last use of it.Other dereferences of both priv and target_storage in other TUs seem to be okay per Qt Creator lookups (check them!)
Also,
*device
is not going to be NULL, it can be the 18th sentinel entry, but itsdevice_id
can be zero -- so correct the no-match branch condition which should trigger a second LUT walk.Tested on gd32f103cb bluepillplus as
bluepill.ini
/stlink
platform and stm32g474ceu target, BMDA as well. Gentoo gcc-13, crossdev. In particular, RTT autosearch no longer hangs up faulting in nonexistent CCM and retrying for ages.Your checklist for this pull request
Closing issues