arduino-style upload on custom boards possible?

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
Post Reply
STM32_Newbbe
Posts: 47
Joined: Thu Nov 05, 2020 10:26 am

arduino-style upload on custom boards possible?

Post by STM32_Newbbe »

Hello,

I am quite happy with the Arduino integration of the Nucleo-boards and am currently wondering if such a simple uploader can also be realized in custom boards?
Does it rely on an ST-Link to be attached to the board?
Is there a way to create an uploader that has no need for bootmode & reset to be pushed like with standard USB DFU?
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: arduino-style upload on custom boards possible?

Post by mrburnette »

ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino-style upload on custom boards possible?

Post by ag123 »

get something in the STM32F4xx family, all those has a built-in dfu boot loader
https://learn.adafruit.com/adafruit-stm ... er-details
STM32_Newbbe
Posts: 47
Joined: Thu Nov 05, 2020 10:26 am

Re: arduino-style upload on custom boards possible?

Post by STM32_Newbbe »

seems I wasn't clear on what I try to achieve...

I want an upload method that does not need an ST-Link and that does not need to push a button or wire some pins.
And it would be really nice if it can be integrated in the Arduino IDE or even better into Sloeber.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: arduino-style upload on custom boards possible?

Post by mrburnette »

STM32_Newbbe wrote: Tue Sep 07, 2021 5:41 am seems I wasn't clear on what I try to achieve...

I want an upload method that does not need an ST-Link and that does not need to push a button or wire some pins.
And it would be really nice if it can be integrated in the Arduino IDE or even better into Sloeber.

You were clear 'nuff; I gave you the WiKi links to the 2 most commonly used cores. Said links explain the upload methods... you are responsible for deciding what works best you you.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino-style upload on custom boards possible?

Post by ag123 »

check in the ref manuals, you may find some registers to do just that, so deemed 'soft' boot0 etc. not every soc has those features. stm32f4xx may have it
STM32_Newbbe
Posts: 47
Joined: Thu Nov 05, 2020 10:26 am

Re: arduino-style upload on custom boards possible?

Post by STM32_Newbbe »

well, I already found out that setting registers or jumping to boot memory should do the trick...
or attaching a cap to the boot-pin and soft-reset...

BUT: how about integration into the "toolchain" (sorry I'm not that used to this and still struggle to use the right words)
bluntly put: how can I get to the point that I just have to push Ctrl-U to upload the sketch?
Which things will I have to modify to achieve this?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: arduino-style upload on custom boards possible?

Post by ag123 »

DFU is normally there even in official STM core, simply install STM32CubeProgrammer and that's about it.
Setting those registers and doing reset is best done within the sketch, this is non-standard and not everyone wants it
I think for what's worth, the 'future' 3d printer boards, possibly 'all' of them would be doing just this.
There is no need for any 'dongles' if a stm32f4 is used. Simply set boot0 and flash away.
Some people want the 'hardware' boot0 for security reasons, otherwise any virus on the desktop computer can simply probe and flash its own firmware.
STM32_Newbbe
Posts: 47
Joined: Thu Nov 05, 2020 10:26 am

Re: arduino-style upload on custom boards possible?

Post by STM32_Newbbe »

Thanks for all those details!

I think I'm going the "capacitor on boot0 pin" way...
This will allow to enter boot mode by sending a command to the µC which still lets a little bit of security, even though hardware pushbutton would be better

Glad to see the L4+ has DFU support

Thanks to all for their help :)
Post Reply

Return to “Custom design boards”