On 01/26/2012 02:15 AM, Luke wrote: > >> Auto-probing the parameters from the device would be great it it can be >> done, but specifying them in the config file would also be OK (and >> probably easier to implement). > > From what I can tell, these devices don't make use of the ARM Private > Peripheral Bus, in particular the DBGMCU_IDCODE @ 0xE0042000 that is > used in the other STM32 devices to distinguish the different devices > and hardware revisions. Also note that there have been silicon bugs in such registers on other CPUs, so a non-autoprobing method may be required anyway in the future.
> If auto probing isn't an option (which looks so far to be the case), I > can see 2 ways to handle the fact that there are nearly identical > devices with different memory amounts: > > 1) Create a driver file for each device (something like em351.c, > stm32w64.c, stm32w128.c, stm32w192.c, stm32w256.c) and remove all > common code from those files and put it into a driver support file. > Then users of OpenOCD would specify exactly which chip they have, and > the appropriate amount of flash memory would known. > > 2) Create a new single driver, perhaps called ember_stm32w.c, which > contains all the code, and have the user pass the flash memory size to > it somehow through the OpenOCD configuration files. I'm not sure how > the driver would get this information. > > Option 1 would probably be the simplest to implement, but it might > result in more duplicated code between the driver files. I am leaning > towards that at first since I don't know how to get info from a .cfg > file to the driver. But if this is super easy, maybe people could > point me to an example of it and I could use the second approach. Look at the CFI flash driver - parameters from the flash bank configuration in the .cfg file are passed to the driver. I think this is definitely the way to go - option 1) looks like a big hack. If you figure out the configuration method, option 2) is probably easier to implement in the long run, since it requires far less files to create/submit. cu Michael ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
