-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32 : targets.json file simplification #4610
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you get rid of the core and progen lines? I really like this diff so far!
targets/targets.json
Outdated
@@ -668,367 +668,321 @@ | |||
"extra_labels_remove": ["FRDM"], | |||
"supported_form_factors": [] | |||
}, | |||
"FAMILY_STM32": { | |||
"inherits": ["Target"], | |||
"core": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not add this line. Assigning core like this can cause problems if a child incorrectly does not define it's core attribute. Further, each child must define the core attribute to function, overriding this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I can't. It seems that core is mandatory in the parse script ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace it with "public": false,
maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required for public targets, but you don't really want to be able to build for the non-target "FAMILY_STM32".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it's working.
I think it's even better to add this public false
targets/targets.json
Outdated
"is_disk_virtual": true, | ||
"macros": ["HSE_VALUE=26000000", "TRANSACTION_QUEUE_SIZE_SPI=2"], | ||
"macros_add": ["HSE_VALUE=26000000"], | ||
"progen": {"target": "mts-mdot-f405rg"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that you did not change this, but could you get rid of this progen key? It's not used anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
066a807
to
898aa6e
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for addressing my comments so quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one missing macro, the rest looks good, +1 for simplifying the stm32 targets
targets/targets.json
Outdated
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "RTC_LSI=1", "HSE_VALUE=12000000", "GNSSBAUD=9600"], | ||
"inherits": ["Target"], | ||
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_FC", "SLEEP", "RTC", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG"], | ||
"macros_add": ["RTC_LSI=1", "HSE_VALUE=12000000"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see here GNSSBAUD=9600
e3cc7ef
to
f5b440d
Compare
Hi |
"FAMILY_STM32" has been creeated with all common features. All STM32 devices can now inherit from it. This will simplify readability and maintainability.
f5b440d
to
8e28d9e
Compare
👏 Thanks @jeromecoutant |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Clearly not related. /morph test |
@mazimkhan Did this one fail to report as well? |
retest uvisor |
@jeromecoutant could there be an additional layer of inheritance for the processor family? for example L0,L1(soon),L4 support Flash but the changes would have to be made to all targets individually. |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Can you elaborate? Is this required for this patch or can be done on top of this one? |
It could be done on top of this, My thoughts were that a lot of things are common to a processor family and splitting out what the HAL for the family supports from the individual targets would tidy it up further. My example being I have implemented the flash HAL for all L1 devices but currently would need to go through any L1 target and modify them all to enable flash. |
@chrissnow |
Description
"FAMILY_STM32" has been created with all common features.
All STM32 devices can now inherit from it.
This will simplify readability and maintainability.
Status
READY