In addition to the problems that were previously identified there were a few other bits and pieces outstanding;
* Timing was dependent on CPU speed rather than absolute time
* End of transfer handling was a bit mixed up
* It's possible for data to still be in the FIFO (i.e. not have reached
the card) when a next write is requested, so we need to wait for that to
complete
* Interrupt Status could be carried over from one transfer episode to the
next, corrupting progress
* Multi-descriptor DMA writing simply wasn't implemented, but there were no
indications ... it just failed silently
(1) Now the Ethernet is completely re-initialized when an error occurs by means of taking the interface down and back up but the PHY is _not_ renegotiated for that case because that is very time consuming and an error in the Ethernet is no reflection on the state of the PHY anyway.
(2) Explicitly sets the expected PHY address to zero (this could be moved into the config) rather than searching for it which takes ages, and it's zero anyway for this board (that's the broadcast address, and anything that cannot respond on that has multiple PHYs, so that would be a new board).
(3) Allows for the renegotiation of the PHY to be optional when a reset is needed. If a non-renegotiated reset doesn't result in good comms to the PHY then it'll automatically be escalated to a renegotiated one.
(4) Only performs a reset for errors that need it (the CRITICAL_ERROR define). The list of errors that need reset are somewhat arbitrarily chosen based on my prejudices and might need to be revisited, but certainly the jabber errors don't need reset, the partial packet is thrown away by the layer above anyway.
(5) Re-loads the multicast table on reset.
(6) Adds a bit more logging into the imxrt Ethernet module.
Pull request for mtd/progmem refactoring.
* mtd/progmem: change up_progmem_npages to up_progmem_neraseblocks
page is a unit for read/write operation.
eraseblock is a unit for erase operation.
up_progmem_npages is a little bit confusing because it returns number of
erase blocks in flash memory. This patch changes up_progmem_npages to
up_progmem_neraseblocks. There is no logical change.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* mtd/progmem: up_progmem_erasesize.
Change argument name to be more readable.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* mtd/progmem: up_progmem_eraseblock
Change up_progmem_erasepage to up_progmem_eraseblock.
eraseblock is more readable name than erasepage.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* mtd/progmem: change up_progmem_eraseblock's return value.
up_progmem_eraseblock erase a block. so it's better to return the erase block
size than page size.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* arm/cortex-r : fix wrong cp15_flash_dcache.
change mcrne to mcr for unconditional dcache.
Signed-off-by: sungduk.cho <sungduk.cho@samsung.com>
Approved-by: GregoryN <gnutt@nuttx.org>
drivers/usbdev: Fix buffer overrun check in rndis.c
The rndis driver has been working since 13 Nov 2017.
However, I finally found that it depends on network and buffer
configurations. If a receiving TCP packet is devided into smaller
ones based on USB max packet size, this condition check works
correctly.
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Approved-by: GregoryN <gnutt@nuttx.org>
many locations: Change occurences of open() followed by file_detach() to file_open(). Change most non-controversion calls to open() to nx_open().
fs/inode/fs_fileopen.c: Flesh out file_open() with some interim, placeholder logic.
fs/inode/fs_fileopen.c: Add a framework for a file_open() implementation (no real logic in place yet).
fs/vfs/fs_open.c: Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
Squashed commit of the following:
Add procfs support to show stopped tasks. Add nxsig_action() to solve a chicken and egg problem: We needed to use sigaction to set default actions, but sigaction() would refuse to set actions if the default actions could not be caught or ignored.
sched/signal: Add configuration option to selectively enabled/disable default signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT. Fix some compilation issues.
sched/sched: Okay.. I figured out a way to handle state changes that may occur while they were stopped. If a task/thread was already blocked when SIGSTOP/SIGSTP was received, it will restart in the running state. I will appear that to the task/thread that the blocked condition was interrupt by a signal and returns the EINTR error.
sched/group and sched/sched: Finish framework for continue/resume logic.
sched/signal: Roughing out basic structure to support task suspend/resume
Pull request for cortex-r4 codes
* arm/armv7-r: Add general interrupt controller.
This is based on armv7-a gic controller code.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* arm/armv7-r: add invalidate dcache in arm_head.S
Adding invalidate dcache as a comment in arm_head.S.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* arm/armv7-r: Fix some wrong configuration of program status register.
PSR_E_BIT bit should be set for big endian system.
PSR_A_BIT bis is set automatically as arm cortex-r4 reference manual 3.7.4.
So we don't need to set this bit.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* arm/armv7-r: Fix some wrong MPU register definition.
Change MPU_RBAR_ADDR_MASK and MPU_RACR_TEX_SHIFT mask as
arm cortex-r4 reference manual.
Region Base Address Register 0-4 bits are reserved.
MPU Region Access control register type 3-5 bits.
Signed-off-by: EunBong Song <eunb.song@samsung.com>
* driver/mtd: fix compilation error.
This commit fixes below compilation errors.
CC: mtd/smart.c
mtd/smart.c:182:22: error: 'gWearBitToLevelMap4' defined but not used [-Werror=unused-const-variable=]
static const uint8_t gWearBitToLevelMap4[] =
^~~~~~~~~~~~~~~~~~~
mtd/smart.c:170:22: error: 'gWearLevelToBitMap4' defined but not used [-Werror=unused-const-variable=]
static const uint8_t gWearLevelToBitMap4[] =
^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [smart.o] Error 1
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
Approved-by: GregoryN <gnutt@nuttx.org>
drivers/timers/arch_timer.c: implement timer arch API on top of timer driver interface
drivers/timers/arch_alarm.c: Implement alarm arch API on top of oneshot driver interface
drivers/timers/arch_rtc.c: Implement RTC arch API on top of RTC driver interface
include/nuttx/timers/rtc.h: Extend struct rtc_time by adding tm_nsec if RTC supporst hiresolution time.
drivers/serial/Kconfig: It is no longer necessary to restrict Ctrl-C handling to the FLAT build
sched/signal: Add a new configuration option to select signal default actions, separate handling of signal default actions from both task startup logic and from the serial TTY Ctrl-C logic. Add a signal set in the group structure to keep track of what signals have been set to the default action. In dispatching signals in PROTECTED or KERNEL mode, use this signal set to determine if the default signal handler is attached and dispatch the signal in kernel mode for the default actions.
driver/ioexpander: Add gpio_pin_unregister function to GPIO driver
driver/ioexpander: Add pinset struct to GPIO driver for interrupt pins larger than 64
driver/ioexpander: Initialize pintype/inttype when registering ioexpander device
driver/ioexpander: Add SETPINTYPE ioctl command to the GPIO driver
drivers/serial/uart_16550.c: Support 16550 auto hardware flow control
drivers/serial/uart_16550.c: Add configuration option CONFIG_16550_SUPRESS_INITIAL_CONFIG. This is identical to the standard configuration in arch/Kconfig CONFIG_SUPPRESS_UART_CONFIG, but with scope of only the 16550 driver.
drivers/serial/uart_16550.c: Add a configuration, analogous to the STM32 configuration option, to suppress the NuttX standard re-ordering for /dev/ttySN for special case of the 16550 UART.
config/serial: UART 16550: Add CONFIG_SERIAL_UART_ARCH_MMIO option so the a memory mapped device doesn't need to provide uart_getreg() and uart_putreg() implementations.
u16550_txempty() should check UART_LSR_TEMT to avoid some data left in the transmit FIFO
drivers/serial: Add Ctrl-C/Ctrl-X support. This is an initial working implementation that still requires that several details be resolved.
sched/task/task_start.c: Add default signal action to SIGKILL.
drivers/syslog: Channel configuration. Decouple SYSLOG_SERIAL_CONSOLE and ARCH_LOWPUTC. Since some hardware can output log to the special debug channel not serial.
drivers/syslog/vsyslog.c: Support pre-pending a prefix string to log output if enabled. This very useful to identify which cpu send out the log in AMP SoC.
drivers/syslog/vsyslog.c: Make timestamp output same as linux kernel. It's very useful if NuttX syslog retarget to Linux syslog.
Squashed commit of the following:
net/netlink: Mark netlink support as EXPERIMENTAL.
net/netlink/netlink_sockif.c: Add netlink_getpeername to the socket interface.
net: Add getpeeername() support for netlink sockets.
include/netpacket/netlink.h: Add a few more definitions and structures used at the NetLink interface. Still missing many.
net/netlink: Add basic framework for Netlink socket support.
include/: Add basic Netlink definitions.
No... I was misled. The shutdown function is usually called when the
driver is unlinked. But not in this case. In this case, it is simply
called when the last reference is closed. And no, you don't want to
detach the interrupt handler in that case. My bad.
This reverts commit b79e6b9c9a.
stm32f746g-disco: touchscreen support
* fixed FT5x06 driver to correctly close (previously it unregistered interrupt handler during close)
* added LittlevGL demo for STM32F746G-DISCO
Approved-by: GregoryN <gnutt@nuttx.org>
configs/stm32f4discovery/src: Add board support to MAX7219 as numeric display controller
drivers/leds/max7219.c: Add support to MAX7219 to control 7-segment displays
Master
* drivers/sensors: added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* bh1790glc.h created online with Bitbucket
* bh1790glc.h deleted online with Bitbucket
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* drivers/sensors: Added drivers for kx224, bh1749nuc and bh1790glc
They are reliant on the cxd56_scu.
* README.txt: minor typo fix
* Minor typo fix
Approved-by: GregoryN <gnutt@nuttx.org>
Master
* libdsp: initial commit
* libdsp: cosmetics
* stm32f334-disco/buckboost: use a PID controller from libdsp
* stm32_adc.h: fix typo
* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1
* stm32_hrtim: cosmetic changes
* power/motor: direction parameter is now int8 + add overload fault
* libdsp: all floats with f-sufix
libdsp: add precision option for library
libdsp: add debug option for library and assertions in functions
libdsp: add current samples correction for SVM3
libds: add some motor control specific functions
libdsp: add basic speed observer
libdsp: fix phase shift in SMO observer
libdsp: add more logic to FOC
config/sim/dsptest: add dsptest configuration
* libdsp/lib_motor.c: remove unused comparation
* libdsp/lib_observer.c: update some comments
Approved-by: GregoryN <gnutt@nuttx.org>
This makes the user interface a little hostile. People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header). A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length. Instead, we define the packet buffer size then derive the MTU.
The MTU is not common currency in networking. On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP). Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes. So we should be all good and without the recurring 14 byte error in MTU's and MSS's.
Squashed commit of the following:
Trivial update to fix some spacing issues.
net/: Rename several macros containing _MTU to _PKTSIZE.
net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE. This is not the MTU which does not include the size of the link layer header. This is the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename the file d_mtu in the network driver structure to d_pktsize. That value saved there is not the MTU. The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header. The MTU does not include the link layer header.
Squashed commit of the following:
drivers/usbhost/usbhost_max3421e.c: Add USB tracing support. Fix compilation errors when assertions and debug is enabled.
drivers/usbhost/usbhost_max3421e.c: Fixes to get a clean compilation.
drivers/usbhost/usbhost_max3421e.c: Drivers is basically code complete.
drivers/usbhost/usbhost_max3421e.c: Missed a little bit of logic in the last commit.
drivers/usbhost/usbhost_max3421e.c: Completes implementatin of control transfers.
drivers/usbhost/usbhost_max3421e.c: Implements low-level part of packet receive.
drivers/usbhost/usbhost_max3421e.c: Reorder some functions add a little more transfer-related logic.
drivers/usbhost/usbhost_max3421e.c: Completes basic logic path for sending normal packets.
drivers/usbhost/usbhost_max3421e.c: Correct handling of SNDFIFO double buffering.
drivers/usbhost/usbhost_max3421e.c: Not necessary to set the ACKSTAT bit in host mode. Clean up some comments.
drivers/usbhost/usbhost_max3421e.c: Mostly cosmetic cleanup
drivers/usbhost/usbhost_max3421e.c: Revise some previous logic. Looks like the MAX3421E can handle 16 channels in host mode. A little bit of work on packet transfer logic.
Copy paste error fix
drivers/usbhost/usbhost_max3421e.c: Add some channel allocation logic.
drivers/usbhost/usbhost_max3421e.c: Add some initialization logic.
drivers/usbhost/usbhost_max3421e.c: Add logic to determine if a full or low speed device has been connected.
drivers/usbhost/usbhost_max3421e.c: Add interrupt handling and bus reset logic.
drivers/usbhost/usbhost_max3421e.c: Add framework for an MAX3421E host driver. Initial commit is just the STM32 OTGFS host driver with a few new SPI-related functions.
Squashed commit of the following:
sched: Rename all use of system_t to clock_t.
syscall: Rename all use of system_t to clock_t.
net: Rename all use of system_t to clock_t.
libs: Rename all use of system_t to clock_t.
fs: Rename all use of system_t to clock_t.
drivers: Rename all use of system_t to clock_t.
arch: Rename all use of system_t to clock_t.
include: Remove definition of systime_t; rename all use of system_t to clock_t.
drivers/xbee: Fixes issue with timeouts. Timeouts were in ticks but should have been in ms. This caused false triggers of timeout causing redundant packets, etc.
Approved-by: GregoryN <gnutt@nuttx.org>