Programming External SPI Flashes

From SEGGER Wiki
Revision as of 10:41, 28 March 2018 by Erik (talk | contribs) (Created page with "The popularity of external SPI flashes has grown and becomes more and more attractive on custom hardware. They are used as additional data memory or even replace the internal...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The popularity of external SPI flashes has grown and becomes more and more attractive on custom hardware. They are used as additional data memory or even replace the internal flash. The J-Link software supports programming most common SPI / QSPI flashes in two different ways. Which way is the right one for you depends on your requirements or your hardware setup. Both have pros and cons.

Direct Mode

In Direct Mode, the flash is programmed directly via J-Link using the SPI protocol, no CPU / MCU in between. The J-Link is connected directly to the SPI flash and communicates with the SPI flash itself. Further information regarding this as well as the interface / protocol description are available here: https://www.segger.com/products/debug-probes/j-link/tools/j-flash-spi/

Diagram:
J-Link <--> SPI flash

Required software:
J-Flash SPI

Pros:
No RAMCode is required.

Cons:
Additional adapter / interface is required on the hardware

Indirect Mode

In Indirect Mode, the flash is programmed indirectly through the CPU. The J-Link is connected to the debug interface of the CPU and the flash is connected to the CPU (e.g. through an SPI / QSPI peripheral controller). For this setup, a RAMCode is required which handles the programming procedure.


Diagram:
J-Link <--> CPU <--> SPI flash

Required software:
J-Flash

Pros:
No additional adapter / interface is required on the hardware

Cons:
A RAMCode is required.