diff --git a/configs/hymini-stm32v/README.txt b/configs/hymini-stm32v/README.txt index 6e44dc9bcf..b50a33ccc0 100755 --- a/configs/hymini-stm32v/README.txt +++ b/configs/hymini-stm32v/README.txt @@ -188,7 +188,7 @@ DFU The DFU SE PC-based software is available from the STMicro website, http://www.st.com. General usage instructions: - 1. Convert the NuttX Intel Hex file (nuttx.ihx) into a special DFU + 1. Convert the NuttX Intel Hex file (nuttx.hex) into a special DFU file (nuttx.dfu)... see below for details. 2. Connect the Hy-Mini STM32v board to your computer using a USB cable. @@ -207,10 +207,9 @@ DFU DFU SE PC_based software installation includes a file "DFU File Manager" conversion program that a file in Intel Hex format to the special DFU format. When you successfully build NuttX, you will find a file called - nutt.ihx in the top-level directory. That is the file that you should - provide to the DFU File Manager. You will need to rename it to nuttx.hex - in order to find it with the DFU File Manager. You will end up with - a file called nuttx.dfu that you can use with the STMicro DFU SE program. + nutt.hex in the top-level directory. That is the file that you should + provide to the DFU File Manager. You will end up with a file called + nuttx.dfu that you can use with the STMicro DFU SE program. LEDs ==== diff --git a/configs/mcu123-lpc214x/README.txt b/configs/mcu123-lpc214x/README.txt index a05b239e61..35afa9ac82 100644 --- a/configs/mcu123-lpc214x/README.txt +++ b/configs/mcu123-lpc214x/README.txt @@ -190,9 +190,7 @@ You download FlashMagic for Windows or MAC here: http://www.flashmagictool.com Check "Erase all Flash+Code Rd Prot" -3. Select the nuttx.hex file (you will have to rename the nuttx.ihx - file generated by the make to nuttx.hex in order for the tool to - see it +3. Select the nuttx.hex file 4. Options: Verify after programming diff --git a/configs/pcblogic-pic32mx/README.txt b/configs/pcblogic-pic32mx/README.txt index ab41a57fdd..5fe88db5c8 100644 --- a/configs/pcblogic-pic32mx/README.txt +++ b/configs/pcblogic-pic32mx/README.txt @@ -227,41 +227,36 @@ Loading NuttX with PICkit2 directory: 1) nuttx - This is an ELF file, and - 2) nuttx.ihx - This is an Intel Hex format file. This is controlled by + 2) nuttx.hex - This is an Intel Hex format file. This is controlled by the setting CONFIG_INTELHEX_BINARY in the .config file. - The PICkit tool wants an Intel Hex format file to burn into FLASH. - However, there are two problems with the generated nutt.ihx: - - 1) The tool expects Intel Hex format files to be named *.hex. This - is not a significant issue. However, just renaming the file to - nuttx.hex is *not* sufficient. There is another problem: - 2) The tool expects the nuttx.hex file to contain physical addresses. - But the nuttx.ihx file generated from the top-level make will have - address in the KSEG0 and KSEG1 regions. + The PICkit tool wants an Intel Hex format file to burn into FLASH. However, + there is a problem with the generated nutt.hex: The tool expects the nuttx.hex + file to contain physical addresses. But the nuttx.hex file generated from the + top-level make will have address in the KSEG0 and KSEG1 regions. tools/mkpichex: --------------- There is a simple tool in the configs/pcblogic-pic32mx/tools directory - that can be used to solve both issues with the nuttx.ihx file. But, + that can be used to solve both issues with the nuttx.hex file. But, first, you must build the the tools: cd configs/pcblogic-pic32mx/tools make Now you will have an excecutable file call mkpichex (or mkpichex.exe on - Cygwin). This program will take the nutt.ihx file as an input, it will + Cygwin). This program will take the nutt.hex file as an input, it will convert all of the KSEG0 and KSEG1 addresses to physical address, and - it will write the modified file as nuttx.hex. + it will write the modified file, replacing the original nuttx.hex. To use this file, you need to do the following things: . ./setenv.sh # Source setenv.sh. Among other this, this script # will add configs/pcblogic-pic32mx/tools to your # PATH variable - make # Build nuttx and nuttx.ihx - mkpichex $PWD # Convert nuttx.ihx to nuttx.hex. $PWD is the path + make # Build nuttx and nuttx.hex + mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path # to the top-level build directory. It is the only # required input to mkpichex. diff --git a/configs/pcblogic-pic32mx/tools/Makefile b/configs/pcblogic-pic32mx/tools/Makefile index 60d3b14adf..018fcaa8c3 100644 --- a/configs/pcblogic-pic32mx/tools/Makefile +++ b/configs/pcblogic-pic32mx/tools/Makefile @@ -1,8 +1,8 @@ ############################################################################ # configs/pcblogic-pic32mx/tools/Makefile # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -41,7 +41,7 @@ default: mkpichex CFLAGS = -O2 -Wall -I. -# mkpichex - Convert nuttx.ihx to nuttx.hex +# mkpichex - Convert virtual addresses in nuttx.hex to physical addresses mkconfig: mkpichex.c mkpichex.c @gcc $(CFLAGS) -o mkpichex mkpichex.c diff --git a/configs/pcblogic-pic32mx/tools/mkpichex.c b/configs/pcblogic-pic32mx/tools/mkpichex.c index 2d5251d028..c15a275643 100644 --- a/configs/pcblogic-pic32mx/tools/mkpichex.c +++ b/configs/pcblogic-pic32mx/tools/mkpichex.c @@ -1,8 +1,8 @@ /**************************************************************************** * configs/pcblogic-pic32mx/tools/mkpichex.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -125,7 +125,7 @@ static inline char *getfilepath(const char *path, const char *name, const char * static void show_usage(const char *progname) { - fprintf(stderr, "USAGE: %s \n", progname); + fprintf(stderr, "USAGE: %s \n", progname); exit(1); } @@ -246,14 +246,14 @@ int main(int argc, char **argv, char **envp) show_usage(argv[0]); } - srcfile = getfilepath(argv[1], "nuttx", "ihx"); + srcfile = getfilepath(argv[1], "nuttx", "hex"); if (!srcfile) { fprintf(stderr, "getfilepath failed\n"); exit(2); } - destfile = getfilepath(argv[1], "nuttx", "hex"); + destfile = getfilepath(argv[1], "nuttx", "tmp"); if (!destfile) { fprintf(stderr, "getfilepath failed\n"); @@ -295,5 +295,21 @@ int main(int argc, char **argv, char **envp) fclose(src); fclose(dest); + + /* Remove the original nuttx.hex file */ + + if (remove(srcfile) != OK) + { + fprintf(stderr, "Failed to remove the old '%s'\n", srcfile); + + } + + /* Rename the new nuttx.tmp file to nuttx.hex */ + + if (rename(destfile, srcfile) != OK) + { + fprintf(stderr, "Failed to rename '%s' to '%s'\n", destfile, srcfile); + } + return 0; } diff --git a/configs/pic32-starterkit/README.txt b/configs/pic32-starterkit/README.txt index d9a562fe15..e2c625419f 100644 --- a/configs/pic32-starterkit/README.txt +++ b/configs/pic32-starterkit/README.txt @@ -469,40 +469,36 @@ Creating Compatible NuttX HEX files directory: 1) nuttx - This is an ELF file, and - 2) nuttx.ihx - This is an Intel Hex format file. This is controlled by + 2) nuttx.hex - This is an Intel Hex format file. This is controlled by the setting CONFIG_INTELHEX_BINARY in the .config file. - However, there are two problems with the generated nutt.ihx: - - 1) The tool expects Intel Hex format files to be named *.hex. This - is not a significant issue. However, just renaming the file to - nuttx.hex is *not* sufficient. There is another problem: - 2) The tool expects the nuttx.hex file to contain physical addresses. - But the nuttx.ihx file generated from the top-level make will have - address in the KSEG0 and KSEG1 regions. + The PICkit tool wants an Intel Hex format file to burn into FLASH. However, + there is a problem with the generated nutt.hex: The tool expects the nuttx.hex + file to contain physical addresses. But the nuttx.hex file generated from the + top-level make will have address in the KSEG0 and KSEG1 regions. tools/mkpichex: --------------- There is a simple tool in the configs/pic32-starterkit/tools directory - that can be used to solve both issues with the nuttx.ihx file. But, + that can be used to solve both issues with the nuttx.hex file. But, first, you must build the the tools: cd configs/pic32-starterkit/tools make Now you will have an excecutable file call mkpichex (or mkpichex.exe on - Cygwin). This program will take the nutt.ihx file as an input, it will + Cygwin). This program will take the nutt.hex file as an input, it will convert all of the KSEG0 and KSEG1 addresses to physical address, and - it will write the modified file as nuttx.hex. + it will write the modified file, replacing the original nuttx.hex. To use this file, you need to do the following things: . ./setenv.sh # Source setenv.sh. Among other this, this script # will add configs/pic32-starterkit/tools to your # PATH variable - make # Build nuttx and nuttx.ihx - mkpichex $PWD # Convert nuttx.ihx to nuttx.hex. $PWD is the path + make # Build nuttx and nuttx.hex + mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path # to the top-level build directory. It is the only # required input to mkpichex. diff --git a/configs/pic32-starterkit/tools/Makefile b/configs/pic32-starterkit/tools/Makefile index b01fbba19e..71ec90476f 100644 --- a/configs/pic32-starterkit/tools/Makefile +++ b/configs/pic32-starterkit/tools/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/pic32-starterkit/tools/Makefile # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ default: mkpichex CFLAGS = -O2 -Wall -I. -# mkpichex - Convert nuttx.ihx to nuttx.hex +# mkpichex - Convert virtual addresses in nuttx.hex to physical addresses mkconfig: mkpichex.c mkpichex.c @gcc $(CFLAGS) -o mkpichex mkpichex.c diff --git a/configs/pic32-starterkit/tools/mkpichex.c b/configs/pic32-starterkit/tools/mkpichex.c index 0922e6768e..90d5efc549 100644 --- a/configs/pic32-starterkit/tools/mkpichex.c +++ b/configs/pic32-starterkit/tools/mkpichex.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/pic32-starterkit/tools/mkpichex.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -125,7 +125,7 @@ static inline char *getfilepath(const char *path, const char *name, const char * static void show_usage(const char *progname) { - fprintf(stderr, "USAGE: %s \n", progname); + fprintf(stderr, "USAGE: %s \n", progname); exit(1); } @@ -246,14 +246,14 @@ int main(int argc, char **argv, char **envp) show_usage(argv[0]); } - srcfile = getfilepath(argv[1], "nuttx", "ihx"); + srcfile = getfilepath(argv[1], "nuttx", "hex"); if (!srcfile) { fprintf(stderr, "getfilepath failed\n"); exit(2); } - destfile = getfilepath(argv[1], "nuttx", "hex"); + destfile = getfilepath(argv[1], "nuttx", "tmp"); if (!destfile) { fprintf(stderr, "getfilepath failed\n"); @@ -295,5 +295,21 @@ int main(int argc, char **argv, char **envp) fclose(src); fclose(dest); + + /* Remove the original nuttx.hex file */ + + if (remove(srcfile) != OK) + { + fprintf(stderr, "Failed to remove the old '%s'\n", srcfile); + + } + + /* Rename the new nuttx.tmp file to nuttx.hex */ + + if (rename(destfile, srcfile) != OK) + { + fprintf(stderr, "Failed to rename '%s' to '%s'\n", destfile, srcfile); + } + return 0; } diff --git a/configs/pjrc-8051/Make.defs b/configs/pjrc-8051/Make.defs index 68de716507..a1443723e7 100644 --- a/configs/pjrc-8051/Make.defs +++ b/configs/pjrc-8051/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/pjrc-8051/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -84,7 +84,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/sam3u-ek/README.txt b/configs/sam3u-ek/README.txt index 872938b6f3..510d2f1e65 100755 --- a/configs/sam3u-ek/README.txt +++ b/configs/sam3u-ek/README.txt @@ -345,8 +345,8 @@ must be is one of the following: nuttx_user.elf - The pass1 ELF file nuttx - The pass2 ELF file - nuttx_user.ihx - The pass1 Intel HEX format file - nuttx.ihx - The pass2 Intel HEX file + nuttx_user.hex - The pass1 Intel HEX format file + nuttx.hex - The pass2 Intel HEX file The J-Link program will except files in .hex, .mot, .srec, and .bin formats. diff --git a/configs/sam3u-ek/kernel/Makefile b/configs/sam3u-ek/kernel/Makefile index f9903b1577..64b53f2f05 100755 --- a/configs/sam3u-ek/kernel/Makefile +++ b/configs/sam3u-ek/kernel/Makefile @@ -72,8 +72,8 @@ $(TOPDIR)/nuttx_user.elf: nuttx_user.elf @echo "LD: nuttx_user.elf" @cp -a nuttx_user.elf $(TOPDIR)/nuttx_user.elf ifeq ($(CONFIG_INTELHEX_BINARY),y) - @echo "CP: nuttx_user.ihx" - @$(OBJCOPY) $(OBJCOPYARGS) -O ihex nuttx_user.elf $(TOPDIR)/nuttx_user.ihx + @echo "CP: nuttx_user.hex" + @$(OBJCOPY) $(OBJCOPYARGS) -O ihex nuttx_user.elf $(TOPDIR)/nuttx_user.hex endif ifeq ($(CONFIG_MOTOROLA_SREC),y) @echo "CP: nuttx_user.srec" diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index 7e23d7dc94..de6e066a39 100755 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -192,7 +192,7 @@ DFU and JTAG The DFU SE PC-based software is available from the STMicro website, http://www.st.com. General usage instructions: - 1. Convert the NuttX Intel Hex file (nuttx.ihx) into a special DFU + 1. Convert the NuttX Intel Hex file (nuttx.hex) into a special DFU file (nuttx.dfu)... see below for details. 2. Connect the STM3210E-EVAL board to your computer using a USB cable. @@ -211,10 +211,9 @@ DFU and JTAG DFU SE PC_based software installation includes a file "DFU File Manager" conversion program that a file in Intel Hex format to the special DFU format. When you successfully build NuttX, you will find a file called - nutt.ihx in the top-level directory. That is the file that you should - provide to the DFU File Manager. You will need to rename it to nuttx.hex - in order to find it with the DFU File Manager. You will end up with - a file called nuttx.dfu that you can use with the STMicro DFU SE program. + nutt.hex in the top-level directory. That is the file that you should + provide to the DFU File Manager. You will end up with a file called + nuttx.dfu that you can use with the STMicro DFU SE program. Enabling JTAG ------------- diff --git a/configs/stm3240g-eval/README.txt b/configs/stm3240g-eval/README.txt index 7ecbd71b5a..b41e492120 100755 --- a/configs/stm3240g-eval/README.txt +++ b/configs/stm3240g-eval/README.txt @@ -43,14 +43,17 @@ GNU Toolchain Options 4. Raisonance GNU toolchain, or 5. The NuttX buildroot Toolchain (see below). - All testing has been conducted using the CodeSourcery toolchain for Windows. To use - the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to + Most testing has been conducted using the CodeSourcery toolchain for Windows and + that is the default toolchain in most configurations (FPU-related testing has + been performed with the Atolloc toolchain for windows. To use the Atollic, + devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to add one of the following configuration options to your .config (or defconfig) file: CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows CONFIG_STM32_CODESOURCERYL=y : CodeSourcery under Linux - CONFIG_STM32_ATOLLIC=y : Atollic toolchain under Windows + CONFIG_STM32_ATOLLIC_LITE=y : The free, "Lite" version of Atollic toolchain under Windows + CONFIG_STM32_ATOLLIC_PRO=y : The paid, "Pro" version of Atollic toolchain under Windows CONFIG_STM32_DEVKITARM=y : devkitARM under Windows CONFIG_STM32_RAISONANCE=y : Raisonance RIDE7 under Windows CONFIG_STM32_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) @@ -99,6 +102,30 @@ GNU Toolchain Options level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with -Os. + The Atollic "Pro" and "Lite" Toolchain + -------------------------------------- + One problem that I had with the Atollic toolchains is that the provide a gcc.exe + and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path + appears in your PATH variable before /usr/bin, then you will get the wrong gcc + when you try to build host executables. This will cause to strange, uninterpretable + errors build some host binaries in tools/ when you first make. Here is my + workaround kludge. + + 1. Edit the setenv.sh to put the Atollic toolchain at the beginning of the PATH + 2. Source the setenv.sh file: . ./setenv.sh. A side effect of this is that it + will set an environment variable called PATH_ORIG. + 3. Then go back to the original patch: export PATH=$PATH_ORIG + 4. Then make. The make will build all of the host executable but will fail + when it gets to the first ARM binary. + 5. Then source setenv.sh again: . ./setenv.sh. That will correct the PATH + again. When you do make again, the host executables are already made and + now the correct PATH is in place for the ARM build. + + Also, the Atollic toolchains are the only toolchains that have built-in support for + the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will + need to use the Atollic toolchain for now. See the FPU section below for more + information. + The Atollic "Lite" Toolchain ---------------------------- The free, "Lite" version of the Atollic toolchain does not support C++ nor @@ -121,28 +148,6 @@ GNU Toolchain Options CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n - Another problem that I had with the Atollic toolchain is that the provide a gcc.exe - and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path - appears in your PATH variable before /usr/bin, then you will get the wrong gcc - when you try to build host executables. This will cause to strange, uninterpretable - errors build some host binaries in tools/ when you first make. Here is my - workaround kludge. - - 1. Edit the setenv.sh to put the Atollic toolchain at the beginning of the PATH - 2. Source the setenv.sh file: . ./setenv.sh. A side effect of this is that it - will set an environment variable called PATH_ORIG. - 3. Then go back to the original patch: export PATH=$PATH_ORIG - 4. Then make. The make will build all of the host executable but will fail - when it gets to the first ARM binary. - 5. Then source setenv.sh again: . ./setenv.sh. That will correct the PATH - again. When you do make again, the host executables are already made and - now the correct PATH is in place for the ARM build. - - Also, the Atollic toolchain is the only toolchain that has built-in support for - the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will - need to use the Atollic toolchain for now. See the FPU section below for more - information. - devkitARM --------- The devkitARM toolchain includes a version of MSYS make. Make sure that the @@ -387,7 +392,7 @@ CFLAGS Only the Atollic toolchain has built-in support for the Cortex-M4 FPU. You will see the following lines in each Make.defs file: - ifeq ($(CONFIG_STM32_ATOLLIC),y) + ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows ... ifeq ($(CONFIG_ARCH_FPU),y) @@ -414,20 +419,22 @@ Configuration Changes Below are all of the configuration changes that I had to make to configs/stm3240g-eval/nsh2 in order to successfully build NuttX using the Atollic toolchain WITH FPU support: - -CONFIG_ARCH_FPU=y : Enable FPU support - +CONFIG_ARCH_FPU=n + -CONFIG_ARCH_FPU=n : Enable FPU support + +CONFIG_ARCH_FPU=y - -CONFIG_STM32_CODESOURCERYW=n : Disable the CodeSourcery toolchain - +CONFIG_STM32_CODESOURCERYW=y + -CONFIG_STM32_CODESOURCERYW=y : Disable the CodeSourcery toolchain + +CONFIG_STM32_CODESOURCERYW=n - -CONFIG_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -CONFIG_STM32_ATOLLIC_LITE=n : Enable *one* the Atollic toolchains + CONFIG_STM32_ATOLLIC_PRO=n + -CONFIG_STM32_ATOLLIC_LITE=y : The "Lite" version + CONFIG_STM32_ATOLLIC_PRO=n : The "Pro" version - -CONFIG_INTELHEX_BINARY=n : Suppress generation FLASH download formats - +CONFIG_INTELHEX_BINARY=y + -CONFIG_INTELHEX_BINARY=y : Suppress generation FLASH download formats + +CONFIG_INTELHEX_BINARY=n : (Only necessary with the "Lite" version) - -CONFIG_HAVE_CXX=n : Suppress generation of C++ code - +CONFIG_HAVE_CXX=y + -CONFIG_HAVE_CXX=y : Suppress generation of C++ code + +CONFIG_HAVE_CXX=n : (Only necessary with the "Lite" version) See the section above on Toolchains, NOTE 2, for explanations for some of the configuration settings. Some of the usual settings are just not supported @@ -838,7 +845,7 @@ Where is one of the following: -CONFIG_STM32_SDIO=n : SDIO is enabled +CONFIG_STM32_SDIO=y - Logically, that is the only difference: This configuration has SDIO (and + Logically, these are the only differences: This configuration has SDIO (and the SD card) enabled and the serial console disabled. There is ONLY a Telnet console!. @@ -887,10 +894,9 @@ Where is one of the following: "If you use a large I/O buffer to access the file system, then the MMCSD driver will perform multiple block SD transfers. With DMA ON, this seems to result in CRC errors detected by the hardware - during the transfer. Workaround: Use I/O buffers less the 1024 - bytes." + during the transfer. Workaround: CONFIG_MMCSD_MULTIBLOCK_DISABLE=y" - For this reason, CONFIG_FTPD_DATABUFFERSIZE=512 appears in the defconfig + For this reason, CONFIG_MMCSD_MULTIBLOCK_DISABLE=y appears in the defconfig file. 6. Another DMA-related concern. I see this statement in the reference @@ -914,14 +920,22 @@ Where is one of the following: If you use the Atollic toolchain, then the FPU test can be enabled in the examples/ostest by adding the following your NuttX configuration file: - -CONFIG_ARCH_FPU=n : Enabled the FPU + -CONFIG_ARCH_FPU=n : Enable FPU support +CONFIG_ARCH_FPU=y - -CONFIG_STM32_CODESOURCERYW=y : Disable CodeSourcery under Windows - +CONFIG_STM32_CODESOURCERYL=n + -CONFIG_STM32_CODESOURCERYW=y : Disable the CodeSourcery toolchain + +CONFIG_STM32_CODESOURCERYW=n - -CONFIG_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -CONFIG_STM32_ATOLLIC_LITE=n : Enable *one* the Atollic toolchains + CONFIG_STM32_ATOLLIC_PRO=n + -CONFIG_STM32_ATOLLIC_LITE=y : The "Lite" version + CONFIG_STM32_ATOLLIC_PRO=n : The "Pro" version + + -CONFIG_INTELHEX_BINARY=y : Suppress generation FLASH download formats + +CONFIG_INTELHEX_BINARY=n : (Only necessary with the "Lite" version) + + -CONFIG_HAVE_CXX=y : Suppress generation of C++ code + +CONFIG_HAVE_CXX=n : (Only necessary with the "Lite" version) -CONFIG_SCHED_WAITPID=y : Enable the waitpid() API needed by the FPU test +CONFIG_SCHED_WAITPID=n diff --git a/configs/stm3240g-eval/dhcpd/Make.defs b/configs/stm3240g-eval/dhcpd/Make.defs index 5de6dec905..ed57ad4969 100644 --- a/configs/stm3240g-eval/dhcpd/Make.defs +++ b/configs/stm3240g-eval/dhcpd/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index 5bbaf0482f..0fa433c4f1 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/dhcpd/setenv.sh b/configs/stm3240g-eval/dhcpd/setenv.sh index e4312c3c24..e16c4a7fdd 100755 --- a/configs/stm3240g-eval/dhcpd/setenv.sh +++ b/configs/stm3240g-eval/dhcpd/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm3240g-eval/nettest/Make.defs b/configs/stm3240g-eval/nettest/Make.defs index 50cb6b296a..a813997878 100644 --- a/configs/stm3240g-eval/nettest/Make.defs +++ b/configs/stm3240g-eval/nettest/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index b690b503b1..d73597d8a6 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/nettest/setenv.sh b/configs/stm3240g-eval/nettest/setenv.sh index 4ce9ee88f6..ee3c15ba1a 100755 --- a/configs/stm3240g-eval/nettest/setenv.sh +++ b/configs/stm3240g-eval/nettest/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm3240g-eval/nsh/Make.defs b/configs/stm3240g-eval/nsh/Make.defs index 5904c18c3c..b99670c073 100644 --- a/configs/stm3240g-eval/nsh/Make.defs +++ b/configs/stm3240g-eval/nsh/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index 75becc8392..654d3342fb 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/nsh/setenv.sh b/configs/stm3240g-eval/nsh/setenv.sh index aacd280898..8d502cbe59 100755 --- a/configs/stm3240g-eval/nsh/setenv.sh +++ b/configs/stm3240g-eval/nsh/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm3240g-eval/nsh2/Make.defs b/configs/stm3240g-eval/nsh2/Make.defs index c7fc580d72..19dd3ee399 100644 --- a/configs/stm3240g-eval/nsh2/Make.defs +++ b/configs/stm3240g-eval/nsh2/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index 39abd9bef8..c2425a0eec 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=y # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/nsh2/setenv.sh b/configs/stm3240g-eval/nsh2/setenv.sh index 380b35933c..4604aa72e8 100755 --- a/configs/stm3240g-eval/nsh2/setenv.sh +++ b/configs/stm3240g-eval/nsh2/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm3240g-eval/ostest/Make.defs b/configs/stm3240g-eval/ostest/Make.defs index dc7d728eb8..c261d4ec32 100644 --- a/configs/stm3240g-eval/ostest/Make.defs +++ b/configs/stm3240g-eval/ostest/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/ostest/defconfig b/configs/stm3240g-eval/ostest/defconfig index 268af2367c..b2481d915d 100644 --- a/configs/stm3240g-eval/ostest/defconfig +++ b/configs/stm3240g-eval/ostest/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/ostest/setenv.sh b/configs/stm3240g-eval/ostest/setenv.sh index bd830183e7..7bd407845a 100755 --- a/configs/stm3240g-eval/ostest/setenv.sh +++ b/configs/stm3240g-eval/ostest/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm3240g-eval/telnetd/Make.defs b/configs/stm3240g-eval/telnetd/Make.defs index 0fede585e8..509bc165f3 100644 --- a/configs/stm3240g-eval/telnetd/Make.defs +++ b/configs/stm3240g-eval/telnetd/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index 8120189f9d..43a5b7c445 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=y CONFIG_STM32_CODESOURCERYL=n -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm3240g-eval/telnetd/setenv.sh b/configs/stm3240g-eval/telnetd/setenv.sh index 4edcc0db29..148a28d520 100755 --- a/configs/stm3240g-eval/telnetd/setenv.sh +++ b/configs/stm3240g-eval/telnetd/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index 1048e54ace..d770496b22 100755 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -49,7 +49,8 @@ GNU Toolchain Options CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows CONFIG_STM32_CODESOURCERYL=y : CodeSourcery under Linux - CONFIG_STM32_ATOLLIC=y : Atollic toolchain under Windows + CONFIG_STM32_ATOLLIC_LITE=y : The free, "Lite" version of Atollic toolchain under Windows + CONFIG_STM32_ATOLLIC_PRO=y : The paid, "Pro" version of Atollic toolchain under Windows CONFIG_STM32_DEVKITARM=y : devkitARM under Windows CONFIG_STM32_RAISONANCE=y : Raisonance RIDE7 under Windows CONFIG_STM32_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default) @@ -98,6 +99,30 @@ GNU Toolchain Options level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with -Os. + The Atollic "Pro" and "Lite" Toolchain + -------------------------------------- + One problem that I had with the Atollic toolchains is that the provide a gcc.exe + and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path + appears in your PATH variable before /usr/bin, then you will get the wrong gcc + when you try to build host executables. This will cause to strange, uninterpretable + errors build some host binaries in tools/ when you first make. Here is my + workaround kludge. + + 1. Edit the setenv.sh to put the Atollic toolchain at the beginning of the PATH + 2. Source the setenv.sh file: . ./setenv.sh. A side effect of this is that it + will set an environment variable called PATH_ORIG. + 3. Then go back to the original patch: export PATH=$PATH_ORIG + 4. Then make. The make will build all of the host executable but will fail + when it gets to the first ARM binary. + 5. Then source setenv.sh again: . ./setenv.sh. That will correct the PATH + again. When you do make again, the host executables are already made and + now the correct PATH is in place for the ARM build. + + Also, the Atollic toolchains are the only toolchains that have built-in support for + the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will + need to use the Atollic toolchain for now. See the FPU section below for more + information. + The Atollic "Lite" Toolchain ---------------------------- The free, "Lite" version of the Atollic toolchain does not support C++ nor @@ -120,28 +145,6 @@ GNU Toolchain Options CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n - Another problem that I had with the Atollic toolchain is that the provide a gcc.exe - and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path - appears in your PATH variable before /usr/bin, then you will get the wrong gcc - when you try to build host executables. This will cause to strange, uninterpretable - errors build some host binaries in tools/ when you first make. Here is my - workaround kludge. - - 1. Edit the setenv.sh to put the Atollic toolchain at the beginning of the PATH - 2. Source the setenv.sh file: . ./setenv.sh. A side effect of this is that it - will set an environment variable called PATH_ORIG. - 3. Then go back to the original patch: export PATH=$PATH_ORIG - 4. Then make. The make will build all of the host executable but will fail - when it gets to the first ARM binary. - 5. Then source setenv.sh again: . ./setenv.sh. That will correct the PATH - again. When you do make again, the host executables are already made and - now the correct PATH is in place for the ARM build. - - Also, the Atollic toolchain is the only toolchain that has built-in support for - the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will - need to use the Atollic toolchain for now. See the FPU section below for more - information. - devkitARM --------- The devkitARM toolchain includes a version of MSYS make. Make sure that the @@ -407,7 +410,7 @@ CFLAGS Only the Atollic toolchain has built-in support for the Cortex-M4 FPU. You will see the following lines in each Make.defs file: - ifeq ($(CONFIG_STM32_ATOLLIC),y) + ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows ... ifeq ($(CONFIG_ARCH_FPU),y) @@ -434,20 +437,22 @@ Configuration Changes Below are all of the configuration changes that I had to make to configs/stm3240g-eval/nsh2 in order to successfully build NuttX using the Atollic toolchain WITH FPU support: - -CONFIG_ARCH_FPU=y : Enable FPU support - +CONFIG_ARCH_FPU=n + -CONFIG_ARCH_FPU=n : Enable FPU support + +CONFIG_ARCH_FPU=y - -CONFIG_STM32_CODESOURCERYW=n : Disable the CodeSourcery toolchain - +CONFIG_STM32_CODESOURCERYW=y + -CONFIG_STM32_CODESOURCERYW=y : Disable the CodeSourcery toolchain + +CONFIG_STM32_CODESOURCERYW=n - -CONFIG_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -CONFIG_STM32_ATOLLIC_LITE=n : Enable *one* the Atollic toolchains + CONFIG_STM32_ATOLLIC_PRO=n + -CONFIG_STM32_ATOLLIC_LITE=y : The "Lite" version + CONFIG_STM32_ATOLLIC_PRO=n : The "Pro" version - -CONFIG_INTELHEX_BINARY=n : Suppress generation FLASH download formats - +CONFIG_INTELHEX_BINARY=y + -CONFIG_INTELHEX_BINARY=y : Suppress generation FLASH download formats + +CONFIG_INTELHEX_BINARY=n : (Only necessary with the "Lite" version) - -CONFIG_HAVE_CXX=n : Suppress generation of C++ code - +CONFIG_HAVE_CXX=y + -CONFIG_HAVE_CXX=y : Suppress generation of C++ code + +CONFIG_HAVE_CXX=n : (Only necessary with the "Lite" version) See the section above on Toolchains, NOTE 2, for explanations for some of the configuration settings. Some of the usual settings are just not supported @@ -715,14 +720,22 @@ Where is one of the following: If you use the Atollic toolchain, then the FPU test can be enabled in the examples/ostest by adding the following your NuttX configuration file: - -CONFIG_ARCH_FPU=n : Enabled the FPU + -CONFIG_ARCH_FPU=n : Enable FPU support +CONFIG_ARCH_FPU=y - -CONFIG_STM32_CODESOURCERYW=y : Disable CodeSourcery under Windows - +CONFIG_STM32_CODESOURCERYL=n + -CONFIG_STM32_CODESOURCERYW=y : Disable the CodeSourcery toolchain + +CONFIG_STM32_CODESOURCERYW=n - -CONFIG_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -CONFIG_STM32_ATOLLIC_LITE=n : Enable *one* the Atollic toolchains + CONFIG_STM32_ATOLLIC_PRO=n + -CONFIG_STM32_ATOLLIC_LITE=y : The "Lite" version + CONFIG_STM32_ATOLLIC_PRO=n : The "Pro" version + + -CONFIG_INTELHEX_BINARY=y : Suppress generation FLASH download formats + +CONFIG_INTELHEX_BINARY=n : (Only necessary with the "Lite" version) + + -CONFIG_HAVE_CXX=y : Suppress generation of C++ code + +CONFIG_HAVE_CXX=n : (Only necessary with the "Lite" version) -CONFIG_SCHED_WAITPID=y : Enable the waitpid() API needed by the FPU test +CONFIG_SCHED_WAITPID=n diff --git a/configs/stm32f4discovery/nsh/Make.defs b/configs/stm32f4discovery/nsh/Make.defs index 60d264c50b..e1e2850190 100644 --- a/configs/stm32f4discovery/nsh/Make.defs +++ b/configs/stm32f4discovery/nsh/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm32f4discovery/nsh/defconfig b/configs/stm32f4discovery/nsh/defconfig index 5bc628323e..61c4d51f5a 100755 --- a/configs/stm32f4discovery/nsh/defconfig +++ b/configs/stm32f4discovery/nsh/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=n CONFIG_STM32_CODESOURCERYL=y -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm32f4discovery/nsh/setenv.sh b/configs/stm32f4discovery/nsh/setenv.sh index 22fbebab2c..c131e3b764 100755 --- a/configs/stm32f4discovery/nsh/setenv.sh +++ b/configs/stm32f4discovery/nsh/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/stm32f4discovery/ostest/Make.defs b/configs/stm32f4discovery/ostest/Make.defs index a59a108bcb..6337940d8d 100644 --- a/configs/stm32f4discovery/ostest/Make.defs +++ b/configs/stm32f4discovery/ostest/Make.defs @@ -51,7 +51,7 @@ ifeq ($(CONFIG_STM32_CODESOURCERYL),y) ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft MAXOPTIMIZATION = -O2 endif -ifeq ($(CONFIG_STM32_ATOLLIC),y) +ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) # Atollic toolchain under Windows CROSSDEV = arm-atollic-eabi- ARCROSSDEV = @@ -62,6 +62,17 @@ else ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft endif endif +ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) + # Atollic toolchain under Windows + CROSSDEV = arm-atollic-eabi- + ARCROSSDEV = arm-atollic-eabi- + WINTOOL = y +ifeq ($(CONFIG_ARCH_FPU),y) + ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif +endif ifeq ($(CONFIG_STM32_DEVKITARM),y) # devkitARM under Windows CROSSDEV = arm-eabi- diff --git a/configs/stm32f4discovery/ostest/defconfig b/configs/stm32f4discovery/ostest/defconfig index 166d723386..26b3c570ef 100755 --- a/configs/stm32f4discovery/ostest/defconfig +++ b/configs/stm32f4discovery/ostest/defconfig @@ -97,7 +97,8 @@ CONFIG_ARCH_DMA=n # CONFIG_STM32_CODESOURCERYW=n CONFIG_STM32_CODESOURCERYL=y -CONFIG_STM32_ATOLLIC=n +CONFIG_STM32_ATOLLIC_LITE=n +CONFIG_STM32_ATOLLIC_PRO=n CONFIG_STM32_DEVKITARM=n CONFIG_STM32_RAISONANCE=n CONFIG_STM32_BUILDROOT=n diff --git a/configs/stm32f4discovery/ostest/setenv.sh b/configs/stm32f4discovery/ostest/setenv.sh index b8b443c885..3028955c13 100755 --- a/configs/stm32f4discovery/ostest/setenv.sh +++ b/configs/stm32f4discovery/ostest/setenv.sh @@ -57,9 +57,10 @@ fi # the CodeSourcery toolchain in any other location export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# This the Cygwin path to the location where I installed the Atollic +# These are the Cygwin paths to the locations where I installed the Atollic # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This the Cygwin path to the location where I build the buildroot diff --git a/configs/sure-pic32mx/README.txt b/configs/sure-pic32mx/README.txt index de1a066f23..0c91f3289e 100644 --- a/configs/sure-pic32mx/README.txt +++ b/configs/sure-pic32mx/README.txt @@ -199,41 +199,36 @@ Loading NuttX with PICkit2 directory: 1) nuttx - This is an ELF file, and - 2) nuttx.ihx - This is an Intel Hex format file. This is controlled by + 2) nuttx.hex - This is an Intel Hex format file. This is controlled by the setting CONFIG_INTELHEX_BINARY in the .config file. - The PICkit tool wants an Intel Hex format file to burn into FLASH. - However, there are two problems with the generated nutt.ihx: - - 1) The tool expects Intel Hex format files to be named *.hex. This - is not a significant issue. However, just renaming the file to - nuttx.hex is *not* sufficient. There is another problem: - 2) The tool expects the nuttx.hex file to contain physical addresses. - But the nuttx.ihx file generated from the top-level make will have - address in the KSEG0 and KSEG1 regions. + The PICkit tool wants an Intel Hex format file to burn into FLASH. However, + there is a problem with the generated nutt.hex: The tool expects the nuttx.hex + file to contain physical addresses. But the nuttx.hex file generated from the + top-level make will have address in the KSEG0 and KSEG1 regions. tools/mkpichex: --------------- There is a simple tool in the configs/sure-pic32mx/tools directory - that can be used to solve both issues with the nuttx.ihx file. But, + that can be used to solve both issues with the nuttx.hex file. But, first, you must build the the tools: cd configs/sure-pic32mx/tools make Now you will have an excecutable file call mkpichex (or mkpichex.exe on - Cygwin). This program will take the nutt.ihx file as an input, it will + Cygwin). This program will take the nutt.hex file as an input, it will convert all of the KSEG0 and KSEG1 addresses to physical address, and - it will write the modified file as nuttx.hex. + it will write the modified file, replacing the original nuttx.hex. To use this file, you need to do the following things: . ./setenv.sh # Source setenv.sh. Among other this, this script # will add configs/sure-pic32mx/tools to your # PATH variable - make # Build nuttx and nuttx.ihx - mkpichex $PWD # Convert nuttx.ihx to nuttx.hex. $PWD is the path + make # Build nuttx and nuttx.hex + mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path # to the top-level build directory. It is the only # required input to mkpichex. diff --git a/configs/sure-pic32mx/tools/Makefile b/configs/sure-pic32mx/tools/Makefile index 6fc4392c78..b9474a4fcb 100644 --- a/configs/sure-pic32mx/tools/Makefile +++ b/configs/sure-pic32mx/tools/Makefile @@ -1,8 +1,8 @@ ############################################################################ # configs/sure-pic32mx/tools/Makefile # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -41,7 +41,7 @@ default: mkpichex CFLAGS = -O2 -Wall -I. -# mkpichex - Convert nuttx.ihx to nuttx.hex +# mkpichex - Convert virtual addresses in nuttx.hex to physical addresses mkconfig: mkpichex.c mkpichex.c @gcc $(CFLAGS) -o mkpichex mkpichex.c diff --git a/configs/sure-pic32mx/tools/mkpichex.c b/configs/sure-pic32mx/tools/mkpichex.c index 9fc20e8dac..299866c001 100644 --- a/configs/sure-pic32mx/tools/mkpichex.c +++ b/configs/sure-pic32mx/tools/mkpichex.c @@ -1,8 +1,8 @@ /**************************************************************************** * configs/sure-pic32mx/tools/mkpichex.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -125,7 +125,7 @@ static inline char *getfilepath(const char *path, const char *name, const char * static void show_usage(const char *progname) { - fprintf(stderr, "USAGE: %s \n", progname); + fprintf(stderr, "USAGE: %s \n", progname); exit(1); } @@ -246,14 +246,14 @@ int main(int argc, char **argv, char **envp) show_usage(argv[0]); } - srcfile = getfilepath(argv[1], "nuttx", "ihx"); + srcfile = getfilepath(argv[1], "nuttx", "hex"); if (!srcfile) { fprintf(stderr, "getfilepath failed\n"); exit(2); } - destfile = getfilepath(argv[1], "nuttx", "hex"); + destfile = getfilepath(argv[1], "nuttx", "tmp"); if (!destfile) { fprintf(stderr, "getfilepath failed\n"); @@ -295,5 +295,21 @@ int main(int argc, char **argv, char **envp) fclose(src); fclose(dest); + + /* Remove the original nuttx.hex file */ + + if (remove(srcfile) != OK) + { + fprintf(stderr, "Failed to remove the old '%s'\n", srcfile); + + } + + /* Rename the new nuttx.tmp file to nuttx.hex */ + + if (rename(destfile, srcfile) != OK) + { + fprintf(stderr, "Failed to rename '%s' to '%s'\n", destfile, srcfile); + } + return 0; } diff --git a/configs/xtrs/nsh/Make.defs b/configs/xtrs/nsh/Make.defs index 3fbec7b5a3..345fa47c1f 100644 --- a/configs/xtrs/nsh/Make.defs +++ b/configs/xtrs/nsh/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/xtrs/ostest/Make.defs b/configs/xtrs/ostest/Make.defs index 6d25689069..6f769411cd 100644 --- a/configs/xtrs/ostest/Make.defs +++ b/configs/xtrs/ostest/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/xtrs/pashello/Make.defs b/configs/xtrs/pashello/Make.defs index 6d25689069..6f769411cd 100644 --- a/configs/xtrs/pashello/Make.defs +++ b/configs/xtrs/pashello/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/z80sim/nsh/Make.defs b/configs/z80sim/nsh/Make.defs index 4d6488212c..ff4e2633a8 100644 --- a/configs/z80sim/nsh/Make.defs +++ b/configs/z80sim/nsh/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/z80sim/nsh/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/z80sim/ostest/Make.defs b/configs/z80sim/ostest/Make.defs index aa9e2a34e9..c684428682 100644 --- a/configs/z80sim/ostest/Make.defs +++ b/configs/z80sim/ostest/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/z80sim/ostest/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/z80sim/pashello/Make.defs b/configs/z80sim/pashello/Make.defs index 945d86d4d9..cb0be065d8 100644 --- a/configs/z80sim/pashello/Make.defs +++ b/configs/z80sim/pashello/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/z80sim/pashello/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ define ARCHIVE endef define CLEAN - @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.ihx *.hex + @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex endef MKDEP = $(TOPDIR)/tools/mkdeps.sh