diff --git a/Documentation/platforms/arm/tiva/boards/lm3s6965-ek/index.rst b/Documentation/platforms/arm/tiva/boards/lm3s6965-ek/index.rst new file mode 100644 index 0000000000000..3166c2059b103 --- /dev/null +++ b/Documentation/platforms/arm/tiva/boards/lm3s6965-ek/index.rst @@ -0,0 +1,169 @@ +=========== +lm3s6965-ek +=========== + +The `Stellaris LM3S6965 Evaluation Kit +`_ is an ARM Cortex-M3 based +development board featuring the LM3S6965 microcontroller with an +integrated 10/100 Ethernet controller. NuttX can run on this board +both on real hardware and under QEMU emulation +(``qemu-system-arm -M lm3s6965evb``). + +Features of the LM3S6965 Evaluation Kit: + +* LM3S6965 microcontroller (ARM Cortex-M3, 50 MHz) +* 256 KB flash, 64 KB SRAM +* Integrated 10/100 Ethernet MAC and PHY +* OLED graphics display (128 x 96 pixel) +* MicroSD card slot +* USB interface for debugging and power supply +* Standard ARM 20-pin JTAG debug connector + +Configurations +============== + +Each configuration is maintained in a sub-directory and can be selected +as follows:: + + $ ./tools/configure.sh lm3s6965-ek: + +Where ```` is one of the following: + +discover +-------- + +A network discovery configuration:: + + $ ./tools/configure.sh -l lm3s6965-ek:discover + $ make + +nsh +--- + +Configures the NuttShell (NSH) with serial and telnet interfaces:: + + $ ./tools/configure.sh -l lm3s6965-ek:nsh + $ make + +nx +-- + +An NX graphics configuration:: + + $ ./tools/configure.sh -l lm3s6965-ek:nx + $ make + +qemu-flat +--------- + +A FLAT memory model configuration for running under QEMU:: + + $ ./tools/configure.sh -l lm3s6965-ek:qemu-flat + $ make + +qemu-protected +-------------- + +A PROTECTED memory model configuration for running under QEMU:: + + $ ./tools/configure.sh -l lm3s6965-ek:qemu-protected + $ make + +qemu-kostest +------------- + +A PROTECTED memory model configuration with kernel ostest for running +under QEMU:: + + $ ./tools/configure.sh -l lm3s6965-ek:qemu-kostest + $ make + +qemu-nxflat +------------ + +A FLAT memory model configuration with NXFLAT binary support for running +under QEMU:: + + $ ./tools/configure.sh -l lm3s6965-ek:qemu-nxflat + $ make + +tcpecho +------- + +A TCP echo server configuration:: + + $ ./tools/configure.sh -l lm3s6965-ek:tcpecho + $ make + +Running with QEMU +================= + +FLAT build (qemu-flat) +---------------------- + +:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin + +PROTECTED build (qemu-protected, qemu-kostest) +----------------------------------------------- + +The PROTECTED build produces separate kernel and user binaries. +Use ``-device loader`` to load the user binary at its link address:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin \ + -device loader,file=nuttx_user.bin,addr=0x20000 + +With networking (qemu-flat) +--------------------------- + +The ``lm3s6965evb`` machine includes a built-in Stellaris Ethernet NIC +(``stellaris_enet``). To enable user-mode networking with the host, +add the ``-nic user`` option:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin -nic user + +With networking (qemu-protected) +--------------------------------- + +For the PROTECTED build, also load the user binary:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin \ + -device loader,file=nuttx_user.bin,addr=0x20000 \ + -nic user + +To exit QEMU, press ``Ctrl-A`` then ``X``. + +Debugging with QEMU +==================== + +1. To debug the NuttX ELF with symbols, ensure that the following + configuration option is enabled in your defconfig (it is already + set in the ``lm3s6965-ek:qemu-protected`` defconfig):: + + CONFIG_DEBUG_SYMBOLS=y + +2. Run QEMU at shell terminal 1 with GDB server enabled:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin -S -s + + For a PROTECTED build, also load the userspace binary:: + + $ qemu-system-arm -M lm3s6965evb -nographic \ + -kernel nuttx.bin \ + -device loader,file=nuttx_user.bin,addr=0x20000 -S -s + +3. Run GDB with TUI, connect to QEMU, load NuttX and continue + (at shell terminal 2):: + + $ arm-none-eabi-gdb -tui --eval-command='target remote localhost:1234' nuttx + (gdb) c + Continuing. + ^C + Program received signal SIGINT, Interrupt. + (gdb) diff --git a/Documentation/platforms/arm/tiva/index.rst b/Documentation/platforms/arm/tiva/index.rst index 7b41b72789054..d64bfb700706b 100644 --- a/Documentation/platforms/arm/tiva/index.rst +++ b/Documentation/platforms/arm/tiva/index.rst @@ -188,3 +188,12 @@ Jose Pablo Carballo and I are doing this port. - TI/Tiva TM4C129E - TI/Tiva TM4C129X - TI/SimpleLink CC13x2 + +Supported Boards +================ + +.. toctree:: + :glob: + :maxdepth: 1 + + boards/*/* diff --git a/arch/arm/src/armv6-m/arm_dispatch_syscall.S b/arch/arm/src/armv6-m/arm_dispatch_syscall.S index 20b341477ab62..9d1d73c1ce855 100644 --- a/arch/arm/src/armv6-m/arm_dispatch_syscall.S +++ b/arch/arm/src/armv6-m/arm_dispatch_syscall.S @@ -89,6 +89,7 @@ arm_dispatch_syscall: lsl r0, r0, #2 /* R0=Offset of the stub for this syscall */ ldr r4, [r4, r0] /* R4=Address of the stub for this syscall */ blx r4 /* Call the stub (modifies lr) */ + ldr r4, [sp, #0] /* Restore r4 */ add sp, sp, #32 /* Destroy the stack frame */ mov r2, r0 /* R2=Save return value in R2 */ mov r0, SYS_syscall_return /* R0=SYS_syscall_return */ diff --git a/arch/arm/src/armv7-m/arm_dispatch_syscall.S b/arch/arm/src/armv7-m/arm_dispatch_syscall.S index fcc876564209a..6b2b88bfd5ff3 100644 --- a/arch/arm/src/armv7-m/arm_dispatch_syscall.S +++ b/arch/arm/src/armv7-m/arm_dispatch_syscall.S @@ -78,9 +78,8 @@ arm_dispatch_syscall: .cfi_sections .debug_frame .cfi_startproc - mov r11, sp - .cfi_register sp, r11 sub sp, sp, #32 + .cfi_def_cfa_offset 32 str r4, [sp, #0] .cfi_offset r4, 0 str r5, [sp, #4] diff --git a/boards/arm/tiva/lm3s6965-ek/configs/qemu-protected/defconfig b/boards/arm/tiva/lm3s6965-ek/configs/qemu-protected/defconfig index f247e8d27f73e..05c76a4be5143 100644 --- a/boards/arm/tiva/lm3s6965-ek/configs/qemu-protected/defconfig +++ b/boards/arm/tiva/lm3s6965-ek/configs/qemu-protected/defconfig @@ -34,7 +34,6 @@ CONFIG_EXAMPLES_WGET=y CONFIG_FS_BINFS=y CONFIG_FS_HOSTFS=y CONFIG_FS_PROCFS=y -CONFIG_FS_TMPFS=y CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_LIBC_DLFCN=y CONFIG_LIBC_ELF_RELOCATION_BUFFERCOUNT=64 @@ -103,4 +102,5 @@ CONFIG_TIVA_GPIOG_IRQS=y CONFIG_TIVA_SSI0=y CONFIG_TIVA_UART0=y CONFIG_TIVA_WITH_QEMU=y +CONFIG_TLS_LOG2_MAXSTACK=11 CONFIG_UART0_SERIAL_CONSOLE=y diff --git a/boards/arm/tiva/lm3s6965-ek/scripts/memory.ld b/boards/arm/tiva/lm3s6965-ek/scripts/memory.ld index f8bfa633a8506..a829353023a7f 100644 --- a/boards/arm/tiva/lm3s6965-ek/scripts/memory.ld +++ b/boards/arm/tiva/lm3s6965-ek/scripts/memory.ld @@ -34,7 +34,7 @@ MEMORY /* 64Kb of contiguous SRAM */ - ksram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K - usram (rwx) : ORIGIN = 0x20004000, LENGTH = 16K - xsram (rwx) : ORIGIN = 0x20008000, LENGTH = 32K + ksram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K + usram (rwx) : ORIGIN = 0x20005000, LENGTH = 20K + xsram (rwx) : ORIGIN = 0x2000a000, LENGTH = 24K }