diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-12-29 15:02:51 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-12-29 15:02:51 -0600 |
commit | 9642e859e341e35fb01fd027d315f0195cb63358 (patch) | |
tree | 36f440f47bb43d7b4ac5b8d13f307fe17c434c52 | |
parent | ad4c6ed3804621dfcbb782f32909de65f7506ea7 (diff) | |
download | nuttx-9642e859e341e35fb01fd027d315f0195cb63358.tar.gz nuttx-9642e859e341e35fb01fd027d315f0195cb63358.tar.bz2 nuttx-9642e859e341e35fb01fd027d315f0195cb63358.zip |
Move nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c to apps/platform/stm3240g-eval/
-rw-r--r-- | apps/ChangeLog.txt | 3 | ||||
-rw-r--r-- | apps/nshlib/README.txt | 52 | ||||
-rw-r--r-- | apps/nshlib/nsh_netcmds.c | 24 | ||||
-rw-r--r-- | apps/platform/stm3240g-eval/Kconfig | 8 | ||||
-rw-r--r-- | apps/platform/stm3240g-eval/Make.defs | 40 | ||||
-rw-r--r-- | apps/platform/stm3240g-eval/up_cxxinitialize.c (renamed from nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c) | 7 | ||||
-rw-r--r-- | nuttx/ChangeLog | 4 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/knxwm/setenv.sh | 18 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/nxwm/setenv.sh | 18 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/src/Makefile | 4 |
10 files changed, 120 insertions, 58 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index ffcbcf14a..40c511e20 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -748,4 +748,7 @@ * apps/nshlib/nsh_mntcmds.c: Modified the df -h logic to eliminate truncating numbers in conversion (like 7900 -> 7M). From Ken Pettit (2013-12-12). + * Moved configs/stm3240g-eval/src/up_cxxinitialize.c to + apps/platform/stm3240g-eval/up_cxxinitialize.c: Now it is available + in user-space in the kernel mode build (2013-12-29). diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index 8b2d4bcdd..dcc4ec711 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -48,8 +48,8 @@ Command Overview Where: <cmd> is any one of the simple commands listed later. - <file> is the full or relative path to any writable object - in the filesystem name space (file or character driver). + <file> is the full or relative path to any writeable object + in the file system name space (file or character driver). Such objects will be referred to simply as files throughout this README. @@ -68,7 +68,7 @@ Conditional Command Execution An if-then[-else]-fi construct is also supported in order to support conditional execution of commands. This works from the command line but is primarily intended for use within NSH scripts - (see the sh commnd). The syntax is as follows: + (see the sh command). The syntax is as follows: if <cmd> then @@ -120,14 +120,14 @@ In this default case, enabling CONFIG_NSH_ROMFSETC will cause NSH to behave as follows at NSH startup time: - NSH will create a read-only RAM disk (a ROM disk), containing a tiny - ROMFS filesystem containing the following: + ROMFS file system containing the following: |--init.d/ `-- rcS Where rcS is the NSH start-up script -- NSH will then mount the ROMFS filesystem at /etc, resulting in: +- NSH will then mount the ROMFS file system at /etc, resulting in: |--dev/ | `-- ram0 @@ -198,7 +198,7 @@ NOTE: All of the startup-behavior is contained in rcS.template. The role of mkromfsimg.sh is to (1) apply the specific configuration settings to rcS.template to create the final rcS, and (2) to -generate the header file nsh_romfsimg.h containg the ROMFS +generate the header file nsh_romfsimg.h containing the ROMFS file system image. Simple Commands @@ -252,7 +252,7 @@ o base64dec [-w] [-f] <string or filepath> o cat <path> [<path> [<path> ...]] - This command copies and concatentates all of the files at <path> + This command copies and concatenates all of the files at <path> to the console (or to another file if the output is redirected). o cd [<dir-path>|-|~|..] @@ -280,7 +280,7 @@ o cmp <path1> <path2> o cp <source-path> <dest-path> Copy of the contents of the file at <source-path> to the location - in the filesystem indicated by <path-path> + in the file system indicated by <path-path> o date [-s "MMM DD HH:MM:SS YYYY"] @@ -399,7 +399,7 @@ o get [-b|-n] [-f <local-path>] -h <ip-address> <remote-path> The file will be saved relative to the current working directory unless <local-path> is provided. -b|-n - Selects either binary ("octect") or test ("netascii") transfer + Selects either binary ("octet") or test ("netascii") transfer mode. Default: text. o help [-v] [<cmd>] @@ -487,7 +487,7 @@ o losetup [-d <dev-path>] | [[-o <offset>] [-r] <ldev-path> <file-path>] o ls [-lRs] <dir-path> Show the contents of the directory at <dir-path>. NOTE: - <dir-path> must refer to a directory and no other filesystem + <dir-path> must refer to a directory and no other file system object. Options: @@ -539,10 +539,10 @@ o mkdir <path> except the final directory name must exist on a mounted file system; the final directory must not. - Recall that NuttX uses a pseudo filesystem for its root file system. + Recall that NuttX uses a pseudo file system for its root file system. The mkdir command can only be used to create directories in volumes set up with the mount command; it cannot be used to create directories - in the pseudo filesystem. + in the pseudo file system. Example: ^^^^^^^^ @@ -563,7 +563,7 @@ o mkfatfs [-F <fatsize>] <block-driver> specified on the command line. NSH provides this command to access the mkfatfs() NuttX API. - This block device must reside in the NuttX pseudo filesystem and + This block device must reside in the NuttX pseudo file system and must have been created by some call to register_blockdriver() (see include/nuttx/fs/fs.h). @@ -650,14 +650,14 @@ o mount [-t <fstype> <block-device> <dir-path>] of this writing, vfat is the only supported value for <fstype> Block Device. The <block-device> argument is the full or relative - path to a block driver inode in the pseudo filesystem. By convention, + path to a block driver inode in the pseudo file system. By convention, this is a name under the /dev sub-directory. This <block-device> must have been previously formatted with the same file system type as specified by <fstype> Mount Point. The mount point is the location in the pseudo file system where the mounted volume will appear. This mount point - can only reside in the NuttX pseudo filesystem. By convention, this + can only reside in the NuttX pseudo file system. By convention, this mount point is a subdirectory under /mnt. The mount command will create whatever pseudo directories that may be needed to complete the full path but the full path must not already exist. @@ -697,7 +697,7 @@ o mount [-t <fstype> <block-device> <dir-path>] o mv <old-path> <new-path> Rename the file object at <old-path> to <new-path>. Both paths must - reside in the same mounted filesystem. + reside in the same mounted file system. o nfsmount <server-address> <mount-point> <remote-path> @@ -744,7 +744,7 @@ o put [-b|-n] [-f <remote-path>] -h <ip-address> <local-path> The file will be saved with the same name on the host unless unless <local-path> is provided. -b|-n - Selects either binary ("octect") or test ("netascii") transfer + Selects either binary ("octet") or test ("netascii") transfer mode. Default: text. o pwd @@ -765,10 +765,10 @@ o pwd o rm <file-path> Remove the specified <file-path> name from the mounted file system. - Recall that NuttX uses a pseudo filesystem for its root file system. + Recall that NuttX uses a pseudo file system for its root file system. The rm command can only be used to remove (unlink) files in volumes set up with the mount command; it cannot be used to remove names from - the pseudo filesystem. + the pseudo file system. Example: ^^^^^^^^ @@ -786,10 +786,10 @@ o rm <file-path> o rmdir <dir-path> Remove the specified <dir-path> directory from the mounted file system. - Recall that NuttX uses a pseudo filesystem for its root file system. The + Recall that NuttX uses a pseudo file system for its root file system. The rmdir command can only be used to remove directories from volumes set up with the mount command; it cannot be used to remove directories from the - pseudo filesystem. + pseudo file system. Example: ^^^^^^^^ @@ -940,13 +940,13 @@ Command Dependencies on Configuration Settings * NOTES: 1. Because of hardware padding, the actual buffersize required for put and get operations size may be larger. - 2. Special TFTP server start-up optionss will probably be required to permit + 2. Special TFTP server start-up options will probably be required to permit creation of file for the correct operation of the put command. 3. CONFIG_FS_READABLE is not a user configuration but is set automatically - if any readable filesystem is selected. At present, this is either CONFIG_FS_FAT + if any readable file system is selected. At present, this is either CONFIG_FS_FAT and CONFIG_FS_ROMFS. 4. CONFIG_FS_WRITABLE is not a user configuration but is set automatically - if any writable filesystem is selected. At present, this is only CONFIG_FS_FAT. + if any writeable file system is selected. At present, this is only CONFIG_FS_FAT. In addition, each NSH command can be individually disabled via one of the following settings. All of these settings make the configuration of NSH potentially complex but @@ -986,7 +986,7 @@ NSH-Specific Configuration Settings * CONFIG_NSH_FILEIOSIZE Size of a static I/O buffer used for file access (ignored if - there is no filesystem). Default is 1024. + there is no file system). Default is 1024. * CONFIG_NSH_STRERROR strerror(errno) makes more readable output but strerror() is @@ -1023,7 +1023,7 @@ NSH-Specific Configuration Settings Default is zero. * CONFIG_NSH_ROMFSETC - Mount a ROMFS filesystem at /etc and provide a startup script + Mount a ROMFS file system at /etc and provide a startup script at /etc/init.d/rcS. The default startup script will mount a FAT FS RAMDISK at /tmp but the logic is easily extensible. diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index 3ff19a090..5c76aca0e 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -116,7 +116,7 @@ #if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 struct tftpc_args_s { - bool binary; /* true:binary ("octect") false:text ("netascii") */ + bool binary; /* true:binary ("octet") false:text ("netascii") */ bool allocated; /* true: destpath is allocated */ char *destpath; /* Path at destination */ const char *srcpath; /* Path at src */ @@ -502,6 +502,7 @@ int cmd_get(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { free(args.destpath); } + free(fullpath); return OK; } @@ -596,7 +597,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } /* If both the network interface name and an IP address are supplied as - * arguments, then ifconfig will set the address of the ethernet device: + * arguments, then ifconfig will set the address of the Ethernet device: * * ifconfig nic_name ip_address */ @@ -677,7 +678,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return ERROR; } - /* Set Hardware ethernet MAC addr */ + /* Set Hardware Ethernet MAC address */ if (hw) { @@ -915,12 +916,12 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) (ipaddr >> 16 ) & 0xff, (ipaddr >> 24 ) & 0xff, DEFAULT_PING_DATALEN); - start = g_system_timer; + start = clock_systimer(); for (i = 1; i <= count; i++) { /* Send the ECHO request and wait for the response */ - next = g_system_timer; + next = clock_systimer(); seqno = uip_ping(ipaddr, id, i, DEFAULT_PING_DATALEN, maxwait); /* Was any response returned? We can tell if a non-negative sequence @@ -934,7 +935,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * to an earlier request, then fudge the elpased time. */ - elapsed = TICK2MSEC(g_system_timer - next); + elapsed = TICK2MSEC(clock_systimer() - next); if (seqno < i) { elapsed += 100 * dsec * (i - seqno); @@ -952,7 +953,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * to the current request! */ - elapsed = TICK2DSEC(g_system_timer - next); + elapsed = TICK2DSEC(clock_systimer() - next); if (elapsed < dsec) { usleep(100000 * (dsec - elapsed)); @@ -961,7 +962,7 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) /* Get the total elapsed time */ - elapsed = TICK2MSEC(g_system_timer - start); + elapsed = TICK2MSEC(clock_systimer() - start); /* Calculate the percentage of lost packets */ @@ -1013,6 +1014,7 @@ int cmd_put(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { free(args.destpath); } + free(fullpath); return OK; } @@ -1123,7 +1125,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { nsh_output(vtbl, g_fmtcmdfailed, argv[0], "wget", NSH_ERRNO); goto exit; - } + } /* Free allocated resources */ @@ -1132,18 +1134,22 @@ exit: { close(fd); } + if (allocfile) { free(allocfile); } + if (fullpath) { free(fullpath); } + if (buffer) { free(buffer); } + return ret; errout: diff --git a/apps/platform/stm3240g-eval/Kconfig b/apps/platform/stm3240g-eval/Kconfig new file mode 100644 index 000000000..647715b83 --- /dev/null +++ b/apps/platform/stm3240g-eval/Kconfig @@ -0,0 +1,8 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +if ARCH_BOARD_STM3240G_EVAL + +endif diff --git a/apps/platform/stm3240g-eval/Make.defs b/apps/platform/stm3240g-eval/Make.defs new file mode 100644 index 000000000..c09fbba03 --- /dev/null +++ b/apps/platform/stm3240g-eval/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# apps/platform/stm3240g-eval/Make.defs +# +# Copyright (C) 2013 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 +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +# Add platform specific sources to ASRCS and CSRCS + +ifeq ($(CONFIG_HAVE_CXX),y) +CSRCS += up_cxxinitialize.c +endif diff --git a/nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c b/apps/platform/stm3240g-eval/up_cxxinitialize.c index b779c65ff..de17dd36b 100644 --- a/nuttx/configs/stm3240g-eval/src/up_cxxinitialize.c +++ b/apps/platform/stm3240g-eval/up_cxxinitialize.c @@ -1,8 +1,7 @@ /************************************************************************************ - * configs/stm3240g-eval/src/up_cxxinitialize.c - * arch/arm/src/board/up_cxxinitialize.c + * apps/platform/stm3240g-eval/src/up_cxxinitialize.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -45,7 +44,6 @@ #include <nuttx/arch.h> #include <arch/stm32/chip.h> -#include "chip.h" #if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) @@ -152,4 +150,3 @@ void up_cxxinitialize(void) } #endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */ - diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7dd234a03..9bd1473fe 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -6342,4 +6342,8 @@ tools (2013-12-29). * configs/stm3240g-eval/knxwm: Add a kernel mode NxWM build configuration (not yet verified) (2013-12-29). + * Moved configs/stm3240g-eval/src/up_cxxinitialize.c to + apps/platform/stm3240g-eval/up_cxxinitialize.c: Now it is available + in user-space in the kernel mode build (2013-12-29). + diff --git a/nuttx/configs/stm3240g-eval/knxwm/setenv.sh b/nuttx/configs/stm3240g-eval/knxwm/setenv.sh index d2f43cd1a..aae83a4da 100755 --- a/nuttx/configs/stm3240g-eval/knxwm/setenv.sh +++ b/nuttx/configs/stm3240g-eval/knxwm/setenv.sh @@ -47,19 +47,23 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# This is the Cygwin path to the location where I installed the RIDE -# toolchain under windows. You will also have to edit this if you install -# the RIDE toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin" - # This is the Cygwin path to the location where I installed the CodeSourcery # 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)/CodeSourcery/Sourcery G++ Lite/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" + +# 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 Atollic toolchain in any other location. /usr/bin is added before +# the Atollic bin path because there is are binaries named gcc.exe and g++.exe +# at those locations as well. +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This is the Cygwin path to the location where I build the buildroot # toolchain. -#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm/staging_dir/bin" # Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" diff --git a/nuttx/configs/stm3240g-eval/nxwm/setenv.sh b/nuttx/configs/stm3240g-eval/nxwm/setenv.sh index a995b02bc..f49c3506b 100755 --- a/nuttx/configs/stm3240g-eval/nxwm/setenv.sh +++ b/nuttx/configs/stm3240g-eval/nxwm/setenv.sh @@ -47,19 +47,23 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# This is the Cygwin path to the location where I installed the RIDE -# toolchain under windows. You will also have to edit this if you install -# the RIDE toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin" - # This is the Cygwin path to the location where I installed the CodeSourcery # 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)/CodeSourcery/Sourcery G++ Lite/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" + +# 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 Atollic toolchain in any other location. /usr/bin is added before +# the Atollic bin path because there is are binaries named gcc.exe and g++.exe +# at those locations as well. +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This is the Cygwin path to the location where I build the buildroot # toolchain. -#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" +#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm/staging_dir/bin" # Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" diff --git a/nuttx/configs/stm3240g-eval/src/Makefile b/nuttx/configs/stm3240g-eval/src/Makefile index 5f65ae799..78b6edea2 100644 --- a/nuttx/configs/stm3240g-eval/src/Makefile +++ b/nuttx/configs/stm3240g-eval/src/Makefile @@ -42,10 +42,6 @@ AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = up_boot.c up_spi.c -ifeq ($(CONFIG_HAVE_CXX),y) -CSRCS += up_cxxinitialize.c -endif - ifeq ($(CONFIG_ARCH_LEDS),y) CSRCS += up_autoleds.c else |