Digi 9P 9360/9750 Application Development, Writing applications, Adding your own applications

Page 31

A p p l i c a t i o n D e v e l o p m e n t

Application Development

C H A P T E R

5

Writing applications

The user applications are stored in subdirectory apps/ of the project folder.

The template project includes several demo applications for use as templates to begin developing your own programs. They will automatically build and copy to the folder “/usr/bin/” of the target when building the system.

Adding your own applications

To add a new application, run the script bin/add_app with the name of the new application as first parameter.

Example:

~/LxNETES-3.2/build_custom$ bin/add_app customapp

This command creates a sample application named ‘customapp’ in the folder apps/ customapp in the source directory. Edit the file apps/customapp/customapp.c to insert your application code.

To use more than one source file, just create the source files and modify Makefile.in to include the files in the build process.

On the next call to make install, the application is added to your root file system.

3 1

Image 31
Contents LxNETES User’s Guide ConnectCore 9P 9360/9750 Page Page Page Contents Building the First Project Interfaces & Devices Appendix B Overview IntroductionCross-development environment Template project Linux kernel sourcesExample applications General features FeaturesWhat’s new in LxNETES 3.2? RTC Gpio This is a tip. It contains useful information about a topic Conventions used in this manualAcronyms and abbreviations System Requirements/Prerequisites RequirementsSystem requirements Optional but recommended components Disk spaceTftp daemon Applications & ServicesNFS server JTAG-Booster N E T E S U s e r ’ s G u i d e Getting Started Connecting host PC with development boardIntroduction Seyon MinicomSeyon Settings Connect powerTest Ethernet configuration # ifconfig eth0 Installing LxNETESGuided Installation Manual Installation N u a l Installation Run configure Building the Default ProjectBuilding the First Project Run make Run make installWriting applications Application DevelopmentAdding your own applications Included example applications Using C++Display Proc/cpuinfo contents Debugging applications Choose the right architecture for your target Web server Boa Included pre-built applicationsShell applications busybox Telnet daemon utelnetdEmbedded Qt Nano-X/microwindowsMem Useful applicationsWriting your own kernel modules What is a kernel module?Kernel Development Writing kernel modulesBuilding and loading of kernel modules Add the module to the build environmentIncluded Kernel modules Minimal Advanced Topics Modifying the default projectD i f y i n g t h e d e Fault p r o j e c t Building a custom project Boot Boot processIntroduction Bank # 0 00000000 32 MB ConnectCore 9P 9360/9750NAND-Flash Linux boot methodsUSB NOR FlashMMU Linux boot processV a n c e d T o p i c s Automating the image download Passing arguments to the kernelUpdating the Flash memory Updating a running system manually Updating a running system the easy wayErase the Flash partition Download the new image file to RAMWrite the image to Flash Kernel BootRoot File System Updating a corrupted system using a debugger Root File System Types Download the kernel to RAM via Tftp Set bootargs to be passed to the kernelLaunch the kernel from RAM JFFS2 Copy the kernel to RAM O t F i l e S y s t e m T y p e s N E T E S U s e r ’ s G u i d e Serial interface Interfaces & DevicesLCD interface USB host interfaceI2C interface SPI interfaceReal time clock RTC How to set the initial system date and timeCompact flash interface SD card interfacePCI interface Appendix a CD contentsRelated documentation Docs Images Install.shReadme.txt RelNotes.txtHardware SetupConnectCore 9P 9360 CC9P9360 ConnectCore 9P 9750 CC9P9750Sdram memory layout Memory layoutsFlash memory layout ConnectCore 9P 9360 / ConnectCore 9PTextbase N E T E S U s e r ’ s G u i d e Appendix B Boot command referenceO o t c o m m a n d r e f e r e n c e Skipped CC9C CCXP270 UNC90 Example A9M24x0 User keys