From 456b8d1b14944ad634e1090032f285b33890e09c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 26 Dec 2015 14:49:02 -0600 Subject: [PATCH] TMS570 is big-endian --- configs/launchxl-tms57004/README.txt | 59 +++++++++++++------ configs/launchxl-tms57004/nsh/Make.defs | 2 +- configs/launchxl-tms57004/nsh/defconfig | 5 +- .../launchxl-tms57004/scripts/flash-sram.ld | 1 + 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/configs/launchxl-tms57004/README.txt b/configs/launchxl-tms57004/README.txt index c4e66fd2a3..4133564892 100644 --- a/configs/launchxl-tms57004/README.txt +++ b/configs/launchxl-tms57004/README.txt @@ -85,33 +85,56 @@ Serial Console This TMS570 has a single SCI. The SCI_RX and TX pins are connected to the FTDI chip which provides a virtual COM port for the launchpad. +Debugging +========= + + I used a Segger J-Link connected to the Launchpad via the JTAG connector. + The following table shows how I connected the 14-pin JTAG connector on + the Launchpad to the Segger 20-pin JTAG connector: + + --- ----------- ------ ------------- --- ---------- ------ ------- + J12 LAUCHPAD J-LINK J-LINK J12 LAUCHPAD J-LINK J-LINK + PIN SIGNAL PIN SIGNAL PIN SIGNAL PIN SIGNAL + --- ----------- ------ ------------- --- ---------- ------ ------- + 1 TMS 7 TMS 2 TRTSN 3 nTRST + 3 TDI 5 TDI 4 GND 2 GND + 5 PD (+3V3) 1 VTref 6 N/C - N/C + 7 TDO 13 TDO 8 JTAG_SEL** 4 GND + 9 RTCK 11 RTCK 10 GND 6 GND + 11 TCK 9 TCK 12 GND 8 GND + 13 EMU0* - N/C 14 EMU1* - N/C + --- ----------- ------ ------------- --- ---------- ------ ------- + + * Pulled high on board + ** Needs to be grounded to select JTAG + Configurations ============== -Information Common to All Configurations ----------------------------------------- -Each LaunchXL-TMS50704 configuration is maintained in a sub-directory and -can be selected as follow: + Information Common to All Configurations + ---------------------------------------- + Each LaunchXL-TMS50704 configuration is maintained in a sub-directory and + can be selected as follow: - cd tools - ./configure.sh launchxl-tms57004/ - cd - - . ./setenv.sh + cd tools + ./configure.sh launchxl-tms57004/ + cd - + . ./setenv.sh -Before sourcing the setenv.sh file above, you should examine it and perform -edits as necessary so that TOOLCHAIN_BIN is the correct path to the directory -than holds your toolchain binaries. + Before sourcing the setenv.sh file above, you should examine it and perform + edits as necessary so that TOOLCHAIN_BIN is the correct path to the directory + than holds your toolchain binaries. -And then build NuttX by simply typing the following. At the conclusion of -the make, the nuttx binary will reside in an ELF file called, simply, nuttx. + And then build NuttX by simply typing the following. At the conclusion of + the make, the nuttx binary will reside in an ELF file called, simply, nuttx. - make oldconfig - make + make oldconfig + make -The that is provided above as an argument to the tools/configure.sh -must be is one of the following. + The that is provided above as an argument to the tools/configure.sh + must be is one of the following. -NOTES: + NOTES: 1. These configurations use the mconf-based configuration tool. To change any of these configurations using that tool, you should: diff --git a/configs/launchxl-tms57004/nsh/Make.defs b/configs/launchxl-tms57004/nsh/Make.defs index 91fe68b023..f139bb761a 100644 --- a/configs/launchxl-tms57004/nsh/Make.defs +++ b/configs/launchxl-tms57004/nsh/Make.defs @@ -68,7 +68,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y) ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCPUFLAGS = -mcpu=cortex-r4 +ARCHCPUFLAGS = -mcpu=cortex-r4 -mbig-endian ARCHCFLAGS = -fno-builtin ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef diff --git a/configs/launchxl-tms57004/nsh/defconfig b/configs/launchxl-tms57004/nsh/defconfig index d879faf59c..58a988cadf 100644 --- a/configs/launchxl-tms57004/nsh/defconfig +++ b/configs/launchxl-tms57004/nsh/defconfig @@ -171,7 +171,7 @@ CONFIG_TMS570_GIO_IRQ=y # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set -CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_HAVE_IRQPRIO is not set # CONFIG_ARCH_L2CACHE is not set # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set @@ -184,9 +184,8 @@ CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_HAVE_POWEROFF is not set # CONFIG_ARCH_HAVE_RESET is not set # CONFIG_ARCH_USE_MPU is not set -# CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y -# CONFIG_ENDIAN_BIG is not set +CONFIG_ENDIAN_BIG=y # CONFIG_ARCH_IDLE_CUSTOM is not set CONFIG_ARCH_HAVE_RAMFUNCS=y # CONFIG_ARCH_RAMFUNCS is not set diff --git a/configs/launchxl-tms57004/scripts/flash-sram.ld b/configs/launchxl-tms57004/scripts/flash-sram.ld index bb4f7f1685..810a2b9b5d 100644 --- a/configs/launchxl-tms57004/scripts/flash-sram.ld +++ b/configs/launchxl-tms57004/scripts/flash-sram.ld @@ -44,6 +44,7 @@ MEMORY } OUTPUT_ARCH(arm) +OUTPUT_FORMAT(elf32-bigarm) EXTERN(_vectors) ENTRY(_stext)