Fix an uninitialized register error that crept into the ARM9 start up code many years ago and was recently cloned into the Cortex-A5. Obviously no on has used NuttX with ARM9 for years

This commit is contained in:
Gregory Nutt
2013-07-24 20:12:04 -06:00
parent e6beda428a
commit 55df28dbcf
4 changed files with 158 additions and 114 deletions
+5
View File
@@ -5196,3 +5196,8 @@
configuration logic for USARTs needs to depend on if the USART is
configured as a UART or not. And this is for all CPUS, not just
SAM3/4 (2013-7-24).
* arch/arm/src/arm/up_head.S and arch/arm/src/armv7-a/arm_head.S:
Fix a bug (uninitialized register error) that crept in the ARM9
boot-up code several years ago and was cloned into the Cortex-A5
code. Obviously no one has used the ARM9 NuttX port for years!
+7 -3
View File
@@ -309,8 +309,14 @@ __start:
#else /* CONFIG_PAGING */
#ifdef CONFIG_IDENTITY_TEXTMAP
mksection r0, r4 /* r0=phys. base section */
ldr r1, .LCmmuflags /* FLGS=MMU_MEMFLAGS */
add r3, r1, r0 /* r3=flags + base */
#endif
/* Create a virtual single section mapping for the first MB of the .text
* address space. Now, we have the first 1MB mapping to both phyical and
* address space. Now, we have the first 1MB mapping to both physical and
* virtual addresses. The rest of the .text mapping will be completed in
* .Lvstart once we have moved the physical mapping out of the way.
*
@@ -500,7 +506,6 @@ __start:
* cover additinal RAM sections.
*/
#ifndef CONFIG_ARCH_ROMPGTABLE
#ifndef CONFIG_IDENTITY_TEXTMAP
ldr r4, .LCvpgtable /* r4=virtual page table */
@@ -658,4 +663,3 @@ g_idle_topstack:
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE
.size g_idle_topstack, .-g_idle_topstack
.end
+11 -2
View File
@@ -315,8 +315,18 @@ __start:
#else /* CONFIG_PAGING */
/* Create identity mapping for first MB of the .text section if we have
* no already done so.
*/
#ifdef CONFIG_IDENTITY_TEXTMAP
mksection r0, r4 /* r0=phys. base section */
ldr r1, .LCmmuflags /* FLGS=MMU_MEMFLAGS */
add r3, r1, r0 /* r3=flags + base */
#endif
/* Create a virtual single section mapping for the first MB of the .text
* address space. Now, we have the first 1MB mapping to both phyical and
* address space. Now, we have the first 1MB mapping to both physical and
* virtual addresses. The rest of the .text mapping will be completed in
* .Lvstart once we have moved the physical mapping out of the way.
*
@@ -573,7 +583,6 @@ __start:
* cover additinal RAM sections.
*/
#ifndef CONFIG_ARCH_ROMPGTABLE
#ifndef CONFIG_IDENTITY_TEXTMAP
ldr r4, .LCvpgtable /* r4=virtual page table */
+33 -7
View File
@@ -67,7 +67,7 @@ Contents
- Configurations
Contents
^^^^^^^^
========
- PIO Muliplexing
- Development Environment
@@ -76,6 +76,7 @@ Contents
- NuttX EABI "buildroot" Toolchain
- NuttX OABI "buildroot" Toolchain
- NXFLAT Toolchain
- Loading Code
- Buttons and LEDs
- Serial Consoles
- SAMA5D3x-EK Configuration Options
@@ -102,7 +103,7 @@ Development Environment
toolchains will likely cause problems.
GNU Toolchain Options
^^^^^^^^^^^^^^^^^^^^^
=====================
The NuttX make system will support the several different toolchain options.
@@ -164,7 +165,7 @@ GNU Toolchain Options
path or will get the wrong version of make.
IDEs
^^^^
====
NuttX is built using command-line make. It can be used with an IDE, but some
effort will be required to create the project (There is a simple RIDE project
@@ -197,7 +198,7 @@ IDEs
startup object needed by RIDE.
NuttX EABI "buildroot" Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
================================
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
@@ -240,7 +241,7 @@ NuttX EABI "buildroot" Toolchain
See instructions below.
NuttX OABI "buildroot" Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
================================
The older, OABI buildroot toolchain is also available. To use the OABI
toolchain, use the build instructtions above, but (1) modify the
@@ -249,7 +250,7 @@ NuttX OABI "buildroot" Toolchain
cortexm3-defconfig-4.3.3
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
================
If you are *not* using the NuttX buildroot toolchain and you want to use
the NXFLAT tools, then you will still have to build a portion of the buildroot
@@ -281,8 +282,33 @@ NXFLAT Toolchain
8. Edit setenv.h, if necessary, so that the PATH variable includes
the path to the newly built NXFLAT binaries.
Loading Code
============
Loading code with the Segger tools and GDB
------------------------------------------
1) Change directories into the directory where you built NuttX.
2) Start the GDB server and wait until it is ready to accept GDB
connections.
3) Then run GDB like this:
$ arm-none-eabi-gdb
(gdb) target remote localhost:2331
(gdb) mon reset
(gdb) load nuttx
(gdb) ... start debugging ...
Loading code using J-Link Commander
----------------------------------
J-Link> r
J-Link> loadbin <file> <address>
J-Link> setpc <address of __start>
J-Link> ... start debugging ...
Buttons and LEDs
^^^^^^^^^^^^^^^^
================
Buttons
-------