Skip to content

Add support of BlackPill F303CC #544

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 2 commits into from
Jun 27, 2019
Merged

Conversation

@fpistm fpistm added the new variant Add support of new bard label Jun 20, 2019
@fpistm fpistm added this to the 1.6.1/1.7.0 milestone Jun 20, 2019
@fpistm fpistm force-pushed the BLACKPILLF303CC branch from 8b045d1 to c335551 Compare June 20, 2019 14:22
@BennehBoy
Copy link
Contributor

Thanks @fpistm

I posted this over on the forums:

I was just thinking about how these 'PILL' style boards should be handled in the official core, there's a fair bit of fragmentation in the variants folder currently, the BLUEPILL_F103XX folder handles generic blue & blackpills (and robotdyns board), Sparky V1 handles the F303CC, and currently there's nothing for the F401...

I might submit a PR which does he following:

F103 based boards - rename BLUEPILL_F103XX to PILL_F103XX
F401 based boards - create PILL_F401XX variant
F303 based boards - create PILL_F303XX variant, essentially the Sparky V1 but with standard usart mapping

I wonder whether it would be also worth creating 'GENERIC' variants which simply have the basefunctionality all enabled - of course anyone wishing to have Arduino style pin mapping would be playing pot luck if they were looping over the pins. This would make it much simpler for people to get up and running with new boards - albeit with potential issues for board specific peripherals.

link here -> https://www.stm32duino.com/viewtopic.php?p=54755#p54755

Thoughts?

@BennehBoy
Copy link
Contributor

ps, boards.txt refers to Black407VE - copy paste error I guess?

# Black F407VE
GenF3.menu.pnum.BLACKPILL_F303XX=BlackPill F303CC

@fpistm
Copy link
Member Author

fpistm commented Jun 20, 2019

@BennehBoy,
I've already answered you 😄
I've already made the variant so don't rename it.
Anyway this is a PR, so under review and wait your comments :)
For boards.txt right copy/paste... nice shot 😉

@BennehBoy
Copy link
Contributor

@BennehBoy,
I've already answered you

So you did - missed that 😊

@fpistm fpistm force-pushed the BLACKPILLF303CC branch from c335551 to 7590a0b Compare June 20, 2019 15:09
@RickKimball
Copy link
Contributor

Have you given any thought to putting the ISR routine code into CCMRAM?

@fpistm
Copy link
Member Author

fpistm commented Jun 21, 2019

Have you given any thought to putting the ISR routine code into CCMRAM?

Honestly no, do not hesitate to share with us 😉

@RickKimball
Copy link
Contributor

RickKimball commented Jun 22, 2019

It would require some startup code changes. The only part missing is to copy *.ccmram from flash to ccmram at startup. The ldscript already defines the names __siccmram, _sccmram, and _eccmram Something like this might work:

$ ls system/Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xc*
system/Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xc_ccmram.s
system/Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xc.s
$ diff system/Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xc*
78,94d77
< /* Copy the ccmram segment initializers from flash to CCMRAM */
<   movs	r1, #0
<   b	LoopCopyCCMRamInit
< 
< CopyCCMRamInit:
< 	ldr	r3, =_siccmram
< 	ldr	r3, [r3, r1]
< 	str	r3, [r0, r1]
< 	adds	r1, r1, #4
< 
< LoopCopyCCMRamInit:
< 	ldr	r0, =_sccmram
< 	ldr	r3, =_eccmram
< 	adds	r2, r0, r1
< 	cmp	r2, r3
< 	bcc	CopyCCMRamInit
< 
113d95
< 

Then for any routine you want to run from CCMRAM, you just give it the attribute.

__attribute__ ((section(".ccmram")))
 void SysTick_Handler(void)
 {
   HAL_IncTick();
...

I guess this is probably best left as an exercise to the user. It would probably be better if it was done on a sketch by sketch basis. ... so .. never mind ... :)

@fpistm
Copy link
Member Author

fpistm commented Jun 22, 2019

Thanks @RickKimball

Maybe you can add this as an example here:
https://github.com/stm32duino/wiki/wiki/Custom-definitions#custom-startup-file

@BennehBoy
Copy link
Contributor

Tested this variant with a RobotDyn F303CC BlackPill, SPI & CDC confirmed working - will do further testing later.

@RickKimball
Copy link
Contributor

RickKimball commented Jun 25, 2019

Placing these boards under the Generic STM32F3 is fine. However calling it a blackpillf303cc seems to be confusing if you haven't been reading the stm32duino.com forum.

Would it be better to identify this board by the name that RobotDyn calls it? On their website it is labeled as: "STM32 ARM Cortex®-M4 Mini System Dev.board"

Maybe we use something like "RobotDyn Cortex-M4 Mini System Dev Board" ? This way we don't have to answer questions about how to use the board with the ST core? Or at least have RobotDyn in the menu selection someplace so it is apparent?

@RickKimball
Copy link
Contributor

Regarding naming. Why does Sparky V1 rate as a top level board? Shouldn't there be a collection of "Flight Controller Board" ? And the RAKWireless? It also rates a top level board. Why not a collection of "Wireless Boards" ?

@fpistm
Copy link
Member Author

fpistm commented Jun 25, 2019

@RickKimball
About board name, probably, yes as robotdyn is the manufacturer. I will update the name displayed with "RobotDyn Cortex-M4 Mini System Dev Board".

About Sparky, I've made the same comment during the PR review:
#432 (comment)
As I don't know the flight controller ecosystem, I followed his comment.

About RAK, as there are several RAK boards, I added them under their site name.
https://www.rakwireless.com/en/.
So why not, maybe it could be renamed later if new wireless board is added 😆

@RickKimball
Copy link
Contributor

Wait!

I was just chatting with the sales agent at RobotDyn. I asked if they had a preferred name and they went and asked Chief Executive Shavkat Begishev. The official name they prefer "RobotDyn Blackpill F303"

@fpistm
Copy link
Member Author

fpistm commented Jun 25, 2019

Don't worry, I will do update later.
Any comment are welcome ;)

fpistm and others added 2 commits June 27, 2019 08:57
Comment from @BennehBoy about 'PILL' style boards handled in the core:

> There's a fair bit of fragmentation in the variants folder currently,
> the BLUEPILL_F103XX folder handles generic blue & black pills

Co-authored-by: BennehBoy <[email protected]>
Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm force-pushed the BLACKPILLF303CC branch from 7590a0b to 6ef9f03 Compare June 27, 2019 06:59
@fpistm
Copy link
Member Author

fpistm commented Jun 27, 2019

I've updated the name.
I have to made a new release to fix an issue with the arm none eabi gcc toolchain on windows.
So I think to merge this variant to add it to the release.
Do you see any blocker for this ?

@BennehBoy
Copy link
Contributor

BennehBoy commented Jun 27, 2019 via email

@fpistm
Copy link
Member Author

fpistm commented Jun 27, 2019

No blockers that I can see, is the gcc fix for windows paths with spaces?

yes.

@fpistm fpistm merged commit 33c9261 into stm32duino:master Jun 27, 2019
@fpistm fpistm deleted the BLACKPILLF303CC branch June 27, 2019 08:17
@Alteregoxxx
Copy link

Sorry if this is not the right place for my question: it seems, reading from the PlatformIO documentation, that DFU upload method is not yet supported for this board/MCU, am I wrong?

If I'm right, in the hope to grasp the concepts behind usb DFU, can I kindly ask why? I mean, AN2606 (https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf) says STM32F303xB(C) has USB bootloader pre-burned in factory and, in my base understanding, having an utility like DFU-util that, still in my base understanding, we already use for boards like BluepillF103Cx, should be sufficient to complete the "recipe", no? What am I missing? Could you point me on some "basic" info source?

I would really like to gain some knowledge on the topic and, maybe, help someday :-)

@fpistm
Copy link
Member Author

fpistm commented Dec 9, 2019

@Alteregoxxx
This is supported, under Arduino IDE select STM32CubeProgrammer (DFU).
You have to apply the correct boot pattern before to switch in STM32 Bootloader mode.

I currently working to automatically switch to the STM32 Bootloader mod. See #710.

@Alteregoxxx
Copy link

@Alteregoxxx
This is supported, under Arduino IDE select STM32CubeProgrammer (DFU).

I see...
So, Arduino IDE support DFU on this chip (and probably other...)making use of the STM32CubeProgrammer software, did I get it right?
However, being a PlatformIO user, just for the sake of a better understanding, can DFU-util (that should be the DFU utility used by PlatformIOif I'm not wrong) be used for the same goal?

You have to apply the correct boot pattern before to switch in STM32 Bootloader mode.

Yep, I've already learned that some time ago, reading trough a few of the "brief" STM32 datasheets :-D

I currently working to automatically switch to the STM32 Bootloader mod. See #710.

That would be great, not great as having DFU already supported in PlatformIO, but still great :-P

@fpistm
Copy link
Member Author

fpistm commented Dec 9, 2019

However, being a PlatformIO user, just for the sake of a better understanding, can DFU-util (that should be the DFU utility used by PlatformIOif I'm not wrong) be used for the same goal?

Yes DFU util could be used. About PIO, I'm not aware how the STM32 core is integrated nor the upload tools.

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.

4 participants