Programming external target xDot with Segger Programmer

The following is a procedure to use a Segger J-Link programmer to program firmware into external target xDots (which might be mounted on a custom PCB board, or the MTAC-XDOT). 
For more details about Programming External Targets and the recommended circuitry, please see the "Chapter13 – Mounting xDots and Programming External Targets" section in the MTXDOT Developer Guide:
https://www.multitech.com/documents/publications/manuals/s000645.pdf


Segger Programming Setup and Procedure:


Download the J-Flash Program from the Segger website:
https://www.segger.com/products/debug-probes/j-link/tools/j-flash/about-j-flash/

1. Install the J-Flash program. 
Note: Segger J-Flash v6.52 was used for this testing.

2. Plug in J-Link programmer to USB on PC and wait for the drivers to install.

3. Run the J-Flash program.

4. Select or Create a project.
When running the J-Flash program, you will be prompted to "Open recent program" or "Create a new project". If this is your first time running J-Flash select "Create New Project" and click "Start J-Flash".

Select Target Device "STM32L151CC" and click OK.
Note: Select the STM32L151CC without the "allow opt. bytes" option.

Leave "Target Interface" as SWD and "Speed (Khz)" as 4000 and click OK again.


4. Connect to Target. 
Click on Target -> Connect and verify that it successfully connects to the xDot.


Programming xDot

5. Open Data File.
Click File -> Open Data File and browse to xDot bin file you wish to program the xDot with.
At the Enter start address menu, leave start address at 0x8000000 and click OK.
Note: If you have any Data Files already open, please close these first before opening a new Data File.

6. Program xDot with "Production Programming" option.
To program the xDot, verify that it is still connected, and click Target -> Production Programming F7. This should erase the area that will be programmed and then program the xDot with the bin file.
Verify that the programming was successful.


*** Important Note: Don't Erase Chip on the xDot before programming! *** 
Erasing the entire xDot flash will wipe out protected locations in the memory that store the Device EUI and Default Frequency settings, and they will require a special firmware to recover. If this happens, please make a support case at support.multitech.com for the recovery procedure.
Note that the "Production Programming" option will only erase the area of flash that the bin file is being programmed to and won't wipe out the protected area.