firmware download and debug user manual - phychips.com · red fdm 2016-05-31 firmware download and...

23
Rev.1.0.2 2016-05-31 RED FDM 2016-05-31 Firmware Download and Debug User Manual

Upload: dongoc

Post on 27-Jul-2018

267 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

Rev.1.0.2 2016-05-31

RED FDM 2016-05-31

Firmware Download and Debug

User Manual

Page 2: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

2 of 23

Firmware download & debug User Manual – RED FDM

Contents 1 Revision History ................................................................................................................................ 3 2 Firmware Development Process ...................................................................................................... 4 2.1 Development Tool (KEIL MDK-ARM) .................................................................................................. 4 2.2 Firmware Programming ....................................................................................................................... 4 2.3 Debugging ........................................................................................................................................... 5 2.4 Alternative solution .............................................................................................................................. 5 3 Flash Download ................................................................................................................................. 5 3.1 ULINK2 ................................................................................................................................................ 5 3.2 CoLinkEx ........................................................................................................................................... 10 3.3 IAP – UART ....................................................................................................................................... 19 4 Debugging ........................................................................................................................................ 20 4.1 Configuration for ULINK2 .................................................................................................................. 20 4.2 Configuration for CoLinkEx ............................................................................................................... 21 4.3 Debugging ......................................................................................................................................... 21 5 Address Information ....................................................................................................................... 23

Page 3: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

3 of 23

Firmware download & debug User Manual – RED FDM

1 Revision History

Version Date Description

1.0.0 2015.03.05 Initial Release (based on PR9200 APU)

1.0.1 2015.06.08 Modified some image

1.0.2 2016.05.31 Modified section 3.3 IAP-UART

Page 4: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

4 of 23

Firmware download & debug User Manual – RED FDM

2 Firmware Development Process Firmware development Process is shown at Figure 1. The suitable tools and devices are required to each development state such as compile, download, debugging system.

COMPILE DOWNLOAD DEBUGGIN PLANNING

KEIL MDK-ARM

ULINK2/CoLinkExIAP(UART/SPI/I2C)ISP(UART/SPI)

ULINK2/CoLinkEx

Figure 1 firmware development process

2.1 Development Tool (KEIL MDK-ARM)

The MDK-ARM is embedded development tool for Cortex-M microcontroller. MDK-ARM includes ARM C/C++ Compilation Tool chain, µVision4 IDE, debugger, and simulation environment. Phychips does not support KEIL MDK-ARM. For more details, please refer to http://www.keil.com

2.2 Firmware Programming PR9200 support two ways to firmware download. One is method using ULINK2 and CoLinkEx debug adapter through SWD (Serial Wire Debug). The other is method using IAP (In-Application Programming). IAP can use three type of interface, UART, SPI and I2C without any hardware debugger.

Flash Programming

with Hardware

without Hardware

ULINK2 / CoLinkEx

- Interface : SWD(Serial Wire Debug)

ISP

- Interface : UART / SPI

IAP

- Interface : UART / SPI / I2C

Figure 2 Methods to firmware programming

Page 5: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

5 of 23

Firmware download & debug User Manual – RED FDM

2.3 Debugging Firmware debugging uses ULINK2 and CoLinkEx. Using two debuggers with Keil µVision IDE can debug embedded application of PR9200 and trace firmware.

Debugging Hardware Debugger

ULINK2/CoLinkEx (with Keil MDK-ARM)- Interface : SWD(Serial Wire Debug)

Figure 3

2.4 Alternative solution PR9200 supports alternative solution besides ULINK2 or CoLinkEx + KEIL MDK-ARM.

IDE Debugging Adopter Port Note

KEIL MDK-ARM J-LINK SWD

CooCox CoIDE CoLinkEx SWD

Refer to related CooCox solution page, www.coocox.org.

3 Flash Download This section describe four method for flash download, ULINK2, CoLinkEx, ISP and IAP

3.1 ULINK2 ULINKS2 debug adapter connects your PC’s USB port to SWD (Serial Wire Debug) of PR9200 and allows you

to programming and debug embedded programs on PR9200. In order to download firmware, Keil µVision IDE is required. After connecting ULINK2 to PR9200, follow next step to success to flash download using ULINK2.

USB DK moduleSWD

KEIL MDK-ARM(in PC)

Figure 4

3.1.1 Flash Download Configuration on KEIL µVision IDE

1. Select or Flash Configure Flash Tools... of pull-down menu.

Figure 5

Page 6: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

6 of 23

Firmware download & debug User Manual – RED FDM

2. At Utilities tab, select command “Use Target Device for Flash Programming” and choose debugger “ULINK Cortex Debugger”. And open Cortex-M Target Driver setup to click “settings”

Figure 6

3. Set “Download Function” as follow

Figure 7

Page 7: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

7 of 23

Firmware download & debug User Manual – RED FDM

4. Click “Add” button and select “PR9200_EFLASH_63KB.FLM”.

Figure 8

[NOTICE] First of all, copy “PR9200_EFLASH_63KB.FLM” to directory KEIL_INSTALL\ARM\FLASH. Flash algorithm file is included in [DK_DATA]\Firmware\Flash_algorithm/KEIL_MDK

5. Make sure that programming algorithm is added.

Figure 9

6. At Debug tab, set driver setup as below Figure 10.

Page 8: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

8 of 23

Firmware download & debug User Manual – RED FDM

Figure 10

3.1.2 Flash Erase

1. Select Flash Erase at main windows.

Figure 11

2. Check chip erase result at Build output window.

Figure 12

3.1.3 Flash Download

1. Select or Flash Download to Flash

Figure 13

2. Check download result from output window.

Page 9: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

9 of 23

Firmware download & debug User Manual – RED FDM

Figure 14

Page 10: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

10 of 23

Firmware download & debug User Manual – RED FDM

3.2 CoLinkEx CooCox CoLinkEx is a hardware debugging adapter which supports SW debugging and supports Cortex-M0 devices, it supports debugging in CooCox software and Keil Realview MDK. This debugger uses SWD (Serial Wire Debug) interface

Figure 15 CoLinkEx and connection

3.2.1 Keil Realview MDK 3.2.1.1 Modify CoMDKPlugin(v1.4.1) CoMDKPlugin is a software that supports debugging ARM Cortex-M chips in Keil Realview MDK. First of all, install CoMDKPlugin.(Download: http://www.coocox.org/book/coocox/stop-maintanance-product/MDKPlugin/MDKPlugin ) The device information provided by CoMDKPlugin is not compatible for PR9200. For loading flash erase/program algorithm for PR9200, modify the plugin file as following. [KEIL Home]\ARM\BIN\CooCox\devices\Cortex-M0.xml [notice] Before you use CooCox CoLinkEx, you need to update ColinkEx firmware and install CoLinkEx USB Deriver first. (Download: http://www.coocox.org/wiki/coocox/CoLinkEx/CoLinkEx-Support#Software ) 3.2.1.2 Flash Download Configuration on KEIL µVision IDE

1. Select or Flash Configure Flash Tools... of pull-down menu.

Figure 16

2. At Debug tab, select “CooCox Debugger”.

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <Device>

<Name>Cortex-M0</Name> <Vendor>ARM</Vendor> <DebugSetting>$TOOLKIT_CONFIG_DIR$\debugger\cortex-m0.xml</DebugSetting> <Flash>

<Block addr="0x00000000" execute="true" name="Embedded Flash" read="true" size="0x10000" write="false"/> </Flash> <Ram>

<Block addr="0x10004000" execute="true" name="Embedded SRAM" read="true" size="0x00004000" write="true"/> </Ram> <FlashLoader>

<loader select="true">$TOOLKIT_FLASH_DIR$\Unspecified</loader> </FlashLoader>

</Device>

Page 11: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

11 of 23

Firmware download & debug User Manual – RED FDM

3. At Utilities tab, select command “Use Target Device for Flash Programming” and choose debugger “CooCox Debugger”. And open Cortex-M Target Driver setup to click “settings”

Figure 17

4. Set “Download Function” as follow

Page 12: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

12 of 23

Firmware download & debug User Manual – RED FDM

Figure 18

Page 13: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

13 of 23

Firmware download & debug User Manual – RED FDM

5. Click “Add” button and select “PR9200_EFLASH_63KB.FLM”.

Figure 19

[NOTICE] First of all, copy “PR9200_EFLASH_63KB.FLM” to directory KEIL_INSTALL/ARM/FLASH. Flash algorithm file is included in [DK_DATA]\Firmware\Flash_algorithm/KEIL_MDK

6. Make sure that programming algorithm is added.

Figure 20

7. At Debug tab, set driver setup as below Figure 10

Page 14: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

14 of 23

Firmware download & debug User Manual – RED FDM

Figure 21

3.2.1.3 Flash Erase

1. Select Flash Erase at main windows.

Figure 22

2. Check chip erase result at Build output window.

Figure 23

3.2.1.4 Flash Download

1. Select or Flash Download to Flash

Figure 24

2. Check download result from output window.

Page 15: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

15 of 23

Firmware download & debug User Manual – RED FDM

Figure 25

3.2.2 CoFlash CooCox CoFlash is a stand-alone Cortex MCU Flash Programming software for PCs. First of all, install CoFlash.(Download: http://www.coocox.org/software.html ). Then copy the ‘PR9200.xml’ file to [COFLASH_INSTALL]\config\devices\Phychips\ (PR9200.xml file location : [DK_DATA]\Firmware\Device_configuration\PR9200.xml)

3.2.2.1 Flash Download Configuration on CoFlash

1. At Config tab, set Device and USB Adapter Setup as below Figure 26

Figure 26

2. Click “Add” button and select “PR9200_EFLASH_63KB.FLM”.

Page 16: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

16 of 23

Firmware download & debug User Manual – RED FDM

Figure 27

[NOTICE] First of all, copy “PR9200_EFLASH_63KB.elf” to directory COFLASH_INSTALL\flash. Flash algorithm file is included in [DK_DATA]\Firmware\Flash_algorithm/CoIDE

3. Make sure that programming algorithm is added.

Figure 28

3.2.2.2 Flash Erase

1. Select Erase in Operate

Page 17: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

17 of 23

Firmware download & debug User Manual – RED FDM

3.2.2.3 Flash Download 1. Select firmware binary file (*.bin)

2. Select Program in Operate

Page 18: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

18 of 23

Firmware download & debug User Manual – RED FDM

Page 19: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

19 of 23

Firmware download & debug User Manual – RED FDM

3.3 IAP – UART PR9200DK support IAP (In-application Programming) using UART. UART IAP help user download flash program without any extra hardware like ULINK2. UART IAP is similar to ISP, but help user download flash program without any extra hardware like ULINK2 and mode transition. User does not need any configuration for IAP. [notice] PR9200DK’s GUI does not support SPI IAP. If you want IAP using SPI, refer to Protocol manual of DK.

3.3.1 UART Download Connect PC’s USB to PR9200DK and execute RED utility. Open “download” window and select firmware binary file (*.hex) you want. Click “update” button and flash downloading is executed.

Figure 29

After download is completed, reset PR9200 or module. [Notice] If the firmware is abnormally deleted, IAP download do not work properly. In this case, ISP mode can help you download as well as SWD. In order to enter this mode, set PR9200 pin as below table

ISP_MODEb P17 P16 P15

Low Low Low Low

Table

Restart or reset PR9200 after this set is changed. And execute “download” as IAP download After download is completed, change ISP mode to normal mode as set ISP_MODEb to high. Don’t forget resetting PR9200. When PR9200 operation mode is changed Normal mode to ISP mode, user must reset the chip and vice versa.

Page 20: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

20 of 23

Firmware download & debug User Manual – RED FDM

4 Debugging This chapter describes how to debug PR9200 firmware with ULINK2 and CoLinkEx.

4.1 Configuration for ULINK2

1. Select or Flash Configure Flash Tools… at Keil µVision IDE main window

2. Select debugger to “ULINK Cortex Debugger” .

3. Click “Settings” button and setup ULINK USB-JTAG/SW Adapter as shown figure.

Page 21: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

21 of 23

Firmware download & debug User Manual – RED FDM

4.2 Configuration for CoLinkEx

1. Select or Flash Configure Flash Tools… at Keil µVision IDE main window

2. Select debugger to “CooCox Debugger.

3. Click “Settings” button and setup USB Adapter as shown figure.

4.3 Debugging

1. Click or Debug Start/Stop Debug Session to start debug.

Page 22: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

22 of 23

Firmware download & debug User Manual – RED FDM

Figure 30

2. When user want to stop debugging, click Debug Start/Stop Debug Session again.

Page 23: Firmware Download and Debug User Manual - phychips.com · RED FDM 2016-05-31 Firmware Download and Debug User Manual `` ... 1. At Config tab, set Device and USB Adapter Setup as below

``

23 of 23

Firmware download & debug User Manual – RED FDM

5 Address Information PHYCHIPS Inc. #104, 187 Techno 2-ro, Yuseong-gu, Daejeon, Korea (Yongsan-dong, Migun Technoworld 2) http://www.phychips.com [email protected] +82-42-864-2402 +82-42-864-2403

Disclaimer: PHYCHIPS reserves the right to make changes to the information in this document without prior notice. The purchase of PHYCHIPS products does not convey any license under patent rights owned by PHYCHIPS or others. PHYCHIPS does not assume any responsibility for the use of this product. It is the customer’s responsibility to make sure that the system complies with regulations. © 2016 PHYCHIPS, Inc. All rights reserved. The reproduction of this document is NOT allowed without approval of PHYCHIPS Inc.