Commit Graph

49033 Commits

Author SHA1 Message Date
David Sidrane
77cf6ce273 stm32l4:stm32l4x{3|4|5|6|r}xx_pinmap pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32L4_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, CONFIG_STM32L4_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set CONFIG_STM32L4_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
1ece250b18 stm32:stm32f10{0|2|3{c|r|v|z}|5{r|v}|7v}_pinmap refactor
replace all GPIO_MODE_xxMHz with GPIO_MODE_2MHz provide GPIO_ADJUST_MODE
    and add legacy pinmap

    For the stm32F1 pinmaps should not have contained GPIO_MODE_50MHz settings
    on all pins. Speed is board dependent.

    This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
    lazy migration to using pinmaps that can have the GPIO_MODE_xxMHz set.

    The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
    The tools will take a board.h, and use all the defconfigs with the legacy
    pinmap and output the required changes that one needs to make to a board.h
    file.

    Eventually, CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
    pinmaps removed from NuttX.

    Any new boards added should set CONFIG_STM32_USE_LEGACY_PINMAP=n and
    fully define the pins in board.hf1
2023-04-19 09:58:11 +02:00
David Sidrane
ee6fb7880b stm32:stm32l15xxx pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
5d025d5d50 stm32:stm32g4xx{c|k|r|m|v|q} pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
98cd82f905 stm32:stm32f3{0|3|7}xxx pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
35258a26c0 stm32:stm32f20xxx pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
39c5931462 stm32:f4/f412 pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
1ce84fff01 stm32f7:pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
   This is board dependent.

   This change adds CONFIG_STM32F7_USE_LEGACY_PINMAP to allow for
   lazy migration to using pinmaps without speeds.

   The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
   The tools will take a board.h file and a legacy pinmap and outut the required
   changes that one needs to make to a board.h file.

   Eventually, STM32F7_USE_LEGACY_PINMAP will be deprecated and the legacy
   pinmaps removed from NuttX.

   Any new boards added should set STM32F7_USE_LEGACY_PINMAP=n and
   fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
14a0e08386 stm32h7:pinmap Remove GPIO_SPEED_xxx and add legacy pinmap
Pinmaps should not have contained GPIO_SPEED_xxx settings.
  This is board dependent.

  This change adds CONFIG_STM32H7_USE_LEGACY_PINMAP to allow for
  lazy migration to using pinmaps without speeds.

  The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
  The tools will take a board.h file and a legacy pinmap and outut the required
  changes that one needs to make to a board.h file.

  Eventually, STM32H7_USE_LEGACY_PINMAP will be deprecated and the legacy
  pinmaps removed from NuttX.

  Any new boards added should set STM32H7_USE_LEGACY_PINMAP=n and
  fully define the pins in board.h
2023-04-19 09:58:11 +02:00
David Sidrane
c5f7620c42 stm32u5:stm32u585xx_pinmap Fix typo 2023-04-19 09:58:11 +02:00
David Sidrane
7e171da63f stm32wl5:pinmap Fix typo 2023-04-19 09:58:11 +02:00
David Sidrane
b5913af01b tools:Add STM32 Pin migration tool
tools/stm32_pinmap_tool: Generate legacy file

stm32_pinmap_tool:Handel #undef
2023-04-19 09:58:11 +02:00
zhangyuan21
c00498c164 arch/arm: update running task when context switch occurred
The text describes an issue related to the running task in code.
The running task is only used when calling the _assert function
to indicate the task that was running before an exception occurred.
However, the current code only updates the running task during
irq_dispatch, which is suitable for ARM-M architecture but not
for ARM-A or ARM-R architecture, because their context switches
are not done through irq handler. Therefore, if the following
process is followed, the value of the running task will be incorrect:

1. task1 is running, this_task()=task1
2. do_irq is executed, setting running task()=task1
3. task1 switches to task2
4. task2 is running and generates a data abort
5. In the data abort, the _assert function is called,
   and the running task obtained is still task1, but
   the actual task that generated the exception is task2.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-19 10:14:05 +09:00
chao an
899be58905 sim/win/hostfs: set O_BINARY for windows hostfs as default
Since the initial default setting in MSVC is text mode ( O_TEXT ):

https://learn.microsoft.com/en-us/cpp/c-runtime-library/text-and-binary-mode-file-i-o?view=msvc-170

In order to unify the translation behavior with unix,
1. set O_BINARY for hostfs as default
2. enable default text mode if the application specifies flag O_TEXT

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-19 02:55:15 +08:00
yinshengkai
2188c0f9a8 trace: modify the dependency to SCHED_INSTRUMENTATION_DUMP
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-19 02:53:34 +08:00
yinshengkai
a297ff61f5 drivers/note: replace sched_note_filter_dump to sched_note_filter_tag
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-19 02:53:34 +08:00
yinshengkai
75d95ae01a trace: replace SCHED_NOTE_BEGIN to sched_note_begin
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-19 02:53:34 +08:00
zhangyuan21
f5f0af4f9c arch/arm64: fixed backtrace skip calc error
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-19 02:53:02 +08:00
zhangyuan21
2c599bb9e6 arch/arm64: call PANIC in arm64_fatal_error
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-19 02:53:02 +08:00
zhangyuan21
e4ae2b48b8 arch/arm64: Obtaining the correct fp pointer
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-19 02:53:02 +08:00
chao an
49c863f238 sim/win/hostuart: only read key event from console
This commit will detect input events and filter out events(mouse/window/etc) other than key

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-19 02:52:16 +08:00
chao an
8b43096e28 fs/hostfs: align operation flags define with fcntl.h
follow the change: https://github.com/apache/nuttx/pull/6357

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-19 02:50:20 +08:00
dongjiuzhu1
1f665e3498 sched/wqueue: fix issue about worker can't wake up thread before work_thread running
Problem:
AppBringup task in default priority 240 ->
board_late_initialize() ->
   some driver called work_queue() ->
      nxsem_post(&(wqueue).sem) failed because sem_count is 0

hp work_thread in default priority 224 ->
      nxsem_wait_uninterruptible(&wqueue->sem);

so hp_work_thread can't wake up, worker can't run immediately.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-04-19 02:50:04 +08:00
Fotis Panagiotopoulos
ab1b3c0337 Added missing checks in strdup'ed strings. 2023-04-19 02:49:31 +08:00
Fotis Panagiotopoulos
098b7bbfb3 Fixes in asprintf usage. 2023-04-19 02:48:39 +08:00
simbit18
433ec4c9de drivers/sensors/Kconfig: Fix bmp280 texts in Kconfig
Fix SENSORS_BMP280 texts in Kconfig
2023-04-19 02:46:09 +08:00
XinStellaris
a4546f35d2 drivers/mtd:fix uninit data in mtd_config_fs
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-04-19 02:45:46 +08:00
Fotis Panagiotopoulos
1530e04f20 ostest: Enabled KASAN, UBSAN & assertions. 2023-04-19 02:44:48 +08:00
Petro Karashchenko
fcd6ec7809 sched/sched: fix scheduler lock/unlock operation for non-SMP case
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 02:43:55 +08:00
XinStellaris
770817ba2f fs/littlefs:littlefs shouldn't be used without C99 BOOL
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-04-18 13:40:50 -04:00
Petro Karashchenko
18e2aa2d03 Revert "risv-v/esp32c6: disable custom optimize level temporary"
This reverts commit b94cc5ff92.
2023-04-18 22:34:40 +08:00
Dong Heng
45bba6e761 xtensa/esp32: ESP32 not use IMEM in user heap mode 2023-04-18 11:03:55 -03:00
zhangyuan21
5207295f83 esp32c6: fixed ci build issue
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-18 16:48:43 +08:00
dependabot[bot]
3dd7a015ba build(deps): bump github/super-linter from 4 to 5
Bumps [github/super-linter](https://github.com/github/super-linter) from 4 to 5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v4...v5)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-18 01:53:58 +08:00
raiden00pl
655f7f14ba github/linters/setup.cfg: use ignore for E203 2023-04-17 01:59:10 -07:00
yinshengkai
b705d9b1d5 sim: switch working directory
If this option is enabled, the working path of nuttx will be modified to the folder where the nuttx file is located.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-17 16:48:52 +08:00
David Sidrane
f1b646efc7 Fix Black/Flake8 whitespace around slice disagreement
See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
2023-04-17 01:47:00 -07:00
SPRESENSE
20424a8a59 drivers/audio/cxd56.c: Fix freeze audio and add underrun notify
Fix freeze audio driver when it start 2nd time.
And add underrun notify to application as an event.
2023-04-17 10:24:48 +02:00
SPRESENSE
79c6efae64 include/audio.h: Add underrun event id
Add an event id for notify underrun,
in case of underrun is happend in audio driver.
2023-04-17 10:24:48 +02:00
raiden00pl
642358e68f stm32h7/rcc: make VOS0 configurable from board.h also for stm32h7x7xx
Over-drive can be forced to a given state by adding define to the
board.h configuration file:

   #define STM32_VOS_OVERDRIVE 1 - force over-drive enabled,
   #define STM32_VOS_OVERDRIVE 0 - force over-drive disabled,
   #undef STM32_VOS_OVERDRIVE    - autoselect over-drive by the default RCC logic
2023-04-17 04:23:40 -04:00
raiden00pl
876b7a5e8e stm32h7/rcc: make VOS0 configurable from board.h
It seems that over-drive is not required for ULPI but it can be a workaround solution for boards with poor signal integration.
Higher core voltage means faster clock signal edges, which may be sufficient to synchronize the high-speed clock and data on poorly designed boards.

Over-drive can be forced to a given state by adding define to the
board.h configuration file:

   #define STM32_VOS_OVERDRIVE 1 - force over-drive enabled,
   #define STM32_VOS_OVERDRIVE 0 - force over-drive disabled,
   #undef STM32_VOS_OVERDRIVE    - autoselect over-drive by the default RCC logic
2023-04-17 04:23:40 -04:00
Zhe Weng
7671ed9615 usrsock_server: Raise error earlier for large sendto request
It's better to raise error before client sends its (NIOVEC+1)th buffer
(and release buffers held by server), otherwise the client may stuck at
getting (NIOVEC+1)th tx buffer if NIOVEC is equal to rpmsg buffer num.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-15 21:56:03 +09:00
Zhe Weng
0d118ec214 usrsock_server: Use remain instead of iov[0] to figure out partial requests
Found a problem:

When sendto handler gets an error, it will release all its rx buffer,
then iov_base becomes NULL. But it cannot let client stop its request,
then the next data from client cannot be handled by usrsock server
correctly.

It's better to note down the remaining bytes, then we can stop at
correct time.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-15 21:56:03 +09:00
Ville Juven
b982c1747b sched/addrenv: Miscellaneous clean-up and fixes
- Remove the temporary "saved" variable when temporarily changing MMU
  mappings to access another process's memory. The fact that it has an
  address environment is enough to make the choice
- Restore nxflat_addrenv_restore-macro. It was accidentally lost when
  the address environment handling was re-factored.
2023-04-15 13:21:48 +09:00
Tiago Medicci Serrano
869aee6a78 xtensa/sigdeliver: fix signal deliver when task is running
The Inter-Processor Interrupt that pauses the other CPU generates
a level-1 interrupt which sets the PS.EXCM. This level-1 interrupt
is treated as an Exception and the bit PS.EXCM bit is automatically
reset on return from Exception. However, this is not the case here
because we are changing the execution to the signal trampoline.
Restoring the PS register with the PS.EXCM bit set would cause any
other exception to deviate execution to the DEC (double exception
vector), avoiding it to be treated correctly. According to the
xtensa ISA: "The process of taking an interrupt does not clear
the interrupt request. The process does set PS.EXCM to 1, which
disables level-1 interrupts in the interrupt handler. Typically,
the PS.EXCM is reset to 0 by the handler, after it has set up the
stack frame and masked the interrupt." Clean the saved PS.EXCM to
1) avoid an exception from being properly treated and 2) avoid
interrupts to be masked while delivering the signal.
2023-04-15 08:19:30 +09:00
chao an
b94cc5ff92 risv-v/esp32c6: disable custom optimize level temporary
This is a workaround commit to temporarily reduce the flash usage of
esp32c6 to avoid ci failure, Since I am not familiar with esptool,
and this issue cannot be reproduced in the local environment,
so I temporarily turn off related optimizations to save flash size.

esptool error log:
-----------------------------------------
| MKIMAGE: ESP32-C6 binary
| esptool.py --chip esp32c6 elf2image --flash_mode dio --flash_size "4MB" -o nuttx.bin nuttx
| esptool.py v4.5.1
| Creating esp32c6 image...
| Merged 1 ELF section
|
| A fatal error occurred: Segment loaded at 0x42010c08 lands in same 64KB flash mapping as segment loaded at 0x42010020. Can't generate binary. Suggest changing linker script or ELF to merge sections.
| make: *** [tools/Unix.mk:527: nuttx] Error 2
| make: Target 'all' not remade because of errors.
-----------------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-13 21:10:42 +08:00
chenwen@espressif.com
8df0a4d9ef xtensa/esp32: Add support for universal mac addresses
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2023-04-13 09:43:30 -03:00
chao an
41f1044fa0 ci/cibuild.sh: upgrade esptool to 4.5.1
Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-12 23:14:45 +03:00
chao an
3f05df3fbb sim/win/hosttime: calculate sec/ms independently to avoid overflow
In the previous implementation, PerformanceCounter would cause overflow
after running for a long time, This commit will separate the calculation
of the sec/ms part to avoid this issue, Reference:

https://github.com/cygwin/cygwin/blob/main/winsup/cygwin/clock.cc#L194-L217

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-12 08:38:34 +02:00
simbit18
2309eacf9f drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig
Fix bmi160 help texts in Kconfig
2023-04-12 07:54:19 +02:00