Hello from Northern Germany

User avatar
RogerClark
Posts: 7481
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Northern Germany

Post by RogerClark » Wed Dec 06, 2017 8:46 pm

Google seems to return a different set of results each day

I remember googling for "Maple bootloader F4", one day and finding some chinese site with that on it, then a few weeks later I had another look, but it didnt appear in the search, and I had to look on the forum for where I'd posted the address

Same the the mass storage bootloader, both Rick and I have Googled for it, but neither of us found that one.

User avatar
mrburnette
Posts: 1885
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Hello from Northern Germany

Post by mrburnette » Wed Dec 06, 2017 8:49 pm

Same the the mass storage bootloader, both Rick and I have Googled for it, but neither of us found that one.
I feel rather "special" ... but, I will try and not let it go to my head :lol:

User avatar
RogerClark
Posts: 7481
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Northern Germany

Post by RogerClark » Wed Dec 06, 2017 9:06 pm

(LOL)

Well I'm normally the GoogleMeister around here, but I bow down before you ;-)


I think the phrasing of the search string is far more important than google make out.

Even the order of the words is important, and can yield drastically different results

I tend to go for minimum number of works which describes what I'm looking for. But perhaps I should be saying "Google, find me a mass storage bootloader for the STM32 family of MCU's"

BlackBrix
Posts: 6
Joined: Wed Dec 06, 2017 7:49 am

Re: Hello from Northern Germany

Post by BlackBrix » Wed Dec 06, 2017 9:16 pm

This is IMHO not a bootloader,
but only a demonstration, how a (already booted) stm32 can behave like a flash drive ...
(but I'm not an expert at all)
Last edited by BlackBrix on Wed Dec 06, 2017 9:26 pm, edited 1 time in total.

User avatar
RogerClark
Posts: 7481
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Northern Germany

Post by RogerClark » Wed Dec 06, 2017 9:17 pm

BlackBrix wrote:
Wed Dec 06, 2017 9:16 pm
This is IMHO not a bootloader,
but only a demonstration, how a (already booted) stm32 can behave like a flash drive ...
OK.

Plenty of examples of that....

BlackBrix
Posts: 6
Joined: Wed Dec 06, 2017 7:49 am

Re: Hello from Northern Germany

Post by BlackBrix » Wed Dec 06, 2017 10:19 pm

when using google,
I found this for a cortex M3 but it's for an LPC1768,
I do not know if this is in some way applicable for STM32
or if this can be a starting point for an expert to create a USB MSD Bootloader for a STM32 ... ?

description: --> http://binaryupdates.com/usb-secondary- ... cortex-m3/
sourcefiles:
--> https://sourceforge.net/projects/cortex ... Landtiger/
--> https://storage.googleapis.com/google-c ... loader.rar
Last edited by BlackBrix on Wed Dec 06, 2017 10:36 pm, edited 1 time in total.

User avatar
RogerClark
Posts: 7481
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Northern Germany

Post by RogerClark » Wed Dec 06, 2017 10:27 pm

Its probably easier to start from the a working USB mass storage system on STM32 than modify it to suit your purpose, than trying to port loads of USB code from another processor.


If it was me, I'd take this code

https://github.com/avislab/STM32F103/tr ... Bootloader

And modify it, so that it faked being an empty formatted usb drive, and then took the data written to it, and put it straight into the flash memory where the application runs from

The bootloaded I linked to does not quite do that

See

http://www.avislab.com/blog/stm32-bootloader_ru/

Because it expects the data to be sent via a program like DD or a Windows disk imager, and also seems to store the data in an intermediate location before finally copying it to the application location.

I don't know why he did those 2 things.

Hacking the code to fake the drive being already formatted, even though it does not actually have any data to read, would be the first step, and then parsing the FAT commands to separate file data from overhead would be the next step

However, I don't know if systems like windows read back the data they put on a drive, in which case you'd have to fake that as well.

User avatar
mrburnette
Posts: 1885
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Hello from Northern Germany

Post by mrburnette » Wed Dec 06, 2017 11:21 pm

BlackBrix wrote:
Wed Dec 06, 2017 9:16 pm
This is IMHO not a bootloader, but only a demonstration, how a (already booted) stm32 can behave like a flash drive ...
(but I'm not an expert at all)
Oh, well... win a few, lose more. Regrets it is not what you are looking for ...
I rarely read more of a reference link than necessary to ensure the search results are not some ad site.
I read,
The STM32 USBMem example program shows how to configure and use the USB peripheral of STMicroelectronics STM32F103xx microcontroller.
and
After verifying the installation of the Mass Storage Device, open Windows File Explorer and move files to and from the Mass Storage Device.
and so I posted the link as potentially interesting.


Ray

BlackBrix
Posts: 6
Joined: Wed Dec 06, 2017 7:49 am

Re: Hello from Northern Germany

Post by BlackBrix » Thu Dec 07, 2017 8:15 am

The bootloaded I linked to does not quite do that
[..]
I don't know why he did those 2 things.
yea, I also do not like this approach of a USB-MSD-Bootloader...

OT: this bootloader* I use for my Atmel Cortex M0 devices, shows IMHO how to do it the right way:
--> https://github.com/mattairtech/SAMD-MSD-Bootloader
it somehow "presents" the whole remaining flash as a kind of FAT Drive to the Host-PC... ("Virtualized FAT12 filesystem implementation")
[no intermediate memory space (cache) is needed]

*(it was largely inspired from the well known USB-MSD-bootloaders of the LUFA-USB-Framework --> https://github.com/abcminiuser/lufa/tre ... assStorage
that were made for AVR / ATMEGA MCUs)

User avatar
RogerClark
Posts: 7481
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Northern Germany

Post by RogerClark » Thu Dec 07, 2017 8:58 am

Actually, I happened to have a meeting with someone today, who said that one of their team is going to write a USB mass storage bootloader for a product which will be launched some time next year

But I didn't have any definite dates, so I'd recommend you write your own

Post Reply