J-Link drag and drop programming

From SEGGER Wiki
Revision as of 09:29, 15 November 2022 by Leon (talk | contribs) (macOS specifics)
Jump to: navigation, search

Drag-And-Drop is an optional J-Link OB intuitive programming feature. It allows programming of your target MCU in a very simple way. J-Link OB with Drag-And-Drop capability appears both as a debug probe and as a flash drive on the user's computer. With the flash drive option it is now as simple as dragging and dropping a file (a Motorola S-record, an Intel Hex, or a plain binary) onto the J-Link drive. There is no need to install application software. Anyone that can drag and drop a file to a USB memory stick can now program the target on an evaluation board.

macOS specifics

Download of large data files

Data files that are 1 MB (1024 KB) or larger in size cannot be guaranteed to be programmed correctly.
Apple macOS has a scheduler that splits data files writes to the drag & drop drive to 1 MB chunks that are delegated to multiple threads.
This may lead to data being written to the drive non-sequentially because each 1 MB job of each thread may be interrupted by another thread at any time.
Due to limited RAM in J-Link (OB), the drag & drop functionality relies on data for a single file being written sequentially by the host operating system.

Programming of such data files may fail silently (not all data be programmed. Programming stopped after 128 KB without error / FAIL.txt etc.).
The silent fail may happen due to various "end of file" detection mechanisms J-Link must implement to handle the different OSes (Windows, Linux, macOS) as well as to handle *.bin files.
Under various circumstances, an out-of-order write to the drag & drop USB drive indicates the end of a file, rather than the macOS specific multi-threaded download and therefore should not cause a FAIL.txt.

As a workaround, the most recent release version of the J-Link software package for macOS can be downloaded and installed.
Then the loadfile command of J-Link Commander can be used. Alternatively, J-Flash Lite can be used to download a data file to the target.