On Sun, Aug 19, 2018 at 11:17 AM, perillamint <perillam...@quendi.moe>
wrote:

> Hello, everyone.
>
> I'm trying to add support for NuMicro M45x series. Fortunately, there are
> already support for its M0 family chip.
>
> I looked its code and found it has some addresses of registers. However,
> M0
> series and M4 series uses different address to access flash peripheral.
>
> Should I hack numicro.c to support both address range or should I put code
> for
> M4 in seperate file (like numicro-m45x.c)?
>
>
If the flash controllers are compatible, just with different base
addresses, then most definitively there shouldn't be two separate flash
drivers. Other drivers already handle differences in addresses and even
other things like layout details using the same flash driver and
autodetecting the parameters during probe. Look around in the existing
drivers to see how it can be done.

Use a NuMicro-specific ID register at a known address to detect the actual
chip, if such is available. Do not use the IDCODE/DPIDR from the JTAG/SWD
layer.

/Andreas
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to