When initialising the SJA1000 peripheral on some implementations
(SJA1000_FDTOL), "releasing" the buffer when the Rx buffer is empty
causes a buffer pointer misalignment.
On peripheral initialise, remove the flag to "release" the buffer.
This should be safe for all systems using the SJA1000 CAN controller
as a "reset" to the peripheral clears the Rx FIFO.
This PR adds support for the SOPHGO SG2000 SoC, based on T-Head C906 64-bit RISC-V Core. This will be used by the upcoming port of NuttX for Milk-V Duo S SBC.
Most of the code was derived from NuttX for Ox64 BL808. The source files are explained in the articles here: https://github.com/lupyuen/nuttx-sg2000
Modified Files in arch/risc-v:
`Kconfig`: Added ARCH_CHIP_SG2000 for SG2000 SoC
New Files in arch/risc-v:
`include/sg2000/chip.h`: SG2000 Definitions
`include/sg2000/irq.h`: External Interrupts
`src/sg2000/chip.h`: Interrupt Stack Macro
`src/sg2000/sg2000_allocateheap.c`: Kernel Heap
`src/sg2000/sg2000_head.S`: Linux Header and Boot Code
`src/sg2000/sg2000_irq.c`: Configure Interrupts
`src/sg2000/sg2000_irq_dispatch.c`: Dispatch Interrupts
`src/sg2000/sg2000_memorymap.h`: Memory Map
`src/sg2000/sg2000_mm_init.c`, `sg2000_mm_init.h`: Memory Mgmt
`src/sg2000/sg2000_pgalloc.c`: Page Allocator
`src/sg2000/sg2000_start.c`: Startup Code
`src/sg2000/sg2000_timerisr.c`: Timer Interrupt
`src/sg2000/hardware/sg2000_memorymap.h`: PLIC and UART Base Address
`src/sg2000/hardware/sg2000_plic.h`: PLIC Register Addresses
`src/sg2000/Kconfig`: SG2000 Config
`src/sg2000/Make.defs`: Makefile
If the CAN stack receiving packets fast, but the application layer reading packets slow. Then `conn->readahead` will continue to grow, leading to memory leaks. Finally CAN stack potentially starve out all IOB buffers. To prevent memory leaks, users can restrict can socket buffer length.
Signed-off-by: gaohedong <gaohedong@xiaomi.com>
As kernel mode is not necessary for S mode build, update related
information for the rv-virt board.
Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
There is no need to use kernel build for S-mode all the time. As cpu
scratch is supported for non kernel mode build, it is possible to use
flat build for S-mode.
Add flat build support for risc-v S mode.
Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
This applies uintreg_t in risc-v commons and fixes araised ci issues
for multiple devices. The FLAT build runs on qemu-rv64ilp32 target.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This adds support of rv64ilp32 toolchain available from Github repo
`ruyisdk/riscv-gnu-toolchain-rv64ilp32`. With this 32-bit nuttx can
be generated for RV64 devices.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
* arch/risc-v/src/common/Toolchain.defs
arch/xtensa/src/lx6/Toolchain.defs
arch/xtensa/src/lx7/Toolchain.defs
- Define SHMODULEFLAGS etc. for sotest/dynload
- Add --entry=__start to SHMODULEFLAGS
* boards/arm64/qemu/qemu-armv8a/scripts/Make.defs
boards/sim/sim/sim/scripts/Make.defs
- Define SHMODULEFLAGS etc. for sotest/dynload
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h: In function 'oneshot_max_delay':
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h:272:3: error: implicit declaration of function 'timespec_from_tick' [-Wimplicit-function-declaration]
272 | timespec_from_tick(ts, tick);
| ^~~~~~~~~~~~~~~~~~
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h: In function 'oneshot_start':
/home/raiden00/git/RTOS/nuttx/nuttx/include/nuttx/timers/oneshot.h:285:10: error: implicit declaration of function 'timespec_to_tick'; did you mean 'timespec_get'? [-Wimplicit-function-declaration]
285 | tick = timespec_to_tick(ts);
| ^~~~~~~~~~~~~~~~
| timespec_get
/home/raiden00/git/RTOS/nuttx/nuttx/drivers/wireless/gs2200m.c:2071:3: note: ‘snprintf’ output between 7 and 9 bytes into a destination of size 8
2071 | snprintf(cmd, sizeof(cmd), "ATE%d\r\n", on);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For newer devices, IDF bootloader is not supported because the
devices are able to boot directly into NuttX or use MCUBoot to
enable OTA and security features.
This commit enables users to select the legacy bootloader (IDF
bootloader) in `menuconfig` directly. Please note, that this is a
legacy option intended to support devices already deployed and it
isn't recommended for new designs.
This adds IS_POWER_OF_2 macro to help catching config errors at
build time.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Need to distinguish between 32bit and 64bit registers, format the gdb reply message using struct.pack with correct format.
'<I' is used for 32bit registers, '<Q' for 64bit
Do not raise exeption for unrecognized registers in log, since they are
not used.
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
sched implementation not depends on macro abstraction, so revert below commit:
This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee
Signed-off-by: chao an <anchao@lixiang.com>
*Note:* ldmd2 is ldc2-wrapper, allow using dmd frontend flags.
This support may be extended to gdc (gnu) if nuttx developers demand it
or are interested in it.
pointer comparison is unsigned, when returning -errno will be converted
to a large positive number, can not enter the error handling branch,
therefore, the error code is returned directly and the sem is returned
through the parameters.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>