NuMaker NuWicam sample on NUC472

Dependencies:   Modbus nvt_rs485

NuWicam for NuMaker-PFM-NUC472 board. Please refer document before executing it. More details, please refer https://github.com/OpenNuvoton/NuMaker_NuWicam_Samples/

Committer:
shliu1
Date:
Mon Dec 12 16:01:52 2016 +0800
Revision:
6:5be66d8a01d1
Child:
8:478b47fb0af6
Add README.md and sync mbed-os to mbed-os 5.2.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shliu1 6:5be66d8a01d1 1
shliu1 6:5be66d8a01d1 2 # Getting started with NuMaker_NuWicam_Lite on mbed OS
shliu1 6:5be66d8a01d1 3
shliu1 6:5be66d8a01d1 4 It needs run with NuMaker NuWicam board, the libraries modbus.lib and nvt_rs485.lib are provided by Nuvoton. The code works on an mbed OS platform.
shliu1 6:5be66d8a01d1 5
shliu1 6:5be66d8a01d1 6 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
shliu1 6:5be66d8a01d1 7
shliu1 6:5be66d8a01d1 8 ## Get the example application!
shliu1 6:5be66d8a01d1 9
shliu1 6:5be66d8a01d1 10 Ontain the mbed-OS library from Windows command prompt
shliu1 6:5be66d8a01d1 11
shliu1 6:5be66d8a01d1 12 git clone https://github.com/ARMmbed/mbed-os
shliu1 6:5be66d8a01d1 13
shliu1 6:5be66d8a01d1 14
shliu1 6:5be66d8a01d1 15 From the command line of Git Bash, for example:
shliu1 6:5be66d8a01d1 16
shliu1 6:5be66d8a01d1 17 ```
shliu1 6:5be66d8a01d1 18 hg clone https://username@developer.mbed.org/teams/Nuvoton/code/NuMaker_NuWicam_Lite/
shliu1 6:5be66d8a01d1 19 cd NuMaker_NuWicam_Lite
shliu1 6:5be66d8a01d1 20 hg clone https://developer.mbed.org/users/wclin/code/Modbus
shliu1 6:5be66d8a01d1 21 hg clone http://mbed.org/users/wclin/code/nvt_rs485
shliu1 6:5be66d8a01d1 22 ```
shliu1 6:5be66d8a01d1 23
shliu1 6:5be66d8a01d1 24 Make shortcut for mbed-os library under the folder NuMaker_NuWicam_Lite
shliu1 6:5be66d8a01d1 25
shliu1 6:5be66d8a01d1 26 ### Now compile
shliu1 6:5be66d8a01d1 27
shliu1 6:5be66d8a01d1 28 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 6:5be66d8a01d1 29
shliu1 6:5be66d8a01d1 30 ```
shliu1 6:5be66d8a01d1 31 mbed compile -m NUMAKER_PFM_NUC472 -t ARM
shliu1 6:5be66d8a01d1 32 ```
shliu1 6:5be66d8a01d1 33
shliu1 6:5be66d8a01d1 34 Your PC may take a few minutes to compile your code. At the end you should get the following result:
shliu1 6:5be66d8a01d1 35
shliu1 6:5be66d8a01d1 36 ```
shliu1 6:5be66d8a01d1 37 +------------------------+-------+-------+---------+
shliu1 6:5be66d8a01d1 38 | Module | .text | .data | .bss |
shliu1 6:5be66d8a01d1 39 +------------------------+-------+-------+---------+
shliu1 6:5be66d8a01d1 40 | Misc | 20112 | 246 | 1052260 |
shliu1 6:5be66d8a01d1 41 | drivers | 2303 | 4 | 56 |
shliu1 6:5be66d8a01d1 42 | features/FEATURE_LWIP | 162 | 16 | 16 |
shliu1 6:5be66d8a01d1 43 | hal | 802 | 8 | 0 |
shliu1 6:5be66d8a01d1 44 | platform | 1981 | 16 | 92 |
shliu1 6:5be66d8a01d1 45 | rtos | 754 | 8 | 0 |
shliu1 6:5be66d8a01d1 46 | rtos/rtx | 7088 | 100 | 8396 |
shliu1 6:5be66d8a01d1 47 | targets/TARGET_NUVOTON | 10632 | 276 | 312 |
shliu1 6:5be66d8a01d1 48 | Subtotals | 43834 | 674 | 1061132 |
shliu1 6:5be66d8a01d1 49 +------------------------+-------+-------+---------+
shliu1 6:5be66d8a01d1 50 Allocated Heap: unknown
shliu1 6:5be66d8a01d1 51 Allocated Stack: unknown
shliu1 6:5be66d8a01d1 52 Total Static RAM memory (data + bss): 1061806 bytes
shliu1 6:5be66d8a01d1 53 Total RAM memory (data + bss + heap + stack): 1061806 bytes
shliu1 6:5be66d8a01d1 54 Total Flash memory (text + data + misc): 44508 bytes
shliu1 6:5be66d8a01d1 55
shliu1 6:5be66d8a01d1 56 Object file test_env.o is not unique! It could be made from: C:\CCLi8\IoT\mbed\mbed-os\NuMaker_NuWicam_Lite\mbed-os\features/unsupported\tests\mbed\env\test_env.cpp .\mbed-os\features\frameworks\greentea-client\source\test_env.cpp
shliu1 6:5be66d8a01d1 57 Image: .\BUILD\NUMAKER_PFM_NUC472\ARM\NuMaker_NuWicam_Lite.bin
shliu1 6:5be66d8a01d1 58 ```
shliu1 6:5be66d8a01d1 59
shliu1 6:5be66d8a01d1 60 ### Program your board
shliu1 6:5be66d8a01d1 61
shliu1 6:5be66d8a01d1 62 1. Connect your mbed device to the computer over USB.
shliu1 6:5be66d8a01d1 63 1. Copy the binary file to the mbed device .
shliu1 6:5be66d8a01d1 64 1. Press the reset button to start the program.
shliu1 6:5be66d8a01d1 65
shliu1 6:5be66d8a01d1 66 Please refer to the documents at the path https://github.com/OpenNuvoton/NuMaker_NuWicam_Samples/
shliu1 6:5be66d8a01d1 67
shliu1 6:5be66d8a01d1 68 ## Export the project to Keil MDK and debug your application
shliu1 6:5be66d8a01d1 69
shliu1 6:5be66d8a01d1 70 From the command line, run the following command:
shliu1 6:5be66d8a01d1 71
shliu1 6:5be66d8a01d1 72 ```
shliu1 6:5be66d8a01d1 73 mbed export -m NUMAKER_PFM_NUC472 -i uvision
shliu1 6:5be66d8a01d1 74 ```
shliu1 6:5be66d8a01d1 75
shliu1 6:5be66d8a01d1 76 To debug the application:
shliu1 6:5be66d8a01d1 77
shliu1 6:5be66d8a01d1 78 1. Start uVision.
shliu1 6:5be66d8a01d1 79 1. Import the uVision project generated earlier.
shliu1 6:5be66d8a01d1 80 1. Compile your application and generate an `.axf` file.
shliu1 6:5be66d8a01d1 81 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 6:5be66d8a01d1 82 1. Set breakpoints and start a debug session.
shliu1 6:5be66d8a01d1 83
shliu1 6:5be66d8a01d1 84 ![Image of uVision](img/uvision.png)
shliu1 6:5be66d8a01d1 85
shliu1 6:5be66d8a01d1 86 ## Troubleshooting
shliu1 6:5be66d8a01d1 87
shliu1 6:5be66d8a01d1 88 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9`
shliu1 6:5be66d8a01d1 89
shliu1 6:5be66d8a01d1 90 ```
shliu1 6:5be66d8a01d1 91 mbed --version
shliu1 6:5be66d8a01d1 92 ```
shliu1 6:5be66d8a01d1 93
shliu1 6:5be66d8a01d1 94 If not, you can update it easily:
shliu1 6:5be66d8a01d1 95
shliu1 6:5be66d8a01d1 96 ```
shliu1 6:5be66d8a01d1 97 pip install mbed-cli --upgrade
shliu1 6:5be66d8a01d1 98 ```
shliu1 6:5be66d8a01d1 99
shliu1 6:5be66d8a01d1 100 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 6:5be66d8a01d1 101
shliu1 6:5be66d8a01d1 102