Friday, December 19, 2014

Using GitHub with GCC4MBED

I too have had a learning curve with git. It is the "hot new revision manager of the day". Mbed.com uses a version of it. The gcc4mbed is at GitHub.com so it seems the thing to do.

To start you git clone the software of interest. This makes a directory named after the repository in the current directory and downloads all the code from the repo there. Now you have  local copy to use/modify/enhance or whatever. So it is sort of sub-directory based.

gcc4mbed is written such that you use one of its sub-directories, gcc4mbed/samples/<proj-name>/ as the source of your project. If you want to contribute your enhancements back to the original author, there are commands to do that. However, they take the entire repo directory and process it. It is possible to configure your way around this, but then using the versioning system for your code gets cumbersome.

Therefore; I made a project directory tree for my stuff that separates it out of GCC4MBED's tree structure. This should make it easy to manage individual subsets of projects for revision management. This makes it much easier to use minute by minute during development, so less time is wasted trying to remember recent changes. It also allows a  complete removal and re-write of the GCC4MBED without affecting my projects.


gcc4mbed/
├── build/
├── external/
├── mri/
├── samples/
├── src/
Projects/
├── App_test
│   ├── ADXL345
│   └── IMU_cal
├── build -> ../gcc4mbed/build/
├── DISCO_F407VG-device.mk
├── external -> ../gcc4mbed/external/
├── Funct_test
│   ├── ADXL345 -> ../../FreeIMU/ADXL345
│   ├── FPU_mathTest
│   ├── I2C_NVIC
│   ├── MB_i2c_IT
│   ├── rtos_basic
│   ├── rtos_mutex
│   ├── rtos_signals
│   └── Ticker
├── mri -> ../gcc4mbed/mri
├── Project
│   └── IMU10DOF
└── src -> ../gcc4mbed/src/


The symbolic links line up with the directories that the makefiles expect so they compile OK, but keep my stuff separate. I use the Project, App_test and Funct_test directories to further divide the namespace.

No comments:

Post a Comment