> You may either
> a) modify em357.c to support all chips (which would mean renaming it
> afterwards might be in order)
> b) move the common code from em357.c to some separate file, leaving
> em357.c a mostly empty wrapper that calls the common code with the right
> parameters, and add stm32w.c which also calls the common code with
> flexible parameters.

Ok, this make sense.  It seems like keeping the em357.c in place make
sense and perhaps (or not) slowly deprecating it if it turns out that
a more generic (i.e., covers all stm32w and Ember variations) is
possible.

> 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.

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.

~Luke

------------------------------------------------------------------------------
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

Reply via email to