Presentation is loading. Please wait.

Presentation is loading. Please wait.

3/6/2017 Richard Kuo Assistant Professor

Similar presentations


Presentation on theme: "3/6/2017 Richard Kuo Assistant Professor"— Presentation transcript:

1 3/6/2017 Richard Kuo Assistant Professor
NuMicro SDK & Keil MDK 3/6/2017 Richard Kuo Assistant Professor

2 Outline SDK Installation Open Keil Project Keil MDK Configuration
SWD Interface Keil Debug Session ICP & ISP mode Programming

3 3rd Party Development Tools

4 SDK Installation Tools (Keil MDK, Nu-Link USB Driver, NuMicro BSP)
IDE : ARM Keil MDK MDK522.exe (run to install) ICE : NuLink Driver Nu-Link_Keil_Driver_V zip (unzip & run to install) BSP : MCU device driver & sample code NUC100_120_Series_BSP_CMSIS_Rev (original BSP) 2017/11/20

5 BSP – Basic Software Package
libraries used by sample code sample code for reference 2017/11/20

6 SampleCode folder For NUC140 Learning Board
NUC100_120_Series_BSP_CMSIS_Rev is the original basic software package 2017/11/20

7 Library folder For ARM CPU (Cortex-M0, M4, …)
For MCU series (NCU100series.h) For NUC140 onboard device (7-seg, 3x3 keypad, …) For sensors (MPU6050, …) & peripherals (LCD) For MCU standard interface (I2C, SPI, UART, ADC, PWM, GPIO, …) 2017/11/20

8 sample code directory C:\Nuvoton\SW_Nu_LB_NUC140_v1.1\SampleCode\Nu-LB-NUC140 2017/11/20

9 Pick one sample code double click to enter the directory 2017/11/20

10 Sample Code Folder Double click to enter Keil directory 2017/11/20

11 Sample Code Folder Double click to start Keil project 2017/11/20

12 Keil IDE (Integrated Development Environment)
Save File Debug Session Window View setting Build Download Tool Configuration Source Code View Rebuild File Hierarchy View 2017/11/20

13 Code Size Assuming Keil MDK compilation result is
Program Size: Code=3696 RO-data=2256 RW-data=60 ZI-data=1348   Code : program code (程式碼) RO-data : Read-Only Data (唯讀資料) RW-data : Read/Write Data (讀寫資料) ZI-data : Zero Initialized Data (初始為0的資料) Then Total ROM size = Code + RO-data + RW-data = = 6012 Bytes Total RAM size = RW-data + ZI-data = = 1408 Bytes * Nano102的 ROM size = 32K Bytes, RAM size = 16K Bytes * Evaluation License limit code size at 32KB

14 Keil Configuration Select Configure Flash Tools…

15 Click to add extra library path
Keil Configuration Click to add extra library path Library path setting 2017/11/20

16 Debug Session main.c printf display message Select UART#1 to
open message view main.c printf display message 2017/11/20

17 Flash > Configure Flash Tools

18 Flash > Configure Flash Tools>Device

19 Flash > Configure Flash Tools>Device
Just to confirm device is correct Don’t change anything here ! ROM=128KB SRAM=16KB ROM base address SRAM base address

20 Flash > Configure Flash Tools>Device
Just to confirm device is correct ROM=128KB SRAM=16KB ROM base address SRAM base address No change needed here !

21 Flash > Configure Flash Tools>Output
No change needed here !

22 Flash > Configure Flash Tools>Listing
No change needed here !

23 Flash > Configure Flash Tools>User
No change needed here !

24 Flash > Configure Flash Tools>C/C++
SEMIHOST debug mode for using printf No change needed here !

25 Flash > Configure Flash Tools>Asm
SEMIHOST debug mode for using printf No change needed here !

26 Flash > Configure Flash Tools>Linker
No change needed here !

27 Flash > Configure Flash Tools>Debug
must use Nu-Link Debugger If you see no Nu-Link Debugger here, then you need to reinstall Nu-Link ICE driver

28 Flash > Configure Flash Tools>Debug
must select correct device series NUC100 is for NUC140, … Nano100 is for Nano102, 112

29 Flash > Configure Flash Tools>Utilities

30 Flash > Configure Flash Tools>Utilities

31 Flash > Configure Flash Tools>Utilities

32 ARM CoreSight Technology
ARM Cortex-M processor-based devices use the ARM CoreSight technology which introduces powerful new debug and trace capabilities Debug Features: Run Control of the processor allowing you to start and stop programs Single Step one source or assembler line Set breakpoints while the processor is running Read/write memory contents and peripheral registers on-the-fly Program internal and external FLASH memory Trace Features: Serial Wire Viewer (SWV) provides program counter (PC) sampling, data trace, event trace, and instrumentation trace information Instruction (ETM) Trace streamed directly to your PC enabling debugging of historical sequences, software profiling, and code coverage analysis

33 CoreSight Block Diagram

34 SWD (Serial Wire Debug)
The SWD interface pins can be overlaid with JTAG signals, allowing the standard target connectors to be used: TCLK - SWCLK (Serial Wire Clock) TMS - SWDIO (Serial Wire Data Input/Output) TDO - SWO (Serial Wire Output - required for SWV) JTAG and SWD modes are fully supported by ULINK2, ULINK-ME, and ULINKpro. Nu-Link ICE signals : VCC ICE_DAT ICE_CLK RST GND

35 Programming Mode : ISP vs ICP
Item ISP ICP PC AP Software NuMicro ISP Programmer NuMicro ICP Programming Tools.exe Extra Hardware No NuLink CPU Run Code CPU runs on the LDROM What Region Can Be Updated APROM DataFlash Config LDROM Interface USB or UART SWD Support Off-Line Programming Yes

36 System Memory Map System Peripheral SRAM 16KB 4KB Code 32KB
Application Program Memory (APROM) 0x0000_0000 0x0000_7FFF Reserved ISP Loader Program Memory (LDROM) 0x0010_0000 0x0010_0FFF APB peripherals 0x4000_0000 0x401F_FFFF AHB peripherals 0x5000_0000 0x501F_FFFF Cortex M0 System Register 0xE000_E000 0xE000_EFFF RAM 0x2000_0000 0x2000_3FFF Code SRAM Peripheral System 16KB 4KB 32KB

37 ICP (In Circuit Programming)
NuMicro ICP AP USB SWD NuMicro MCU Vcc, Data, Clk, Rst, Gnd

38 ISP (In System Programming)
NuMicro ISPAP USB-to-UART USB Cable UART I/F USB I/F Address M0-CPU Update Code ROMCODE LDROM APROM Nuvoton ISP LDROM firmware code Boot From LDROM USB interface only supports NUC120/NUC140 series

39 Setup ISP mode Step 1. use ICP tool to upload MCU’s LDROM code for ISP mode (ICP tool use Nu-Link to upload LDROM) Step 2. run Keil MDK to build a project for MCU binary file Step 3. connect USB-to-UART comm port to Nu-LB-NUC140 UART TX/RX pins (used by LDROM code) Step 4. run ISP tool to download binary into MCU 2017/11/20

40 1. use ICP tool to upload LDROM code for ISP mode
Connect / Disconnect load code 2017/11/20

41 NuMicro ISP (In System Programming)


Download ppt "3/6/2017 Richard Kuo Assistant Professor"

Similar presentations


Ads by Google