Skip to content

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

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

jeromecoutant
Copy link
Collaborator

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

Copy link
Contributor

@theotherjimmy theotherjimmy left a 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!

@@ -668,367 +668,321 @@
"extra_labels_remove": ["FRDM"],
"supported_form_factors": []
},
"FAMILY_STM32": {
"inherits": ["Target"],
"core": "",
Copy link
Contributor

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.

Copy link
Collaborator Author

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 ?

Copy link
Contributor

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

Copy link
Contributor

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".

Copy link
Collaborator Author

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

"is_disk_virtual": true,
"macros": ["HSE_VALUE=26000000", "TRANSACTION_QUEUE_SIZE_SPI=2"],
"macros_add": ["HSE_VALUE=26000000"],
"progen": {"target": "mts-mdot-f405rg"},
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jeromecoutant
Copy link
Collaborator Author

jeromecoutant commented Jun 22, 2017

Could you get rid of the core and progen lines?

done

Copy link
Contributor

@theotherjimmy theotherjimmy left a 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.

Copy link
Contributor

@0xc0170 0xc0170 left a 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

"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"],
Copy link
Contributor

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

@jeromecoutant jeromecoutant force-pushed the PR_TARGETJSON branch 2 times, most recently from e3cc7ef to f5b440d Compare June 26, 2017 08:39
@jeromecoutant
Copy link
Collaborator Author

Hi
Missing macro added and rebase done
Thx

"FAMILY_STM32" has been creeated with all common features.
All STM32 devices can now inherit from it.
This will simplify readability and maintainability.
@theotherjimmy
Copy link
Contributor

👏 Thanks @jeromecoutant

@theotherjimmy
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 641

Test failed!

@theotherjimmy
Copy link
Contributor

Clearly not related.

/morph test

@theotherjimmy
Copy link
Contributor

@mazimkhan Did this one fail to report as well?

@theotherjimmy
Copy link
Contributor

retest uvisor

@chrissnow
Copy link
Contributor

chrissnow commented Jun 28, 2017

@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.

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 668

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 28, 2017

@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.

Can you elaborate? Is this required for this patch or can be done on top of this one?

@chrissnow
Copy link
Contributor

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.

@jeromecoutant
Copy link
Collaborator Author

@chrissnow
I am not in favor of this additional level... 2 levels are enough to see what is common for all STM32, and what makes the difference.

@0xc0170
Please merge, I am waiting for this PR for #4421

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

Successfully merging this pull request may close these issues.

5 participants