Commit Graph

2782 Commits

Author SHA1 Message Date
Nathan Hartman 03802dad13 NuttX graduated the Incubator; update repository links 2022-11-26 11:58:15 -08:00
SuGliger 83a4b45dd4 boards/esp32-wrover-kit: Fix GPIO conflicts 2022-11-26 11:58:58 +08:00
SuGliger 9cdb865c9c boards/esp32-wrover-kit: Add Lua Interpreter defconfig 2022-11-26 11:58:58 +08:00
zouboan b45f113943 boards/sparc add initial support of s698pm-dkit board 2022-11-25 08:54:28 -03:00
Lee Lup Yuen c2d083e3c1 Update boards/arm64/a64/pinephone/src/pinephone_boardinit.c
Co-authored-by: hartmannathan <59230071+hartmannathan@users.noreply.github.com>
2022-11-25 17:19:48 +08:00
Lee Lup Yuen b31054b1e3 arch/arm64: Add support for PINE64 PinePhone
This PR adds support for PINE64 PinePhone and the Allwinner A64 SoC (based on Arm Cortex-A53).

With this PR, PinePhone boots successfully to nsh (via microSD Card) and runs console apps.

-   `arch/arm64/Kconfig`: Added Allwinner A64 SoC

-   `boards/Kconfig`: Added PINE64 PinePhone

-   `arch/arm64/src/a64/Kconfig`: New Kconfig for Allwinner A64 SoC

-   `boards/arm64/a64/pinephone/Kconfig`: New Kconfig for PINE64 PinePhone

-   `src/a64/a64_boot.c`, `a64_boot.h`: Boot functions for Allwinner A64

-   `src/a64/a64_lowputc.S`: Low-level console output

-   `src/a64/a64_serial.c`, `a64_serial.h`: A64 Serial Driver

-   `src/a64/chip.h`: A64 SoC Definitions

-   `include/a64/chip.h`: A64 Memory Map, Generic Interrupt Controller

-   `include/a64/irq.h`: A64 Interrupts

-   `src/a64/Make.defs`: Source files for A64

-   `configs/nsh/defconfig`: Board Configuration for `pinephone:nsh`

-   `src/pinephone_appinit.c`: Init PinePhone

-   `src/pinephone_boardinit.c`: Init PinePhone

-   `src/pinephone_bringup.c`: Start PinePhone Drivers

-   `src/pinephone.h`: PinePhone Declarations

-   `include/board_memorymap.h`: PinePhone Memory Map

-   `scripts/dramboot.ld`: PinePhone Linker Script

-   `scripts/Make.defs`: Source files for PinePhone

-   `src/Makefile`: PinePhone Makefile

-   `platforms/arm/a64/boards/pinephone/index.rst`: Building and booting NuttX on PinePhone

-   `platforms/arm/a64/index.rst`: Overview of Allwinner A64

-   `introduction/supported_platforms.rst`: Added Allwinner A64

-   `introduction/detailed_support.rst`: Added Allwinner A64
2022-11-25 17:19:48 +08:00
Alan Carvalho de Assis 0e57e69b08 Add libc_stubs functions to get hmac_md5()
Co-author: Gustavo Nihei <gustavo.nihei@espressif.com>
Co-author: Lucas Vaz <lucas.vaz@espressif.com>
2022-11-25 10:26:37 +08:00
chao an 6d8c28a83c boards/citest: disable NET_ARP for usrsocktest
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-24 20:54:18 +08:00
Robert-Ionut Alexa 9c6971279d esp32-sparrow-kit: enable support for MMCSD-SPI
Add the necessary configs to the default nsh config file in order to enable
support for MMCSD-SPI.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08:00
Robert-Ionut Alexa e0374c30e4 esp32-sparrow-kit: add support for the LTR308 light sensor
Add support to esp32-sparrow-kit for the LTR308 sensor. This patch also
enables the sensor in the default nsh config file.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08:00
Robert-Ionut Alexa 3351146c0b boards/xtensa/esp32: add initial commit for the ESP32-SPARROW-KIT
ESP32-SPARROW-KIT is built upon ESP32-WROVER-KIT by adding various
peripherals. This is an initial commits that only backports the code
as it is, without further changes.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08:00
Tiago Medicci Serrano d3ffeb40a7 libc/machine/xtensa: make longjmp safe against context switch
In order to turn longjmp context-switch safe, it's necessary
to disable interrupts before modifying windowbase and windowstart.
Otherwise, after a context switch, windowstart and windowbase
would be different, leading to a wrongly set windowstart bit due to
longjmp writing it based on the windowbase before the context switch.
This corrupts the registers at the next window overflow reaching
that wrongly set bit.

*Background:*
This PR is related to an issue first observed on ESP-IDF
https://github.com/espressif/esp-idf/issues/5229 and it was, then,
checked on NuttX using a test application.

*The test application:*
To check if the problem affects ESP32, ESP32-S2 and ESP32-S3 on
NuttX, it was created an application based on:
https://en.cppreference.com/w/c/program/longjmp

The application creates 16 tasks (`#define NUMBER_OF_TASKS  16`)
that implements the following daemon:

```
static int setjmp_longjmp_daemon(int argc, char *argv[])
{
  for (int i = 0; i < NUMBER_OF_TASKS * 2; i++)
    {
      jmp_buf env;

      volatile int count = 0;
      if (setjmp(env) != UINT16_MAX)
        {
          foo(&env, ++count);
        }
    }

  sem_post(&g_sem);

  return EXIT_SUCCESS;
}
```

The main function also initializes a semaphore to avoid application
exiting before tasks return successfully:

```
  sem_init(&g_sem, 0, -NUMBER_OF_TASKS);
```

Finally, the round-robin interval was lowered to 1ms to raise the
chances of the longjmp being interrupted by a context switch
(`CONFIG_RR_INTERVAL=1).

This setup was able to reproduce the problem prior to this patch
being applied.
2022-11-22 19:34:44 +01:00
zhangyuan21 d8051ba979 nuttx/sched: merge up_block_task and up_unblock_task 2022-11-22 22:59:08 +08:00
Xiang Xiao 39338ce96c boards: Refresh ursock related config
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-22 20:45:26 +09:00
zhangyuan21 a8fa51e6bf arch: rename arch special function name 2022-11-22 16:27:56 +08:00
Xiang Xiao 12b3a1ae56 Fix Error: board/stm32_ssd1289.c:310:12: error: converting the result of '<<' to a boolean always evaluates to true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-22 11:38:41 +08:00
Xiang Xiao 88649d03ba Fix Error: stm32_wm8994.c:198:54: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int')
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-22 11:38:41 +08:00
chao an 624d69ee05 boards: enter/leave critical section should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-22 08:19:24 +09:00
chao an 52235b468b spresense/wifi: icmp/arp message should talk to GS2200M through usrsock
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-22 03:11:26 +08:00
Tiago Medicci Serrano d492a5b092 esp32s2/i2s: implement I2S receiver module
- Add ioctl method to enable allocating the apb buffer.
- Add RX methods to set data width, sample rate, channels and
for receiving data from the I2S peripheral.
- Update the i2schar defconfig to enable the I2S receiver.
- Add nxlooper defconfig to enable testing the RX interface.
- Add specific bindings on ESP32-S2  bringup to enable nxlooper
to work without the need of any specific codec.
2022-11-21 23:46:47 +08:00
chao an 01ec02380d stm32f4discovery/wifi: icmp/arp message should talk to GS2200M through usrsock
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 22:13:52 +08:00
Xiang Xiao 30a01ab551 Fix Error: board/stm32_selectsram.c:163:13: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
FSMC_BTR_ADDHLD(SRAM_ADDRESS_HOLD_TIME) |
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/github/workspace/sources/nuttx/arch/arm/src/chip/hardware/stm32_fsmc.h:164:42: note: expanded from macro 'FSMC_BTR_ADDHLD'
                                         ^
/github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:54: note: expanded from macro 'putreg32'
                                                     ^
Error: board/stm32_selectsram.c:166:13: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
            FSMC_BTR_CLKDIV(SRAM_CLK_DIVISION) |
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/github/workspace/sources/nuttx/arch/arm/src/chip/hardware/stm32_fsmc.h:176:42: note: expanded from macro 'FSMC_BTR_CLKDIV'
                                         ^
/github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:54: note: expanded from macro 'putreg32'
                                                     ^
Error: board/stm32_selectsram.c:167:13: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
            FSMC_BTR_DATLAT(SRAM_DATA_LATENCY) |
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/github/workspace/sources/nuttx/arch/arm/src/chip/hardware/stm32_fsmc.h:180:42: note: expanded from macro 'FSMC_BTR_DATLAT'
                                         ^
/github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:54: note: expanded from macro 'putreg32'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-21 17:39:04 +08:00
Xiang Xiao 81b9df53fc Fix Error: board/dfu_signature.c:53:16: error: unknown attribute 'externally_visible' ignored
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-21 17:39:04 +08:00
Lee Lup Yuen 6aba739f05 arch/arm64: Add support for Generic Interrupt Controller Version 2
Currently NuttX on Arm64 supports Generic Interrupt Controller (GIC) Versions 3 and 4: [`arm64_gicv3.c`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm64/src/common/arm64_gicv3.c), [`arm64_gic.h`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm64/src/common/arm64_gic.h). This PR adds support for GIC Version 2, which is needed by [Pine64 PinePhone](https://lupyuen.github.io/articles/interrupt) based on Allwinner A64 SoC.

This 64-bit implementation of GIC v2 is mostly identical to the existing GIC v2 for 32-bit Armv7-A ([`armv7-a/arm_gicv2.c`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/armv7-a/arm_gicv2.c), [`armv7-a/gic.h`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/armv7-a/gic.h)), with minor modifications to support 64-bit Registers (Interrupt Context).

-   `arch/arm64/Kconfig`: Under "ARM64 Options", we added an integer option `ARM_GIC_VERSION` ("GIC version") that selects the GIC Version. Valid values are 2, 3 and 4, default is 3.

-   `arch/arm64/src/common/arm64_gicv2.c`: Implements 64-bit GIC v2 based on 32-bit [`armv7-a/arm_gicv2.c`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/armv7-a/arm_gicv2.c) and [`armv7-a/gic.h`](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/armv7-a/gic.h), modified to support 64-bit Registers (Interrupt Context).

    Function and Macro Names have not been changed, for easier cross-referencing between the 32-bit and 64-bit implementations of GIC v2.

-   `arch/arm64/src/common/arm64_gicv3.c`: Added Conditional Compilation for GIC v3. This file will not be compiled if `ARM_GIC_VERSION` is 2.

-   `arch/arm64/src/common/arm64_gic.h`: Added the Version Identifier for GIC v2. At startup we read the GIC Version from hardware and verify that it matches `ARM_GIC_VERSION`.

-   `arch/arm64/include/qemu/chip.h`: Added the QEMU Base Addresses for GIC v2.

-   `arch/arm64/src/common/Make.defs`: Added the source file that implements GIC v2.

-   `boards/arm64/qemu/qemu-armv8a/README.txt`: Added the documentation for testing GIC v2 with QEMU.

-   `boards/arm64/qemu/qemu-armv8a/configs/nsh_gicv2/defconfig`: Added the Board Configuration `qemu-armv8a:nsh_gicv2` for testing GIC v2 with QEMU. Identical to `qemu-armv8a:nsh`, except that `ARM_GIC_VERSION` is 2.
2022-11-20 21:44:12 -08:00
Xiang Xiao f2320a4a69 Fix board/stm32_lcd.c:584:14: error: converting the result of '<<' to a boolean; did you mean '(7 << (10)) != 0'?
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
Xiang Xiao ffda739704 Fix error: shifting a negative signed value is undefined
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
Xiang Xiao 908bade7a7 Fix error: converting the result of '<<' to a boolean always evaluates to true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
chao an 422272044b boards/iperf: device name will vary across different NICs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-20 19:44:32 +08:00
Ville Juven d088a48da4 mpfs/knsh: Enable SHM for MPFS kernel mode build 2022-11-18 22:45:26 +08:00
Ville Juven 603992fc5f mpfs/ld-kernel: Increase size of kflash and ksram to 2MB 2022-11-18 22:45:26 +08:00
zhangyuan21 7bf1aed08b lpc31xx/ea3131/pgnsh: enable DEFAULT_SMALL to reducing the code size 2022-11-16 23:33:51 +08:00
zhangyuan21 61535798a0 stm32f103-minimum: enable LTO to reducing the code size 2022-11-16 12:48:31 +08:00
Tiago Medicci Serrano 3b5ab27893 esp32/i2s: implement I2S receiver module
- Add ioctl method to enable allocating the apb buffer.
- Add RX methods to set data width, sample rate, channels and
for receiving data from the I2S peripheral.
- Update the i2schar defconfig to enable the I2S receiver.
- Add nxlooper defconfig to enable testing the RX interface.
- Add specific bindings on ESP32 bringup to enable nxlooper
to work without the need of any specific codec.
2022-11-15 17:01:47 -03:00
Xiang Xiao 67686c231a Call nxmutex_destroy and nxsem_destroy in error patch to avoid the leak
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
anjiahao a4563b8744 Fix the coding style and typo issue
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
anjiahao d07792a343 Initialize global mutext/sem by NXMUTEX_INITIALIZER and SEM_INITIALIZER
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
Alan Carvalho de Assis 990b6f2164 board/stm32f103-minimum: Add ssd1306 example 2022-11-14 00:04:55 +08:00
Alan Carvalho de Assis 8af30db2c5 board/stm32f103-minimum: Enable nsh help and basic commands 2022-11-14 00:04:44 +08:00
Alan Carvalho de Assis 013b15db2d esp32: Add support to LilyGO_TBeam V1.1 LoRa/GPS board 2022-11-13 22:59:50 +08:00
YAMAMOTO Takashi 0f2206e9a8 esp32-devkitc/wamr_wasi_debug: bump WAMR version 2022-11-09 18:20:05 +08:00
Xiang Xiao 352006af6d boards/esp32-lyrat: Remove CONFIG_MM_CIRCBUF=y from audio config
since this config is removed from:
commit a446b5816f
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun Nov 6 00:18:52 2022 +0800

    mm/circbuf: Remove MM_CIRCBUF option from Kconfig

    since the linker can remove the unused object file from the final image

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 18:24:07 -03:00
Xiang Xiao 33dabe3c38 sim: Always enable full UBSan feature to catch more error
since the resource is plenty on simulator

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
Xiang Xiao a446b5816f mm/circbuf: Remove MM_CIRCBUF option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
Lucas Saavedra Vaz bcafc77cf8 boards/esp32-lyrat: Add support for the ES8388 codec 2022-11-08 10:03:18 -03:00
Masayuki Ishikawa 6bd285814d boards: esp32-devkitc: Update elf/defconfig
Summary:
- This commit adds the following configs to elf/defconfig
  +CONFIG_DEBUG_FULLOPT=y
  +CONFIG_DEBUG_SYMBOLS=y
  +CONFIG_STACK_COLORATION=y

Impact:
- None

Testing:
- Tested with esp32-devkitc (QEMU and board)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-08 10:03:00 -03:00
Lucas Saavedra Vaz 22ce6e8a9c boards/xtensa: Added support for the ESP32-S2-Kaluga-1 board 2022-11-07 14:23:09 -03:00
Gustavo Henrique Nihei f0cf1ea69e boards/esp32s3: Improve documentation on the IRAM upper limit definition
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-08 00:49:03 +08:00
Gustavo Henrique Nihei 3cb6d103c5 xtensa/esp32s3: Extend IRAM region according to IDFboot v4.4.2
This change syncs the NuttX application image IRAM upper limit to the
start of the IRAM region used by the IDF 2nd stage bootloader.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-08 00:49:03 +08:00
Masayuki Ishikawa bbe2fd3b80 boards: Fix the CI build errors for telnetd
Summary:
- This commit fixes the CI build errors regressed by
  https://github.com/apache/incubator-nuttx/pull/7351

Impact:
- None

Testing:
- Build only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-07 16:06:00 +01:00
Xiang Xiao 4e43fef5cd boards: Update telnetd related config after apps/nshlib change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 15:24:29 +09:00