Page 1 of 1

Firmware update via usb?

Posted: Thu Mar 21, 2019 8:22 pm
by 960
I am looking for a way to upload firmware via usb.

Are there any way to do this yet?

I know about DFU, but need a software solution only.

One way could be two usb ports, one of them with VBUS to Boot0, but it's not a ideal way.

Re: Firmware update via usb?

Posted: Thu Mar 21, 2019 8:30 pm
by AndreyB
@ has contributed https://github.com/rusefi/rusefi/tree/master/firmware/bootloader which could be relevant here

Unfortunately I never had time to play with this and while we have the code, it's not enabled in the default compilation configuration. Also I have no idea if it's usable with USB or only serial. Also I do not know if it compiles currently :(

We have too few software developers and too many ideas :( At the moment this is not on top of my priority list :(

Re: Firmware update via usb?

Posted: Thu Mar 21, 2019 8:40 pm
by 960
I saw that in the code, but did not understand completly how it works.

I could not find the STM32F407xG_CCM_bootloader.ld file either.

Re: Firmware update via usb?

Posted: Fri Mar 22, 2019 2:18 am
by 960
I dont think it's used.

In the bootloader makefile it points to some files/folders that does not exist:

LDSCRIPT= $(CONFIG)/stm32f4ems/STM32F407xG_CCM.ld


CHIBIOS = $(PROJECT_DIR)/ChibiOS3


If there are no software options, I think maybe adding a ST-Link are the closest I get.

Re: Firmware update via usb?

Posted: Fri Mar 22, 2019 2:49 pm
by andreika
I'll post the update for the bootloader code soon...

Re: Firmware update via usb?

Posted: Fri Mar 22, 2019 5:37 pm
by 960
andreika wrote:
Fri Mar 22, 2019 2:49 pm
I'll post the update for the bootloader code soon...
Would be great!!

Can you make a config for F7?

Does it work from Tunerstudio with a software interrupt?

OTG port?

Re: Firmware update via usb?

Posted: Fri Mar 22, 2019 6:57 pm
by andreika
960 wrote:
Fri Mar 22, 2019 5:37 pm
Would be great!!
Can you make a config for F7?
Does it work from Tunerstudio with a software interrupt?
The bootloader is updated and merged - please checkout and try (thank you @Russian!).
I haven't tried it on F7, but you can use Prometheus configs as a starting point and change them a little... I added some portability to the code so it might even work for F7 if you set the compile options correctly.

Re: Firmware update via usb?

Posted: Sat Mar 23, 2019 2:28 pm
by 960
Can we make a function that jumps to DFU mode triggered by a software-button?

Re: Firmware update via usb?

Posted: Sat Mar 23, 2019 4:41 pm
by 960
Also, I think I have messed up a F4 somehow.

Everything works fine, exept DFU.
It keeps trying to enumerate over and over when I keep Boot0 high.

How can I find out what's wrong?

Re: Firmware update via usb?

Posted: Mon Mar 25, 2019 2:58 am
by AndreyB
Is https://github.com/PX4/Bootloader showing that a great bootloader with USB is a project by itself?

Re: Firmware update via usb?

Posted: Mon Mar 25, 2019 7:28 am
by 960
russian wrote:
Mon Mar 25, 2019 2:58 am
Is https://github.com/PX4/Bootloader showing that a great bootloader with USB is a project by itself?
Would be great if it can be used. I have no idea how this copyright works.

I have tested it on a F4, and can confirm it works flawless from their software.

All at native USB.

Re: Firmware update via usb?

Posted: Mon Mar 25, 2019 6:22 pm
by ZHoob2004
960 wrote:
Mon Mar 25, 2019 7:28 am
russian wrote:
Mon Mar 25, 2019 2:58 am
Is https://github.com/PX4/Bootloader showing that a great bootloader with USB is a project by itself?
Would be great if it can be used. I have no idea how this copyright works.

I have tested it on a F4, and can confirm it works flawless from their software.

All at native USB.
I'm no lawyer, but upon skimming their license declaration it looks like we'd be fine to use it as long as we 1: give credit, 2: keep the same license on the bootloader/any changes we make to it, and 3: include their copyright/license notice. We could probably just fork their repo and use it as-is and be safe, or even reference their repo directly as a submodule or however that works.

Re: Firmware update via usb?

Posted: Wed Mar 27, 2019 7:43 am
by 960
I think they would be okay with it.

We probably need to change some of the names, VID, PID's etc. but most work are already done.

No need to reinvent the wheel :-)

I think I read it somewhere they are moving on to use DFU instead.

That makes more sense for a drone, but for a ECU that often are a little work to remove their bootloader are needed.

Maybe russian could contact them?