Commit Graph

48392 Commits

Author SHA1 Message Date
Jackson R 62c15c03d3 STM32 Nucleo: warning: #warning "Default Flash Configuration Used"
https://cwiki.apache.org/confluence/display/NUTTX/Configuration+Variables
Fixed the Warning F412ZG has 1028 KB Flash.
2023-02-17 23:22:32 +08:00
Ville Juven e9ef70e24b sched/assert: Call abort() instead of exit() in assert
POSIX dictates that assert() terminates via abort(), even though in NuttX
abort() just calls exit(EXIT_FAILURE) it is better to use the correct
API here, if at some point a proper implementation for abort() is made.

Also, as the kernel must not use abort() which is a userspace API, direct
the exit to PANIC() if for some reason _assert() returns (it should not
but trap it here just in case).
2023-02-17 23:07:17 +08:00
Ville Juven df1d7dd480 libc/exit: Purge calls to userspace API exit() from kernel
Remove calls to the userspace API exit() from the kernel. The problem
with doing such calls is that the exit functions are called with kernel
mode privileges which is a big security no-no.
2023-02-17 23:07:17 +08:00
wangbowen6 0f5b66c335 nxstyle: add "CMUnitTest" to nxstyle white list
https://github.com/apache/nuttx-apps/pull/1575 need this

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-17 22:57:58 +08:00
Ville Juven 2cdba4a0a2 task/task_cancelpt: Kill the child if it is not in a cancel point
Do not allow a deferred cancellation if the group is exiting, it is too
dangerous to allow the threads to execute any user space code after the
exit has started.

If the cancelled thread is not inside a cancellation point, just kill it
immediately via asynchronous cancellation. This will create far less
problems than allowing it to continue running user code.
2023-02-17 22:57:36 +08:00
Ville Juven 0e44666828 signal/sig_dispatch: Signal action was not performed if TCB_FLAG_SYSCALL is set
For some reason the signal action was never performed if the receiveing
task was within a system call, the pending queue inser was simply missing.

This fixes the issue.
2023-02-17 22:54:55 +08:00
Igor Mišić 8e4d461d61 drivers/mtd/ramtron: change nsectors size to uint32 2023-02-17 11:19:46 -03:00
Fotis Panagiotopoulos 85ceb7920e Typo fixes. 2023-02-17 11:17:11 -03:00
Takeyoshi Kikuchi 70ce4b4fc1 libc: unistd: lib_getrlimit: set cur/max value for RLIMIT_NOFILE to "OPEN_MAX".
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
Takeyoshi Kikuchi c4fc414b09 libc: unistd: lib_getrlimit: use INT_MAX as dummy rlim_max value.
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
Takeyoshi Kikuchi 2e5a20612c libc: unistd: lib_getrlimit: return a value for RLIMIT_NOFILE request.
In the Nim language "selectors"(I/O multiplexing) module, the maximum
number of file descriptors is obtained with getrlimit() as follows.

        var fdLim: RLimit
        var res = int(getrlimit(RLIMIT_NOFILE, fdLim))
        if res >= 0:
          res = int(fdLim.rlim_cur) - 1

To be able to use the same implementation as other POSIX-based OS,
getrlimit() should return a value.
(For now, let it return 128.)

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-17 18:07:30 +08:00
chao an fff0e58860 tools/kconfiglib: purge warning print of kconfiglib
Purge warning:
Kconfig:249: warning: the 'modules' option is not supported.
Let me know if this is a problem for you, as it wouldn't be that
hard to implement. Note that modules are supported -- Kconfiglib
just assumes the symbol name MODULES, like older versions of the
C implementation did when 'option modules' wasn't used.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-17 16:01:52 +08:00
Xiang Xiao e334786f81 tools/Unix.mk: Make sed compatible with macOS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Co-authored-by: chao an <anchao@xiaomi.com>
2023-02-17 16:01:52 +08:00
Xiang Xiao 6b61b5ed15 Fix warning: warning: ESP32C6_DEVKIT_RUN_IRAM has 'help' but empty help text
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-17 16:01:52 +08:00
Xiang Xiao d5b510e023 tools/ci: Install genromfs instead building it from source code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-17 16:01:52 +08:00
Xiang Xiao 0582930e4b tools/ci: Install python kconfiglib
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-17 16:01:52 +08:00
David Sidrane 9d0e712347 mmcsd_sdio:Release CPU during wait for Write Completion 2023-02-17 15:26:19 +08:00
David Sidrane d570a93945 mmcsd_sdio:Insure a error exiting via mmcsd_removed will not Hang system.
mmcsd_removed will be called if the card is in invalid state.
   This can happen if the card is bad, or vibrations causes a power
   loss.

   mmcsd_removed resets:
     priv->capacity     = 0; /* Capacity=0 sometimes means no media */
     priv->blocksize    = 0;
     priv->probed       = false;
     priv->mediachanged = false;
     priv->wrbusy       = false;
     priv->type         = MMCSD_CARDTYPE_UNKNOWN;
     priv->rca          = 0;
     priv->selblocklen  = 0;
     priv->widebus      = false;

  If blocksize is set to 0 will cause the log2 to result
  in an infinate loop in some drivers.

  IS_EMPTY will check for priv->type = MMCSD_CARDTYPE_UNKNOWN
  and return ENODEV.
2023-02-17 15:26:19 +08:00
crafcat7 33b22f51da libc/lib_memcpy.c: Add mempcpy method.
Signed-off-by: crafcat7 <chenrun1@xiaomi.com>
2023-02-17 15:15:19 +08:00
David Sidrane c6d3e7e087 stm32:dma v2 Remove CPU lock on HW fail 2023-02-17 14:23:27 +08:00
David Sidrane d2ea49109a stm32h7:dma Remove CPU lock on HW fail 2023-02-17 14:23:27 +08:00
David Sidrane 8064f60a9e stm32f7:dma Remove CPU lock on HW fail 2023-02-17 14:23:27 +08:00
Alan Carvalho de Assis fd9f2b8a03 boards/esp32: Fix WiFi default Algorithm 2023-02-17 12:10:13 +08:00
Nathan Hartman b881948b27 arch/pic32mz: Fix compiler warnings in pic32mz_ethernet.c
* arch/mips/src/pic32mz/pic32mz_ethernet.c
  (): Fix warnings related to printf-style format specifiers.
2023-02-17 09:58:02 +08:00
Fotis Panagiotopoulos f78bdd3978 stm32_eth: Busy bit is cleared before accessing the MACMIIAR register. 2023-02-17 09:56:35 +08:00
Nathan Hartman de01550e7e Fix typo: s/then/them/ 2023-02-17 09:55:55 +08:00
Nathan Hartman 1d5c8380b1 arch/pic32mz: Serial TIOCxBRK BSD-compatible BREAK support
In the lower half UART driver for PIC32MZ architecture, adding the
TIOCxBRK ioctl calls, which allow an application to transmit a UART
line BREAK signal.

This architecture does not support BSD-style BREAK in hardware so our
implementation follows the precedent set in STM32, GD32, and Kinetis
architectures: By default, if only PIC32MZ_UART_BREAKS is configured,
we produce the hardware-native BREAK, which lasts for 12 bit lengths;
if, in addition, PIC32MZ_SERIALBRK_BSDCOMPAT is configured, we
generate a BSD-style BREAK by putting the TX pin in GPIO mode and
driving it low "manually" until told to stop.

* arch/mips/src/pic32mz/Kconfig
  (config PIC32MZ_UART_BREAKS): New. Appears as
   CONFIG_PIC32MZ_UART_BREAKS in code.
  (config PIC32MZ_SERIALBRK_BSDCOMPAT): New. Appears as
   CONFIG_PIC32MZ_SERIALBRK_BSDCOMPAT in code.

* arch/mips/src/pic32mz/hardware/pic32mz_pps.h
  (__PPS_OUTPUT_REGADDR_TO_GPIO, PPS_OUTPUT_REGADDR_TO_GPIO): New
   macros to automatically determine the GPIO port and pin from the
   corresponding PPS (Peripheral Pin Select) define. Since there is a
   one-to-one correspondence between PPS output mappings and a single
   port and pin, these macros avoid writing redundant pin mappings. We
   use this when switching the TX pin from UART to GPIO to generate
   the BREAK and we could use it in other peripheral drivers in the
   future to override hardware behavior.

* arch/mips/src/pic32mz/pic32mz_serial.c
  (struct up_dev_s): Add new field 'brk' to indicate line break in
   progress when built with PIC32MZ_UART_BREAKS. If generating BSD-
   compatible BREAKs, also add tx_gpio, tx_pps_reg, and tx_pps_val, to
   let us toggle the pin between UART and GPIO modes.
  (up_ioctl): Add cases for TIOCSBRK and TIOCCBRK to turn BREAK on and
   off, with both hardware-native and BSD-compatible implementations.
   This is similar to the STM32F7 implementation.
  (up_txint): Block enabling TX interrupt if line break in progress.
   This is similar to the STM32F7 implementation.
2023-02-17 09:55:29 +08:00
Nathan Hartman 461cd4c4c5 boards/chipkit-wifire: Avoid sudo for flash programming 2023-02-17 09:54:16 +08:00
yinshengkai abdb16aea2 tools: add trace parse script
Extract a valid trace line and resolve the address to a function name

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-17 02:06:38 +08:00
Ville Juven 905cba3ee3 group/tg_info/argv: Make utility function to read argv as string
This creates a generic and safe way to read a process argument vector
as string from any context.
2023-02-17 01:27:16 +08:00
SPRESENSE a8e5dcbfa9 boards/spresense: Enable broadcast flag in DHCP process
In spresense:wifi, renew command will be failed with disabling
broadcast flag.
For spresense defconfig, enabling it.
2023-02-16 20:11:35 +09:00
Jackson R 491c3b564f Repeated Command "sudo port install"
The merged code had Repeated Command.
2023-02-16 14:09:50 +08:00
SPRESENSE 277e0b941a include/sys/socket.h: Add SOCK_CTRL to socket type
SOCK_CTRL is added to provide special control over network drivers
and daemons. Currently, SOCK_DGRAM and SOCK_STREAM perform this control,
but these use socket resources. In the case of usersocket in particular,
this is a waste of the device's limited socket resources.
2023-02-16 12:13:01 +09:00
Jackson R 37db965cff This simulator was tested on ARM MacBook.
Updating Simulator for macOS

macOS requires genromfs and X11 Libraries to run Simulators.
* Added instructions to install genromfs
* Added instructions to install X11
Adding Xorg Server

The linker was unable to identify the location of X11 libraries.

removed -L/opt/X11/lib from ln 145

Updating Changes to streamline with other Hosts
2023-02-16 09:27:54 +08:00
Nathan Hartman 212ef18803 arch/pic32mz: Fix typos in PPS register mapping defines
The PIC32MZ architecture provides a Peripheral Pin Select (PPS) which
allows mapping peripherals to different GPIO pins. To map a peripheral
output, a value is programmed to a register called RPnxR, where n is
the GPIO port (A thru K) and x is the GPIO pin (0 thru 15). The names
of these registers in code are PIC32MZ_RPnxR. However, in various
definitions, these were mistakenly written as PI32MZ_RPnxR (missing C
in PIC32). This prevents using any of the affected mappings. This
issue is fixed by repairing the define names.

* arch/mips/src/pic32mz/hardware/pic32mzec_pps.h,
  arch/mips/src/pic32mz/hardware/pic32mzef_pps.h:
  (): s/PI32MZ/PIC32MZ/g
2023-02-16 09:27:33 +08:00
Nathan Hartman 7c90fbd7c2 arch/pic32mz: Fix PPS mappings for RPE5R register
The defines for Peripheral Pin Select (PPS) register RPE5R were called
RPE4R inadvertently; however, mappings elsewhere in the file used the
correct name of RPE5R, so the build would break if anyone attempted to
map those peripherals to GPIO pin E5. This issue is now fixed.

* arch/mips/src/pic32mz/hardware/pic32mzec_pps.h,
  arch/mips/src/pic32mz/hardware/pic32mzef_pps.h:
  (PIC32MZ_RPE4R_OFFSET): Rename to PIC32MZ_RPE5R_OFFSET.
  (PIC32MZ_RPE4R): Rename to PIC32MZ_RPE5R.
2023-02-16 09:26:30 +08:00
Nathan Hartman 6fb08b8b03 Fix typos: s/UARt/UART/ 2023-02-16 09:25:35 +08:00
Xiang Xiao 6920fffb00 limits.h: Map _POSIX_[S]SIZE_M[AX|IN] to [U]LONG_M[AX|IN]
correct SIZE_MAX and SSIZE_MAX/SSIZE_MIN definition

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-15 17:47:51 +01:00
Julian Oes 4f30c298bf stm32h7: reduce the extended filter size to 64
When I checked how this register was set I discovered that 128 was not
accepted by the H7 but 64 was ok. Looking at the STM32Cube's HAL it
seems to be only 64 words long, however, the reference manual claims
otherwise.

I have opened a discussion on the ST community forum
https://community.st.com/s/question/0D73W000001nzqFSAQ
but unfortunately not received an answer yet.

In the meantime, I think, we should update this to what I found to be
working though.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-02-15 19:06:54 +08:00
Julian Oes a59e65db3f stm32h7: fix comment
This was likely just a copy-paste error.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-02-15 19:06:54 +08:00
Nathan Hartman 2092e9a9ca Adding myself to AUTHORS 2023-02-15 08:59:47 +01:00
Nathan Hartman 409e2f3701 drivers/serial, libc/termios: Implement tcsendbreak
The TERMIOS(3) function tcsendbreak() and the IOCTLs TCSBRK and TCSBRKP
transmit a serial line Break.

Previously NuttX included an extern declaration for tcsendbreak() and
defines for TCSBRK and TCSBRKP but none of these were implemented.
Attempting to build programs that called tcsendbreak() would fail with
a linker error; attempting to use TCSBRK and TCSBRKP would result in an
error at runtime.

This changeset adds the tcsendbreak() function and handling for TCSBRK
and TCSBRKP; tcsendbreak() is implemented in terms of TCSBRK. Both
TCSBRK and TCSBRKP are implemented in terms of the BSD-compatible Break
IOCTLs TIOCSBRK and TIOCCBRK, which must be provided by the lower half
serial driver. Currently, not all lower half serial drivers in NuttX
support these IOCTLs. Those that do implement them may need one or more
Kconfig options to be set, such as `CONFIG_*_U[S]ART_BREAKS` and, on
some architectures, a separate `CONFIG_*_SERIALBRK_BSDCOMPAT`.

* drivers/serial/serial.c
  (uart_tcsendbreak): New function.
  (uart_ioctl): Implement TCSBRK and TCSBRKP.

* libs/libc/termios/lib_tcsendbreak.c
  (): New file.

* libs/libc/termios/Make.defs
  (CSRCS): Add lib_tcsendbreak.c to the build.

Thanks to Xiang Xiao for PR feedback.

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-02-15 07:50:02 +08:00
Eero Nurkkala b9ba262fb7 risc-v/mpfs: add athena irq defines
Add the Athena cryptographic microprocessor irq defines.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-02-15 00:21:03 +08:00
SPRESENSE a9fb20039e utsname: Expand the buffer for version information slightly
The version information basically uses 20 characters for date and time,
which is small enough to specify an arbitrary version string. Therefore,
increase the buffer a little.
2023-02-14 22:35:43 +08:00
zhangyuan21 32513cedf0 usbdev/adb: add adb usbclass_unbind function
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-14 22:20:12 +08:00
Fotis Panagiotopoulos 4d341ed152 Added myself in AUTHORS file. 2023-02-14 15:08:45 +01:00
Xiang Xiao a3a1883787 fs: Don't guard rename with CONFIG_DISABLE_MOUNTPOINT
since the pseudo root fs support rename too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-14 11:24:37 +08:00
Xiang Xiao 4009cb1970 fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT
since ftruncate depends on file_operations not mountpt_operations

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-14 11:24:37 +08:00
Xiang Xiao a05f9aaa85 fs: Don't guard fsync with CONFIG_DISABLE_MOUNTPOINT
since the driver can also support fsync by implementing BIOC_FLUSH

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-14 11:24:37 +08:00
chao an bd7e521871 net/sendfile: adapt sendfile() to support new driver model
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-14 11:21:09 +08:00