Commit Graph

20300 Commits

Author SHA1 Message Date
Xiang Xiao 7d3a9b1cbc Revert "STM32 Nucleo: warning: #warning "Default Flash Configuration Used""
This reverts commit 62c15c03d3.

Fix warning: the choice symbol STM32_FLASH_CONFIG_G (defined at arch/arm/src/stm32/Kconfig:1275) is selected by the following symbols, but select/imply has no effect on choice symbols
 - ARCH_CHIP_STM32F412ZG (defined at arch/arm/src/stm32/Kconfig:1014)
2023-02-20 00:02:36 +02:00
Michal Lenc 333707e101 pwm: add PWM overwrite under CONFIG_PWM_OVERWRITE option
Generic drivers shoud not use architecture related config options like
CONFIG_SAMV7_PWM. This commit adds PWM pin overwrite under generic
configuration option CONFIG_PWM_OVERWRITE.

Now the overwrite can be used on other architectures as well or can be
completely disabled for SAMv7.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-19 00:16:41 +08:00
dirksavage88 02fc698e75 Add UART4 & UART5 to high density stm32f103 chips
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
2023-02-18 13:32:52 +08:00
Fotis Panagiotopoulos 9bfa9a0b49 stm32_eth: Enabled store-end-forward. 2023-02-18 11:08:46 +08:00
Fotis Panagiotopoulos 87a23f8e38 stm32_eth: Fixed alignment of Ethernet descriptors & buffers. 2023-02-18 11:06:59 +08:00
Michal Lenc d52e875a99 samv7: fix build error in sam_mcan.c file
Commit d07792a caused a build error in sam_mcan.c file. This commit fixes
the build. The file now succesfully compiles and CAN works.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-17 14:58:37 -03:00
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
Fotis Panagiotopoulos 85ceb7920e Typo fixes. 2023-02-17 11:17:11 -03: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
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 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
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
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
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
chao an 1e7014262c sim/windows: fix build break on visual studio
1. fix build break on visual studio
2. enable more net config

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-13 20:37:25 +08:00
ligd 87a92d995f sim: fix nuttx consumes much CPU time
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-13 18:41:43 +09:00
ligd 758668d11a sim: remove sim_saveusercontext() return value
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-13 18:41:43 +09:00
ligd 7e3e99c940 sim: fix vfork report error
user_main: vfork() test
=================================================================
==3754757==ERROR: AddressSanitizer: stack-buffer-underflow on address 0xae9126f0 at pc 0x56845661 bp 0xae912570 sp 0xae912560
READ of size 1 at 0xae9126f0 thread T0
    #0 0x56845660 in memcpy string/lib_memcpy.c:44
    #1 0x56b70f61 in up_vfork sim/sim_vfork.c:133
    #2 0x567c0b85 in vfork (/home/ligd/platform/sim/nuttx/nuttx+0x26bb85)

0xae9126f0 is located 73456 bytes inside of 73728-byte region [0xae900800,0xae912800)
allocated by thread T0 here:
    #0 0xf7ab1c2f in __interceptor_posix_memalign ../../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

SUMMARY: AddressSanitizer: stack-buffer-underflow string/lib_memcpy.c:44 in memcpy

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-12 02:37:25 +08:00
Fotis Panagiotopoulos 1b372a55cc stm32_sdio: Fix in SDIO clocking configuration. 2023-02-11 23:29:11 +08:00
Michal Lenc 00e87962fd imxrt: add option to select PWM trigger source value from configuration
Current implementation supports the trigger generation only from timer
capture on period value. This is sufficient for PWM synchronization but
may not be enough for other purposes as ADC triggering for example.

This change adds an option to generate the trigger based on a duty
cycle value.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-11 20:07:28 +08:00
chenwen@espressif.com cfc9029c5d risc-v/esp32c6: Add ESP32-C6 basic support
1. Bring up OS kernel.
  2. Add interrupt support.
  3. Add system timer support.
  4. Add the ESP32-C6 devkit board.
  5. Add basic UART support for console.
  6. Add clock configuration.
  7. Add board reset support.
2023-02-10 17:38:41 -03:00
Masayuki Ishikawa 777c6c4aad arch: imxrt: Fix imxrt for CONFIG_BUILD_PROTECTED=y
Summary:
- Fix imxrt_allocateheap.c for CONFIG_BUILD_PROTECTED=y
- Call mpu_reset() in imxrt_mpuinit.c

Impact:
- CONFIG_BUILD_PROTECTED=y only

Testing:
- Tested with imxrt1060-evk:knsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-02-09 23:30:50 -08:00
ligd 1cc6e4b1fa sim: add uart dma mode & use work instead of loop.
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-10 13:54:42 +08:00
Janne Rosberg 739688f6c6 sama5/twi: add support for flexcom twi 2023-02-10 10:56:56 +08:00
Michal Lenc 725dfd5db9 samv7: fix compilation error when only DAC1 is configured
The function call dac_txdone(&g_dac1dev) was not contained in ifdef
section. This was cousing compilation error if only DAC1 was configured
as the structure g_dac1dev is defined only if DAC0 is used.

This commit fixes the error and ensures the function is called only if
corresponding DAC is configured.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-10 02:33:30 +08:00
TimJTi becaf3bf9d Correct SAMA5_USBA_DRP to be SAMA5_USB_DRP 2023-02-10 01:01:03 +08:00
TimJTi b3365858ee Fix sam_udphs to allow RNDIS to work
Update sam_udphs.c
2023-02-10 00:55:59 +08:00
Peter Bee 2ebccd82b6 drivers/video: add timestamp support
Add support for timestamp and change in related drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-09 23:27:15 +08:00
chao an 74ce3b81d3 build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
First decoupling changes related to CMAKE

BINDIR/APPSBINDIR:
Output path of Kconfig which dynamically generated by NuttX Kernel/Apps
This option is consistent with the TOPDIR/APPSDIR by default, and will
be changed when out-of-tree compilation is supported

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:13:04 +08:00
chao an e942a7c55e build/Kconfig: fix warnings detected by kconfiglib
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:07:46 +08:00
chao an 3a0fdb019d nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:05:44 +08:00
ligd 9b35a2e1a1 sim: fix compile warning
sim/sim_doirq.c: In function 'sim_doirq':
Error: sim/sim_doirq.c:79:10: error: function may return address of local variable [-Werror=return-local-addr]
   79 |   return regs;
      |          ^~~~
sim/sim_doirq.c:44:14: note: declared here
   44 |   xcpt_reg_t tmp[XCPTCONTEXT_REGS];
      |              ^~~

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-09 14:22:38 +08:00
ligd 16367aa084 sim: correct save irq flags error when use sim 64bits
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-09 14:22:38 +08:00
ligd 8aecad287c sim: set loop task duration to 10ms
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-09 14:19:09 +08:00
ligd f102837fe1 sim: realize sim timer tickless
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-09 14:19:09 +08:00
Zhihong Chen d082af34f7 add hpmicro chip: hpm6750
Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
2023-02-09 14:17:49 +08:00
TimJTi 4aada75249 Changes to allow board-specific DRP/OTG support
Update sam_udphs.c
2023-02-09 03:42:55 +08:00
Lucas Saavedra Vaz 1fb6dcec3b arch/xtensa/esp32s2: Fix function header 2023-02-09 02:39:54 +08:00
Lucas Saavedra Vaz b29198a62a arch/xtensa/esp32s3: Add support for touch pad interrupts 2023-02-09 02:39:54 +08:00
Ville Juven 9ac3e841da group_addrenv: Fix call to group_addrenv for targets that don't need it 2023-02-09 00:14:52 +08:00
Nathan Hartman 375cb09ff0 arch/pic32mz: Serial support for termios
Previously, it was impossible to build for PIC32MZ architecture with
CONFIG_SERIAL_TERMIOS because it introduced compiler errors in the
lower half driver.

Fixing the compiler errors and adding an implementation of the
TIOCSERGSTRUCT, TCGETS, and TCSETS ioctl calls.

* arch/mips/src/pic32mz/pic32mz_serial.c
  (): Include nuttx/fs/ioctl.h, needed for the TIOCSERGSTRUCT, TCGETS,
   and TCSETS defines.
  (up_ioctl): Fix compile breakage. Implement TIOCSERGSTRUCT. Make
   TCGETS return data bits, parity, and stop bits. Make TCSETS apply
   changes to data bits, parity, and stop bits.
2023-02-08 23:55:37 +08:00
Nathan Hartman 8b2c8c73e8 arch/tiva: Serial TIOCxBRK BSD-compatible BREAK support
In the lower half UART driver for Tiva architecture (TM4C12x), adding
the TIOCxBRK ioctl calls, which allow an application to transmit a BSD
compatible line BREAK. TIOCSBRK starts the BREAK and TIOCCBRK ends it.

This architecture supports BSD-style BREAK in hardware. We write to
the BRK bit (bit 0) of the UART Line Control register (UARTLCRH) to
start the BREAK, which begins after the UART finishes shifting out the
current character in progress, if any, including its stop bit(s), and
continues indefinitely until we write to the BRK bit again to stop the
BREAK.

* arch/arm/src/tiva/Kconfig
  (config TIVA_UART_BREAKS): New. Appears as CONFIG_TIVA_UART_BREAKS
   in code.

* arch/arm/src/tiva/common/tiva_serial.c
  (struct up_dev_s): Add new field 'brk' to indicate line break in
   progress when built with CONFIG_TIVA_UART_BREAKS.
  (up_ioctl): Add cases for TIOCSBRK to turn BSD-compatible break on
   unconditionally and TIOCCBRK to turn break off unconditionally.
  (up_txint): Block enabling TX interrupt if line break in progress.
   This is similar to the STM32F7 implementation.
2023-02-08 23:55:28 +08:00
ligd 24cdcd9a6e sim: fix kasan report memalign crash when alignment is 1
(0)Allocating 3 bytes aligned to 0x00000001
=================================================================
==1461685==ERROR: AddressSanitizer: invalid alignment requested in posix_memalign: 1, alignment must be a power of two and a multiple of sizeof(void*) == 4 (thread T0)
    #0 0xf7ab1c2f in __interceptor_posix_memalign ../../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-02-08 20:37:43 +08:00