From 77303f389f29b947c31bf0322d730be36fc4e061 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 24 Oct 2024 09:54:18 +0200 Subject: [PATCH] Documentation: migrate README.txt from boards and fixes for mps boards migrate some README.txt form boards/ and fixes for mps boards rst --- .../arm/mps/boards/mps2-an500/index.rst | 35 +++---- .../arm/mps/boards/mps2-an512/index.rst | 41 ++++++++ .../arm/mps/boards/mps3-an547/index.rst | 98 ++++++++----------- .../hpm6000/boards/hpm6360evk/index.rst | 47 +++++++++ .../platforms/risc-v/hpm6000/index.rst | 12 +++ boards/arm/mps/mps2-an521/README.txt | 52 ---------- boards/risc-v/hpm6000/hpm6360evk/README.txt | 42 -------- 7 files changed, 154 insertions(+), 173 deletions(-) create mode 100644 Documentation/platforms/arm/mps/boards/mps2-an512/index.rst create mode 100644 Documentation/platforms/risc-v/hpm6000/boards/hpm6360evk/index.rst create mode 100644 Documentation/platforms/risc-v/hpm6000/index.rst delete mode 100644 boards/arm/mps/mps2-an521/README.txt delete mode 100644 boards/risc-v/hpm6000/hpm6360evk/README.txt diff --git a/Documentation/platforms/arm/mps/boards/mps2-an500/index.rst b/Documentation/platforms/arm/mps/boards/mps2-an500/index.rst index 09ef63250e..81caaf4714 100644 --- a/Documentation/platforms/arm/mps/boards/mps2-an500/index.rst +++ b/Documentation/platforms/arm/mps/boards/mps2-an500/index.rst @@ -1,33 +1,24 @@ -================= +================ MPS2 AN500 Board -================= +================ This board configuration will use QEMU to emulate generic ARM v7-M series hardware platform and provides support for these devices: - - ARM Generic Timer - - CMSDK UART controller - -Contents -======== - - Getting Started - - Status - - Platform Features - - Debugging with QEMU - - FPU Support and Performance - - SMP Support - - References +- ARM Generic Timer +- CMSDK UART controller Getting Started =============== -1. Configuring and running +1. Configuring NuttX and compile:: - Configuring NuttX and compile: $ ./tools/configure.sh -l mps2-an500:nsh $ make - Running with qemu - $ qemu-system-arm -M mps2-an500 -nographic -kernel nuttx.bin + +Running with qemu:: + + $ qemu-system-arm -M mps2-an500 -nographic -kernel nuttx.bin Debugging with QEMU =================== @@ -35,14 +26,14 @@ Debugging with QEMU The nuttx ELF image can be debugged with QEMU. 1. To debug the nuttx (ELF) with symbols, make sure the following change have - applied to defconfig. + applied to defconfig:: -+CONFIG_DEBUG_SYMBOLS=y + +CONFIG_DEBUG_SYMBOLS=y -2. Run QEMU(at shell terminal 1) +2. Run QEMU(at shell terminal 1):: $ qemu-system-arm -M mps2-an500 -nographic -kernel nuttx.bin -S -s -3. Run gdb with TUI, connect to QEMU, load nuttx and continue (at shell terminal 2) +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 diff --git a/Documentation/platforms/arm/mps/boards/mps2-an512/index.rst b/Documentation/platforms/arm/mps/boards/mps2-an512/index.rst new file mode 100644 index 0000000000..37bb9bcfc0 --- /dev/null +++ b/Documentation/platforms/arm/mps/boards/mps2-an512/index.rst @@ -0,0 +1,41 @@ +================ +MPS2 AN521 Board +================ + +This board configuration will use QEMU to emulate generic ARM v8-M series +hardware platform and provides support for these devices: + +- ARM Generic Timer +- CMSDK UART controller + +Getting Started +=============== + +1. Configuring NuttX and compile (Single Core):: + + $ ./tools/configure.sh -l mps2-an521:nsh + $ make + +Running with qemu:: + + $ qemu-system-arm -M mps2-an521 -nographic -chardev stdio,id=con,mux=on \ + -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx + +Debugging with QEMU +=================== + +The nuttx ELF image can be debugged with QEMU. + +1. To debug the nuttx (ELF) with symbols, make sure the following change have + applied to defconfig:: + + CONFIG_DEBUG_SYMBOLS=y + +2. Run QEMU (at shell terminal 1):: + + qemu-system-arm -M mps2-an521 -nographic -chardev stdio,id=con,mux=on \ + -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx -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 diff --git a/Documentation/platforms/arm/mps/boards/mps3-an547/index.rst b/Documentation/platforms/arm/mps/boards/mps3-an547/index.rst index 147355527a..0fea4818b3 100644 --- a/Documentation/platforms/arm/mps/boards/mps3-an547/index.rst +++ b/Documentation/platforms/arm/mps/boards/mps3-an547/index.rst @@ -1,8 +1,9 @@ -================= +================ MPS3 AN547 Board -================= +================ -The MPS3 AN547 board configuration uses QEMU to emulate a generic ARM v8-M series hardware platform and provides support for the following devices: +The MPS3 AN547 board configuration uses QEMU to emulate a generic ARM v8-M +series hardware platform and provides support for the following devices: - ARM Generic Timer - CMSDK UART controller @@ -10,76 +11,59 @@ The MPS3 AN547 board configuration uses QEMU to emulate a generic ARM v8-M serie Getting Started =============== -Configuring and Running ------------------------ +Configuring and Running (Single Core) +------------------------------------- -### Single Core +1. Configuring NuttX and Compiling:: -1. **Configuring NuttX and Compiling:** + ./tools/configure.sh -l mps3-an547:nsh + make - ```bash - $ ./tools/configure.sh -l mps3-an547:nsh - $ make - ``` +2. Running with QEMU:: -2. **Running with QEMU:** + $ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin - ```bash - $ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin - ``` +3. Pic ostest:: -3. **Pic ostest:** + ./tools/configure.sh mps3-an547:picostest + make -j20 + genromfs -f romfs.img -d ../apps/bin/ + qemu-system-arm -M mps3-an547 -m 2G -nographic \ + -kernel nuttx.bin -gdb tcp::1127 \ + -device loader,file=romfs.img,addr=0x60000000 + nsh> /pic/hello + nsh> /pic/ostest - ```bash - $ ./tools/configure.sh mps3-an547:picostest - $ make -j20 - $ genromfs -f romfs.img -d ../apps/bin/ - $ qemu-system-arm -M mps3-an547 -m 2G -nographic \ - -kernel nuttx.bin -gdb tcp::1127 \ - -device loader,file=romfs.img,addr=0x60000000 - $ nsh> /pic/hello - $ nsh> /pic/ostest - ``` +4. Pic bootloader boot to ap, and run ostest:: -4. **Pic bootloader boot to ap, and run ostest:** - - ```bash - $ ./tools/configure.sh mps3-an547:ap - $ make -j20 - $ mkdir -p pic - $ arm-none-eabi-strip --remove-section=.rel.text --remove-section=.comment --strip-unneeded nuttx -o pic/boot - $ genromfs -a -f 128 ../romfs.img -d pic - $ make distclean -j20 - $ ./tools/configure.sh mps3-an547:bl - $ make -j20 - $ qemu-system-arm -M mps3-an547 -m 2G -nographic \ - -kernel nuttx.bin -gdb tcp::1127 \ - -device loader,file=../romfs.img,addr=0x60000000 - $ bl> boot /pic/boot - $ ap> ostest - ``` + ./tools/configure.sh mps3-an547:ap + make -j20 + mkdir -p pic + arm-none-eabi-strip --remove-section=.rel.text --remove-section=.comment --strip-unneeded nuttx -o pic/boot + genromfs -a -f 128 ../romfs.img -d pic + make distclean -j20 + ./tools/configure.sh mps3-an547:bl + make -j20 + qemu-system-arm -M mps3-an547 -m 2G -nographic \ + -kernel nuttx.bin -gdb tcp::1127 \ + -device loader,file=../romfs.img,addr=0x60000000 + bl> boot /pic/boot + ap> ostest Debugging with QEMU =================== The NuttX ELF image can be debugged using QEMU. -1. **Enable Debug Symbols:** +1. Enable Debug Symbols. + Ensure the following change is applied to ``defconfig``:: - Ensure the following change is applied to `defconfig`: + CONFIG_DEBUG_SYMBOLS=y - ```bash - +CONFIG_DEBUG_SYMBOLS=y - ``` +2. Run QEMU:: -2. **Run QEMU:** + qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin -S -s - ```bash - $ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin -S -s - ``` +3. Run GDB with TUI:: -3. **Run GDB with TUI:** - - ```bash - $ arm-none-eabi-gdb -tui --eval-command='target remote localhost:1234' nuttx - ``` + arm-none-eabi-gdb -tui --eval-command='target remote localhost:1234' nuttx diff --git a/Documentation/platforms/risc-v/hpm6000/boards/hpm6360evk/index.rst b/Documentation/platforms/risc-v/hpm6000/boards/hpm6360evk/index.rst new file mode 100644 index 0000000000..647376c75f --- /dev/null +++ b/Documentation/platforms/risc-v/hpm6000/boards/hpm6360evk/index.rst @@ -0,0 +1,47 @@ +========== +hpm6360evk +========== + +1. Download and install toolchain:: + + curl https://github.com/hpmicro/riscv-gnu-toolchain/releases/tag/2022.05.15 + +2. Download and install openocd. + + Download hpmicro sdk_env, openocd in the path: sdk_env/tools/openocd + +3. Configure and build NuttX:: + + mkdir ./nuttxspace + cd ./nuttxspace + git clone https://github.com/apache/nuttx.git nuttx + git clone https://github.com/apache/nuttx-apps.git apps + cd nuttx + make distclean + ./tools/configure.sh hpm6750evk2:nsh + make menuconfig + make V=1 + +Note: make menuconfig to config toolchain + +To switch GNU riscv64 toolchain to GNU riscv32 toolchain, the following option must be selected:: + + System Type ---> + Toolchain Selection ---> + [ ] Generic GNU RV64 toolchain + [x] Generic GNU RV32 toolchain + +Make sure HPMicro GNU riscv32 toolchain have been installed and be found in PATH. + +4. Debug the nuttx with openocd and run:: + + picocom -b 115200 /dev/ttyACM0 + + When using fireDAP, command as follows. Those cfg files in the path: ``sdk_env/hpm_sdk/boards/openocd``:: + + $ openocd -f probes/cmsis_dap.cfg -f soc/hpm6750-single-core.cfg -f boards/hpm6750evk2.cfg + + $ riscv32-unknown-elf-gdb ./nuttx + (gdb) target extended-remote [ip_addr]:3333 + (gdb) load + (gdb) c diff --git a/Documentation/platforms/risc-v/hpm6000/index.rst b/Documentation/platforms/risc-v/hpm6000/index.rst new file mode 100644 index 0000000000..82740ddb3d --- /dev/null +++ b/Documentation/platforms/risc-v/hpm6000/index.rst @@ -0,0 +1,12 @@ +=============== +Hpmicro HPM6000 +=============== + +Supported Boards +================ + +.. toctree:: + :glob: + :maxdepth: 1 + + boards/*/* diff --git a/boards/arm/mps/mps2-an521/README.txt b/boards/arm/mps/mps2-an521/README.txt deleted file mode 100644 index 311d837a66..0000000000 --- a/boards/arm/mps/mps2-an521/README.txt +++ /dev/null @@ -1,52 +0,0 @@ -README.txt -========== - -This board configuration will use QEMU to emulate generic ARM v8-M series -hardware platform and provides support for these devices: - - - ARM Generic Timer - - CMSDK UART controller - -Contents -======== - - Getting Started - - Status - - Platform Features - - Debugging with QEMU - - FPU Support and Performance - - SMP Support - - References - -Getting Started -=============== - -1. Configuring and running - 1.1 Single Core - Configuring NuttX and compile: - $ ./tools/configure.sh -l mps2-an521:nsh - $ make - Running with qemu - $ qemu-system-arm -M mps2-an521 -nographic -chardev stdio,id=con,mux=on \ - -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx - - 2.2 Kernel protected mode - TODO - -Debugging with QEMU -=================== - -The nuttx ELF image can be debugged with QEMU. - -1. To debug the nuttx (ELF) with symbols, make sure the following change have - applied to defconfig. - -+CONFIG_DEBUG_SYMBOLS=y - -2. Run QEMU(at shell terminal 1) - - $ qemu-system-arm -M mps2-an521 -nographic -chardev stdio,id=con,mux=on \ - -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx -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 diff --git a/boards/risc-v/hpm6000/hpm6360evk/README.txt b/boards/risc-v/hpm6000/hpm6360evk/README.txt deleted file mode 100644 index 7ef9d1b9e8..0000000000 --- a/boards/risc-v/hpm6000/hpm6360evk/README.txt +++ /dev/null @@ -1,42 +0,0 @@ -1. Download and install toolchain - - $ curl https://github.com/hpmicro/riscv-gnu-toolchain/releases/tag/2022.05.15 - -2. Download and install openocd - - Download hpmicro sdk_env, openocd in the path: sdk_env/tools/openocd - -3. Configure and build NuttX - - $ mkdir ./nuttxspace - $ cd ./nuttxspace - $ git clone https://github.com/apache/nuttx.git nuttx - $ git clone https://github.com/apache/nuttx-apps.git apps - $ cd nuttx - $ make distclean - $ ./tools/configure.sh hpm6750evk2:nsh - $ make menuconfig - $ make V=1 - - Note: make menuconfig to config toolchain - ================== - To switch GNU riscv64 toolchain to GNU riscv32 toolchain, the following option must be selected: - - System Type ---> - Toolchain Selection ---> - [ ] Generic GNU RV64 toolchain - [x] Generic GNU RV32 toolchain - - Make sure HPMicro GNU riscv32 toolchain have been installed and be found in PATH. - -4. Debug the nuttx with openocd and run - - $ picocom -b 115200 /dev/ttyACM0 - - When using fireDAP, command as follows. Those cfg files in the path: sdk_env/hpm_sdk/boards/openocd. - $ openocd -f probes/cmsis_dap.cfg -f soc/hpm6750-single-core.cfg -f boards/hpm6750evk2.cfg - - $ riscv32-unknown-elf-gdb ./nuttx - (gdb) target extended-remote [ip_addr]:3333 - (gdb) load - (gdb) c