diff options
Diffstat (limited to 'user/start/app.rst')
-rw-r--r-- | user/start/app.rst | 111 |
1 files changed, 55 insertions, 56 deletions
diff --git a/user/start/app.rst b/user/start/app.rst index 98fb284..0599305 100644 --- a/user/start/app.rst +++ b/user/start/app.rst @@ -8,9 +8,9 @@ Build Your Application ====================== You tested a BSP in the previous section. We built the ``erc32`` BSP -and it is installed under :file:`$HOME/quick-start/rtems/5`. +and it is installed under :file:`$HOME/quick-start/rtems/@rtems-ver-major@`. -We will now create a simple hello world application with a Git +We will now create a simple Hello World application with a Git repository and using the `Waf <https://waf.io>`_ build system. The application is be created in :file:`$HOME/quick-start/app/hello`. @@ -38,7 +38,7 @@ Download the Waf build system and set it to executable: .. code-block:: none curl https://waf.io/waf-2.0.19 > waf - chmod +w waf + chmod +x waf Initialise a new Git repository: @@ -64,20 +64,20 @@ settings: /* * Simple RTEMS configuration */ - #include <rtems.h> - #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - #define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM + + #define CONFIGURE_UNLIMITED_OBJECTS + #define CONFIGURE_UNIFIED_WORK_AREAS #define CONFIGURE_RTEMS_INIT_TASKS_TABLE - #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_INIT #include <rtems/confdefs.h> -Create the *hello world* application source file. Using an editor +Create the Hello World application source file. Using an editor create :file:`hello.c` and copy the follow code: .. code-block:: c @@ -107,7 +107,7 @@ and copy the Waf script: # from __future__ import print_function - rtems_version = "5" + rtems_version = "6" try: import rtems_waf.rtems as rtems @@ -142,7 +142,7 @@ Configure the application using Waf's ``configure`` command: .. code-block:: none - ./waf configure --rtems=$HOME/quick-start/rtems/5 --rtems-bsp=sparc/erc32 + ./waf configure --rtems=$HOME/quick-start/rtems/6 --rtems-bsp=sparc/erc32 The output will be something close to: @@ -150,45 +150,44 @@ The output will be something close to: Setting top to : $BASE/app/hello Setting out to : $BASE/app/hello/build - RTEMS Version : 5 - Architectures : sparc-rtems5 - Board Support Package (BSP) : sparc-rtems5-erc32 + RTEMS Version : @rtems-ver-major@ + Architectures : sparc-rtems@rtems-ver-major@ + Board Support Package (BSP) : sparc-rtems@rtems-ver-major@-erc32 Show commands : no Long commands : no - Checking for program 'sparc-rtems5-gcc' : $BASE/rtems/5/bin/sparc-rtems5-gcc - Checking for program 'sparc-rtems5-g++' : $BASE/rtems/5/bin/sparc-rtems5-g++ - Checking for program 'sparc-rtems5-gcc' : $BASE/rtems/5/bin/sparc-rtems5-gcc - Checking for program 'sparc-rtems5-ld' : $BASE/rtems/5/bin/sparc-rtems5-ld - Checking for program 'sparc-rtems5-ar' : $BASE/rtems/5/bin/sparc-rtems5-ar - Checking for program 'sparc-rtems5-nm' : $BASE/rtems/5/bin/sparc-rtems5-nm - Checking for program 'sparc-rtems5-objdump' : $BASE/rtems/5/bin/sparc-rtems5-objdump - Checking for program 'sparc-rtems5-objcopy' : $BASE/rtems/5/bin/sparc-rtems5-objcopy - Checking for program 'sparc-rtems5-readelf' : $BASE/rtems/5/bin/sparc-rtems5-readelf - Checking for program 'sparc-rtems5-strip' : $BASE/rtems/5/bin/sparc-rtems5-strip - Checking for program 'sparc-rtems5-ranlib' : $BASE/rtems/5/bin/sparc-rtems5-ranlib - Checking for program 'rtems-ld' : $BASE/rtems/5/bin/rtems-ld - Checking for program 'rtems-tld' : $BASE/rtems/5/bin/rtems-tld - Checking for program 'rtems-syms' : $BASE/rtems/5/bin/rtems-syms - Checking for program 'rtems-bin2c' : $BASE/rtems/5/bin/rtems-bin2c + Checking for program 'sparc-rtems@rtems-ver-major@-gcc' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-gcc + Checking for program 'sparc-rtems@rtems-ver-major@-g++' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-g++ + Checking for program 'sparc-rtems@rtems-ver-major@-gcc' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-gcc + Checking for program 'sparc-rtems@rtems-ver-major@-ld' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-ld + Checking for program 'sparc-rtems@rtems-ver-major@-ar' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-ar + Checking for program 'sparc-rtems@rtems-ver-major@-nm' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-nm + Checking for program 'sparc-rtems@rtems-ver-major@-objdump' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-objdump + Checking for program 'sparc-rtems@rtems-ver-major@-objcopy' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-objcopy + Checking for program 'sparc-rtems@rtems-ver-major@-readelf' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-readelf + Checking for program 'sparc-rtems6-strip' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-strip + Checking for program 'sparc-rtems6-ranlib' : $BASE/rtems/@rtems-ver-major@/bin/sparc-rtems@rtems-ver-major@-ranlib + Checking for program 'rtems-ld' : $BASE/rtems/@rtems-ver-major@/bin/rtems-ld + Checking for program 'rtems-tld' : $BASE/rtems/@rtems-ver-major@/bin/rtems-tld + Checking for program 'rtems-syms' : $BASE/rtems/@rtems-ver-major@/bin/rtems-syms + Checking for program 'rtems-bin2c' : $BASE/rtems/@rtems-ver-major@/bin/rtems-bin2c Checking for program 'tar' : /usr/bin/tar - Checking for program 'gcc, cc' : $BASE/rtems/5/bin/sparc-rtems5-gcc - Checking for program 'ar' : $BASE/rtems/5/bin/sparc-rtems5-ar - Checking for program 'g++, c++' : $BASE/rtems/5/bin/sparc-rtems5-g++ - Checking for program 'ar' : $BASE/rtems/5/bin/sparc-rtems5-ar - Checking for program 'gas, gcc' : $BASE/rtems/5/bin/sparc-rtems5-gcc - Checking for program 'ar' : $BASE/rtems/5/bin/sparc-rtems5-ar + Checking for program 'gcc, cc' : $BASE/rtems/6/bin/sparc-rtems6-gcc + Checking for program 'ar' : $BASE/rtems/6/bin/sparc-rtems6-ar + Checking for program 'g++, c++' : $BASE/rtems/6/bin/sparc-rtems6-g++ + Checking for program 'ar' : $BASE/rtems/6/bin/sparc-rtems6-ar + Checking for program 'gas, gcc' : $BASE/rtems/6/bin/sparc-rtems6-gcc + Checking for program 'ar' : $BASE/rtems/6/bin/sparc-rtems6-ar Checking for c flags '-MMD' : yes Checking for cxx flags '-MMD' : yes - Compiler version (sparc-rtems5-gcc) : 7.5.0 20191114 (RTEMS 5, RSB 5.1.0, Newlib fbaa096) + Compiler version (sparc-rtems@rtems-ver-major@-gcc) : 10.2.1 20210309 (RTEMS @rtems-ver-major@, RSB 5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9) Checking for a valid RTEMS BSP installation : yes Checking for RTEMS_DEBUG : no Checking for RTEMS_MULTIPROCESSING : no Checking for RTEMS_NEWLIB : yes - Checking for RTEMS_POSIX_API : yes + Checking for RTEMS_POSIX_API : no Checking for RTEMS_SMP : no Checking for RTEMS_NETWORKING : no - 'configure' finished successfully (0.686s) - + 'configure' finished successfully (1.142s) Build the application: .. code-block:: none @@ -199,48 +198,48 @@ The output will be something close to: .. code-block:: none - Waf: Entering directory `$BASE/app/hello/build/sparc-rtems5-erc32' + Waf: Entering directory `$BASE/app/hello/build/sparc-rtems@rtems-ver-major@-erc32' [1/3] Compiling init.c [2/3] Compiling hello.c - [3/3] Linking build/sparc-rtems5-erc32/hello.exe - Waf: Leaving directory `$BASE/app/hello/build/sparc-rtems5-erc32' - 'build-sparc-rtems5-erc32' finished successfully (0.183s) + [3/3] Linking build/sparc-rtems@rtems-ver-major@-erc32/hello.exe + Waf: Leaving directory `$BASE/app/hello/build/sparc-rtems@rtems-ver-major@-erc32' + 'build-sparc-rtems@rtems-ver-major@-erc32' finished successfully (0.183s) Run the executable: .. code-block:: none - $HOME/quick-start/rtems/5/bin/rtems-run --rtems-bsps=erc32-sis build/sparc-rtems5-erc32/hello.exe + rtems-run --rtems-bsps=erc32-sis build/sparc-rtems@rtems-ver-major@-erc32/hello.exe The output will be something close to: .. code-block:: none - RTEMS Testing - Run, 5.1.0 - Command Line: $BASE/rtems/5/bin/rtems-run --rtems-bsps=erc32-sis build/sparc-rtems5-erc32/hello.exe - Host: FreeBSD hihi 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64 - Python: 3.7.6 (default, Jan 30 2020, 01:18:54) [Clang 6.0.1 (tags/RELEASE_601/final 335540)] - Host: FreeBSD-12.1-RELEASE-p2-amd64-64bit-ELF (FreeBSD hihi 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64 amd64) + RTEMS Testing - Run, @rtems-ver-mjminrev@ + Command Line: $BASE/quick-start/rtems/@rtems-ver-major@/bin/rtems-run --rtems-bsps=erc32-sis build/sparc-rtems@rtems-ver-major@-erc32/hello.exe + Host: Linux 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 + Python: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] + Host: Linux-5.8.0-44-generic-x86_64-with-glibc2.29 (Linux 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 x86_64) - SIS - SPARC/RISCV instruction simulator 2.21, copyright Jiri Gaisler 2019 - Bug-reports to jiri@gaisler.se + SIS - SPARC/RISCV instruction simulator 2.26, copyright Jiri Gaisler 2020 + Bug-reports to jiri@gaisler.se - ERC32 emulation enabled + ERC32 emulation enabled - Loaded build/sparc-rtems5-erc32/hello.exe, entry 0x02000000 + Loaded build/sparc-rtems@rtems-ver-major@-erc32/hello.exe, entry 0x02000000 Hello World *** FATAL *** fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT) fatal code: 0 (0x00000000) - RTEMS version: 5.1.0 - RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5.1.0, Newlib fbaa096) + RTEMS version: 6.0.0.586e06ec6222f1cd1f005aa8f4a34a8b33f5d862 + RTEMS tools: 10.2.1 20210309 (RTEMS @rtems-ver-major@, RSB 5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9) executing thread ID: 0x08a010001 executing thread name: UI1 cpu 0 in error mode (tt = 0x101) - 107883 0200b6c0: 91d02000 ta 0x0 - Run time : 0:00:01.011474 + 158479 0200d500: 91d02000 ta 0x0 + Run time : 0:00:00.259136 Commit the application to the repository: |