development_environments.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. .. todo:: revise and update links
  2. ========================
  3. Development Environments
  4. ========================
  5. Linux + GNU ``make`` + GCC/binutils for Linux
  6. =============================================
  7. The is the most natural development environment for NuttX. Any version
  8. of the GCC/binutils toolchain may be used. There is a highly modified
  9. `buildroot <http://buildroot.uclibc.org/>`__ available for download from
  10. the `NuttX
  11. Bitbucket.org <https://bitbucket.org/nuttx/buildroot/downloads/>`__
  12. page. This download may be used to build a NuttX-compatible ELF
  13. toolchain under Linux or Cygwin. That toolchain will support ARM, m68k,
  14. m68hc11, m68hc12, and SuperH ports. The buildroot GIT may be accessed in
  15. the NuttX `buildroot GIT <https://bitbucket.org/nuttx/buildroot>`__.
  16. Linux + GNU ``make`` + SDCC for Linux
  17. =====================================
  18. Also very usable is the Linux environment using the
  19. `SDCC <http://sdcc.sourceforge.net/>`__ compiler. The SDCC compiler
  20. provides support for the 8051/2, z80, hc08, and other microcontrollers.
  21. The SDCC-based logic is less well exercised and you will likely find
  22. some compilation issues if you use parts of NuttX with SDCC that have
  23. not been well-tested.
  24. Windows with Cygwin + GNU ``make`` + GCC/binutils (custom built under Cygwin)
  25. =============================================================================
  26. This combination works well too. It works just as well as the native
  27. Linux environment except that compilation and build times are a little
  28. longer. The custom NuttX
  29. `buildroot <https://bitbucket.org/nuttx/buildroot/downloads/>`__
  30. referenced above may be build in the Cygwin environment as well.
  31. Windows with Cygwin + GNU ``make`` + SDCC (custom built under Cygwin)
  32. =====================================================================
  33. I have never tried this combination, but it would probably work just
  34. fine.
  35. Windows with Cygwin + GNU ``make`` + Windows Native Toolchain
  36. =============================================================
  37. This is a tougher environment. In this case, the Windows native
  38. toolchain is unaware of the Cygwin *sandbox* and, instead, operates in
  39. the native Windows environment. The primary difficulties with this are:
  40. - **Paths**. Full paths for the native toolchain must follow Windows
  41. standards. For example, the path ``/home/my\ name/nuttx/include`` my
  42. have to be converted to something like
  43. ``'C:\cygwin\home\my name\nuttx\include'`` to be usable by the
  44. toolchain.
  45. - **Symbolic Links** NuttX depends on symbolic links to install
  46. platform-specific directories in the build system. On Linux, true
  47. symbolic links are used. On Cygwin, emulated symbolic links are used.
  48. Unfortunately, for native Windows applications that operate outside
  49. of the Cygwin *sandbox*, these symbolic links cannot be used.
  50. - **Dependencies** NuttX uses the GCC compiler's ``-M`` option to
  51. generate make dependencies. These dependencies are retained in files
  52. called ``Make.deps`` throughout the system. For compilers other than
  53. GCC, there is no support for making dependencies in this way.
  54. **Supported Windows Native Toolchains**. At present, the following
  55. Windows native toolchains are in use:
  56. #. GCC built for Windows (such as CodeSourcery, Atollic, devkitARM,
  57. etc.),
  58. #. SDCC built for Windows,
  59. #. the ZiLOG XDS-II toolchain for Z16F, z8Encore, and eZ80Acclaim parts.
  60. Windows Native (``CMD.exe``) + GNUWin32 (including GNU ``make``) + MinGW Host GCC compiler + Windows Native Toolchain
  61. =====================================================================================================================
  62. Build support has been added to support building natively in a Windows
  63. console rather than in a POSIX-like environment.
  64. This build:
  65. #. Uses all Windows style paths
  66. #. Uses primarily Windows batch commands from cmd.exe, with
  67. #. A few extensions from GNUWin32
  68. This capability first appeared in NuttX-6.24 and should still be
  69. considered a work in progress because: (1) it has not been verfied on
  70. all targets and tools, and (2) still lacks some of the creature-comforts
  71. of the more mature environments. The windows native build logic
  72. initiated if ``CONFIG_WINDOWS_NATIVE=y`` is defined in the NuttX
  73. configuration file:
  74. At present, this build environment also requires:
  75. **Windows Console**. The build must be performed in a Windows console
  76. window. This may be using the standard ``CMD.exe`` terminal that comes
  77. with Windows. I prefer the ConEmu terminal which can be downloaded from:
  78. http://code.google.com/p/conemu-maximus5/
  79. **GNUWin32**. The build still relies on some Unix-like commands. I
  80. usethe GNUWin32 tools that can be downloaded from
  81. http://gnuwin32.sourceforge.net/. See the top-level ``nuttx/README.txt``
  82. file for some download, build, and installation notes.
  83. **MinGW-GCC**. MinGW-GCC is used to compiler the C tools in the
  84. ``nuttx/tools`` directory that are needed by the build. MinGW-GCC can be
  85. downloaded from http://www.mingw.org/. If you are using GNUWin32, then
  86. it is recommended that you not install the optional MSYS components as
  87. there may be conflicts.
  88. Wine + GNU ``make`` + Windows Native Toolchain
  89. ==============================================
  90. I've never tried this one, but I off the following reported by an ez80
  91. user using the ZiLOG ZDS-II Windows-native toolchain:
  92. "I've installed ZDS-II 5.1.1 (IDE for ez80-based boards) on wine
  93. (windows emulator for UNIX) and to my surprise, not many changes were
  94. needed to make GIT snapshot of NuttX buildable... I've tried nsh
  95. profile and build process completed successfully. One remark is
  96. necessary: NuttX makefiles for ez80 are referencing ``cygpath``
  97. utility. Wine provides similar thing called ``winepath`` which is
  98. compatible and offers compatible syntax. To use that, ``winepath``
  99. (which itself is a shell script) has to be copied as ``cygpath``
  100. somewhere in ``$PATH``, and edited as in following patch:
  101. "Better solution would be replacing all ``cygpath`` references in
  102. ``Makefiles`` with ``$(CONVPATH)`` (or ``${CONVPATH}`` in shell
  103. scripts) and setting ``CONVPATH`` to ``cygpath`` or ``winepath``
  104. regarding to currently used environment.
  105. Other Environments
  106. ==================
  107. **Environment Dependencies**. The primary environmental dependency of
  108. NuttX are (1) GNU make, (2) bash scripting, and (3) Linux utilities
  109. (such as cat, sed, etc.). If you have other platforms that support GNU
  110. make or make utilities that are compatible with GNU make, then it is
  111. very likely that NuttX would work in that environment as well (with some
  112. porting effort). If GNU make is not supported, then some significant
  113. modification of the Make system would be required.
  114. **MSYS**. I have not used MSYS but what I gather from talking with NuttX
  115. users is that MSYS can be used as an alternative to Cygwin in any of the
  116. above Cygwin environments. This is not surprising since MSYS is based on
  117. an older version of Cygwin (cygwin-1.3). MSYS has been modified,
  118. however, to interoperate in the Windows environment better than Cygwin
  119. and that may be of value to some users.
  120. MSYS, however, cannot be used with the native Windows NuttX build
  121. because it will invoke the MSYS bash shell instead of the ``CMD.exe``
  122. shell. Use GNUWin32 in the native Windows build environment.