Skip to content

Add Sparky V1 Variant, modify boards.txt #432

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 7 commits into from
Feb 21, 2019
Merged

Add Sparky V1 Variant, modify boards.txt #432

merged 7 commits into from
Feb 21, 2019

Conversation

geosmall
Copy link
Contributor

Summary

Pull Request to add Sparky V1 Variant. First documented here http://www.stm32duino.com/viewtopic.php?f=49&t=4542

This PR fixes/implements the following bugs/features

  • [ x] Feature 1 - Add Sparky V1 Flight Controller board as new Variant.

Motivation for making this change:

I would like to propose a new STM core variant based on Sparky V1 Flight Controller. This would enable support for open source drone flight controller development and sharing. It would also enabledevelopment of higher performance open source UAVCAN nodes for drone use.

Reasons for targeting this design:

  • Open source design with published schematic
  • Based on STM32F303CC processor with FPU
  • Available for purchase
  • Integrated CAN transceiver

Validation:

See http://www.stm32duino.com/viewtopic.php?p=53147#p53147

@fpistm fpistm self-requested a review February 11, 2019 06:02
@fpistm fpistm assigned fpistm and unassigned fpistm Feb 11, 2019
@fpistm fpistm added the new variant Add support of new bard label Feb 11, 2019
@fpistm
Copy link
Member

fpistm commented Feb 11, 2019

Hi @geosmall
thanks for this variant.
Please, Could you rebase it on top of the master.
Maybe a new more generic name could be used in the boards.txt: "Flight Controllers" ?

@geosmall
Copy link
Contributor Author

geosmall commented Feb 12, 2019

Hi @fpistm
I've resolved conflict in boards.txt, Travis CI shows a check fail I am not sure how to resolve (I must admit to being a GitHub novice).

There are so many STM32 based flight controllers out there, I targeted this specific board as it is open source and documented so I would propose specific nomenclature to avoid confusion.

@fpistm
Copy link
Member

fpistm commented Feb 12, 2019

Thanks @geosmall
CI build is failed because it's build under Linux which is case sensitive.
In boards.txt the variant is not correct this should be: SPARKY_F303CC

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Thanks. See my comments.

@geosmall
Copy link
Contributor Author

Hi @fpistm ,

I've updated to the requested changes, now appear to be failing an AStyle check, unsure how to best resolve.

Thanks,
George

@fpistm
Copy link
Member

fpistm commented Feb 15, 2019

Thanks @geosmall
About astyle check, you have to use astyle to format your code.
The astyle config used for the core is available here:
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/CI/astyle/.astylerc

Simply install astyle:
https://sourceforge.net/projects/astyle/files/
then launch it like this:
astyle --project=.astylerc <your target dir/file>
or use the python script I provide to ease astyle usage on git root repo:
python CI/astyle/astyle.py
note you can use -p option to specify astyle install dir.

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Still duplicated pins to comment and apply astyle formatting

@fpistm
Copy link
Member

fpistm commented Feb 15, 2019

If this can help, I've rebased and format your PR:
https://github.com/fpistm/Arduino_Core_STM32/tree/pr-432

Note: I do not comment duplicated pins line.

@BennehBoy
Copy link
Contributor

Haha, I'm amused that Astyle is catching you out also @fpistm

@fpistm
Copy link
Member

fpistm commented Feb 15, 2019

Haha, I'm amused that Astyle is catching you out also @fpistm

I know this will require some support/question but I think is a necessary evil 😈

@geosmall
Copy link
Contributor Author

geosmall commented Feb 15, 2019

Ok I am a bit familiar with AStyle and will work to directions above. Thanks for the help :)

On peripheral pins, let me make sure I'm thinking it correctly:

Some exposed board pins may be used for more than one function when considered across multiple sketches. For example PA2 might be used as analog input in one sketch (using ADC1_IN3), as PWM input measurement pin in another sketch (using TIM2_CH3), and as hardware USART TX output in a third sketch (using USART2_TX). So it would be expected for PA2 to have multiple uncommented options in PeripheralPins.c. Does this sound correct? This is why I have some pins with duplicate uncommented out definition lines.

Does this sound correct?

Thanks,
George

@fpistm
Copy link
Member

fpistm commented Feb 15, 2019

Across all array this is not a problem. One pins can have several feature (I2C, UART, SPI, TIM,...)
When I talk about duplicated pins, I talk about the same pin for a dedicated features.
Ex: PA_7 for Timer:

  {PA_7,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N
  {PA_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
  {PA_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N
  {PA_7,  TIM17,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1

The core will search if PA7 has TIM capabilities then it will get the first one defined. PA7 with TIM1. All other will be ignored but consume memory space for nothing.
By commenting, you are able to choose which TIM use with PA7, ex to use TIM8

  //{PA_7,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM1, 1, 1)}, // TIM1_CH1N
  //{PA_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
  {PA_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM8, 1, 1)}, // TIM8_CH1N
  //{PA_7,  TIM17,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1

@geosmall
Copy link
Contributor Author

Ah, ok thanks will fix that.

@geosmall
Copy link
Contributor Author

I believe I have completed the requested changes and successfully passed CI checks.

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Still 2 lines changed while they should not.
Else it is ok.

@fpistm fpistm added this to the 1.5.1/1.6.0 milestone Feb 19, 2019
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Sorry @geosmall
I would like to merge and view 2 small issues which required to be fixed.
Thanks in advance.

@fpistm fpistm merged commit da60d84 into stm32duino:master Feb 21, 2019
@geosmall
Copy link
Contributor Author

Thanks for merging @fpistm , and thanks for the patience (first GitHub PR :)

@fpistm
Copy link
Member

fpistm commented Feb 21, 2019

Welcome.
All contributions are welcome. This is a community project ;)

benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants