Firmware update via usb?

It's all about the code!
Post Reply
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Firmware update via usb?

Post 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.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Firmware update via usb?

Post 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 :(
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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.
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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.
User avatar
andreika
donator
donator
Posts: 461
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: Firmware update via usb?

Post by andreika »

I'll post the update for the bootloader code soon...
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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?
User avatar
andreika
donator
donator
Posts: 461
Joined: Mon Feb 13, 2017 2:35 pm
Location: Kiev

Re: Firmware update via usb?

Post 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.
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post by 960 »

Can we make a function that jumps to DFU mode triggered by a software-button?
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Firmware update via usb?

Post by AndreyB »

Is https://github.com/PX4/Bootloader showing that a great bootloader with USB is a project by itself?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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.
ZHoob2004
contributor
contributor
Posts: 153
Joined: Sun Apr 03, 2016 7:11 pm
Location: Tucson, AZ

Re: Firmware update via usb?

Post 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.
960
contributor
contributor
Posts: 336
Joined: Mon Dec 10, 2018 1:22 am
Location: Norway

Re: Firmware update via usb?

Post 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?
Post Reply