Custom Command Sequences; Init / Exit Steps; Example - Segger J-Link User Manual

Hide thumbs Also See for J-Link:
Table of Contents

Advertisement

265
11.7

Custom Command Sequences

J-Flash SPI supports sending custom command sequences, which may be different for dif-
ferent SPI flashes (e.g. program OTP, program security register, etc...), via the SPI inter-
face. Due to the generic syntax, this feature can be used to implement any kind of required
command sequence. The sequence is stored in the J-Flash SPI project file (*.jflash) and
therefore it can be included in automated production environments without any problems
and be used with the command line version of J-Flash SPI as well.
The custom command sequence can be configured in the Setup tab of the J-Flash project
settings as part of the Init / Exit Steps which allow to enter custom sequences using
a pre-defined list of operations. The following list shows all valid commands which can be
used:
Command
Delay
Activate CS
Deactivate CS
Write data
Var Read Data
Var Write Data
Var AND
Var OR
Var XOR
11.7.1

Init / Exit steps

The init sequence will be performed as part of the connect sequence, for example to disable
security, while the exit sequence will be executed after programming, for example to enable
the security in order to secure the SPI flash.
11.7.2

Example

The example below demonstrates how to use the custom command sequence feature to
implement a read-modify-write security register on the Winbond W25Q128FVSIG SPI flash
using the init steps. To make sure that the output of the example is exactly the same, the
sample erases the security register to have defined values.
Step #0 to Step#2: Set Write Enable
Step #3 to Step#6: Erase security register to have a defined values (0xFF)
Step #7 to Step#11: Read 16 byte security register into Var buffer
Step #12 to Step#19: Modify the data in the Var buffer
Step #20 to Step#22: Set Write Enable
Step #23 to Step#27: Program security register with values from Var buffer
Step #28 to Step#32: Read back security register to verify successful programming
J-Link / J-Trace (UM08001)
CHAPTER 11
Value0
Value1
Delay in ms
ByteStream
NumByte(s)
separated by
commas (hex)
NumByte(s)
OffInVarBuffer
max. 16 bytes
NumByte(s)
OffInVarBuffer
max. 16 bytes
ByteIndex
Value (hex)
ByteIndex
Value (hex)
ByteIndex
Value (hex)
Custom Command Sequences
Description
Waits a given time
Sets the CS signal low
Sets the CS signal high
Sends a number of bytes via the SPI
interface to the SPI. (e.g.: 9F,13,CA)
Reads the specified number of bytes
via the SPI interface into the Var-
Buffer which is 16 bytes in size.
Writes the specified number of bytes
via the SPI interface from the Var-
Buffer (filled via Var Read).
Logical AND combination of the inter-
nal var buffer at the specified index
with a given value.
Logical OR combination of the internal
var buffer at the specified index with a
given value.
Logical XOR combination of the inter-
nal var buffer at the specified index
with a given value.
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG

Advertisement

Table of Contents

Troubleshooting

loading
Need help?

Need help?

Do you have a question about the J-Link and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

J-trace

Table of Contents

Save PDF