2 minutes
Flashing/Programming the DA16200 with J-Link
Introduction
Whether you’re developing a custom application or using the AT Command Set firmware image, it is necessary to flash/program it inside the either the DA16200 SoC or the DA16200MOD module.
The stadard way to do this is through the built-in serial bootloader. And to do that you need to follow the steps in section 4.5 Programming Firmware Images of the document DA16200 DA16600 FreeRTOS Getting Started Guide. It is important that you connect the COM Port the debug interface (UART0) and not the ATCMD interface (UART1).
However, if you want to flash/program those same images through the J-Link interface, there are a few steps you need to do that are described below.
Requirements
- Download and install the J-Link software
- Download the
DA16200 DA16600 FreeRTOS SDKin the Software Downloads section of the DA16200 or DA16200MOD page. - Have Python Installed.
- Have the
BOOTandRTOSimages you want to flash.- This example uses the provided images at the
DA16200 DA16600 FreeRTOS SDK Imagepackage, also available in the in the Software Downloads section of the DA16200 or DA16200MOD page.
- This example uses the provided images at the
Pre-work before flashing/programming
Get the images
- Go to inside the
DA16200 DA16600 FreeRTOS SDK Imagepackage, in theDA16200_IMG_FreeRTOS_ATCMD_UART1_EVK_v3.2.8.1_4MBfolder, and copy theDA16200_FBOOT-GEN01-01-c7f4c6cc22_W25Q32JW.imgandDA16200_FRTOS-GEN01-01-2aa77df370-006629.imgimages to\DA16200_DA16600_SDK_FreeRTOS_v3.2.8.1\utility\programming-scripts.
Add the DA16200 device inside J-Link’s device list
- Go to the J-Link folder (i.e.:
C:\Program Files (x86)\SEGGER\JLink), and add the followingXMLcode to end of theJLinkDevices.xmlfile, before the closing</DataBase>tag:
<!-- -->
<!-- Dialog Semiconductor -->
<!-- -->
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200_W25Q32JW" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x80000" WorkRAMSize="0x00040000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x100000" MaxSize="0x400000" Loader="Devices/Dialog/DA16200_W25Q32JW.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.SeggerES.4MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x400000" Loader="Devices/Dialog/ES_DA16200_4MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.SeggerES.2MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x200000" Loader="Devices/Dialog/ES_DA16200_2MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.eclipse.4MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x400000" Loader="Devices/Dialog/DA16200_4MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
<Device>
<ChipInfo Vendor="Dialog Semiconductor" Name="DA16200.eclipse.2MB" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x83000" WorkRAMSize="0x00020000" />
<FlashBankInfo Name="QSPI Flash" BaseAddr="0x10000000" MaxSize="0x200000" Loader="Devices/Dialog/DA16200_2MB.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" />
</Device>
- Go to
\DA16200_DA16600_SDK_FreeRTOS_v3.2.8.1\utility\j-link\scripts\flashloader\Devicesand copy theDialogfolder with the flashloader files to theDevicesfolder inside the J-Link folder.
Procedure
More details at \DA16200_DA16600_SDK_FreeRTOS_v3.2.8.1\utility\programming-scripts\ReadMe.txt):
- Make one combined binary with the images
python mkimage.py -o output.bin .\DA16200_FBOOT-GEN01-01-c7f4c6cc22_W25Q32JW.img 0x0 .\DA16200_FRTOS-GEN01-01-2aa77df370-006629.img 0x23000
- Erase chip’s memory:
python programmer.py -p "JLINK_PATH" chip_erase
- Flash/Program the combined binary file:
python programmer.py -p "JLINK_PATH" write_bin output.bin
References: