NuMaker Ethernet TCP

Committer:
shliu1
Date:
Tue Dec 13 14:33:37 2016 +0800
Revision:
4:f49bb78f93ef
Child:
5:f33d0ab82615
Add README.md and sync mbed-os library to mbed-os 5.2.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shliu1 4:f49bb78f93ef 1
shliu1 4:f49bb78f93ef 2 # Getting started with NuMaker-mbed-tcp on mbed OS
shliu1 4:f49bb78f93ef 3
shliu1 4:f49bb78f93ef 4 The code works on an mbed OS platform. The code tests TCP network.
shliu1 4:f49bb78f93ef 5
shliu1 4:f49bb78f93ef 6 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
shliu1 4:f49bb78f93ef 7
shliu1 4:f49bb78f93ef 8 ## Get the example application!
shliu1 4:f49bb78f93ef 9
shliu1 4:f49bb78f93ef 10 Obtain the mbed-OS library from Windows command prompt
shliu1 4:f49bb78f93ef 11
shliu1 4:f49bb78f93ef 12 git clone https://github.com/ARMmbed/mbed-os
shliu1 4:f49bb78f93ef 13
shliu1 4:f49bb78f93ef 14
shliu1 4:f49bb78f93ef 15 From the command line of Git Bash, for example:
shliu1 4:f49bb78f93ef 16
shliu1 4:f49bb78f93ef 17 ```
shliu1 4:f49bb78f93ef 18 hg clone https://developer.mbed.org/teams/Nuvoton/code/NuMaker-mbed-tcp/
shliu1 4:f49bb78f93ef 19 cd NuMaker-mbed-tcp
shliu1 4:f49bb78f93ef 20
shliu1 4:f49bb78f93ef 21 ```
shliu1 4:f49bb78f93ef 22
shliu1 4:f49bb78f93ef 23 Make shortcut for mbed-os library within the folder NuMaker-mbed-tcp
shliu1 4:f49bb78f93ef 24
shliu1 4:f49bb78f93ef 25 ### Now compile
shliu1 4:f49bb78f93ef 26
shliu1 4:f49bb78f93ef 27 Invoke `mbed compile` specifying the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
shliu1 4:f49bb78f93ef 28
shliu1 4:f49bb78f93ef 29 ```
shliu1 4:f49bb78f93ef 30 mbed compile -m NUMAKER_PFM_NUC472 -t ARM
shliu1 4:f49bb78f93ef 31 ```
shliu1 4:f49bb78f93ef 32
shliu1 4:f49bb78f93ef 33 Your PC may take a few minutes to compile your code. At the end you should get the following result:
shliu1 4:f49bb78f93ef 34
shliu1 4:f49bb78f93ef 35 ```
shliu1 4:f49bb78f93ef 36 +------------------------+-------+-------+---------+
shliu1 4:f49bb78f93ef 37 | Module | .text | .data | .bss |
shliu1 4:f49bb78f93ef 38 +------------------------+-------+-------+---------+
shliu1 4:f49bb78f93ef 39 | Misc | 14316 | 32 | 1027512 |
shliu1 4:f49bb78f93ef 40 | drivers | 1289 | 4 | 28 |
shliu1 4:f49bb78f93ef 41 | features/FEATURE_LWIP | 42735 | 341 | 37131 |
shliu1 4:f49bb78f93ef 42 | features/frameworks | 5135 | 128 | 516 |
shliu1 4:f49bb78f93ef 43 | features/netsocket | 4043 | 85 | 60 |
shliu1 4:f49bb78f93ef 44 | hal | 358 | 8 | 0 |
shliu1 4:f49bb78f93ef 45 | platform | 1641 | 16 | 92 |
shliu1 4:f49bb78f93ef 46 | rtos | 198 | 8 | 0 |
shliu1 4:f49bb78f93ef 47 | rtos/rtx | 7994 | 100 | 8396 |
shliu1 4:f49bb78f93ef 48 | targets/TARGET_NUVOTON | 9416 | 272 | 312 |
shliu1 4:f49bb78f93ef 49 | Subtotals | 87125 | 994 | 1074047 |
shliu1 4:f49bb78f93ef 50 +------------------------+-------+-------+---------+
shliu1 4:f49bb78f93ef 51 Allocated Heap: unknown
shliu1 4:f49bb78f93ef 52 Allocated Stack: unknown
shliu1 4:f49bb78f93ef 53 Total Static RAM memory (data + bss): 1075041 bytes
shliu1 4:f49bb78f93ef 54 Total RAM memory (data + bss + heap + stack): 1075041 bytes
shliu1 4:f49bb78f93ef 55 Total Flash memory (text + data + misc): 88119 bytes
shliu1 4:f49bb78f93ef 56 ```
shliu1 4:f49bb78f93ef 57
shliu1 4:f49bb78f93ef 58 ### Program your board
shliu1 4:f49bb78f93ef 59
shliu1 4:f49bb78f93ef 60 1. Connect your mbed device to the computer over USB.
shliu1 4:f49bb78f93ef 61 1. Copy the binary file to the mbed device .
shliu1 4:f49bb78f93ef 62 1. Press the reset button to start the program.
shliu1 4:f49bb78f93ef 63
shliu1 4:f49bb78f93ef 64 Please refer to the documents at the path https://github.com/OpenNuvoton/NuMaker_NuWicam_Samples/
shliu1 4:f49bb78f93ef 65
shliu1 4:f49bb78f93ef 66 ## Export the project to Keil MDK and debug your application
shliu1 4:f49bb78f93ef 67
shliu1 4:f49bb78f93ef 68 From the command line, run the following command:
shliu1 4:f49bb78f93ef 69
shliu1 4:f49bb78f93ef 70 ```
shliu1 4:f49bb78f93ef 71 mbed export -m NUMAKER_PFM_NUC472 -i uvision
shliu1 4:f49bb78f93ef 72 ```
shliu1 4:f49bb78f93ef 73
shliu1 4:f49bb78f93ef 74 To debug the application:
shliu1 4:f49bb78f93ef 75
shliu1 4:f49bb78f93ef 76 1. Start uVision.
shliu1 4:f49bb78f93ef 77 1. Import the uVision project generated earlier.
shliu1 4:f49bb78f93ef 78 1. Compile your application and generate an `.axf` file.
shliu1 4:f49bb78f93ef 79 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
shliu1 4:f49bb78f93ef 80 1. Set breakpoints and start a debug session.
shliu1 4:f49bb78f93ef 81
shliu1 4:f49bb78f93ef 82 ![Image of uVision](img/uvision.png)
shliu1 4:f49bb78f93ef 83
shliu1 4:f49bb78f93ef 84 ## Troubleshooting
shliu1 4:f49bb78f93ef 85
shliu1 4:f49bb78f93ef 86 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9`
shliu1 4:f49bb78f93ef 87
shliu1 4:f49bb78f93ef 88 ```
shliu1 4:f49bb78f93ef 89 mbed --version
shliu1 4:f49bb78f93ef 90 ```
shliu1 4:f49bb78f93ef 91
shliu1 4:f49bb78f93ef 92 If not, you can update it easily:
shliu1 4:f49bb78f93ef 93
shliu1 4:f49bb78f93ef 94 ```
shliu1 4:f49bb78f93ef 95 pip install mbed-cli --upgrade
shliu1 4:f49bb78f93ef 96 ```
shliu1 4:f49bb78f93ef 97
shliu1 4:f49bb78f93ef 98 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32KB restriction on code size.
shliu1 4:f49bb78f93ef 99
shliu1 4:f49bb78f93ef 100