SFS is a small filesystem designed for saving limited size files in
page based flash such as that often found in a SoC. It's best suited
for applications that write up to a hundred small files of a similar
size which are also similar to the flash page size.
Compared to NFFS, SFS:
- Is much smaller
- Doesn't need byte erasable flash
Compared to FCB, SFS:
- Implements the fs API
- Doesn't need byte writable flash
Signed-off-by: Michael Hope <mlhx@google.com>
This is a minor change that makes the data pointer const and shifts
the length to a size_t to match the other CRC functions.
Signed-off-by: Michael Hope <mlhx@google.com>
In the same way as cdc_acm, set a semaphore in the transfer complete
interrupt and wait for it in the main loop before retrying.
This fixes a bug with >= 64 byte frames when logging is off. If
logging is on, then the time to print logging is enough for the
transmit to complete. If logging is off, then the 10 retries complete
quickly and try_write() gives up.
Signed-off-by: Michael Hope <mlhx@google.com>
This fixes a bug in the cdc_ecm Ethernet over USB driver. The ECM
spec (section 3.3.1) says that the end of an Ethernet frame is marked
using the USB short packet mechanisim, where the last packet is less
than the maximum packet size. If the Ethernet frame is a multiple of
the USB maximum packet size then a final zero length packet must be
sent.
However, Linux sends a one byte packet instead (usbnet.c:1393) to work
around hardware issues with zero length packets.
The current Zephyr driver works most of the time except when you send
an Ethernet frame of the right length where the last byte is zero,
such as:
$ ping 192.0.2.1 -s 23 -p 0
Zephyr then drops the last byte, creating a short frame which gets
dropped higher up in the stack.
Signed-off-by: Michael Hope <mlhx@google.com>
As per uart_pipe.c, irq_is_pending should only return true if any
*unmasked* interrupts are pending.
The device_get_binding() code only checks devices that have an API.
Set the API at compile time so that other devices can refer to the CDC
ACM driver.
usb_write() may return EBUSY if the endpoint is full. Propagate this
for future use.
Signed-off-by: Michael Hope <mlhx@google.com>
Read up to an (arbitrary) 32 bytes at once from the port. This improves
performance with the USB CDC ACM driver which may have 64 bytes
available at a time.
Signed-off-by: Michael Hope <mlhx@google.com>
include/uart.h says that an interrupt may be an edge or a level.
Re-work the uart_pipe interrupt handler to support both. This makes
uart_pipe work with the USB CDC ACM driver.
Signed-off-by: Michael Hope <mlhx@google.com>
The previous code is equivalent to:
if !isprint:
if is carriage-return:
post line
set current line to NULL
store ch in current line (*)
which causes a null pointer fault when receiving a carriage return.
This patch switches to a single condition tree. The side effect is
that other non-printable characters are dropped.
Signed-off-by: Michael Hope <mlhx@google.com>
The Trinket M0 has an on-board APA102 LED connected to SPI1. Add to
Device Tree, the fixup, and enable the driver.
Signed-off-by: Michael Hope <mlhx@google.com>
Implements the set line control API for baud rate only. The SAM0
doesn't implement flow control in hardware.
Signed-off-by: Michael Hope <mlhx@google.com>
Define a Device Tree binding for the SAM0 SPI and use it instead of
Kconfig for enabling / disabaling instances
Signed-off-by: Michael Hope <mlhx@google.com>
The space referred to in these comments was once truly reserved for
the application: no zephyr partition would ever use it.
Now, though, that's not the case, since NFFS will use these sectors
when enabled.
Just delete the comments.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Let's point users at the latest documentation on flash
partitions from each of the board files, rather than duplicating some
of the information in it.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Edits and additions for clarity and correctness, based on the current
contents of the file (dts.cmake) which controls the DTS build.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Re-work the flash partitions documentation:
- add sections to provide more complete context
- link to useful information on DT overlays elsewhere in the
documentation
- touch up some phrasing
- inline a smaller, self-contained example within the page rather than
linking to an entire board dts
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Per arch the path to the SOC dir that we would find dts.fixup varies
between being ${CONFIG_SOC_FAMILY}/${CONFIG_SOC_SERIES} and just
${CONFIG_SOC}. The ${SOC_PATH} var handles defining this correct so
use it instead when we define DTS_SOC_FIXUP_FILE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We need access to SOC_PATH in dts.cmake so we need to move the
definitions of SOC_NAME, SOC_SERIES, SOC_FAMILY, and SOC_PATH out of the
toplevel CMakeLists.txt and into cmake/app/boilerplate.cmake. We place
them before we include cmake/dts.cmake so they will be available to use
in it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some of APIs of POSIX implmentation layer has same name as
native_posix architecture. posix_cheats.h is used to handle this
duplication in API name. Adding a guard in posix_cheats.h based on
CONFIG_PTHREAD_API.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
This test is POSIX based implementation of tests:kernel:pthread test.
It used POSIX APIs instead of Zephyr APIs.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
This patch removes unused member element from POSIX object attributes
(mutex, condition variable and barrier).
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
This patch provides POSIX sleep APIs for POSIX 1003.1 PSE52 standard.
sleep(n) is implemented using Zephyr k_sleep API.
uleep(n) is implemented using Zephyr k_sleep/k_busy_Wait API.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
As per POSIX standard typedef should be part of sys/types.h file.
So moving typedef from pthread.h to sys/types.h file.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
As per IEEE 1003.1 POSIX APIs should return ERROR_CODE on error.
But currently these are returning -ERROR_CODE instead of ERROR_CODE.
So fixing the return value.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Duplicate code to query was mistakenly added in commit
2ad7ccdb2d. This code is redundant; the
existing `boot_read_bank_header()` function can read the version from
both image banks.
Signed-off-by: Christopher Collins <ccollins@apache.org>
Move the generated files into include/generated so they live with the
build and not in the zephyr source tree.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>