Commit cb67914d authored by Andrey Filippov's avatar Andrey Filippov

updated from master

parents 4e77789f ee474cb0
......@@ -11,7 +11,6 @@ sysroots
.pydevproject
html
*.directory
*.kate-swp
doxygen.tag
# auto-generated files from x393 project
src/drivers/elphel/x393.c
......@@ -21,4 +20,4 @@ src/drivers/elphel/x393_map.h
src/drivers/elphel/x393_types.h
all_sources.lst
excluding.lst
attic
attic
\ No newline at end of file
# linux-elphel
Extras (drivers, etc.) and patches for the kernel
This project handles kernel drivers and driver modification for Elphel NC393 seriees cameras.
The best way to install it is by running installation script in the top project -
https://github.com/Elphel/elphel393 as different parts of the camera software are inter-dependent,
and some of the required header files are generated from the Verilog code in
[x393 FPGA project](https://github.com/Elphel/x393).
##Downloading
Code must be located in `poky/` directory. Navigate to `poky/` and run:
```
git clone https://github.com/Elphel/linux-elphel.git
```
##Generating links and headers
Links between project tree and kernel source tree are generated by Bitbake during 'link' task when using `meta-elphel393`. Some required header files are automatically generated during the build process.
```
. ./oe-init-build-env
bitbake linux-xlnx -c clean -f
bitbake linux-xlnx -c link -f
bitbake linux-xlnx -f
```
##Importing project into Eclipse
Run Eclipse from its location directory and provide additional heap memory to it.
```
./eclipse -vmargs -Xmx4G
```
or just edit eclipse.ini (same directory as eclipse executable) and make sure -Xmx has at least 4G
This is Eclipse CDT project, and the [setup sctipt](https://github.com/Elphel/elphel393) copies
project configuration (.project, .cproject, .settings) from eclipse_project_setup subdirectory.
Eclipse should be started after Linux kernel is built with `bitbake linux-xlnx` at least once
so all the required files are already present. Then you may import *linux-elphel* as
'existing Git project' in Eclipse (you need either Eclipse for C/C++ development or intall [CDT
plugin](https://eclipse.org/cdt/) separately.
- File → Import... → General → Existing Project into Workspace
- [Next] → Select root directory → Browse → specify project location (`poky/linux-elphel/`) → [OK][Finish]
Do not run `bitbake linux-xlnx -c clean` while the project is open in Eclipse - this command
will delete all he staged files (kernel sources) and Eclipse will reset all file filters, so
*.cproject* file will have to be restored from *eclipse_project_setup*.
Project now is imported into Eclipse workspace.
Source files in Yocto project are staged (downloaded and optionally patched), so `-c clean` re-downloads
files and erases any of your files or changes if they were made in the source directory tree.
*linux-elphel* project keeps all the modified or new files in a sparse copy of the Linux kernel tree (*src*
sub-directory) and the bitbake recipe (`bitbake linux-xlnx -c link`) adds symlinks to the actual
project files. When the full kernel is opened in Eclipse, the base kernel files are from the staging
area (so will be refreshed after `-c clean`) and the project files edits will stay safe in the *src*
subdirectory.
The khelper.py script is used to generate filters for the kernel by collecting information - which
files where accessed during `bitbake linux-xlnx -c compile -f`, results are injected into *.cproject*
configuratgion file, so any of the Linux kernel files that were not accessed during build will be marked
as excluded from build (crossed out) and not resolved by the indexer.
- Project → Properties
- C/C++ General → Preprocessor Include Paths → Entries → GNU C → CDT User Settings
- [Add...] → Select "Preprocessor macros file" → `linux/include/generated/autoconf.h`[OK]
- [Add...] → Select "Preprocessor macros file" → `linux/include/linux/compiler.h`[OK]
- [Add...] → Select "Include file" → `linux/include/linux/kconfig.h`[OK]
- C/C++ General → Indexer
- Check “Enable project specific setttings”
- Check “Enable indexer”
- Uncheck “Index source files not included in the build”
- Uncheck “Index unused headers”
- Check “Index header variants”
- Uncheck “Index source and header files opened in editor”
- Uncheck “Allow heuristic resolution of includes”
- Set size of files to be skipped >100MB (effectively disabling this feature)
- Uncheck all “Skip…” options
- [OK] to close the Advanced Settings window.
- Project → C/C++ Index → Rebuild
......@@ -2,21 +2,53 @@
# encoding: utf-8
from __future__ import division
from __future__ import print_function
"""
# @file khelper.py
# @brief Extract file access data after build, modify CDT project configuration
# (.cproject) accordingly
# @copyright Copyright (C) 2016, Elphel.inc.
# @param <b>License</b>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
@author: Andrey Filippov
@license: GPLv3.0+
@contact: andrey@elphel.coml
@deffield updated: Updated
"""
__author__ = "Andrey Filippov"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Andrey Filippov"
__email__ = "andrey@elphel.com"
__status__ = "Development"
import sys
import os
import time
import xml.etree.ElementTree as ET
'''
TODO: make 2 runs, first before
bitbake linux-xlnx
khelper.py linux -1
#get timestamp
#next 2 commands - I do not understand why their access timestamp is set during previous command and does not change during bitbake
touch /home/eyesis/git/elphel393/linux-elphel/src/drivers/ata/ahci_elphel.c
touch /home/eyesis/git/elphel393/linux-elphel/src/drivers/elphel/sensor_common.c
bitbake linux-xlnx -c compile -f
khelper.py linux <timestamp_from_the_first_run>
TODO:Automate, find out why separate touch commands are needed
Run this program twice:
1-st run ./khelper.py linux -1
and save shown timestamp
Then run (some mystery here)
touch src/drivers/ata/ahci_elphel.c
touch src/drivers/elphel/sensor_common.c
Wait 5 seconds and run (in a different console with appropriate sourcing)
bitbake linux-xlnx -c compile -f
Then again
./khelper.py linux <timestamp_from_the_first_run>
If somethong went wrong you will need to resore .cproject from eclipse_project_setup directory
'''
def file_tree(flist): # Each file in list is a file, no directories
ftree={}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment