diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-27 19:50:35 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-27 19:50:35 +0000 |
commit | 34abeda54d7093df62fc2808601c7d7e0bb2ab1c (patch) | |
tree | 84593559b23d580c9330f7c2ca516069a166c789 | |
parent | a500a9ab6d73b61328c3e42e4b1e103ad0656e07 (diff) | |
download | nuttx-34abeda54d7093df62fc2808601c7d7e0bb2ab1c.tar.gz nuttx-34abeda54d7093df62fc2808601c7d7e0bb2ab1c.tar.bz2 nuttx-34abeda54d7093df62fc2808601c7d7e0bb2ab1c.zip |
Add support for the Atollic Pro toolchain; Change extension .ihx to .hex to be better compatible with most of the rest of the world
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4431 42af7a65-404d-4744-a932-0658087f49c3
53 files changed, 405 insertions, 235 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1880b94ad..d3a9b3e62 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2509,3 +2509,8 @@ * arch/arm/src/armv7-m: Lazy saving of floating point registers on context switches now seems to be functional. * net/uip/uip_tcpinput.c: Fix a TCP protocol error reported by Max Nekludov. + * configs/stm3240g-eval, configs/stm32f40discovery: Add changes to support + building with the Atollic "Pro" toolchain. + * Makefile: Use the more common .hex extension for Intel hex files instead of + more precise .ihx extension. This change has ripple effects to many build- + related scripts and programs and could cause some short-term problems. diff --git a/nuttx/Makefile b/nuttx/Makefile index a5cf3a434..1f1e4f8b0 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -464,8 +464,8 @@ ifeq ($(CONFIG_RRLOAD_BINARY),y) fi endif ifeq ($(CONFIG_INTELHEX_BINARY),y) - @echo "CP: $(BIN).ihx" - @$(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).ihx + @echo "CP: $(BIN).hex" + @$(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex endif ifeq ($(CONFIG_MOTOROLA_SREC),y) @echo "CP: $(BIN).srec" diff --git a/nuttx/TODO b/nuttx/TODO index c62e93a1e..0b0ba9dfd 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -1147,8 +1147,7 @@ o ARM/STM32 (arch/arm/src/stm32/) Description: 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. Status: Open Priority: Medium diff --git a/nuttx/arch/8051/src/Makefile b/nuttx/arch/8051/src/Makefile index 87ff4daf5..47d828b2f 100644 --- a/nuttx/arch/8051/src/Makefile +++ b/nuttx/arch/8051/src/Makefile @@ -171,7 +171,7 @@ board/libboard$(LIBEXT): # This target builds the final executable -pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT) +pass1.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBEXT) @echo "LD: $@" @$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ @@ -179,14 +179,14 @@ pass1.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) board/libboard$(LIBE @rm -f up_allocateheap$(OBJEXT) libarch$(LIBEXT) @$(MAKE) TOPDIR=$(TOPDIR) libarch$(LIBEXT) -nuttx.ihx: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) +nuttx.hex: up_mem.h $(SDCCLIBDIR)/libmysdcc.lib $(LINKOBJS) @echo "LD: $@" @$(CC) $(LDFLAGS) $(LDPATHES) -L$(BOARDDIR) $(SDCCPATH) $(LINKOBJS) \ $(LDLIBS) -llibboard$(LIBEXT) $(SDCCLIBS) -o $@ -nuttx$(EXEEXT): pass1.ihx nuttx.ihx +nuttx$(EXEEXT): pass1.hex nuttx.hex @rm -f pass1.* - @packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) + @packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) @cp -f nuttx.map $(TOPDIR)/. # This is part of the top-level export target @@ -202,11 +202,11 @@ export_head: board/libboard$(LIBEXT) p_head$(OBJEXT) # This target builds a test program to verify interrupt context switching. irqtest is # a PHONY target that just sets upt the up_irqtest build correctly -up_irqtest.ihx: $(TESTOBJS) +up_irqtest.hex: $(TESTOBJS) $(CC) $(LDFLAGS) -L. $(SDCCPATH) $(TESTLINKOBJS) $(TESTOBJS) $(TESTEXTRAOBJS) $(SDCCLIBS) -o $@ irqtest: - @$(MAKE) TOPDIR=../../.. up_irqtest.ihx + @$(MAKE) TOPDIR=../../.. up_irqtest.hex # Build dependencies diff --git a/nuttx/arch/z80/src/Makefile.sdcc b/nuttx/arch/z80/src/Makefile.sdcc index fdb949fa5..e88c2f2bd 100644 --- a/nuttx/arch/z80/src/Makefile.sdcc +++ b/nuttx/arch/z80/src/Makefile.sdcc @@ -145,8 +145,8 @@ board/libboard$(LIBEXT): # This target builds the final executable -pass1.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) - @echo "LD: pass1.ihx" +pass1.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) + @echo "LD: pass1.hex" @echo "--" >pass1.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library @echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library @@ -169,7 +169,7 @@ endif @echo "-x" >>pass1.lnk # Hexadecimal @echo "-m" >>pass1.lnk # Generate a map file @echo "-j" >>pass1.lnk # Generate a symbol file - @echo "pass1.ihx" >>pass1.lnk # Path to head object + @echo "pass1.hex" >>pass1.lnk # Path to head object @echo "$(HEAD_OBJ)" >>pass1.lnk # Path to head object @echo "-e" >>pass1.lnk # End of script @$(LD) -f pass1.lnk @@ -178,8 +178,8 @@ endif @$(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) @$(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) -nuttx.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) - @echo "LD: nuttx.ihx" +nuttx.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) + @echo "LD: nuttx.hex" @echo "--" >nuttx.lnk # Non-interactive @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library @echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library @@ -202,19 +202,19 @@ endif @echo "-x" >>nuttx.lnk # Hexadecimal @echo "-m" >>nuttx.lnk # Generate a map file @echo "-j" >>nuttx.lnk # Generate a symbol file - @echo "nuttx.ihx" >>nuttx.lnk # Path to head object + @echo "nuttx.hex" >>nuttx.lnk # Path to head object @echo "$(HEAD_OBJ)" >>nuttx.lnk # Path to head object @echo "-e" >>nuttx.lnk # End of script @$(LD) -f nuttx.lnk -nuttx$(EXEEXT): pass1.ihx nuttx.ihx +nuttx$(EXEEXT): pass1.hex nuttx.hex @rm -f pass1.* @cp -f nuttx.map $(TOPDIR)/. ifeq ($(EXEEXT),.cmd) - sed s/:00000001FF/:00520001AD/ nuttx.ihx | \ + sed s/:00000001FF/:00520001AD/ nuttx.hex | \ hex2cmd > $(TOPDIR)/nuttx.cmd else - @packihx nuttx.ihx > $(TOPDIR)/nuttx$(EXEEXT) + @packihx nuttx.hex > $(TOPDIR)/nuttx$(EXEEXT) endif # This is part of the top-level export target diff --git a/nuttx/configs/hymini-stm32v/README.txt b/nuttx/configs/hymini-stm32v/README.txt index 6e44dc9bc..b50a33ccc 100755 --- a/nuttx/configs/hymini-stm32v/README.txt +++ b/nuttx/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/nuttx/configs/mcu123-lpc214x/README.txt b/nuttx/configs/mcu123-lpc214x/README.txt index a05b239e6..35afa9ac8 100644 --- a/nuttx/configs/mcu123-lpc214x/README.txt +++ b/nuttx/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/nuttx/configs/pcblogic-pic32mx/README.txt b/nuttx/configs/pcblogic-pic32mx/README.txt index ab41a57fd..5fe88db5c 100644 --- a/nuttx/configs/pcblogic-pic32mx/README.txt +++ b/nuttx/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/nuttx/configs/pcblogic-pic32mx/tools/Makefile b/nuttx/configs/pcblogic-pic32mx/tools/Makefile index 60d3b14ad..018fcaa8c 100644 --- a/nuttx/configs/pcblogic-pic32mx/tools/Makefile +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/pcblogic-pic32mx/tools/mkpichex.c b/nuttx/configs/pcblogic-pic32mx/tools/mkpichex.c index 2d5251d02..c15a27564 100644 --- a/nuttx/configs/pcblogic-pic32mx/tools/mkpichex.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <abs path to nuttx.ihx>\n", progname); + fprintf(stderr, "USAGE: %s <abs path to nuttx.hex>\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/nuttx/configs/pic32-starterkit/README.txt b/nuttx/configs/pic32-starterkit/README.txt index d9a562fe1..e2c625419 100644 --- a/nuttx/configs/pic32-starterkit/README.txt +++ b/nuttx/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/nuttx/configs/pic32-starterkit/tools/Makefile b/nuttx/configs/pic32-starterkit/tools/Makefile index b01fbba19..71ec90476 100644 --- a/nuttx/configs/pic32-starterkit/tools/Makefile +++ b/nuttx/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 <gnutt@nuttx.org> # # 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/nuttx/configs/pic32-starterkit/tools/mkpichex.c b/nuttx/configs/pic32-starterkit/tools/mkpichex.c index 0922e6768..90d5efc54 100644 --- a/nuttx/configs/pic32-starterkit/tools/mkpichex.c +++ b/nuttx/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 <gnutt@nuttx.org> * * 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 <abs path to nuttx.ihx>\n", progname); + fprintf(stderr, "USAGE: %s <abs path to nuttx.hex>\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/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs index 68de71650..a1443723e 100644 --- a/nuttx/configs/pjrc-8051/Make.defs +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/sam3u-ek/README.txt b/nuttx/configs/sam3u-ek/README.txt index 872938b6f..510d2f1e6 100755 --- a/nuttx/configs/sam3u-ek/README.txt +++ b/nuttx/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/nuttx/configs/sam3u-ek/kernel/Makefile b/nuttx/configs/sam3u-ek/kernel/Makefile index f9903b157..64b53f2f0 100755 --- a/nuttx/configs/sam3u-ek/kernel/Makefile +++ b/nuttx/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/nuttx/configs/stm3210e-eval/README.txt b/nuttx/configs/stm3210e-eval/README.txt index 7e23d7dc9..de6e066a3 100755 --- a/nuttx/configs/stm3210e-eval/README.txt +++ b/nuttx/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/nuttx/configs/stm3240g-eval/README.txt b/nuttx/configs/stm3240g-eval/README.txt index 7ecbd71b5..b41e49212 100755 --- a/nuttx/configs/stm3240g-eval/README.txt +++ b/nuttx/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 <subdir> 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 <subdir> 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 <subdir> 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_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_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -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/nuttx/configs/stm3240g-eval/dhcpd/Make.defs b/nuttx/configs/stm3240g-eval/dhcpd/Make.defs index 5de6dec90..ed57ad496 100644 --- a/nuttx/configs/stm3240g-eval/dhcpd/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/dhcpd/defconfig b/nuttx/configs/stm3240g-eval/dhcpd/defconfig index 5bbaf0482..0fa433c4f 100644 --- a/nuttx/configs/stm3240g-eval/dhcpd/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/dhcpd/setenv.sh b/nuttx/configs/stm3240g-eval/dhcpd/setenv.sh index e4312c3c2..e16c4a7fd 100755 --- a/nuttx/configs/stm3240g-eval/dhcpd/setenv.sh +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nettest/Make.defs b/nuttx/configs/stm3240g-eval/nettest/Make.defs index 50cb6b296..a81399787 100644 --- a/nuttx/configs/stm3240g-eval/nettest/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nettest/defconfig b/nuttx/configs/stm3240g-eval/nettest/defconfig index b690b503b..d73597d8a 100644 --- a/nuttx/configs/stm3240g-eval/nettest/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nettest/setenv.sh b/nuttx/configs/stm3240g-eval/nettest/setenv.sh index 4ce9ee88f..ee3c15ba1 100755 --- a/nuttx/configs/stm3240g-eval/nettest/setenv.sh +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh/Make.defs b/nuttx/configs/stm3240g-eval/nsh/Make.defs index 5904c18c3..b99670c07 100644 --- a/nuttx/configs/stm3240g-eval/nsh/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig index 75becc839..654d3342f 100644 --- a/nuttx/configs/stm3240g-eval/nsh/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh/setenv.sh b/nuttx/configs/stm3240g-eval/nsh/setenv.sh index aacd28089..8d502cbe5 100755 --- a/nuttx/configs/stm3240g-eval/nsh/setenv.sh +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh2/Make.defs b/nuttx/configs/stm3240g-eval/nsh2/Make.defs index c7fc580d7..19dd3ee39 100644 --- a/nuttx/configs/stm3240g-eval/nsh2/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh2/defconfig b/nuttx/configs/stm3240g-eval/nsh2/defconfig index 39abd9bef..c2425a0ee 100644 --- a/nuttx/configs/stm3240g-eval/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh2/setenv.sh b/nuttx/configs/stm3240g-eval/nsh2/setenv.sh index 380b35933..4604aa72e 100755 --- a/nuttx/configs/stm3240g-eval/nsh2/setenv.sh +++ b/nuttx/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/nuttx/configs/stm3240g-eval/ostest/Make.defs b/nuttx/configs/stm3240g-eval/ostest/Make.defs index dc7d728eb..c261d4ec3 100644 --- a/nuttx/configs/stm3240g-eval/ostest/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/ostest/defconfig b/nuttx/configs/stm3240g-eval/ostest/defconfig index 268af2367..b2481d915 100644 --- a/nuttx/configs/stm3240g-eval/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/ostest/setenv.sh b/nuttx/configs/stm3240g-eval/ostest/setenv.sh index bd830183e..7bd407845 100755 --- a/nuttx/configs/stm3240g-eval/ostest/setenv.sh +++ b/nuttx/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/nuttx/configs/stm3240g-eval/telnetd/Make.defs b/nuttx/configs/stm3240g-eval/telnetd/Make.defs index 0fede585e..509bc165f 100644 --- a/nuttx/configs/stm3240g-eval/telnetd/Make.defs +++ b/nuttx/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/nuttx/configs/stm3240g-eval/telnetd/defconfig b/nuttx/configs/stm3240g-eval/telnetd/defconfig index 8120189f9..43a5b7c44 100644 --- a/nuttx/configs/stm3240g-eval/telnetd/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/telnetd/setenv.sh b/nuttx/configs/stm3240g-eval/telnetd/setenv.sh index 4edcc0db2..148a28d52 100755 --- a/nuttx/configs/stm3240g-eval/telnetd/setenv.sh +++ b/nuttx/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/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt index 1048e54ac..d770496b2 100755 --- a/nuttx/configs/stm32f4discovery/README.txt +++ b/nuttx/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 <subdir> 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_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_STM32_ATOLLIC=y : Enable the Atollic toolchain - +CONFIG_STM32_ATOLLIC=n + -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/nuttx/configs/stm32f4discovery/nsh/Make.defs b/nuttx/configs/stm32f4discovery/nsh/Make.defs index 60d264c50..e1e285019 100644 --- a/nuttx/configs/stm32f4discovery/nsh/Make.defs +++ b/nuttx/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/nuttx/configs/stm32f4discovery/nsh/defconfig b/nuttx/configs/stm32f4discovery/nsh/defconfig index 5bc628323..61c4d51f5 100755 --- a/nuttx/configs/stm32f4discovery/nsh/defconfig +++ b/nuttx/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/nuttx/configs/stm32f4discovery/nsh/setenv.sh b/nuttx/configs/stm32f4discovery/nsh/setenv.sh index 22fbebab2..c131e3b76 100755 --- a/nuttx/configs/stm32f4discovery/nsh/setenv.sh +++ b/nuttx/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/nuttx/configs/stm32f4discovery/ostest/Make.defs b/nuttx/configs/stm32f4discovery/ostest/Make.defs index a59a108bc..6337940d8 100644 --- a/nuttx/configs/stm32f4discovery/ostest/Make.defs +++ b/nuttx/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/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig index 166d72338..26b3c570e 100755 --- a/nuttx/configs/stm32f4discovery/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm32f4discovery/ostest/setenv.sh b/nuttx/configs/stm32f4discovery/ostest/setenv.sh index b8b443c88..3028955c1 100755 --- a/nuttx/configs/stm32f4discovery/ostest/setenv.sh +++ b/nuttx/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/nuttx/configs/sure-pic32mx/README.txt b/nuttx/configs/sure-pic32mx/README.txt index de1a066f2..0c91f3289 100644 --- a/nuttx/configs/sure-pic32mx/README.txt +++ b/nuttx/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/nuttx/configs/sure-pic32mx/tools/Makefile b/nuttx/configs/sure-pic32mx/tools/Makefile index 6fc4392c7..b9474a4fc 100644 --- a/nuttx/configs/sure-pic32mx/tools/Makefile +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/sure-pic32mx/tools/mkpichex.c b/nuttx/configs/sure-pic32mx/tools/mkpichex.c index 9fc20e8da..299866c00 100644 --- a/nuttx/configs/sure-pic32mx/tools/mkpichex.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 <abs path to nuttx.ihx>\n", progname); + fprintf(stderr, "USAGE: %s <abs path to nuttx.hex>\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/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs index 3fbec7b5a..345fa47c1 100644 --- a/nuttx/configs/xtrs/nsh/Make.defs +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs index 6d2568906..6f769411c 100644 --- a/nuttx/configs/xtrs/ostest/Make.defs +++ b/nuttx/configs/xtrs/ostest/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs index 6d2568906..6f769411c 100644 --- a/nuttx/configs/xtrs/pashello/Make.defs +++ b/nuttx/configs/xtrs/pashello/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # configs/xtrs/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs index 4d6488212..ff4e2633a 100644 --- a/nuttx/configs/z80sim/nsh/Make.defs +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs index aa9e2a34e..c68442868 100644 --- a/nuttx/configs/z80sim/ostest/Make.defs +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs index 945d86d4d..cb0be065d 100644 --- a/nuttx/configs/z80sim/pashello/Make.defs +++ b/nuttx/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 <spudmonkey@racsa.co.cr> +# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <gnutt@nuttx.org> # # 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/nuttx/net/uip/uip_tcpinput.c b/nuttx/net/uip/uip_tcpinput.c index 5dc3435cc..593f55b55 100644 --- a/nuttx/net/uip/uip_tcpinput.c +++ b/nuttx/net/uip/uip_tcpinput.c @@ -179,13 +179,9 @@ void uip_tcpinput(struct uip_driver_s *dev) /* The connection structure was successfully allocated. Now see if * there is an application waiting to accept the connection (or at * least queue it it for acceptance). - * - * TCP state machine should move to the ESTABLISHED state only after - * it has received ACK from the host. */ conn->crefs = 1; - if (uip_accept(dev, conn, tmp16) != OK) { /* No, then we have to give the connection back */ @@ -194,6 +190,15 @@ void uip_tcpinput(struct uip_driver_s *dev) uip_tcpfree(conn); conn = NULL; } + else + { + /* TCP state machine should move to the ESTABLISHED state only after + * it has received ACK from the host. This needs to be investigated + * further. + */ + + conn->tcpstateflags = UIP_ESTABLISHED; + } } if (!conn) |