Commit Graph

1707 Commits (8b6a7aacc5d2b90ba40d89c8eeb680ebee81ea18)

Author SHA1 Message Date
Russ Butler beaac1525e Fix clearing of ISTAT in Kinetis USB
The ISTAT register is write 1 to clear. Because of this ORing this
register with itself fill clear all bits that are set. This patch
updates the code to use plain assignment so only desired
bit is cleared.
2018-01-17 20:54:08 -06:00
Russ Butler 48cf4d85d1 Remove use of deprecated attach in USB
Attach callbacks with the assignment operator rather than with the
deprecated attach function. This fixes deprecation warnings.

This patch also adds the ability to attach a Callback directly.
2018-01-17 20:54:05 -06:00
Russ Butler 6decbedbb8 Fix local static initialization in USB
The local static initialization in USB was causing multiple problems:
-Configurable descriptor values are set only once
-USB descriptor initialization causes a trap in debug builds since
 this is acquiring a mutex in an interrupt handler
-Extra ram used since all descriptors  are in RAM

This patch fixes these problems by making fixed descriptors
static const so they are stored in flash and never need to be
initialized and by making descriptors that do change a member
of the class so they are always initialized when requested
rather than once though lazy static local initialization.
2018-01-17 20:53:57 -06:00
Jani Suonpera fe80b6751a Update CoAP to 4.0.11
This PR implement https://tools.ietf.org/html/rfc7959#section-2.5
"The error code 4.13 (Request Entity Too Large) can be returned at any
time by a server that does not currently have the resources to store
blocks for a block-wise request payload transfer that it would intend
to implement in an atomic fashion. (Note that a 4.13 response to a
request that does not employ Block1 is a hint for the client to try
sending Block1, and a 4.13 response with a smaller SZX in its Block1
Option than requested is a hint to try a smaller SZX.)
2018-01-17 14:49:46 +02:00
Kevin Bracey 268a07db37 NSAPI: Add Nanostack multicast membership support
Add support for recently introduced NSAPI generic socket options to
control group membership. Previously applications using Nanostack would
have had to use Nanostack's native socket options.
2018-01-17 14:30:45 +02:00
Vincent Coubard e2a2582549 BLE: Fix inclusion of BLE.h (case) 2018-01-17 11:31:50 +00:00
Cruz Monrreal 25aa0e6d37
Merge pull request #5846 from geky/fix-block-addr-overflow
littlefs: Fix block addr overflow
2018-01-16 15:53:30 -06:00
Cruz Monrreal 671c2d7e90
Merge pull request #5346 from scartmell-arm/feature-hal-spec-critical-section
Add Critical Section HAL API specification
2018-01-16 12:49:38 -06:00
Martin Kojtal 7be79f93fe
Merge pull request #5727 from dschuler/nrf52pf
Add presentation format descriptor support for nRF5x
2018-01-15 15:43:21 +00:00
Martin Kojtal 663a6d84e3
Merge pull request #5623 from SeppoTakalo/clarify_socket_docs
Clarify TCPSocket::recv() and UDPSocket::recvfrom() documentation.
2018-01-15 15:29:28 +00:00
Martin Kojtal 41be3727fc
Merge pull request #5731 from terhei/master
mesh-api documentation removal
2018-01-15 15:26:55 +00:00
Martin Kojtal 2d83463f9c
Merge pull request #5813 from TomoYamanaka/master
Revise the structure in RZ_A1 related directory
2018-01-15 15:23:52 +00:00
Martin Kojtal 8c78649078
Merge pull request #5829 from deepikabhavnani/fat_issue_5780_3
Fix: Sector/Size overflow from uint32_t
2018-01-15 15:22:11 +00:00
Daniel Schuler 271b09cda6 Add presentation format descriptor support for NRF52 2018-01-13 15:49:40 -08:00
Christopher Haster 44e2ca44a8 littlefs: Fix block addr overflow
deepikabhavnani did the hard work in tracking this issue down.  Block
addresses are not cast to the correct type until after multiplying to
convert to byte addresses. This results in an overflow when the storage
is larger than 4 GB.
2018-01-12 14:44:44 -06:00
deepikabhavnani c86d757267 Fix: Sector/Size overflow from uint32_t
FATFilesystem declares sector count and size as uint32_t and block
device class arguments are addr and size which is uint64_t
While passing arguments to program/read/write API's of block device,
multiplication of uint32_t*uint32_t was not typecasted properly to
uint64_t which resulted in MSB truncation.

Eg. If block 0x800000 is accessed with block size 0x200, addr to be
passed (0x800000*0x200)0x100000000, but actual address passed was 0x0
which resulted in over-writting the root directory, and hence corrupted
filesystem
2018-01-12 11:12:34 -06:00
Arto Kinnunen 8151e55838 Merge commit '47341478379429c08c468093e0326b5c79ecbc62'
* commit '47341478379429c08c468093e0326b5c79ecbc62':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from d0a2597..8689fca
2018-01-12 14:02:31 +02:00
Seppo Takalo 6bf0611748 Clarify TCPSocket::recv() and UDPSocket::recvfrom() documentation. 2018-01-12 12:03:56 +02:00
Christopher Haster 5df2b9b0e7 littlefs: Fixed file truncation without writes
In the open call, the LFS_O_TRUNC flag was correctly zeroing the file, but
it wasn't actually writing the change out to disk. This went unnoticed because
in the cases where the truncate was followed by a file write, the
updated contents would be written out correctly.

Marking the file as dirty if the file isn't already truncated fixes the
problem with the least impact. Also added better test cases around
truncating files.
2018-01-11 16:27:33 -06:00
Cruz Monrreal dc87f0b1e6
Merge pull request #5313 from pan-/ble-cordio-pal-gap
Cordio: Pal Gap implementation
2018-01-11 10:35:42 -06:00
Cruz Monrreal b32828bc37
Merge pull request #5739 from pan-/nordic-new-client
BLE: Nordic pal client implementation
2018-01-11 10:26:47 -06:00
Cruz Monrreal c0c501c70f
Merge pull request #5768 from deepikabhavnani/storage_stats
Added statvfs API to get storage statistics
2018-01-11 10:25:41 -06:00
TomoYamanaka 0d00be3a60 Add the function declarations of WEAK attribute to use LWIP on GR-LYCHEE
I added the function declarations of Ethernet functions that have a WEAK attribute. Although several Ethernet functions was called in rza1_emac.c, GR-LYCHEE don't have Ethernert feature. But there may be case that GR-LYCHEE uses LWIP feature.
In this case, since GR-LYCHEE will occur the build error, I addressed the error by defining the functions with a WEAK attribute. For reason of WEAK attribute, there is no influence in GR-PEACH and VK_RZ_A1H that have Ethernet feature.
2018-01-11 18:11:37 +09:00
Vincent Coubard d33b02818a BLE: Implement Generic GattClient reset logic. 2018-01-10 14:31:52 +00:00
Vincent Coubard 29988d5265 BLE: Align naming of GattClient procedure control blocks. 2018-01-10 14:18:00 +00:00
Vincent Coubard 3061db271d BLE: Put generic gattclient procedures inside the GattClient class 2018-01-10 14:15:08 +00:00
Christopher Haster d82d9888d4 Added COMMON folder for tests
A COMMON folder allows code reuse across different test cases. This
avoids code duplication or code enterying the application space.

The COMMON folder is uppercase to match naming conventions in Mbed OS.
2018-01-09 16:11:14 -06:00
Steven Cartmell 061795c489 Move in_critical_section implementation into the HAL
- Add function to HAL hal_in_critical_section()
- Wrap assert in FEATURE_UVISOR macro
2018-01-09 10:41:29 +00:00
Tero Heinonen d8b369f5b2 mesh-api documentation removed
All documentation is now in Handbook
2018-01-09 12:37:06 +02:00
TomoYamanaka 9cbd678049 Modify the TYPO of debug info when using LWIP in RZ/A1 related
I modified the debug message when using LWIP in RZ/A1 related mbed boards.
In eth_arch_enetif_init(), sys_thread_new() was called and task name is appeared as debug information, but task name for debug was a mistake.
2018-01-09 18:30:07 +09:00
TomoYamanaka 285c259472 Performance improvement of LWIP communication in RZ_A1 related
For LWIP communication speedup in RZ_A1 related, I changed the below macro value and added the definition processing in RZ/A1 related header file(lwipopts_conf.h). For this reason, those macros are overrode by RZ/A1 related values, not default values.
2018-01-09 18:28:39 +09:00
ccli8 a68750473c [M487] Support ECP H/W accelerator 2018-01-09 16:20:41 +08:00
TomoYamanaka 2e7d6df775 Commonize RZ_A1 related folders placed in "FEATURE_LWIP" directory
In the below "features/FEATURE_LWIP" folders, same as Cortex-M targets, I changed the folder structure to combine files that can be shared as RZ/A1 related. And I renamed the folder name to "TARGET_RZ_A1XX" in order to make commonality explicit.
- "features/FEATURE_LWIP" folder
  <before>
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_RZ_A1H
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_VK_RZ_A1H
  <after>
  \features\FEATURE_LWIP\lwip-interface\lwip-eth\arch\TARGET_RZ_A1XX
2018-01-09 16:48:39 +09:00
Jimmy Brisson 086ccd5536
Merge pull request #5782 from geky/littlefs-fix-seek-cur
littlefs: Fix positive seek bounds checking
2018-01-08 10:38:00 -06:00
Jimmy Brisson cef1cc26d8
Merge pull request #5651 from gorazdko/ff_lpc546xx-add-ethernet
ff_lpc546xx: add enet, change led1 and led3 pins
2018-01-08 10:35:56 -06:00
Jimmy Brisson 737f75a68f
Merge pull request #5608 from productize/nucleo-f413zh
NUCLEO_F413ZH: Add support for the NUCLEO-F413ZH board
2018-01-08 10:35:27 -06:00
Vincent Coubard c5bc247217 Nordic BLE: Use SD API version rather than SDK define. 2018-01-08 14:00:23 +00:00
Vincent Coubard e9ba84168b Nordic BLE: Fix PalGattClient for SDK v13. 2018-01-08 13:52:42 +00:00
Vincent Coubard e8bad03a1c Nordic BLE: Simplification and clarification of pal client implementation. 2018-01-08 12:04:02 +00:00
Vincent Coubard 331e8f2aed BLE: Fix include dependency in UUID.h. 2018-01-08 12:01:30 +00:00
Steven Cartmell e14bee5209 Fix potential race condition in critical section HAL API
Call underlying HAL implementation to enter critical section/disable interrupts
before incrementing the global critical section counter.

Modify HAL implementations to track first entrances to the critical section and
only update the saved state on first enter.
2018-01-05 14:55:58 +00:00
Steven Cartmell 3c9ae7bf1c NRF51_DK: Add Critical Section HAL implementation 2018-01-05 14:55:57 +00:00
ccli8 67386b9ebd [NUC472/M487] Fix DMA input/output buffers are overlapped in AES alter. 2018-01-05 09:18:26 +08:00
ccli8 4023078e14 [NUC472/M487] Remove unnecessary H/W context clone functions in SHA alter. 2018-01-05 09:18:26 +08:00
ccli8 acff29e6f2 [NUC472/M487] Fix context clone corner case in SHA alter.
As destination/source contexts are the same, we return immediately.
2018-01-05 09:18:25 +08:00
ccli8 d96bcda606 [NUC472/M487] Fix indefinite loop in SHA alter. 2018-01-05 09:18:25 +08:00
ccli8 8b7ff095a9 [NUC472/M487] Remove duplicate configuration of CRPT->SHA_CTL/CRPT->HMAC_CTL in SHA alter. 2018-01-05 09:18:25 +08:00
ccli8 3a8c1aa687 [NUC472/M487] Use interrupt signal rather than polling to check operation completion in DES alter.
This is to be consistent with PRNG/AES.
2018-01-05 09:18:24 +08:00
ccli8 0c1098483f [NUC472/M487] Refine flow control code between crypto start and crypto ISR 2018-01-05 09:18:24 +08:00
ccli8 add839c808 [NUC472/M487] Refine code in SHA alter. 2018-01-05 09:18:24 +08:00
ccli8 b443a23b07 [NUC472/M487] Add memory barrier for DMA transfer in AES/DES alter. 2018-01-05 09:18:23 +08:00
ccli8 c906790257 [NUC472/M487] Call BSP driver rather than direct register access in DES alter. 2018-01-05 09:18:23 +08:00
ccli8 dc3c84c011 [NUC472/M487] Fix parameter check for TMODE/OPMODE in DES alter. 2018-01-05 09:18:23 +08:00
ccli8 815a6a7c4d [NUC472/M487] Add parameter check for configuring DES registers in DES alter. 2018-01-05 09:18:23 +08:00
ccli8 1d62b9120b [NUC472/M487] Refine comment with BSP driver use in DES alter. 2018-01-05 09:18:22 +08:00
ccli8 479cf687ff [NUC472/M487] Fix multiple calls to SHA free in SHA alter. 2018-01-05 09:18:22 +08:00
ccli8 7d92550d11 [NUC472/M487] Remove superfluous code in AES alter. 2018-01-05 09:18:22 +08:00
ccli8 116b14aa84 [NUC472/M487] Refine code with SHA context selection in SHA alter. 2018-01-05 09:18:22 +08:00
ccli8 980cb6b9c8 [NUC472/M487] Guard against SHA internal state size is not word-aligned in SHA alter. 2018-01-05 09:18:21 +08:00
ccli8 8ba07815ed [NUC472/M487] Fix SHA H/W resource leakage in context cloning 2018-01-05 09:18:21 +08:00
ccli8 83fb50cca3 [NUC472/M487] Fix SHA H/W is not stopped in corner case
Take SHA1 for example, without the fix, SHA H/W is not stopped in either case:
(1) ctx->total == 0 in mbedtls_sha1_hw_finish()
(2) mbedtls_sha1_hw_finish() is not called by upper layer
2018-01-05 09:18:21 +08:00
ccli8 a0a8a955a9 [NUC472/M487] Strengthen crypto DMA buffer check
1. Catch incompatible buffer range, where buffer base = 0xffffff00 and buffer size = 0x100.
2. Add buffer size alignment check.
2018-01-05 09:18:21 +08:00
ccli8 ac000244f4 [NUC472/M487] Refine AES/DES alter. DMA buffer requirement comment 2018-01-05 09:18:20 +08:00
ccli8 aafbdc8d38 [NUC472/M487] Fix compile error with disabled crypto
For example, even though MBEDTLS_SHA512_C is disabled (via #undef MBEDTLS_SHA512_C),
mbedtls_sha512_context is still necessary due to referenced in sha512.h.
2018-01-05 09:18:20 +08:00
ccli8 b0228d020d [NUC472/M487] Fix compile error as mbedtls is not included
Currently, trng_api.c is located in targets/ and AES/DES/SHA alter. are located in mbedtls/.
They have shared crypto code.
If they could locate at same location e.g. mbedtls/, the shared crypto code placement would be more reasonable.
2018-01-05 09:18:20 +08:00
ccli8 ba16fd9617 [NUC472/M487] Refine AES alter. key endianness code 2018-01-05 09:18:20 +08:00
ccli8 6464649c41 [NUC472/M487] Coordinate crypto interrupt handler among AES/PRNG 2018-01-05 09:18:20 +08:00
ccli8 0c2d59d327 [NUC472/M487] Refine AES/DES alter. code 2018-01-05 09:18:19 +08:00
ccli8 289bbf0ec7 [NUC472/M487] Fix AES alter. CFB128 error 2018-01-05 09:18:19 +08:00
ccli8 7076675fec [NUC472/M487] Optimize AES alter. code 2018-01-05 09:18:19 +08:00
ccli8 6cc3aa3e54 [NUC472/M487] Guard from re-entry into crypto H/W 2018-01-05 09:18:19 +08:00
ccli8 d66074fecc [NUC472/M487] Coordinate crypto init among AES/DES/SHA/PRNG
Add counter to track crypto init among crypto sub-modules. It includes:
1. Enable crypto clock
2. Enable crypto interrupt

As counter gets zero, crypto clock is disabled to save power.
2018-01-05 09:18:18 +08:00
ccli8 b0eededdaf [NUC472/M487] Fix DES alter. DMA buffer could locate at unsupported region 2018-01-05 09:18:18 +08:00
ccli8 f85875c7b6 [NUC472/M487] Fix AES alter. DMA buffer could locate at unsupported region 2018-01-05 09:18:18 +08:00
ccli8 70e9a90957 [NUC472/M487] Refine AES alter. input/output data endianness 2018-01-05 09:18:18 +08:00
ccli8 a1e202518f [NUC472/M487] Fix AES alter. DMA buffer check 2018-01-05 09:18:18 +08:00
ccli8 20aa516e79 [NUC472/M487] Refine config check code 2018-01-05 09:18:17 +08:00
ccli8 126aa565c7 [NUC472/M487] Remove redundant S/W DES code
This S/W DES code was to test DES H/W port before.
2018-01-05 09:18:17 +08:00
ccli8 2e7f07e264 [NUC472/M487] Refine DES alter. code 2018-01-05 09:18:17 +08:00
ccli8 b2b67af189 [NUC472/M487] Add comment for DES alter. context 2018-01-05 09:18:17 +08:00
ccli8 ed57432c95 [NUC472/M487] Add comment for AES alter. context 2018-01-05 09:18:17 +08:00
ccli8 9e5837fd77 [NUC472/M487] Refine AES alter. code with IV endianness 2018-01-05 09:18:16 +08:00
ccli8 087186aba7 [NUC472/M487] Rework AES alter. CFB128
1. Fix bug on non-block aligned data size
2. More concise
2018-01-05 09:18:16 +08:00
ccli8 93f6ef996f [NUC472/M487] Refine AES alter. DMA buffer code 2018-01-05 09:18:16 +08:00
ccli8 f24ca8c857 [NUC472/M487] Refine AES alter. code 2018-01-05 09:18:16 +08:00
ccli8 82bd285e51 [NUC472/M487] Support multiple contexts in AES alter. with context save & restore 2018-01-05 09:18:15 +08:00
ccli8 0d25a9c421 [NUC472/M487] Fix AES DMA buffer cannot locate at ROM region 2018-01-05 09:18:15 +08:00
ccli8 2dcc1e9e27 [NUC472/M487] Remove AES alter. dead code 2018-01-05 09:18:15 +08:00
ccli8 5665247d4a [NUC472/M487] Fix AES alternative function not thread-safe 2018-01-05 09:18:14 +08:00
ccli8 315b684bd9 [NUC472] Refine coding style 2018-01-05 09:18:14 +08:00
ccli8 0c5b860409 [M487] Refine coding style 2018-01-05 09:18:14 +08:00
ccli8 19e9dbf799 [NUC472] Fix DES alternative function not thread-safe 2018-01-05 09:18:13 +08:00
ccli8 61d9e69be4 [NUC472] Remove unnecessary MBEDTLS_CONFIG_FILE check from AES/DES/SHA alternative
1. aes.h/des.h/sha1.h/sha256.h/sha512.h includes config.h before aes_alt.h/des_alt.h/sha1_alt.h/sha256_alt.h/sha512_alt.h.
2. aes_alt.h/des_alt.h/sha1_alt.h/sha256_alt.h/sha512_alt.h should not be included in any other location.
3. Just include aes.h/des.h/sha1.h/sha256.h/sha512.h in aes_alt.c/des_alt.c/sha1_alt.c/sha256_alt.c/sha512_alt.c.
2018-01-05 09:18:13 +08:00
ccli8 6b0213c13d [NUC472] Remove other unnecessary AES alternative macro definitions
As MBEDTLS_AES_ALT is defined, alternative implementations for all AES functions should be defined.
2018-01-05 09:18:13 +08:00
ccli8 925eee0688 [NUC472] Remove debug code in AES alternative 2018-01-05 09:18:13 +08:00
ccli8 530b8dfdb9 [M487] Fix DES alternative function not thread-safe 2018-01-05 09:18:13 +08:00
ccli8 436ecdbd60 [M487] Remove unnecessary MBEDTLS_CONFIG_FILE check from AES/DES/SHA alternative
1. aes.h/des.h/sha1.h/sha256.h/sha512.h includes config.h before aes_alt.h/des_alt.h/sha1_alt.h/sha256_alt.h/sha512_alt.h.
2. aes_alt.h/des_alt.h/sha1_alt.h/sha256_alt.h/sha512_alt.h should not be included in any other location.
3. Just include aes.h/des.h/sha1.h/sha256.h/sha512.h in aes_alt.c/des_alt.c/sha1_alt.c/sha256_alt.c/sha512_alt.c.
2018-01-05 09:18:12 +08:00
ccli8 8f7df9ab41 [M487] Remove other unnecessary AES alternative macro definitions
As MBEDTLS_AES_ALT is defined, alternative implementations for all AES functions should be defined.
2018-01-05 09:18:12 +08:00
ccli8 fbf7d40778 [M487] Remove debug code in AES alternative 2018-01-05 09:18:12 +08:00
Jimmy Brisson af9e07357a
Merge pull request #5740 from ashok-rao/master
Adding MTB ublox ODIN W2 as a new target.
2018-01-04 10:05:02 -06:00
Christopher Haster 5e7c0976fa littlefs: Fixed issue with immediate exhaustion and small unaligned storage
This was a small hole in the logic that handles initializing the
lookahead buffer. To imitate exhaustion (so the block allocator
will trigger a scan), the lookahead buffer is rewound a full
lookahead and set up to look like it is exhausted. However,
unlike normal allocation, this rewind was not kept aligned to
a multiple of the scan size, which is limited by both the
lookahead buffer and the total storage size.

This bug went unnoticed for so long because it only causes
problems when the block device is both:
1. Not aligned to the lookahead buffer (not a power of 2)
2. Smaller than the lookahead buffer

While this seems like a strange corner case for a block device,
this turned out to be very common for internal flash, especially
when a handleful of blocks are reserved for code.
2018-01-04 09:49:13 -06:00
Christopher Haster ffc857ddc9 littlefs: Fixed positive seek bounds checking
This bug was a result of an annoying corner case around intermingling
signed and unsigned offsets. The boundary check that prevents seeking
a file to a position before the file was preventing valid seeks with
positive offsets.

This corner case is a bit more complicated than it looks because the
offset is signed, while the size of the file is unsigned. Simply
casting both to signed or unsigned offsets won't handle large files.
2018-01-03 18:07:17 -06:00
Christopher Haster 9dd3060d60 Added littlefs statvfs implementation 2018-01-03 12:54:28 -06:00
Christopher Haster f1a9815876 Moved squiggly bracket placement per mbed style 2018-01-03 12:30:50 -06:00
gorazd f6283f5b03 ff_lpc546xx: add enet
fsl_phy.c/.h move to ../drivers to reuse it
lwip: add hardware_init.c
2018-01-01 15:55:24 +01:00
Deepika 7a90be0ce1 Added statvfs API to get storage statistics
The API is as per posix standard, but does not provide stats for file/directory.
Stats buffer (block size, total block count, free block count) is filled for
entire mounted filesystem.
2017-12-29 16:42:31 -06:00
Adam Heinrich da81229186 NUCLEO_F413ZH: Add support for the NUCLEO-F413ZH board
Merged from the existing TARGET_DISCO_F413ZH code (which has the same MCU)
and TARGET_NUCLEO_F412ZG code (which has the same Nucleo-144 board and
pinout).
2017-12-29 15:30:10 +01:00
Anna Bridge a4d1dee25e
Merge pull request #5617 from bcostm/usbhost_clean-up
STM32: USBHost clean-up
2017-12-29 10:48:03 +00:00
Cruz Monrreal II 5a19f6dcf5
Merge pull request #5684 from juhaylinen/lwip-socket-fix
lwip: fix socket behaviour
2017-12-28 20:40:14 +00:00
Cruz Monrreal II 6d042d4ad4
Merge pull request #5736 from SeppoTakalo/ONME-3199
Allow 6LoWPAN applications to leave out channel specification.
2017-12-28 17:51:04 +00:00
Ashok Rao c849db2dab Adding license info 2017-12-22 13:54:22 +00:00
Martin Kojtal 9cce4d2b06
Merge pull request #5745 from kjbracey-arm/k64f_init_order
K64F Ethernet: avoid using NULL thread during init
2017-12-22 13:26:26 +00:00
Juha Ylinen 32e64e7171 Fix build for IPv4+IPv6 config 2017-12-22 13:22:00 +02:00
Juha Ylinen 52353d2ede Add function to check if address is local
Update the code to check all addresses for all interfaces. Move
the code from mbed_lwip_socket_bind() to a new function called
mbed_lwip_is_local_addr()
2017-12-22 13:21:59 +02:00
Juha Ylinen 6d3e417eaa lwip: fix socket behaviour
Return NSAPI_ERROR_PARAMETER when:
Binding to a non-local address
Socket listen() is called without calling bind() first
Socket accept() is called without calling listen() first
2017-12-22 13:21:59 +02:00
Vincent Coubard 70e5a14a4d BLE: Generic Gap - fix address management. 2017-12-21 17:39:25 +00:00
Vincent Coubard 65f74bf8ac BLE: Address GattClient comments
* invalid namespace name documentation
* vocabulary
* typo
* Add constants to improve readability
* Fix abort usages
2017-12-21 16:51:10 +00:00
Ashok Rao 9556736411 Add new line to EOF 2017-12-21 16:14:00 +00:00
Kevin Bracey 9daf450eb3 K64F Ethernet: avoid using NULL thread during init
The K64F Ethernet driver installs an interrupt handler that sets thread
flags, and this could be called before the thread was initialised, so it
would use a NULL thread ID.

This triggers an RTX error-checking trap in debug builds, and could also
lead to other problems with received packets not being processed.

Adjusted so the RX interrupt handler does nothing if the thread isn't
initialised yet, and manually trigger a RX event flag after initialising
the thread in case any interrupts were ignored.

An alternative would have been to implement eth_arch_enable_interrupts,
but this mechanism is not present in the EMAC world - drivers will have
to start returning interrupts in their power up.

Fixes #5680
2017-12-21 11:14:08 +02:00
Ashok Rao dc3c7fc11e Adding MTB ublox ODIN W2 2017-12-20 18:52:04 +00:00
Vincent Coubard 3fdb749a33 BLE: Remove old client implementation. 2017-12-20 16:27:12 +00:00
Vincent Coubard 865bd94fbd BLE: Enable Generic client on Nordic targets. 2017-12-20 16:26:40 +00:00
Vincent Coubard dea488b4f0 BLE: Introduce pal client adaptation layer for nordic targets. 2017-12-20 16:13:06 +00:00
Martin Kojtal 227b0341cb
Merge pull request #5670 from ryankurte/fix/efr32-ack-flag
Nanostack EFR32 flag fix
2017-12-20 14:42:51 +00:00
Seppo Takalo 4f36bb6480 Allow 6LoWPAN applications to leave out channel specification.
When specifying a full channel mask in .lib and setting the channel
to zero, device does proper channel scan.

For Thread, channel must be specified for router.
Sleepy devices don't respect the channel settings but do a full channel
scan at the start.

+ Modified the channel mask print to use hex.
2017-12-20 15:12:58 +02:00
Anna Bridge 4d81eadb25
Merge pull request #5701 from pan-/ble-doxy-fixes
Ble doxy fixes
2017-12-14 19:36:02 +00:00
Mika Leppänen 7f6a6323cd Fixed lwip k64f ethernet driver ipv6 multicast groups
Work around for problem in:
https://github.com/ARMmbed/mbed-os/issues/4372
2017-12-14 11:05:05 +02:00
Vincent Coubard b554fce00f BLE: Fix doxygen warnings. 2017-12-13 18:30:38 +00:00
Vincent Coubard c621a92a6a BLE: Put GapEvent into INVALID doxygen sections. 2017-12-13 16:15:21 +00:00
Vincent Coubard 82f669b61f BLE: Fix doxygen warnings.
Replace @important tag by @attention.
2017-12-13 16:14:16 +00:00
Martin Kojtal b4dc32521a
Merge pull request #5688 from artokin/mesh-fix-for-mbed-os-5.7-oob
Mesh fix for mbed os 5.7 oob
2017-12-13 09:20:47 +00:00
Martin Kojtal 5c01c3e59c
Merge pull request #5633 from paul-szczepanek-arm/master
BLE: added function converting error codes into strings
2017-12-12 17:42:10 +00:00
Martin Kojtal 484b4a29d1
Merge pull request #5311 from pan-/ble-generic-gap
BLE: Add generic GAP implementation.
2017-12-12 17:38:06 +00:00
Martin Kojtal ef44e4b4fb
Merge pull request #5469 from jeromecoutant/PR_UNITY
Unity framework : add float support in error print
2017-12-12 17:33:01 +00:00
Martin Kojtal 02beec7ee3
Merge pull request #5567 from bcostm/dev_usbdevice_disco-f413zh
STM32: Add USB Device on DISCO_F413ZH
2017-12-12 17:32:03 +00:00
Arto Kinnunen e78db9edd6 Update Thread PSKd default value
Thread PSKd can contain only uppercase characters.
2017-12-12 10:45:48 +02:00
Arto Kinnunen efc7f60799 Merge commit '6c0b324e3a5a9a5c22dc4c3a66b6c892b9ed1644' into coap-service-fix-mbedos57oob
* commit '6c0b324e3a5a9a5c22dc4c3a66b6c892b9ed1644':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from 29bfb78..d0a2597
2017-12-12 10:41:08 +02:00
Ryan Kurte 136ac17947 Nanostack flag fix 2017-12-07 14:23:35 +13:00
Abdelhak Bougouffa 4bba4e59fc Add checking for MAX_HUB_NB in a part of code that depend on MAX_HUB_NB 2017-12-02 17:09:46 +01:00
Abdelhak Bougouffa fd06eb2534 Replace the old deprecated callbacks 2017-12-02 17:08:43 +01:00
paul-szczepanek-arm 4ac75bd7b2 added function converting error codes into strings 2017-12-01 15:25:21 +00:00
Steven Cooreman 5dd46136ad Remove usage from USB driver as well 2017-12-01 12:13:06 +01:00
Martin Kojtal 2e1c2a1cdf
Merge pull request #5538 from geky/littlefs-staging
Integrate littlefs into mbed OS
2017-12-01 08:15:26 +00:00
Martin Kojtal 41591eb83b
Merge pull request #5602 from artokin/nanostack_release_v704
Nanostack release v704
2017-11-30 18:26:45 +00:00
Martin Kojtal 9f8ac6523c
Merge pull request #5300 from pan-/ble-pal-event-queue
Ble pal event queue
2017-11-30 18:16:45 +00:00
Martin Kojtal 8a39773e89
Merge pull request #5490 from deepikabhavnani/fat_upgrade
Upgrade ChanFs to R0.13a
2017-11-30 18:14:42 +00:00
Martin Kojtal 118c1bb2b4
Merge pull request #5579 from SiliconLabs/feature/rail-2.1
Upgrade Silicon Labs radio driver to v2.1.1
2017-11-30 18:10:46 +00:00
Martin Kojtal 221b8a84b1
Merge pull request #5580 from bcostm/dev_usb_speed_disco-f746ng
DISCO_F746NG: add usp_speed configuration
2017-11-30 18:09:47 +00:00
Martin Kojtal 2b84a1742f
Merge pull request #5584 from SiliconLabs/feature/emlib-5.3.3
Upgrade to Silicon Labs HAL
2017-11-30 18:09:04 +00:00
Martin Kojtal 969f8af386
Merge pull request #5589 from pan-/ble-nordic-set-description-handle
Nordic: Set handle of user description descriptors.
2017-11-30 18:07:48 +00:00
Martin Kojtal 1498a807c7
Merge pull request #5592 from pan-/ble-nordic-fix-gatt-server-write
BLE: Fix GattServer::write on Nordic targets.
2017-11-30 18:05:27 +00:00
Martin Kojtal 0ef3ca7f19
Merge pull request #5593 from pan-/ble-fix-equality-comparison
BLE: Fix greater than or equal to comparision in GattCharacteristic.
2017-11-30 18:04:58 +00:00
Christopher Haster c6130306e0 littlefs: Removed links to previous repository locations 2017-11-30 11:46:00 -06:00
bcostm c621c688c4 STM32 USBHOST: Remove DISCO_F429ZI
Impossible to make USBHost working on this board.
Remove it for now until a fix is found.
2017-11-30 13:59:43 +01:00
bcostm fe507af862 STM32 USBHOST: Corrections for DISCO_F746NG 2017-11-30 13:52:10 +01:00
Amanda Butler 634fcf0cc4 Copy edit littlefs
ExhaustibleBlockDevice.h
- Fix typos for consistent spelling.
ObservingBlockDevice.h
- Fix typos for consistent spelling.
ReadOnlyBlockDevice.h
- Fix typos for consistent spelling.
README.md
- Fix typos, mostly for branding.
DESIGN.md
- Make minor changes for consistent spelling and precise language.
SPEC.md
- Make minor changes for consistent spelling and precise language.
README.md
- Make minor changes for consistent spelling and precise language.
2017-11-29 16:35:06 -06:00
Arto Kinnunen 3252fa0971 Remove mbed-mesh-example and application 2017-11-29 21:37:10 +02:00
Arto Kinnunen 32abfcfe77 Merge commit '041b6fa73681061072f970e9cf11ff4d422fa04b' into nanostack_release_v704
* commit '041b6fa73681061072f970e9cf11ff4d422fa04b':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/' changes from 0697d9a..c9bf20f
2017-11-29 21:34:19 +02:00
bcostm 22a4299368 STM32 USBHOST: Corrections for DISCO_F429ZI 2017-11-29 18:54:04 +01:00
bcostm 18a6b96242 STM32 USBHOST: Add support of DISCO_F469NI and DISCO_F769NI 2017-11-29 18:54:04 +01:00
bcostm 8416afaeb1 STM32 USBHOST: Add support of DISCO_F413ZH 2017-11-29 18:54:04 +01:00
bcostm 755865d3fc STM32 USBHost: Improvements in USBHALHost_STM.h 2017-11-29 18:54:04 +01:00
bcostm 377db59371 STM32 USBHost: Remove USBHALHost_STM_TARGET.h files
These files are replaced by the USBHALHost_STM.h file common to all boards.
2017-11-29 18:54:04 +01:00
bcostm ef46d08589 STM32 USBHost: rename files
The USBHALHost_STM_144_64pins.h has been renamed in USBHALHost_STM.h

All the configuration is done in this file now for Nucleo and Disco boards
2017-11-29 18:54:03 +01:00
Arto Kinnunen 0413253181 Merge commit 'f900accac5b4efc426e0c2889e78ed9cd8de9b68' into nanostack_release_v704
* commit 'f900accac5b4efc426e0c2889e78ed9cd8de9b68':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from 471121d..29bfb78
2017-11-29 09:41:27 +02:00
Mahadevan Mahesh f2d2ed44cd LPC546XX: Add ENET support
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-11-28 16:18:36 +00:00
Arto Kinnunen ac4fae8618 Merge commit 'f5265c3d2083333276909cf7b16c89657aa7d58a'
* commit 'f5265c3d2083333276909cf7b16c89657aa7d58a':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/coap-service/' changes from b1c9efb..471121d
2017-11-28 13:50:00 +02:00
Arto Kinnunen fc6aeb95ff Merge commit '6887e495f0cb0b3009e4da7c0282c1542bbb2608'
* commit '6887e495f0cb0b3009e4da7c0282c1542bbb2608':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/' changes from 0a5ef1c..0697d9a
2017-11-28 13:48:31 +02:00
Arto Kinnunen 97cf8869da Add apache license to nanostack-interface 2017-11-28 11:52:43 +02:00
Arto Kinnunen 0c041b95f1 Remove obsolete clone_nanostack script 2017-11-28 09:45:09 +02:00
Christopher Haster 47684d89a5 Added test config for simulated block devices
Not all devices have enough heap to fit a simulated heap block device,
however using a simulated heap block device is preferred if available
(reduced flash wear, faster testing).

Added MBED_TEST_SIM_BLOCKDEVICE for tests that only need a simulated
block device (wear_leveling + resilience), and added support for targets
that are known to have enough heap.
2017-11-27 19:48:56 -06:00
Christopher Haster b52575bc65 littlefs: Added checks for __CLZ instruction in IAR 2017-11-27 19:48:56 -06:00
Vincent Coubard 6c015b98c9 BLE: Fix greater than or equal to comparision in GattCharacteristic. 2017-11-27 19:08:33 +00:00
Vincent Coubard 6f19dea656 BLE: Fix GattServer::write on Nordic targets.
GattServer::write on Nordic's targets use sd_ble_gatts_hvx to send an
handle value Notification or Indication; This function can fail if the
connection handle is invalid or if Updates are not enabled for this
connection.

This patch workaround those limitations.
2017-11-27 18:56:51 +00:00
Jimmy Brisson 20eeaf5c30
Merge pull request #5511 from artokin/nanostack_oss_release
Nanostack OSS release for mbed-os-5.7
2017-11-27 10:36:44 -06:00
Jimmy Brisson b9c3003419
Merge pull request #5466 from kjbracey-arm/write_all
Make POSIX-like writes write everything when blocking
2017-11-27 10:36:28 -06:00
Vincent Coubard a665f3e06d Nordic: Set handle of user description descriptors. 2017-11-27 14:26:05 +00:00
Steven Cooreman 2becfbe2e4 Convert USB library from em_int to em_core 2017-11-25 13:03:40 +01:00
bcostm b1073c165f DISCO_F746NG: add usp_speed config 2017-11-24 16:52:59 +01:00
Steven Cooreman 21d0920068 Use mbed_sleep API instead of Silicon Labs specific sleepmode API 2017-11-24 15:36:44 +01:00
Steven Cooreman a2514fdef3 Clear TX FIFO on every transmit
Need to avoid a TX packet error from messing up the TX FIFO. Since this API will return busy if a packet is in transmission anyways, this is acceptable.
2017-11-24 14:49:53 +01:00
Steven Cooreman 812e47ca9c Add sleep mode blocking to avoid going into EM2 during RTOS idle handler 2017-11-24 14:03:10 +01:00
Steven Cooreman 76fd28c825 Upgrade RAIL to v2.1.1 2017-11-24 12:57:43 +01:00
jeromecoutant da379757f9 Unity framework : add float support in error print 2017-11-23 15:22:58 +01:00
bcostm ada482a4c3 STM32: Add USB Device on DISCO_F413ZH 2017-11-23 11:11:58 +01:00
Christopher Haster 2cf4715cb6 littlefs: Increased test timeout to 4 minutes
Unfortunately there are several issues colluding to force the timeout
this high.

1. The tests push littlefs to the limits of how many errors it can
handle before failing. As a side effect this causes a massive amount
of debug/warn/error logging about the situation.

2. The logging can't be turned off for specific tests. Note: This might
change with the introduction of test-configs.

3. Logging is fixed to a baud rate of 9600. Previous testing was carried
out with a baud rate of 115200, which is the reason for the original
timeout.
2017-11-22 17:19:16 -06:00
Christopher Haster 4adf75c9aa littlefs: Moved test block devices into general block devices 2017-11-22 16:02:54 -06:00
Christopher Haster 9bc4ea6504 littlefs: Removed mbed namespace leaks 2017-11-22 16:02:54 -06:00
Christopher Haster 314995f841 Add 'features/filesystem/littlefs/' from commit 'd02b3122f006aa201bca4efc699bae40971e5a00'
git-subtree-dir: features/filesystem/littlefs
git-subtree-mainline: b025ea16d6
git-subtree-split: d02b3122f0
2017-11-22 16:02:21 -06:00
Jimmy Brisson 1ea4e4c446
Merge pull request #5549 from pan-/ble-gatt-server-doc-update
Ble gatt server doc update
2017-11-22 10:21:11 -06:00
Jimmy Brisson 5e7851c9c5
Merge pull request #5521 from bcostm/dev_usbdevice_disco-f429zi
STM32: Add USB Device on DISCO_F429ZI
2017-11-22 10:17:15 -06:00
Jimmy Brisson 23408e40d1
Merge pull request #5299 from pan-/ble-generic-event-filter
Ble: generic event filter
2017-11-22 10:14:13 -06:00
Arto Kinnunen 02290f9dd7 Merge commit '03d1c4331350e6be4455b5234101075268431f11' into nanostack-release-candidate
* commit '03d1c4331350e6be4455b5234101075268431f11':
  Squashed 'features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack/' changes from 8f75e39..0a5ef1c
2017-11-22 11:22:16 +02:00
Amanda Butler 8e7d74c91a
Update GattService.h
Fix minor typos.
2017-11-21 16:08:30 -06:00
Amanda Butler 1da844bdf9
Update GattServer.h
Copy edit, mostly for active voice and because American English treats collective nouns as singular.
2017-11-21 16:06:12 -06:00
Amanda Butler 70041c1fdc
Update GattCharacteristic.h
Make minor copy edits, mostly for American English.
2017-11-21 15:41:06 -06:00
Amanda Butler 036ea46c8f
Update GattAttribute.h
Make minor copy edits for precise language and active voice.
2017-11-21 15:03:03 -06:00
Vincent Coubard d153af332c BLE: Update GattServer documentation. 2017-11-21 18:30:08 +00:00
Kevin Bracey 67b97d39c4 Make TCPSocket send all data when blocking
Previously, send() was somewhat soft - it only ever made one send
call to the underlying stack, so it would typically take as much data
as would fit in the buffer, and only block if it was unable to write
anything.

This is not the intent of a POSIX socket/filehandle write. It should try
to send everything if blocking, and only send less if interrupted by a
signal:

 - If the O_NONBLOCK flag is clear, write() shall block the calling
   thread until the data can be accepted.

 - If the O_NONBLOCK flag is set, write() shall not block the thread.
   If some data can be written without blocking the thread, write()
   shall write what it can and return the number of bytes written.
   Otherwise, it shall return -1 and set errno to [EAGAIN].

This "send all" behaviour is of slightly limited usefulness in POSIX, as
you still usually have to worry about the interruption possibility:

  - If write() is interrupted by a signal before it writes any data, it
    shall return -1 with errno set to [EINTR].

  - If write() is interrupted by a signal after it successfully writes
    some data, it shall return the number of bytes written.

But as mbed OS does not have the possibility of signal interruption, if we
strengthen send to write everything, we can make applications' lives
easier - they can just do "send(large amount)" confident that it will
all go in one call (if no errors).

So, rework to make multiple sends to the underlying stack, blocking as
necessary, until all data is written.

This change does not apply to recv(), which is correct in only blocking until
some data is available:

 - If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].

 - If O_NONBLOCK is clear, read() shall block the calling thread until some
   data becomes available.

 - The use of the O_NONBLOCK flag has no effect if there is some data
   available.
2017-11-21 09:51:36 +02:00
Deepika a2a7c28191 Upgrade ChanFs to R0.13a 2017-11-20 16:02:39 -06:00