Skip to content

Commit

Permalink
Squash of all commits for H5.
Browse files Browse the repository at this point in the history
Initial STM32H5 Commit

Initial commit of what I deemed essential files for bringing up the STM32H5. src/stm32h5/hardware files were edited by me, but need review. files in src/stm32h5 all need review and edits. include/stm32h5 files need review, some were edited by me.

Add Nucleo-H563ZI Folder

Add the board folder for the nucleo-h563zi. Right now this is largely a copy of the stm32l562e-dk configuration. Some files may be deleted in the future. Also made minor modifications to arch/arm/src/stm32h5/Kconfig file.

hardware/stm32h562xx_rcc.h update

Finished register and bit mapping for STM32H5 RCC

Rename hardware/stm32h5_rcc.h

Renamed stm32h562xx_rcc.h to stm32h5_rcc.h. The RCC register is the same for all versions of the STM32H5.

Defined rcc_enableperipherals functions

Defined all the functions wihtin rcc_enableperipherals. Getting started on stm32h5_stdclockconfig.

Incremental STM32H5 RCC Updates

Incremental Updates apache#2

Added stm32h5_lse.c and stm32h5_lsi.c files. Incremental updates to board.h, stm32h5xx_rcc.c, and hardware/stm32h5_rcc.h

Incremental Updates apache#3

Added stm32h5_hsi48.c and stm32h5_hsi48.h files. Incremental updates to board.h, stm32h5xx_rcc.c, and hardware/stm32h5_rcc.h. Renamed hardware crs file. Fixed lse.c and lsi.c for STM32H5.

Incremental Updates apache#4

Updated setting of VOS for STM32H5. Added HSIDIV definition to hardware/stm32h5_rcc.h for potential of changing HSIDIV from default. Changed board.h to use HSI of 32 MHz, which is the default. We still set SYSCLK to the max of 250MHz.

First STM32H5 PWR Commit

Rewrote hardware/stm32h5_pwr.h. Added stm32h5_pwr.c and stm32h5_pwr.h. Made minor changes to RCC files based on PWR peripheral.

PWR Peripheral Changes

Removed enablesmps function. LDO or SMPS is decided by hardware. Removed enablepwrclk. There is no PWREN for the STM32H5. Rewrote adustvcore. vcore must be adjusted incrementally.

Incremental Updates apache#5

Changed stm32 to stm32h5 in pwr.c. Added additional logic for selecting PLL sources. Added additional logic for enabling LSE or LSI. Set VCORE properly with stm32h5_pwr.c function. Fixes to adjustvcore function.

STM32H5 Power and RCC cleanup

Fixed some errors with private functions and incorrect preprocessor variables. Changed adjustvcore to not select intermediate VOS levels. Figure 49 in RM shows changing directly from VOS3 to VOS1. Added function adjustvos_ext for externally supplied VCORE. However I'm not sure if VOS should be incremented, then voltage incremented, then frequency incremented, or if VOS should be incremented one by one to final setting, then adjust voltage, then frequency. adjustvos does the former. Won't be used in stdclockconfig.

STM32H5 serial update

This commit primarily adds functionality taken from the stm32g4 lpuart implementation. The template I used, from the stm32l5, already had the LPUART in there but did not calculate the baud correctly. Added more USARTS and UARTS supported by STM32H5. Minor changes to chip.h, stm32h5_start.c, and Kconfig.

STM32H5 Serial Update apache#2

Added support for additional USARTS and UARTS on STM32H5. Other minor serial updates.

Build Fixes

Various fixes to get the stm32h5 arch to build. Many changes to follow. But for now, Nuttx builds.

Remove unnecessary hardware files from STM32H5 directory

More build changes

Even more build fixes

Minor fixes in stm32h5_rcc.c and stm32h5_pwr.c. Changed nucleo-h563zi defconfig to use std clock config. This resulted in errors that were fixed here. Also added stm32h5_lse.c and stm32h5_lsi.c to Make.defs.

Removed legacy pinmap. It is deprecated and should not be used on new designs.

Confirmed hardware crs and i2c files are correct. Will keep them for now.

IRQ info for STM32H52, STM32H53, STM32H56, STM32H57

libcxx: fix compile error

                 from ServiceManager.cpp:17:
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:71:24: error: expected nested-name-specifier before numeric constant
   71 |     template <typename _U>
      |                        ^~
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:71:24: error: expected ‘>’ before numeric constant
In file included from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/ConnectionInfo.h:3,
                 from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/IServiceManager.h:3,
                 from /home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/aidl/android/os/BnServiceManager.h:4:
/home/ligd/platform/dev/apps/external/android/frameworks/native/libs/binder/ndk/include_cpp/android/binder_to_string.h:72:56: error: no matching function for call to ‘declval<1>()’
   72 |     static auto _test(int) -> decltype(std::declval<_U>().toString(), std::true_type());
      |                                        ~~~~~~~~~~~~~~~~^~
In file included from /home/ligd/platform/dev/nuttx/include/libcxx/__type_traits/is_convertible.h:18,

Signed-off-by: ligd <[email protected]>

libc string:Separate code.

Separate the code that follows the BSD license into independent files.

Signed-off-by: yangguangcai <[email protected]>

arch/sim/cmake: remove the host specific -U when HOSTSRCS

fix macos compile hostfs.c compile issue.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_string.h:131:62: error: expected function body after function declarator
  131 | char    *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
      |                                                              ^

Signed-off-by: buxiasen <[email protected]>

Revert "libc/lib_bzero:Add bzero prototype."

This reverts commit 908814a.

In macos, memset will be automatic optmize to bzero, caused dead loop, as we not using bzero, macro re-define should ablt to cover the requirements.

Signed-off-by: buxiasen <[email protected]>

arhc/arm64: vector table may be far away form arm64_fatal_handle

use 33-bit (+/-4GB) pc-relative addressing to load
the address of arm64_fatal_handle

Signed-off-by: lipengfei28 <[email protected]>

sim: fix asan address space conflict

Modify the starting position of the elf segment to 0x5000000

==2561587==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==2561587==ASan shadow was supposed to be located in the [0x1ffff000-0x3fffffff] range.
==2561587==Process memory map follows:

Signed-off-by: yinshengkai <[email protected]>

arm64/toolchains:Add the following kasan compilation options

Signed-off-by: wangmingrong1 <[email protected]>

remove unused variable 'cpu_freq'

Signed-off-by: lipengfei28 <[email protected]>

drivers/timers/arch_alarm.c: Remove ndelay_accurate

Using ONESHOT_CURRENT retrieves the tick number multiplied by tick time; thus
it doesn't give the accurate monotonic time - it is quantized by
the tick time. This cannot be used as a ndelay timer, it would always loop
at least to the end of the ongoing tick.

Revert the up_udelay to use the original "coarse" looping. The "accurate" udelay,
if such is needed, should either be done under arch specific code, or there should be
a function for getting the accurate time that is available for all the platforms.

Signed-off-by: Jukka Laitinen <[email protected]>

boards/imx93-evk: Define CONFIG_BOARD_LOOPSPERMSEC

Use value measured with 1.8GHz CPU speed

Signed-off-by: Jukka Laitinen <[email protected]>

arch/x86_64:Fix variable used before assignment

Signed-off-by: liwenxiang1 <[email protected]>

arch/arm64: vector table 2K align

Signed-off-by: lipengfei28 <[email protected]>

arm/build: suppress LOAD RWX linker warning

Add --no-warn-rwx-segments in case of RAM boot mode to linker to
suppress the below warning:
"nuttx has a LOAD segment with RWX permissions"

Signed-off-by: Jinliang Li <[email protected]>

arch/arm64/src/imx9/imx9_lpspi.c: Fix 9-16 bit transfers

Signed-off-by: Jukka Laitinen <[email protected]>

arch/arm64/src/imx9/imx9_lpspi.c: Small cache operation optimization

There is no need to invalidate the RX buffer before every transfer.
It is never gets dirty, so it is good to invalidate initially after allocation,
and after each transfer.

Signed-off-by: Jukka Laitinen <[email protected]>

libxx: C++ low level library select LIBSUPCXX by default.

Signed-off-by: cuiziwei <[email protected]>

nuttx/sim: Fix m64 build error.

LD:  nuttx
 nuttx.rel: in function `ff_dct32_float_sse2':
 (.text+0x66f9e): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_32' defined in .bss.ff_cos_32 section in nuttx.rel
 (.text+0x66fa7): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_32' defined in .bss.ff_cos_32 section in nuttx.rel
 (.text+0x672a6): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_16' defined in .bss.ff_cos_16 section in nuttx.rel
 (.text+0x672ae): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_16' defined in .bss.ff_cos_16 section in nuttx.rel
 nuttx.rel: in function `ff_imdct_calc_sse':
 (.text+0x67905): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_64' defined in .bss.ff_cos_64 section in nuttx.rel
 (.text+0x67948): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_128' defined in .bss.ff_cos_128 section in nuttx.rel
 (.text+0x67988): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_256' defined in .bss.ff_cos_256 section in nuttx.rel
 (.text+0x679c8): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_512' defined in .bss.ff_cos_512 section in nuttx.rel
 (.text+0x67a08): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_1024' defined in .bss.ff_cos_1024 section in nuttx.rel
 (.text+0x67a48): relocation truncated to fit: R_X86_64_32S against symbol `ff_cos_2048' defined in .bss.ff_cos_2048 section in nuttx.rel
 (.text+0x67a88): additional relocation overflows omitted from the output

Signed-off-by: cuiziwei <[email protected]>

tls.h: list.h should depends on CONFIG_PTHREAD_ATFORK

Signed-off-by: ligd <[email protected]>

bluetooth: fix bt missing header files nuttx/wqueue.h

Signed-off-by: ligd <[email protected]>

lib_gdbstub: fix container of

Signed-off-by: buxiasen <[email protected]>
Signed-off-by: ligd <[email protected]>

container_of: fix compile failed cause of list.h not support container_of

Signed-off-by: ligd <[email protected]>

nuttx/arch:Enabling ARCH_MATH_H is required when compiling sim with the 13.2 version of the toolchain.

Signed-off-by: cuiziwei <[email protected]>
Signed-off-by: ligd <[email protected]>

arm/stm32f401rc-rs485: Add support to WS2812 addressable LED

Signed-off-by: Rodrigo Sim <[email protected]>

syslog: Don't allow blocking when in signal handler

Blocking while running a signal handler is not advisable, instead write
the log string character by character.

There is also a potential for a deadlock, as discussed in apache#6618

Note: querying for rtcb->sigdeliver is not 100% ideal, as it only tells
_if_ a signal handler has been queued, not if it is running. However, it
makes syslog safe / usable which is a debug feature anyhow.

boards/risc-v: Remove ref to riscv_internal.h

`riscv_internal.h` is a private chip level header file,
and it should not be included in the board files.

Signed-off-by: Huang Qi <[email protected]>

boards/esp32s3: Merge MCUboot and "simple-boot" linker scripts

To make it easier to keep the linker scripts updated for both
MCUboot and "simple-boot", this commit merges them into a single
linker script with macros to enable/disable specific sections.

task_exit.c: Add missing sched_note_stop()

A regression from apache#13728 ; sched_note_stop() is never called for tasks
that exit normally via exit().

nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.

Signed-off-by: cuiziwei <[email protected]>

serial/gdbstub:Adjust serial port gdbstub Kconfig dependencies

Signed-off-by: anjiahao <[email protected]>

gdbstub:fix typo

Signed-off-by: anjiahao <[email protected]>

coredump: coredump_add_memory_region need use flags

Signed-off-by: anjiahao <[email protected]>

arm64: fix fvp smp faild to boot

reason:
we should give a busy wait addr

This commit fixes the regression from apache#13640

Signed-off-by: hujun5 <[email protected]>

CI: Enable sim-02 build when we create or update a Complex PR

CI Build Job sim-02 was disabled to reduce our usage of GitHub Runners, to comply with ASF Policy: apache#14376 (comment)

However this causes the Scheduled Merge Job to fail, due to reduced CI Checks: https://github.com/NuttX/nuttx/actions/runs/11490041505/job/31980056690#step:7:465

This PR re-enables sim-02 when we create or update a Complex PR.

arch/Kconfig: remove ARCH_MATH_H if LIBCXX

Because some libraries do require a full libm implementation.

Signed-off-by: zhanghongyu <[email protected]>

Documentation: migrate README.txt from boards and fixes for mps boards

migrate some README.txt form boards/ and fixes for mps boards rst

samv7: fix QSPI build

Commit 313d6df caused the following build error:

CC:  fixedmath/lib_b16atan2.c chip/sam_qspi.c: In function 'qspi_memory':
chip/sam_qspi.c:1552:7: warning: implicit declaration of function 'IS_ALIGNED' [-Wimplicit-function-declaration]
 1552 |       IS_ALIGNED((uintptr_t)meminfo->buffer, 4) &&
      |       ^~~~~~~~~~
In file included from chip/sam_qspi.c:41:
chip/sam_qspi.c: In function 'qspi_alloc':
chip/sam_qspi.c:1591:21: warning: implicit declaration of function 'ALIGN_UP' [-Wimplicit-function-declaration]
 1591 |   return kmm_malloc(ALIGN_UP(buflen, 4));

This was caused by missing include of nuttx.h header defining ALIGN_UP
and IS_ALIGNED.

Signed-off-by: Michal Lenc <[email protected]>

mmcsd: SDIO_CAPS_4BIT_ONLY set buswidth MMCSD_SCR_BUSWIDTH_4BIT

uint8_t buswidth:4;              /* Bus widths supported (SD only) */

Signed-off-by: zhangshoukui <[email protected]>

armv8m/clang.cmake: add armv8m clang config

Its makefile is implemented in arch/arm/src/armv8-m/Toolchain.defs as follows:
ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)

  ifeq ($(CONFIG_ARCH_CORTEXM23),y)
    TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
  else ifeq ($(CONFIG_ARCH_CORTEXM33),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM35P),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM55),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM85),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
    endif
  endif

Signed-off-by: wangmingrong1 <[email protected]>

Writing documentation related to SPI slave.

Fix build issues

Fix xtensa build error with choice LIBSUPCXX by default.

Signed-off-by: cuiziwei <[email protected]>

sim/cmake: compatible when nuttx COMPILE_OPTIONS is not set yet

Signed-off-by: buxiasen <[email protected]>

Fix cdcncm printf formatter compiler warning

esp32s3: Increase the init task stask size when using NSH

After recent changes on nuttx-apps (not limited to, but related
to nuttx-apps#2738, for instance), the stack usage for the NSH
task increased, causing stack overflows under specific situations
(when running `ps` command, for instance). This commit increases
the init task stack size to avoid it. Please note that, even before
these changes, the stack usage of the NSH task was around 90% and,
then, increasing the stack size of it was recommended.

kconfig: Add link parameters that can print remaining memory information

LD: nuttx
Memory region         Used Size  Region Size  %age Used
           flash:      284272 B       512 KB     54.22%
           sram1:       13296 B         2 MB      0.63%
           sram2:          0 GB         2 MB      0.00%
CP: nuttx.hex
CP: nuttx.bin

Signed-off-by: wangmingrong1 <[email protected]>

Fixed selection of irq file.

Added flash.ld script to nucleo-h563zi/scripts folder. Changed Make.defs to use it. Minor change to Kconfig regarding flash configurations.

Various changes

Fix include guards.
  • Loading branch information
kywwilson11 authored and stbenn committed Oct 25, 2024
1 parent 974da12 commit 9c599ff
Show file tree
Hide file tree
Showing 237 changed files with 23,796 additions and 1,546 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ jobs:
# If PR was Created or Modified: Exclude some boards
pr=${{github.event.pull_request.number}}
if [[ "$pr" != "" ]]; then
echo "Excluding arm-0[248], arm-1[02-9], risc-v-04..06, sim-02, xtensa-02"
echo "Excluding arm-0[248], arm-1[02-9], risc-v-04..06, sim-03, xtensa-02"
boards=$(
echo '${{ inputs.boards }}' |
jq --compact-output \
'map(
select(
test("arm-0[248]") == false and test("arm-1[02-9]") == false and
test("risc-v-0[4-9]") == false and
test("sim-0[2-9]") == false and
test("sim-0[3-9]") == false and
test("xtensa-0[2-9]") == false
)
)'
Expand Down
42 changes: 42 additions & 0 deletions Documentation/applications/examples/spislv_test/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
``spislv`` SPI slave example
============================

A simple example for the device functioning as an SPI slave.
This example can be used to validate communication with another device
operating as an SPI master. If the spitool is used on the other device,
and the following command is sent:

``spi exch -x 4 deadbeef``

The expected response in device running spislv_test app is:

.. code-block:: bash
Slave: 4 Bytes reads
Value in hex form from /dev/spislv2: de ad be ef
Slave: Writing value back to /dev/spislv2
This test requires the device to be configured in SPI slave mode.(your
specific spi slave hardware settings might require additional settings).

Specific configuration options for this example include:
Configs inside <> are the options that you need to find, It are arch de-
pendent and might be different for your board.

- ``<Enable SPI Peripheral Support>`` – Enables SPI peripheral support
in System Type->Peripheral Support.

- ``<Configure SPI>`` – Configures SPI peripheral in System Type->SPI
configuration. Set here the right pins to be used for SPI communication.

- ``CONFIG_SPI`` – In the SPI driver support, enable SPI Slave support.

- ``CONFIG_SPI_SLAVE`` – Enables SPI Slave support.

- ``SPI_SLAVE_DRIVER`` – Enables SPI Slave character driver.

- ``<Configure SPI>`` – Return to this option and enable SPI Slave mode.



35 changes: 13 additions & 22 deletions Documentation/platforms/arm/mps/boards/mps2-an500/index.rst
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
=================
================
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
===================

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
41 changes: 41 additions & 0 deletions Documentation/platforms/arm/mps/boards/mps2-an512/index.rst
Original file line number Diff line number Diff line change
@@ -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
114 changes: 49 additions & 65 deletions Documentation/platforms/arm/mps/boards/mps3-an547/index.rst
Original file line number Diff line number Diff line change
@@ -1,85 +1,69 @@
=================
================
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

Getting Started
===============

Configuring and Running
-----------------------

### Single Core

1. **Configuring NuttX and Compiling:**

```bash
$ ./tools/configure.sh -l mps3-an547:nsh
$ make
```

2. **Running with QEMU:**

```bash
$ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin
```

3. **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:**

```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
```
Configuring and Running (Single Core)
-------------------------------------

1. Configuring NuttX and Compiling::

./tools/configure.sh -l mps3-an547:nsh
make

2. Running with QEMU::

$ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin

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

4. Pic bootloader boot to ap, and run 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:**

Ensure the following change is applied to `defconfig`:
1. Enable Debug Symbols.
Ensure the following change is applied to ``defconfig``::

```bash
+CONFIG_DEBUG_SYMBOLS=y
```
CONFIG_DEBUG_SYMBOLS=y

2. **Run QEMU:**
2. Run QEMU::

```bash
$ qemu-system-arm -M mps3-an547 -nographic -kernel nuttx.bin -S -s
```
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
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,27 @@ NSH commands::
WRITING:
0000: 1b5b471b5b30304c1b5b4548656c6c6f 204e75747458 .[G.[00L.[EHello NuttX
Test complete
nsh>
nsh>

ws2812
------

This configuration sets up the NuttShell (NSH) interface over USB Serial (refer to the usbserial
configuration for details). It also enables the driver for an addressable LED WS2812 and the SPI1.
The MOSI pin from SPI must be connected to DIN on WS2812 module and the number of LEDs can be
configured using CONFIG_WS2812_LED_COUNT.


======= ====
WS2812 PINS
======= ====
DIN PA7
======= ====

NSH commands::

NuttShell (NSH) NuttX-12.7.0-RC0
nsh> ws2812


47 changes: 47 additions & 0 deletions Documentation/platforms/risc-v/hpm6000/boards/hpm6360evk/index.rst
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions Documentation/platforms/risc-v/hpm6000/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===============
Hpmicro HPM6000
===============

Supported Boards
================

.. toctree::
:glob:
:maxdepth: 1

boards/*/*
Loading

0 comments on commit 9c599ff

Please sign in to comment.