9
0
Fork 0

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: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4431 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-02-27 19:50:35 +00:00
parent 72943247a8
commit 9a530cbaa0
53 changed files with 405 additions and 235 deletions

View File

@ -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.

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
====

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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;
}

View File

@ -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.

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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.

View File

@ -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"

View File

@ -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
-------------

View File

@ -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=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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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=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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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-

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)