Nuvoton
/
NuMaker-mbed-SDFileSystem-example
NuMaker SD-File-System with SD mode (deprecated after mbed OS 5.4)
README.md@4:8a6db27b798c, 2016-12-13 (annotated)
- Committer:
- shliu1
- Date:
- Tue Dec 13 14:19:25 2016 +0800
- Revision:
- 4:8a6db27b798c
- Child:
- 5:de77e9636ac0
Add README.md and sync mbed-os library to mbed-os 5.2.3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shliu1 |
4:8a6db27b798c | 1 | |
shliu1 |
4:8a6db27b798c | 2 | # Getting started with NuMaker-mbed-SDFileSystem-example on mbed OS |
shliu1 |
4:8a6db27b798c | 3 | |
shliu1 |
4:8a6db27b798c | 4 | The code works on an mbed OS platform. The code could access SD card by using file system in mbed platform. |
shliu1 |
4:8a6db27b798c | 5 | |
shliu1 |
4:8a6db27b798c | 6 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
shliu1 |
4:8a6db27b798c | 7 | |
shliu1 |
4:8a6db27b798c | 8 | ## Get the example application! |
shliu1 |
4:8a6db27b798c | 9 | |
shliu1 |
4:8a6db27b798c | 10 | Obtain the mbed-OS library from Windows command prompt |
shliu1 |
4:8a6db27b798c | 11 | |
shliu1 |
4:8a6db27b798c | 12 | git clone https://github.com/ARMmbed/mbed-os |
shliu1 |
4:8a6db27b798c | 13 | |
shliu1 |
4:8a6db27b798c | 14 | |
shliu1 |
4:8a6db27b798c | 15 | From the command line of Git Bash, for example: |
shliu1 |
4:8a6db27b798c | 16 | |
shliu1 |
4:8a6db27b798c | 17 | ``` |
shliu1 |
4:8a6db27b798c | 18 | hg clone https://developer.mbed.org/teams/Nuvoton/code/NuMaker-mbed-SDFileSystem-example/ |
shliu1 |
4:8a6db27b798c | 19 | cd NuMaker-mbed-SDFileSystem-example |
shliu1 |
4:8a6db27b798c | 20 | |
shliu1 |
4:8a6db27b798c | 21 | ``` |
shliu1 |
4:8a6db27b798c | 22 | |
shliu1 |
4:8a6db27b798c | 23 | Make shortcut for mbed-os library within the folder NuMaker-mbed-SDFileSystem-example |
shliu1 |
4:8a6db27b798c | 24 | |
shliu1 |
4:8a6db27b798c | 25 | ### Now compile |
shliu1 |
4:8a6db27b798c | 26 | |
shliu1 |
4:8a6db27b798c | 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:8a6db27b798c | 28 | |
shliu1 |
4:8a6db27b798c | 29 | ``` |
shliu1 |
4:8a6db27b798c | 30 | mbed compile -m NUMAKER_PFM_NUC472 -t ARM |
shliu1 |
4:8a6db27b798c | 31 | ``` |
shliu1 |
4:8a6db27b798c | 32 | |
shliu1 |
4:8a6db27b798c | 33 | Your PC may take a few minutes to compile your code. At the end you should get the following result: |
shliu1 |
4:8a6db27b798c | 34 | |
shliu1 |
4:8a6db27b798c | 35 | ``` |
shliu1 |
4:8a6db27b798c | 36 | +------------------------+-------+-------+---------+ |
shliu1 |
4:8a6db27b798c | 37 | | Module | .text | .data | .bss | |
shliu1 |
4:8a6db27b798c | 38 | +------------------------+-------+-------+---------+ |
shliu1 |
4:8a6db27b798c | 39 | | Misc | 24893 | 28 | 1053020 | |
shliu1 |
4:8a6db27b798c | 40 | | drivers | 1889 | 4 | 28 | |
shliu1 |
4:8a6db27b798c | 41 | | features/FEATURE_LWIP | 162 | 16 | 16 | |
shliu1 |
4:8a6db27b798c | 42 | | hal | 358 | 8 | 0 | |
shliu1 |
4:8a6db27b798c | 43 | | platform | 2093 | 32 | 120 | |
shliu1 |
4:8a6db27b798c | 44 | | rtos | 144 | 8 | 0 | |
shliu1 |
4:8a6db27b798c | 45 | | rtos/rtx | 6946 | 100 | 8396 | |
shliu1 |
4:8a6db27b798c | 46 | | targets/TARGET_NUVOTON | 14780 | 356 | 1072 | |
shliu1 |
4:8a6db27b798c | 47 | | Subtotals | 51265 | 552 | 1062652 | |
shliu1 |
4:8a6db27b798c | 48 | +------------------------+-------+-------+---------+ |
shliu1 |
4:8a6db27b798c | 49 | Allocated Heap: unknown |
shliu1 |
4:8a6db27b798c | 50 | Allocated Stack: unknown |
shliu1 |
4:8a6db27b798c | 51 | Total Static RAM memory (data + bss): 1063204 bytes |
shliu1 |
4:8a6db27b798c | 52 | Total RAM memory (data + bss + heap + stack): 1063204 bytes |
shliu1 |
4:8a6db27b798c | 53 | Total Flash memory (text + data + misc): 51817 bytes |
shliu1 |
4:8a6db27b798c | 54 | ``` |
shliu1 |
4:8a6db27b798c | 55 | |
shliu1 |
4:8a6db27b798c | 56 | ### Program your board |
shliu1 |
4:8a6db27b798c | 57 | |
shliu1 |
4:8a6db27b798c | 58 | 1. Connect your mbed device to the computer over USB. |
shliu1 |
4:8a6db27b798c | 59 | 1. Copy the binary file to the mbed device . |
shliu1 |
4:8a6db27b798c | 60 | 1. Press the reset button to start the program. |
shliu1 |
4:8a6db27b798c | 61 | |
shliu1 |
4:8a6db27b798c | 62 | Please refer to the documents at the path https://github.com/OpenNuvoton/NuMaker_NuWicam_Samples/ |
shliu1 |
4:8a6db27b798c | 63 | |
shliu1 |
4:8a6db27b798c | 64 | ## Export the project to Keil MDK and debug your application |
shliu1 |
4:8a6db27b798c | 65 | |
shliu1 |
4:8a6db27b798c | 66 | From the command line, run the following command: |
shliu1 |
4:8a6db27b798c | 67 | |
shliu1 |
4:8a6db27b798c | 68 | ``` |
shliu1 |
4:8a6db27b798c | 69 | mbed export -m NUMAKER_PFM_NUC472 -i uvision |
shliu1 |
4:8a6db27b798c | 70 | ``` |
shliu1 |
4:8a6db27b798c | 71 | |
shliu1 |
4:8a6db27b798c | 72 | To debug the application: |
shliu1 |
4:8a6db27b798c | 73 | |
shliu1 |
4:8a6db27b798c | 74 | 1. Start uVision. |
shliu1 |
4:8a6db27b798c | 75 | 1. Import the uVision project generated earlier. |
shliu1 |
4:8a6db27b798c | 76 | 1. Compile your application and generate an `.axf` file. |
shliu1 |
4:8a6db27b798c | 77 | 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:8a6db27b798c | 78 | 1. Set breakpoints and start a debug session. |
shliu1 |
4:8a6db27b798c | 79 | |
shliu1 |
4:8a6db27b798c | 80 | ![Image of uVision](img/uvision.png) |
shliu1 |
4:8a6db27b798c | 81 | |
shliu1 |
4:8a6db27b798c | 82 | ## Troubleshooting |
shliu1 |
4:8a6db27b798c | 83 | |
shliu1 |
4:8a6db27b798c | 84 | 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9` |
shliu1 |
4:8a6db27b798c | 85 | |
shliu1 |
4:8a6db27b798c | 86 | ``` |
shliu1 |
4:8a6db27b798c | 87 | mbed --version |
shliu1 |
4:8a6db27b798c | 88 | ``` |
shliu1 |
4:8a6db27b798c | 89 | |
shliu1 |
4:8a6db27b798c | 90 | If not, you can update it easily: |
shliu1 |
4:8a6db27b798c | 91 | |
shliu1 |
4:8a6db27b798c | 92 | ``` |
shliu1 |
4:8a6db27b798c | 93 | pip install mbed-cli --upgrade |
shliu1 |
4:8a6db27b798c | 94 | ``` |
shliu1 |
4:8a6db27b798c | 95 | |
shliu1 |
4:8a6db27b798c | 96 | 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:8a6db27b798c | 97 | |
shliu1 |
4:8a6db27b798c | 98 |