folg / stm32flash

Automatically exported from code.google.com/p/stm32flash
0 stars 0 forks source link

Unable to program STM32L15xx series microcontrollers...plus a patch #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After my last "patch", stm32flash was able to detect the STM32L15xx 
microcontrollers (such as the STM32L152RB, found on the Discovery L eval 
board), but I could not get it to program them.

Looking into it, the problem was the erasing that takes place first. These 
chips use a newer(?) erase protocol called Extended Erase, which thankfully, 
can be detected on an ad hoc basis. This means we can switch to programming the 
erase (mass and page-by-page) using the two-byte based method they require.

Not that my chip supports mass erase, but it's not a big issue, since it is so 
quick- takes around about 2.1 seconds to erase the whole chip and upload a 
small program.

I don't own anything that uses the extended erase *and* supports mass erase, so 
that part of the code is untested, but should work.

This patch also includes the fixes I did for detecting this class/subfamily of 
microcontrollers, making sure it dies if I can't positively identify the chip, 
along with a typo fix. You may well not need this unless you downloaded the 
software a while ago- just delete those lines as required.

Original issue reported on code.google.com by mishg...@gmail.com on 10 Jul 2011 at 5:41

Attachments:

GoogleCodeExporter commented 9 years ago
Great, thanks for the patch but I cant apply it, please provide it as a 
universal diff (diff -u)

Original comment by ge...@spacevs.com on 4 Oct 2011 at 2:49

GoogleCodeExporter commented 9 years ago
Dont worry about re-formatting it, I manually applied it with a few changes 
such as removal of calls to exit and added checking on the return of the 
function

Original comment by ge...@spacevs.com on 4 Oct 2011 at 3:08