Stefan Tauner писал 02.06.2014 21:02:
On Mon, 02 Jun 2014 11:35:31 +0400 Andrew andrew@ncrmnt.org wrote:
- Programmer lock/unlock (Another accidentally started instance of
flashrom won't screw us up anymore)
chromiumos' flashrom has something like that implemented globally IIRC. It does not make too much sense to implement that for a single programmer... could two instances get access to the interface concurrently at all?
Okay, I'll drop it then. Thanks. For an stm32-based one it can be possible and makes sense to concurrently interact with several SPI chips connected to several hardware SPI interfaces e.g. stm32 has the guts to do so without any slowdowns, so I think of implementing this feature in the core code, yet leave it out for avr.
For STM32 it might also make more sense to export a /dev/ttyACMx for each SPI interface and use serprog protocol, but that needs testing. On avr vusb-based cdc_acm is damn slow for device->host transfers and doesn't work for some usb hosts. And I'm not sure it will be the fastest way on a stm32 either.
STM32 right now requires love, since ST's usb device stack is utter unusable crap and definitely has a race condition somewhere that causes enumeration problems. I'm playing with it for my pet antares project ( http://github.com/nekromant/antares ), but ST's code needs a lot of refactoring before it can be used at all (or even a rewrite from scratch).
I will be also making some new hardware based on STM32, that should provide a real speed boost, but since the actual chips are stuck somewhere between China and Russia this may take a while.
I have a discovery board laying around with an STM32F4... but have never plugged it in yet :/
Actually, you can use even an stm32f1 discovery as a flashrom programmer with stlink as the interface ;) The stlink will deliver ~25Kb/sec speeds. I've done this a while ago using this hack of mine: http://ncrmnt.org/wp/2013/05/06/stlink-as-a-serial-terminal/ when I had to urgently debrick a router. But it was utter hackery and I didn't bother to send in the patch to flashrom. ST also has COMPLETELY different usb device stacks for stm32f4x and stm32f1x with COMPLETELY different API. (And both look weird as hell.) For now I target stm32f1x.
My goal is to make a blazing fast programmer with BOM cost of under 5$ (and possibly parallel flash programming support as well).
You might be interested in http://qiprog.org/ The GSoC student that made it last year sadly joined the US armed forces, so don't expect too many answers regarding it from him. Peter Stuge was the mentor and is probably the one to ask if you have questions not answered by the website/code or last year's blog articles http://blogs.coreboot.org/blog/author/mrnuke/
Thanks for the links, I'll have a look. But I guess it will be faster for me to design it from scratch, I guess. Not a big deal, anyway.