Commit Graph

43442 Commits

Author SHA1 Message Date
chao.an
cbd82f1c1b compile/flags: remove redundant -fomit-frame-pointer from board flags
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:31:27 -06:00
chao.an
a42aa8415d compile/flags: add FRAME_POINTER into Toolchain.defs
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:31:27 -06:00
chao.an
8eb999ff03 arch/arm: select ARM_THUMB by default for Cortex-M
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:30:53 -06:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
Alexander Lunev
e68ffb9f99 net/tcp(unbuffered): fixed an issue with unackseq calculation.
Wrong unackseq calculation locked conn->tx_unacked at non-zero values
even if all ACKs were received. Thus unbuffered psock_tcp_send() never completed.
2021-12-27 20:59:48 -06:00
Xiang Xiao
8f72c7626c driver/rwbuffer: Fix the compiler warning
rwbuffer.c: In function 'rwb_initialize':
rwbuffer.c:842:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  842 |           ferr("Write buffer kmm_malloc(%d) failed\n", allocsize);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                                        |
      |                                                        uint32_t {aka long unsigned int}
rwbuffer.c:842:42: note: format string is defined here
  842 |           ferr("Write buffer kmm_malloc(%d) failed\n", allocsize);
      |                                         ~^
      |                                          |
      |                                          int
      |                                         %ld
In file included from rwbuffer.c:36:
rwbuffer.c:846:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  846 |       finfo("Write buffer size: %d bytes\n", allocsize);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                              |
      |                                              uint32_t {aka long unsigned int}
rwbuffer.c:846:34: note: format string is defined here
  846 |       finfo("Write buffer size: %d bytes\n", allocsize);
      |                                 ~^
      |                                  |
      |                                  int
      |                                 %ld

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-27 11:05:47 -06:00
Alexander Lunev
19dc121a4f net/tcp(unbuffered): fixed an issue with tx_unacked overflow that occurred if NET_TCP_WINDOW_SCALE option was enabled.
If the remote TCP receiver advertised TCP window size greater than 64 KB
and TCP ACK packets returned to the NuttX TCP sender with a significant delay,
tx_unacked variable overflowed and further TCP send stalled forever
(until TCP re-connection).
2021-12-27 11:05:01 -06:00
Xiang Xiao
ab0f5f607d Fix ioexpander/gpio_lower_half.c:302:23: warning: too many arguments for format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-27 11:04:11 -06:00
zhuyanlin
c5aca37f8f regulator: fix warning in RPIu32
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 06:56:38 -06:00
Xiang Xiao
540c6f8c39 esp32-devkitc: Change CONFIG_USER_ENTRYPOINT to CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-25 18:05:59 +08:00
Huang Qi
0751bcd4ca arch/sim: Support vncserver as display device
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-24 11:59:43 -06:00
ligd
412d030149 boards: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
ligd
0bb32f27c0 init: use exec_spawn instead of exec
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
ligd
10ccba6671 init: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
Alan C. Assis
36389dab76 Add board support to SHT3X sensor 2021-12-24 08:11:51 -06:00
Alan C. Assis
01e4e249cc Add WiFi/BLE Coexistence support
Co-authored-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Co-authored-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-12-23 20:42:23 -06:00
Eero Nurkkala
509350a614 risc-v/mpfs: update m100pfsevp board info
Update the cache settings for the Aries m100pfsevp board. This
assigns scratchpad ways for this board as well, as seen in the
commit 491ae6c.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-23 06:55:18 -06:00
chao.an
6069433d2d arch/arm/cortex-a/r: dump all registers with alias
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-23 06:54:32 -06:00
Eero Nurkkala
3394dca826 risc-v/opensbi: Make.defs: use a wildcard for file listing
The source directory contents of the OpenSBI directory lib/sbi may be
listed with a one-line wildcard. This makes the Make.defs file look
simpler. The rest of the files need to be picked one at a time.

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-23 02:42:09 -06:00
ligd
e5420c8eee wqueue: fix NO leave_critical_section() when only CONFIG_SCHED_HPWORK
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-23 02:27:34 -06:00
Eero Nurkkala
b128ce334f mpfs: introduce OpenSBI
OpenSBI may be compiled as an external library. OpenSBI commit d249d65
(Dec. 11, 2021) needs to be reverted as it causes memcpy / memcmp to
end up in the wrong section. That issue has yet no known workaround.

OpenSBI may be lauched from the hart0 (e51). It will start the U-Boot
and eventually the Linux kernel on harts 1-4.

OpenSBI, once initialized properly, will trap and handle illegal
instructions (for example, CSR time) and unaligned address accesses
among other things.

Due to size size limitations for the mpfs eNVM area where the NuttX
is located, we actually set up the OpenSBI on its own section which
is in the bottom of the DDR memory. Special care must be taken so that
the kernel doesn't override the OpenSBI. For example, the Linux device
tree may reserve some space from the beginning:

  opensbi_reserved: opensbi@80000000 {
      reg = <0x80000000 0x200000>;
      label = "opensbi-reserved";
  };

The resulting nuttx.bin file is very large, but objcopy is used to
create the final binary images for the regions (eNVM and DDR) using
the nuttx elf file.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-22 20:48:12 -06:00
Eero Nurkkala
491ae6cc53 mpfs: cache: assign ways to L2 zero device
Assign ways to L2 zerodevice. L2 zero device is used for
the scratchpad functionality. The area may be used for the
harts communicating to each other.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-22 20:48:12 -06:00
Diego Herranz
e6bd444fd3 drivers/sensors/isl29023.c: fix compilation error and warnings
- "op_mode" instead of "mode" (compilation error)
- CONFIG_ISL29023_I2C_FREQUENCY instead of CONFIG_LM75_I2C_FREQUENCY
(probably a leftover)
- Fix a couple of format warnings: now using PRIu32
- Also minor comment changes
2021-12-22 20:44:52 -06:00
David Sidrane
74e692b3c1 stm32f7:sdmmc invalidate before DMA to avoid eviction overwrite
For FAT the same buffer is used for read and writes, there
  is a possibility a cache line is dirty. But the fs is
  not dirty and will not write the sector to disk. This can
  be seen  https://github.com/PX4/NuttX/pull/175

  When the system is busy that cache line can be evicted after the
  RX DMA has completed and overwrite the data in memory. The solution
  is to invalidate before the DMA to prevent an evection causing an
  overwite, and after the DMA it to insure coherency.
2021-12-22 20:44:04 -06:00
Alan Rosenthal
5d07dc96a8 Improve Makefile.[unix|win]::context's dependencies
This pull request improves the dependencies for Makefile.unix::context rule.
* `include/math.h`, `include/float.h`, `include/stdarg.h`, `include/setjmp.h` are only added to `context`'s dependency if the Kconfig value is set. This prevents `context` from trying to make `include/math.h` only to find out there's no command to create the file.
* Instead of executing $(CONTEXTDIRS) in a for loop in the `context` rule, $(CONTEXTDIRS) are added as a dependency to `context` and a rule is created to create the targets. Real files are used, to prevent needlessly rebuilding the same `context` over and over and over again.
* Instead of making the directory `staging`, add it as an order-only dependency for `context`. this ensures the directory is only created if it doesn't exist.

Tested by running:
```
(cd tools && ./configure.sh -a ../incubator-nuttx-apps stm32f3discovery:nsh)
make context
```

First time running context:
```
➜  incubator-nuttx git:(improve-make-context) time make context
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/builtin'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/builtin'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Entering directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[3]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics/nxglib'
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/graphics'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx'
Create .version
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/tools'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/tools'
Create version.h
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/include
LN: include/arch/chip to arch/arm/include/stm32
LN: arch/arm/src/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/../common
LN: arch/arm/src/board/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/src
LN: arch/arm/src/chip to arch/arm/src/stm32
LN: /home/user/code/fitbit/incubator-nuttx/drivers/platform to /home/user/code/fitbit/incubator-nuttx/drivers/dummy
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
LN: platform/board to /home/user/code/fitbit/incubator-nuttx-apps/platform/dummy
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make context  0.95s user 0.45s system 109% cpu 1.281 total
```
second time running context:
```
➜  incubator-nuttx git:(improve-make-context) time make context
Create .version
Create version.h
LN: include/arch/board to /home/user/code/fitbit/incubator-nuttx/boards/arm/stm32/stm32f3discovery/include
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Nothing to be done for 'dirlinks'.
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx/boards'
make[1]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps'
make[2]: Entering directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
LN: platform/board to /home/user/code/fitbit/incubator-nuttx-apps/platform/dummy
make[2]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps/platform'
make[1]: Leaving directory '/home/user/code/fitbit/incubator-nuttx-apps'
make context  0.30s user 0.20s system 121% cpu 0.414 total
```
2021-12-22 16:10:13 -03:00
chao.an
fe2830ec94 xtensa: enhance the task dump
add irq stack information
add cpu loading

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-22 11:46:02 -03:00
chao.an
362fe2c6f8 arch/risc-v: enhance the task dump
add irq stack information
add cpu loading

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-22 11:46:02 -03:00
chao.an
a0b61bbf6f arm/cortex-a/r: enhance the task dump
add irq stack information
add cpu loading

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-22 11:46:02 -03:00
Abdelatif Guettouche
4f0dd95fe1 arch/Kconfig: Add HAVE_SYSCALL_HOOKS configs to Xtensa arch.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-12-22 06:26:36 -06:00
Xiang Xiao
348b9b0d35 net/slip: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-22 07:15:00 -03:00
Xiang Xiao
e63e083a2f net/tun: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-22 07:15:00 -03:00
Xiang Xiao
500d8541fa net/loopback: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-22 07:15:00 -03:00
Xiang Xiao
b03886415f sim/netdev: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-22 07:15:00 -03:00
Huang Qi
19e748f278 graphics/vncserver: Fix buffer overflow
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-22 16:13:35 +08:00
chao.an
e0f7bab13c libc/symtab: optimize the find speed by bisection
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-21 20:40:12 -06:00
Gustavo Henrique Nihei
1d26d75e66 ci: Bump github/super-linter version to V4
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 11:56:45 -06:00
Nathan Hartman
878c347bb6 sched: Fix typos in comments
sched/pthread/pthread_mutextimedlock.c:
sched/pthread/pthread_mutextrylock.c:

    * Fix typos in comments. No functional change.
2021-12-21 11:07:23 -06:00
songnannan
0a62701c1a fix: regulator: set ioexpander direction in regulator gpio init.
Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-12-21 08:47:17 -06:00
Alan C. Assis
aa41b9732a boards/esp32: Enable canaries stack protection to ESP32 chips 2021-12-21 08:46:46 -06:00
Xiang Xiao
dfcb3cea59 Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-21 11:02:33 -03:00
Xiang Xiao
cc1a1b5781 net: Implement getifaddrs and freeifaddrs
specify here:
https://man7.org/linux/man-pages/man3/getifaddrs.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-21 11:01:33 -03:00
Xiang Xiao
1cd935fece net: Add lifr_ifindex field to struct lifreq
to ensure union lifr_ifru start at the same offset of union ifr_ifru

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-21 11:01:33 -03:00
chao.an
2737701996 cortex-m/hardfault: add secure-fault handler
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-21 07:08:13 -06:00
ChenWen
6d165506d5 risc-v/esp32c3: Initialize rtc and peripheral parameters by default when chip starts 2021-12-21 10:03:58 -03:00
Gustavo Henrique Nihei
c471f0fe96 risc-v/esp32c3: Remove deprecated note about Flash Detect feature
Flash Detect option is already available on esptool.py installed via pip

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
1c8e84b341 risc-v/esp32c3: Add Secure Boot support on top of MCUboot
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
f542ab4564 xtensa/esp32s2: Add Secure Boot support on top of MCUboot
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
d22a2aa7a0 xtensa/esp32: Refactor makefiles for compliance to Function Call Syntax
According to Make documentation:
- "Commas and unmatched parentheses or braces cannot appear in the text
  of an argument as written";
- "Leading spaces cannot appear in the text of the first argument as
  written".

Although in the current state it was not resulting in parsing issues, it
is better to fix it.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Gustavo Henrique Nihei
6c3223289f xtensa/esp32: Add Secure Boot support on top of MCUboot
This adds the capabitlity of building signed images on NuttX.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-21 07:02:40 -06:00
Juha Niskanen
54b652235c Update arch/Kconfig
Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-12-21 03:26:16 -06:00