Page 1 of 1

arduino-style upload on custom boards possible?

Posted: Mon Sep 06, 2021 6:58 am
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?

Re: arduino-style upload on custom boards possible?

Posted: Mon Sep 06, 2021 11:59 am
by mrburnette

Re: arduino-style upload on custom boards possible?

Posted: Mon Sep 06, 2021 1:02 pm
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

Re: arduino-style upload on custom boards possible?

Posted: Tue Sep 07, 2021 5:41 am
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.

Re: arduino-style upload on custom boards possible?

Posted: Tue Sep 07, 2021 6:48 pm
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.

Re: arduino-style upload on custom boards possible?

Posted: Tue Sep 07, 2021 8:46 pm
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

Re: arduino-style upload on custom boards possible?

Posted: Fri Sep 10, 2021 7:30 am
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?

Re: arduino-style upload on custom boards possible?

Posted: Fri Sep 10, 2021 8:49 am
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.

Re: arduino-style upload on custom boards possible?

Posted: Thu Sep 16, 2021 9:40 am
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 :)