|
|
| (12 intermediate revisions by 4 users not shown) |
| Line 1: |
Line 1: |
| == Getting the software ==
| | This page is no longer valid. Please go to [[System_less_framework]] for actual information. |
| | |
| Actual source code can be downloaded using a [[Darcs]] tool:
| |
| | |
| darcs get http://rtime.felk.cvut.cz/repos/h8300-boot
| |
| | |
| This will create a copy of the repository on your computer. You can upgrade your repository using the command: | |
| | |
| darcs pull
| |
| | |
| If you have an acount on the ''rtime'' server, you can use ''ssh''-based access to the repository. If an administrater gave you the right for writing to the repository, you can not only read (pull) repository but also write (push) changes to the repository.
| |
| | |
| The syntax for getting the repo is:
| |
| | |
| darcs get <login>@rtime.felk.cvut.cz:/var/repos/h8300-boot
| |
| | |
| | |
| Browsing of project sources is also possible via [http://rtime.felk.cvut.cz/darcs/darcsweb.cgi?r=h8300-boot;a=summary Darcs web interface].
| |
| | |
| If you plan to record some changes and push them back to the server, it is recomended to add the following lines to <tt>_darcs/prefs/boring</tt>:
| |
| | |
| ^TAGS$
| |
| ^config\.omk
| |
| ^_build
| |
| ^_compiled
| |
| | |
| == Compiling ==
| |
| | |
| First, you have to configure the make-system for a board you plan to use. For ''h8canusb'' execute the following command from h8300-boot directory:
| |
| ln -s board/h8canusb/config.h8canusb config.omk
| |
| make default-config
| |
| Then, you can change default configuration of what is compiled by copying <tt>config.omk-default</tt> to <tt>config.omk</tt>. In the copied file change default configuration as you want and delete other lines you want to have default value.
| |
| | |
| After typing
| |
| make
| |
| everithing is goning to compile and if the compilation is completed without errors, you can use this ''build environment'' for building your own applications.
| |
| | |
| === Compiling one application only ===
| |
| | |
| To compile only a part of sources (e.g. your own application), change the directory to where your applications resides and run
| |
| make
| |
| This will (re)compile everithing in current directory and all subdirectories. The result of compilation can be found under the <tt>_compiled</tt> direcotry (located at root of h8300-boot directory structure). The structure of <tt>_compiled</tt> directory is as follows:
| |
| | |
| ; bin : binary programs for target system
| |
| ; bin-utils : binary programs for host system (PC)
| |
| ; include : header files which are used when compiling for target
| |
| ; libs : compiled libraries for target
| |
| | |
| There is another directory called <tt>_build</tt> where are stored intermediate products of compilation such as object files, linker maps and dependency descriptions. You can delete files in <tt>_build</tt> corresponding to your application by issuing
| |
| make clean
| |
| If you want to delete both <tt>_compiled</tt> and <tt>_build</tt> directories, run
| |
| make distclean
| |
| | |
| TODO: LINK_VARIANTS = ram flash
| |
| | |
| === Loading and running an application ===
| |
| | |
| To load an application to the target processor, run
| |
| make load
| |
| This load the application from current directory to either RAM or FLASH memory. Which one is selected depends on a value of <tt>DEFAULT_LD_SCRIPT_VARIANT</tt> variable. First word from value of this variable determines the default memory location for loading (and running). This variable can be set globaly in <tt>config.target</tt> or locally in <tt>Makefile.omk</tt>.
| |
| | |
| If you want to load an application to different memory location, use one of
| |
| make load-flash
| |
| make load-ram
| |
| | |
| You can run loaded application by running one of the following
| |
| make run
| |
| make run-ram
| |
| make run-flash
| |
| | |
| === Bootstrapping the processor ===
| |
| | |
| In order to be able to load applications to the target system, there have to be a bool loader program in processor's FLASH memory. The loader program is located at <tt>app/bloader</tt> directory and you can load it to the processor by
| |
| sh bootstrap
| |
| from <tt>bloader</tt> direcotry.
| |
| | |
| == Using KDevelop for development ==
| |
| | |
| [http://www.kdevelop.org/ KDevelop] is a very good IDE for developing various kind of applications. It can be easily used to develop software for H8300 processors and can be well integrated with OMK make-system.
| |
| | |
| If you want to use KDevelop for development, follow theese points:
| |
| | |
| # Import project to KDevelop (from menu choose Project -> Import existing project). Select the type of project to ''Generic C Application (Custom Makefile)''<br/>[[Image:Kdevelop1.png]]
| |
| # (Optional) Populate your project with source files by anwering '''yes''' to the dialog.<br/>[[Image:Kdevelop2.png]]
| |
| # Open ''Project Options'' dialog (menu Project -> Project Options) and choose ''Run Options''. Select '''Run from the BUILD directory''', to Main Program editbox write '''/usr/local/bin/make''' (you may have your ''make'' in a different directory) and as ''Program Arguments'' write '''load run'''.<br/>[[Image:Kdevelop3.png]]
| |
| # Now you can compile your application by pressing ''F8'' and if there are some errors, you can quickly jump the place in source whre the error is by pressing ''F4''.<br/>[[Image:Kdevelop4.png]]
| |
| # After successfull compilation you can run your application by clicking ''Execute program'' icon. I recomend you to create shortcut key ''F9'' for this action. If you change your sources, you can booth recompile and execute your application by simply pressing ''F9''.<br/>[[Image:Kdevelop5.png]]
| |
| | |
| == Using TAGS for navigation in files ==
| |
| | |
| If you run
| |
| make TAGS
| |
| in any direcotry, the file TAGS in the toplevel directory of the project will be created. This file can be used by various editors (such as [[wikipedia:Emacs|Emacs]]) for quick searching of symbols in source files.
| |
This page is no longer valid. Please go to System_less_framework for actual information.