Page 2 of 3

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 8:46 pm
by RogerClark
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.

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 8:49 pm
by mrburnette
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:

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 9:06 pm
by RogerClark
(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"

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 9:16 pm
by BlackBrix
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)

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 9:17 pm
by RogerClark
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....

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 10:19 pm
by BlackBrix
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

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 10:27 pm
by RogerClark
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.

Re: Hello from Northern Germany

Posted: Wed Dec 06, 2017 11:21 pm
by mrburnette
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

Re: Hello from Northern Germany

Posted: Thu Dec 07, 2017 8:15 am
by BlackBrix
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)

Re: Hello from Northern Germany

Posted: Thu Dec 07, 2017 8:58 am
by RogerClark
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