tinyriscv-openocd/contrib/loaders/flash
Paul Fertser fccc55225a mdr32fx: support for Milandr's MDR32Fx internal flash memory
This adds example config and flash driver for russian Cortex-M3
microcontroller model.

Run-time tested on MDR32F9Q2I evaluation board; the flash driver
should be compatible with MDR32F2x (Cortex-M0) too but I lack hardware
to test.

There're no status bits at all, the datasheets specifies some delays
for flash operations instead. All being in <100us range, they're hard
to violate with JTAG, I hope. There're also no flash identification
registers so the flash size and type has to be hardcoded into the
config.

The flashing is considerably complicated because the flash is split
into pages, and each page consists of 4 interleaved non-consecutive
"sectors" (on MDR32F9 only, MDR32F2 is single-sectored), so the
fastest way is to latch the page and sector address and then write
only the part that should go into the current page and current sector.

Performance testing results with adapter_khz 1000 and the chip running
on its default HSI 8MHz oscillator:

When working area is specified, a target helper algorithm is used:
wrote 131072 bytes from file testfile.bin in 3.698427s (34.609 KiB/s)

This can theoretically be sped up by ~1.4 times if the helper
algorithm is fed some kind of "loader instructions stream" to allow
sector-by-sector writing.

Pure JTAG implementation (when target memory area is not available)
flashes all the 128k memory in 49.5s.

Flashing "info" memory region is also implemented, but due to the
overlapping memory addresses (resulting in incorrect memory map
calculations for GDB) it can't be used at the same time, so OpenOCD
needs to be started this way: -c "set IMEMORY true" -f
target/mdr32f9q2i.cfg

It also can't be read/verified because it's not memory-mapped anywhere
ever, and OpenOCD NOR framework doesn't really allow to provide a
custom handler that would be used when verifying.

Change-Id: I80c0632da686d49856fdbf9e05d908846dd44316
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1532
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-08-07 21:02:51 +00:00
..
armv4_5_cfi_intel_8.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_intel_16.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_intel_32.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_span_8.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_span_16.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_span_16_dq7.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv4_5_cfi_span_32.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv7m_cfi_span_16.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
armv7m_cfi_span_16_dq7.s Support for SST 39VF3201C NOR flash 2013-07-01 08:39:36 +00:00
armv7m_io.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
efm32.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
lpcspifi_erase.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
lpcspifi_init.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
lpcspifi_write.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
mdr32fx.S mdr32fx: support for Milandr's MDR32Fx internal flash memory 2013-08-07 21:02:51 +00:00
pic32mx.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
stellaris.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
stm32f1x.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
stm32f2x.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
stm32lx.S update files to correct FSF address 2013-06-05 19:52:42 +00:00
str7x.s update files to correct FSF address 2013-06-05 19:52:42 +00:00
str9x.s update files to correct FSF address 2013-06-05 19:52:42 +00:00