takashi kadono / Mbed OS Nucleo446_SSD1331

Dependencies:   ssd1331

Committer:
kadonotakashi
Date:
Wed Oct 10 00:33:53 2018 +0000
Revision:
0:8fdf9a60065b
how to make mbed librry

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kadonotakashi 0:8fdf9a60065b 1 # Description
kadonotakashi 0:8fdf9a60065b 2
kadonotakashi 0:8fdf9a60065b 3 This document describes how to update the Arm Mbed OS LWIP stack. The Mbed OS LWIP stack is a copy of the LWIP master repository. Stack is located in `features/lwipstack/lwip` directory.
kadonotakashi 0:8fdf9a60065b 4
kadonotakashi 0:8fdf9a60065b 5 When you add new releases or single commits from the LWIP master repository, you must fetch them using the Mbed OS LWIP fork repository. Use the repository to rename LWIP source files with the `lwip_` prefix to make them compatible with the Mbed OS build system.
kadonotakashi 0:8fdf9a60065b 6
kadonotakashi 0:8fdf9a60065b 7 * The LWIP master repository is part of the [LWIP project](https://savannah.nongnu.org/projects/lwip).
kadonotakashi 0:8fdf9a60065b 8 * The Mbed OS LWIP fork repository is part of [`ARMmbed`](https://github.com/ARMmbed/lwip).
kadonotakashi 0:8fdf9a60065b 9
kadonotakashi 0:8fdf9a60065b 10 ## How to integrate a release from the LWIP master repository to the Mbed OS
kadonotakashi 0:8fdf9a60065b 11
kadonotakashi 0:8fdf9a60065b 12 You can integrate a new release using the following steps.
kadonotakashi 0:8fdf9a60065b 13
kadonotakashi 0:8fdf9a60065b 14 * Fetch the release to the Mbed OS LWIP fork.
kadonotakashi 0:8fdf9a60065b 15 * Prefix files in the Mbed OS LWIP fork with the `lwip_` prefix.
kadonotakashi 0:8fdf9a60065b 16 * Merge the release to the Mbed OS repository.
kadonotakashi 0:8fdf9a60065b 17
kadonotakashi 0:8fdf9a60065b 18 ### Fetching the release to the Mbed OS LWIP fork and prefixing files
kadonotakashi 0:8fdf9a60065b 19
kadonotakashi 0:8fdf9a60065b 20 1. Clone the Mbed OS LWIP fork repository.
kadonotakashi 0:8fdf9a60065b 21
kadonotakashi 0:8fdf9a60065b 22 `git clone git@github.com:ARMmbed/lwip.git`
kadonotakashi 0:8fdf9a60065b 23
kadonotakashi 0:8fdf9a60065b 24 2. Go to the Mbed OS LWIP fork root directory, and add the LWIP master repository as remote.
kadonotakashi 0:8fdf9a60065b 25
kadonotakashi 0:8fdf9a60065b 26 `git remote add <remote name> https://git.savannah.nongnu.org/git/lwip.git`
kadonotakashi 0:8fdf9a60065b 27
kadonotakashi 0:8fdf9a60065b 28 `e.g. git remote add lwip https://git.savannah.nongnu.org/git/lwip.git`
kadonotakashi 0:8fdf9a60065b 29
kadonotakashi 0:8fdf9a60065b 30 3. Pull the release from the LWIP master repository using the release tag. You can find tags [here](<https://savannah.nongnu.org/projects/lwip>).
kadonotakashi 0:8fdf9a60065b 31
kadonotakashi 0:8fdf9a60065b 32 `git pull <remote name> <tag>`
kadonotakashi 0:8fdf9a60065b 33
kadonotakashi 0:8fdf9a60065b 34 `e.g. git pull lwip STABLE-2_0_2_RELEASE_VER`
kadonotakashi 0:8fdf9a60065b 35
kadonotakashi 0:8fdf9a60065b 36 4. Push the tag to the Mbed OS LWIP fork repository to keep the fork in sync.
kadonotakashi 0:8fdf9a60065b 37
kadonotakashi 0:8fdf9a60065b 38 `git push origin <tag>`
kadonotakashi 0:8fdf9a60065b 39
kadonotakashi 0:8fdf9a60065b 40 `e.g. git push origin STABLE-2_0_2_RELEASE_VER`
kadonotakashi 0:8fdf9a60065b 41
kadonotakashi 0:8fdf9a60065b 42 5. Create a branch for release. Use the same naming convention as previous branches.
kadonotakashi 0:8fdf9a60065b 43
kadonotakashi 0:8fdf9a60065b 44 `git branch <branch name> <tag>`
kadonotakashi 0:8fdf9a60065b 45
kadonotakashi 0:8fdf9a60065b 46 `e.g. git branch mbed-os-lwip-stable-2_0_2 STABLE-2_0_2_RELEASE_VER`
kadonotakashi 0:8fdf9a60065b 47
kadonotakashi 0:8fdf9a60065b 48 6. Push the branch to the Mbed OS LWIP fork repository to keep the fork in sync.
kadonotakashi 0:8fdf9a60065b 49
kadonotakashi 0:8fdf9a60065b 50 `git push origin <branch name>`
kadonotakashi 0:8fdf9a60065b 51
kadonotakashi 0:8fdf9a60065b 52 `e.g. git push origin mbed-os-lwip-stable-2_0_2`
kadonotakashi 0:8fdf9a60065b 53
kadonotakashi 0:8fdf9a60065b 54 7. Fetch the previous prefixed branch from the Mbed OS LWIP fork repository.
kadonotakashi 0:8fdf9a60065b 55
kadonotakashi 0:8fdf9a60065b 56 `git fetch <remote name> <remote branch>:<local branch>`
kadonotakashi 0:8fdf9a60065b 57
kadonotakashi 0:8fdf9a60065b 58 `e.g. git fetch origin mbed-os-lwip-stable-2_0_1-prefixed:mbed-os-lwip-stable-2_0_1-prefixed`
kadonotakashi 0:8fdf9a60065b 59
kadonotakashi 0:8fdf9a60065b 60 8. Checkout the latest prefixed branch.
kadonotakashi 0:8fdf9a60065b 61
kadonotakashi 0:8fdf9a60065b 62 `git checkout <prefixed branch>`
kadonotakashi 0:8fdf9a60065b 63
kadonotakashi 0:8fdf9a60065b 64 `e.g. git checkout mbed-os-lwip-stable-2_0_1-prefixed`
kadonotakashi 0:8fdf9a60065b 65
kadonotakashi 0:8fdf9a60065b 66 9. Merge the new branch to the prefixed branch.
kadonotakashi 0:8fdf9a60065b 67
kadonotakashi 0:8fdf9a60065b 68 `git merge <branch name>`
kadonotakashi 0:8fdf9a60065b 69
kadonotakashi 0:8fdf9a60065b 70 `e.g. git merge mbed-os-lwip-stable-2_0_2`
kadonotakashi 0:8fdf9a60065b 71
kadonotakashi 0:8fdf9a60065b 72 10. Check if there are any new or colliding files.
kadonotakashi 0:8fdf9a60065b 73
kadonotakashi 0:8fdf9a60065b 74 If there are new c-files rename those with `lwip_` prefix and make a commit about changes to the prefixed branch. Also, check that LWIP stack header file names do not collide with headers under the Mbed OS directory tree. If there are collisions, rename the colliding LWIP headers with `lwip_` prefix.
kadonotakashi 0:8fdf9a60065b 75
kadonotakashi 0:8fdf9a60065b 76 If needed, rename files, and make a commit. Update the C-files to include any renamed header files.
kadonotakashi 0:8fdf9a60065b 77
kadonotakashi 0:8fdf9a60065b 78 `git mv <old filename> <new filename>`
kadonotakashi 0:8fdf9a60065b 79
kadonotakashi 0:8fdf9a60065b 80 `git commit`
kadonotakashi 0:8fdf9a60065b 81
kadonotakashi 0:8fdf9a60065b 82 11. Rename the local prefixed branch to the new version. (Do not change branch names on remotes.)
kadonotakashi 0:8fdf9a60065b 83
kadonotakashi 0:8fdf9a60065b 84 `git branch -m <new prefixed branch>`
kadonotakashi 0:8fdf9a60065b 85
kadonotakashi 0:8fdf9a60065b 86 `e.g. git branch -m mbed-os-lwip-stable-2_0_2-prefixed`
kadonotakashi 0:8fdf9a60065b 87
kadonotakashi 0:8fdf9a60065b 88 12. Push the new local prefixed branch to the Mbed OS LWIP fork repository.
kadonotakashi 0:8fdf9a60065b 89
kadonotakashi 0:8fdf9a60065b 90 `git push origin <new prefixed branch>`
kadonotakashi 0:8fdf9a60065b 91
kadonotakashi 0:8fdf9a60065b 92 `e.g. git push origin mbed-os-lwip-stable-2_0_2-prefixed`
kadonotakashi 0:8fdf9a60065b 93
kadonotakashi 0:8fdf9a60065b 94 ### Merging the prefixed release to the Mbed OS repository
kadonotakashi 0:8fdf9a60065b 95
kadonotakashi 0:8fdf9a60065b 96 1. Clone the Mbed OS repository.
kadonotakashi 0:8fdf9a60065b 97
kadonotakashi 0:8fdf9a60065b 98 `git clone git@github.com:ARMmbed/mbed-os.git`
kadonotakashi 0:8fdf9a60065b 99
kadonotakashi 0:8fdf9a60065b 100 2. Go to the Mbed OS root directory, and add the Mbed OS LWIP fork repository as remote. Fetch branches from fork.
kadonotakashi 0:8fdf9a60065b 101
kadonotakashi 0:8fdf9a60065b 102 `git remote add <remote name> https://github.com/ARMmbed/lwip.git`
kadonotakashi 0:8fdf9a60065b 103
kadonotakashi 0:8fdf9a60065b 104 `e.g. git remote add lwip-fork https://github.com/ARMmbed/lwip.git`
kadonotakashi 0:8fdf9a60065b 105
kadonotakashi 0:8fdf9a60065b 106 `git fetch <remote name>`
kadonotakashi 0:8fdf9a60065b 107
kadonotakashi 0:8fdf9a60065b 108 `e.g. git fetch lwip-fork`
kadonotakashi 0:8fdf9a60065b 109
kadonotakashi 0:8fdf9a60065b 110 3. Do a subtree pull for LWIP prefixed branch in the Mbed OS root directory.
kadonotakashi 0:8fdf9a60065b 111
kadonotakashi 0:8fdf9a60065b 112 `git subtree pull --squash -P features/lwipstack/lwip <remote name> <new prefixed branch> -m "<commit message>"`
kadonotakashi 0:8fdf9a60065b 113
kadonotakashi 0:8fdf9a60065b 114 `e.g. git subtree pull --squash -P features/lwipstack/lwip lwip-fork mbed-os-lwip-stable-2_0_2-prefixed -m "Merged lwip 2.0.2 stable"`
kadonotakashi 0:8fdf9a60065b 115
kadonotakashi 0:8fdf9a60065b 116 After this step, there is a new commit visible in the Mbed OS master branch that contains the changes.
kadonotakashi 0:8fdf9a60065b 117
kadonotakashi 0:8fdf9a60065b 118 4. Verify that changes in the new commit are correct, and create a new branch. Push the branch to your Mbed OS fork for GitHub review.