Programming External SPI Flashes

From SEGGER - Support Wiki
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, please refer to the J-Flash SPI information page.

Setup:
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), too. For this setup, a RAMCode is required which handles the programming procedure. For some CPUs, the J-Link software already includes RAMCodes. For a list of all supported CPUs, please refer to the J-Link Supported Device List on our website. If no RAMCode is available for the used CPU, you can create the RAMCode on your own using the Open Flashloader. Alternatively you can get in contact with SEGGER directly via e-mail to check if there are any plans to create a custom RAMCode for your setup.

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

Required software:
J-Flash

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

Cons:
A RAMCode is required