Commit Graph

45682 Commits

Author SHA1 Message Date
raiden00pl
b3e11b605a boards: add initial support for stm32l0538-disco 2022-07-09 23:37:33 +08:00
raiden00pl
b179c46178 arch/stm32f0l0g0: add support for stm32l053 2022-07-09 23:37:33 +08:00
chao.an
8ae8c10954 net/poll: fix race condition if connect free before poll teardown
Net poll teardown is not protected by net lock, if the conn is released
before teardown, the assertion failure will be triggered during free dev
callback, this patch will add the net lock around net poll teardown to
fix race condition

nuttx/libs/libc/assert/lib_assert.c:36
nuttx/net/devif/devif_callback.c:85
nuttx/net/tcp/tcp_netpoll.c:405
nuttx/fs/vfs/fs_poll.c:244
nuttx/fs/vfs/fs_poll.c:500

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-09 19:11:42 +08:00
Adam Kaliszan
da69b013bc SSD1680 Landscape mode bugfix
Displays with resolution that is not multiplication of 8 had some issues in landscape mode (columns ware shifted).
Fixed function for copying bits.
Optimized memory reload for landscape mode.
2022-07-09 16:13:22 +08:00
chao.an
9bdeed73e2 net/tcp: fix assertion of fallback connection alloc
When the free connection list is unenough to alloc a new instance,
the TCP stack will reuse the currently closed connection, but if
the handle is not released by the user via close(2), the reference
count of the connection remains in a non-zero value, it will cause
the assertion to fail, so when the handle is not released we should
not use such a conn instance when being actively closed, and ensure
that the reference count is assigned within the net lock protection

|(gdb) bt
|#0  up_assert (filename=0x565c78f7 "tcp/tcp_conn.c", lineno=771) at sim/up_assert.c:75
|#1  0x56566177 in _assert (filename=0x565c78f7 "tcp/tcp_conn.c", linenum=771) at assert/lib_assert.c:36
|#2  0x5657d620 in tcp_free (conn=0x565fb3e0 <g_tcp_connections>) at tcp/tcp_conn.c:771
|#3  0x5657d5a1 in tcp_alloc (domain=2 '\002') at tcp/tcp_conn.c:700
|#4  0x565b1f50 in inet_tcp_alloc (psock=0xf3dea150) at inet/inet_sockif.c:144
|#5  0x565b2082 in inet_setup (psock=0xf3dea150, protocol=0) at inet/inet_sockif.c:253
|#6  0x565b1bf0 in psock_socket (domain=2, type=1, protocol=0, psock=0xf3dea150) at socket/socket.c:121
|#7  0x56588f5f in socket (domain=2, type=1, protocol=0) at socket/socket.c:278
|#8  0x565b11c0 in hello_main (argc=1, argv=0xf3dfab10) at hello_main.c:35
|#9  0x56566631 in nxtask_startup (entrypt=0x565b10ef <hello_main>, argc=1, argv=0xf3dfab10) at sched/task_startup.c:70
|#10 0x565597fa in nxtask_start () at task/task_start.c:134

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-09 09:37:49 +09:00
Alan Carvalho de Assis
cd3e93ef17 esp32s3-devkit: Add support to ST7735 SPI LCD 2022-07-09 01:36:41 +08:00
YAMAMOTO Takashi
19eb4d7d77 Revert "net/tcp: discard connect reference before free"
This reverts commit b88a1fd7fd. [1]

Because:

* It casues assertion failures like [2].

* I don't understand what it attempted to fix.

[1]
```
commit b88a1fd7fd
Author: chao.an <anchao@xiaomi.com>
Date:   Sat Jul 2 13:17:41 2022 +0800

    net/tcp: discard connect reference before free

    connect reference should be set to 0 before free

    Signed-off-by: chao.an <anchao@xiaomi.com>
```

[2]
```
    #0  up_assert (filename=0x5516d0 "tcp/tcp_conn.c", lineno=771) at sim/up_assert.c:75
    #1  0x000000000040a4bb in _assert (filename=0x5516d0 "tcp/tcp_conn.c", linenum=771) at assert/lib_assert.c:36
    #2  0x000000000042a2ad in tcp_free (conn=0x597fe0 <g_tcp_connections+384>) at tcp/tcp_conn.c:771
    #3  0x000000000053bdc2 in tcp_close_disconnect (psock=0x7f58d1abbd80) at tcp/tcp_close.c:331
    #4  0x000000000053bc69 in tcp_close (psock=0x7f58d1abbd80) at tcp/tcp_close.c:366
    #5  0x000000000052eefe in inet_close (psock=0x7f58d1abbd80) at inet/inet_sockif.c:1689
    #6  0x000000000052eb9b in psock_close (psock=0x7f58d1abbd80) at socket/net_close.c:102
    #7  0x0000000000440495 in sock_file_close (filep=0x7f58d1b35f40) at socket/socket.c:115
    #8  0x000000000043b8b6 in file_close (filep=0x7f58d1b35f40) at vfs/fs_close.c:74
    #9  0x000000000043ab22 in nx_close (fd=9) at inode/fs_files.c:544
    #10 0x000000000043ab7f in close (fd=9) at inode/fs_files.c:578
```
2022-07-08 16:11:24 +08:00
Huang Qi
4945c49c61 vncserver: Support pointer driver
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-07-08 13:28:34 +08:00
Huang Qi
2e9fa4586b boards/sim/vncserver: Enable LPWORK to fix warning
Fix:
```
warning: (NET_TCP_NO_STACK && NET_USRSOCK_TCP) selects NET_TCP which has unmet direct dependencies (NET && SCHED_WORKQUEUE)
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-07-08 13:28:34 +08:00
Nathan Hartman
849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Abdelatif Guettouche
0bdf713df0 risc-v/esp32c3: Add the rest of the reset causes.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-07-08 01:06:35 +08:00
Xiang Xiao
3daa18b661 arch: Remove the unnecessary #if/#endif in assert
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-07 19:25:47 +03:00
Xiang Xiao
9ff0971d3f arch: Correct the order of stack related information in assert
forget to update in this patch:
commit b02db04e00
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun Jun 5 17:10:19 2022 +0800

    arch/assert: Keep the thread dump column order same as ps

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

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-07 19:25:47 +03:00
curuvar
aa6ec6518c Added ADC to RP2040 2022-07-07 12:45:28 -03:00
Masayuki Ishikawa
7307b8b6d5 boards: stm32f4discovery: Add iperf to rndis/defconfig
- NOTE: This commit also removes CONFIG_HOST_WINDOWS=y

nsh> iperf -c 10.0.2.15
       IP: 10.0.2.20

 mode=tcp-client sip=10.0.2.20:5001,dip=10.0.2.15:5001, interval=3, time=30

           Interval         Transfer         Bandwidth

   0.00-   3.01 sec    2211840 Bytes    5.88 Mbits/sec
   3.01-   6.02 sec    4423680 Bytes    5.88 Mbits/sec
   6.02-   9.03 sec    6651904 Bytes    5.92 Mbits/sec
   9.03-  12.04 sec    8863744 Bytes    5.88 Mbits/sec
  12.04-  15.05 sec   11091968 Bytes    5.92 Mbits/sec
  15.05-  18.06 sec   13303808 Bytes    5.88 Mbits/sec
  18.06-  21.07 sec   15532032 Bytes    5.92 Mbits/sec
  21.07-  24.08 sec   17743872 Bytes    5.88 Mbits/sec
  24.08-  27.09 sec   19972096 Bytes    5.92 Mbits/sec
  27.09-  30.10 sec   22183936 Bytes    5.88 Mbits/sec
   0.00-  30.10 sec   22183936 Bytes    5.90 Mbits/sec

nsh> iperf -s
       IP: 10.0.2.20

 mode=tcp-server sip=10.0.2.20:5001,dip=0.0.0.0:5001, interval=3, time=0
accept: 10.0.2.15,59072

           Interval         Transfer         Bandwidth

   0.00-   3.01 sec    1780056 Bytes    4.73 Mbits/sec
   3.01-   6.02 sec    3566544 Bytes    4.75 Mbits/sec
   6.02-   9.03 sec    5350888 Bytes    4.74 Mbits/sec

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-07 11:40:33 +03:00
curuvar
178ba6fbb4 Add ws2812 bringup logic to all RP2040 boards. 2022-07-07 12:33:25 +08:00
Xiang Xiao
3308f77e7c drivers/segger: Support the customize SEGGER_RTT_[BUFFER_]SECTION
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-06 12:55:16 -03:00
Gustavo Henrique Nihei
f3e8decad2 xtensa: Build sources required for supporting CONFIG_BUILD_PROTECTED
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-05 23:07:00 +08:00
Gustavo Henrique Nihei
cd1ed92844 xtensa: Build sources for supporting CONFIG_SCHED_BACKTRACE
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-05 23:07:00 +08:00
Gustavo Henrique Nihei
b9703619b5 xtensa: Unify common options within a single Make.defs
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-05 23:07:00 +08:00
Adam Kaliszan
664d45dcba New rules of triggering redrawing display.
New callback redraw in lcd_framebuffer.c
SSD1680 driver (e-ink display) changes.
2022-07-05 23:05:32 +08:00
Huang Qi
a4e867b8d4 arch/arm/Kconfig: Add description for ARM_THUMB to make it configurable
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-07-05 19:34:18 +08:00
licheng
ee0dc87059 fix sd can't usage when mult-block receive errro 2022-07-04 20:43:50 +03:00
Xiang Xiao
fcc48c2254 arch/arm: Don't include arch/arch.h in include/irq.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-04 13:25:56 +03:00
Xiang Xiao
9ab3417882 arch/risc-v: Move __XSTR, FLOAD/FSTORE and REGLOAD/REGSTORE to the right place
1.Move __XSTR from include/arch.h to include/irq.h
2.Move  FLOAD/FSTORE and REGLOAD/REGSTORE from include/arch.h to src/common/riscv_internal.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-04 13:25:56 +03:00
Xiang Xiao
c20ed58879 arch: Remove the inclusion of arch/irq.h from chip/irq.h
since arch/irq.h will include chip/irq.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-04 13:03:47 +03:00
zhanghongyu
c7c5c75451 net_if: add IFF_LOOPBACK/POINTOPOINT/MULTICAST/BROADCAST
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-07-03 09:57:10 -04:00
chao.an
58dcee641e net/netdev: move netdev_ifup/down to public header
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-03 02:28:50 +08:00
chao.an
5048be1bfe wireless/bcm43xxx: set listen interval on lowpower
set listen interval dtim(Delivery Traffic Indication Message) on lowpower mode

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-03 02:28:50 +08:00
Xiang Xiao
881902d2cd drivers/lcd_framebuffer: Optimize updateearea for the full screan case
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-02 18:37:42 +03:00
chao.an
9a4f494da2 wireless/bcm43xxx: fix memory leak if tx fail
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 21:33:16 +08:00
chao.an
f424bb32aa wireless/bcm43xxx: only break out the send loop if no data
only break out the continuous send if IP stack has no data to send to avoid
tx being constantly interrupted by RX

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 19:39:49 +08:00
chao.an
96192eac55 wireless/bcm43xxx: filter out the bssi with same ssid name
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 19:39:23 +08:00
chao.an
ba3e859aa5 wireless/bcm43xxx: allocate tx frame with nonblock mode
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 19:24:34 +08:00
chao.an
5ce7b35020 wireless/bcm43xxx: replace private queue implement to list_node
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 19:24:34 +08:00
chao.an
14f1519d1e wireless/bcm43xxx: discard auth event if netdev down
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 17:39:52 +08:00
chao.an
752e48eb34 wireless/bcm43xxx: remove flowctrl check
remove flowctrl check since credit is enough to check flow control status

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 17:34:56 +08:00
chao.an
fe2231989b wireless/bcm43xxx: mac address does not need to be updated in ifup
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 16:14:54 +08:00
chao.an
b88a1fd7fd net/tcp: discard connect reference before free
connect reference should be set to 0 before free

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 16:07:34 +08:00
chao.an
bd713d6431 wireless/bcm43xxx: country code should terminating with null
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-07-02 14:13:21 +08:00
curuvar
b70fc57849 RP2040 Board Documentation 2022-07-02 11:22:52 +08:00
Alan Carvalho de Assis
922ebe5b96 Fix IOMUX function number 2022-07-01 23:34:21 +08:00
Xiang Xiao
3d1ce144df arch: Move up_getsp from arch.h to irq.h
since all other special register operation in irq.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-01 10:44:55 -03:00
Adam Kaliszan
caf92cdadf Esp32 lilygo tty t5v2 bugfix
E-ink initialization failed because small bug in the code (just 5 missing chars
2022-07-01 20:02:56 +08:00
curuvar
feb5c5307a fixed up defconfig files. 2022-06-30 22:13:49 -07:00
curuvar
0c3db448bb Added Adafruit Feather RP2040, Adafruit KB2040 and Added neopixel driver to support RP2040 2022-06-30 22:13:49 -07:00
Sergey Nikitenko
4285274c31 New stm32wb chip family 2022-07-01 12:13:58 +08:00
Nathan Hartman
a3688b0c3b tiva: Add UART CTS/RTS support
* arch/arm/src/tiva/common/tiva_lowputc.c
  (tiva_lowsetup):
    For each UART, if Kconfig enables RTS/CTS (e.g.,
    CONFIG_UART0_IFLOWCONTROL and/or CONFIG_UART0_OFLOWCONTROL),
    configure the corresponding GPIO(s).

* arch/arm/src/tiva/common/tiva_serial.c:
  (struct up_dev_s):
    If CONFIG_SERIAL_IFLOWCONTROL, add a bool field 'iflow'. If
    CONFIG_SERIAL_OFLOWCONTROL, add a bool field 'oflow'. This is
    inspired by the implementation for kinetis.
  (g_uart0priv, g_uart1priv, g_uart2priv, g_uart3priv, g_uart4priv,
   g_uart5priv, g_uart6priv, g_uart7priv):
    If Kconfig enables RTS/CTS for a UART (e.g.,
    CONFIG_UART0_IFLOWCONTROL thru CONFIG_UART7_OFLOWCONTROL), set
    the corresponding iflow and/or oflow flag(s).
  (up_setup):
    Check the above-mentioned iflow and oflow flags and set or unset
    the RTSEN and/or CTSEN bits in the UART's CTL register to enable
    the feature.
2022-07-01 11:52:02 +08:00
Nathan Hartman
bf91047f33 libc: Fix getrandom() bug: Didn't propagate read error
* libs/libc/misc/lib_getrandom.c, in function getrandom():
  We were assigning the return value of _NX_READ() to nbytes, a
  variable of the unsigned type size_t. Note that _NX_READ() resolves
  to either read() or nx_read(), both of which return the signed type
  ssize_t to indicate either the number of bytes read successfully
  (>= 0) or an error (< 0). Then we were testing for a negative
  size_t value, a condition that can never occur. The end result is
  that if an error occured in _NX_READ(), it would never be detected
  and getrandom() would return some large positive value. This bug is
  corrected by assigning the return value of _NX_READ() to a new local
  variable, ret, of size ssize_t.
2022-07-01 11:51:53 +08:00
Gustavo Henrique Nihei
1416afc6b6 sched: Remove "0x" prefix preceding "%p" specifier on format string
The "p" format specifier already prepends the pointer address with
"0x" when printing.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-06-30 22:08:58 +03:00