Commit Graph

1062 Commits (master)

Author SHA1 Message Date
Lukas Karel 46e8545b55 reduce spam on info log of cellular sockets 2024-07-11 15:22:48 +02:00
Martin Kojtal 20340d7941
Merge pull request #15477 from davidalo/fix-sms
SMS: Increase timeout for send and get. Fix text SMS parsing when CRLF is contained in the text.
2024-06-08 16:22:54 +01:00
Mathieu Camélique 3746f5af68 change type in ScanParameters getters 2024-05-22 08:52:42 +02:00
Mathieu Camélique 17a03ab8e6 correct scan parameters types 2024-05-16 12:39:40 +02:00
David Alonso de la Torre 9e7e22dd2c Fix AT_CellularSMS::list_messages breaking in text mode when CRLF is contained in SMS payload text
When parsing SMS, it can happen that we receive CRLF in the SMS payload (happened to me when receiving provider texts).
As an example, we can receive:

"""
Hello <CR><LF>
World!
"""

With previous implementation, second consume_to_stop_tag was stopping in <CR><LF> and rest of the code was failing for obvious reasons.
With this commit we consume the full payload as bytes.
2024-05-11 10:42:46 +02:00
Martin Kojtal 7e16b0044e
Merge pull request #15496 from szsam/patch-1
ESP8266: Fix accessing uninitialized variable
2024-05-03 19:07:01 +02:00
Martin Kojtal 95fee2f75a
Merge pull request #15500 from OpenNuvoton/nuvoton_fix_function_undeclare
NUVOTON: Fix undeclared function as error
2024-04-24 19:07:38 +02:00
David Alonso de la Torre d676084600 Increase AT timeout to 10s in AT_CellularSMS::get_sms
When SMS list is big and baudrate is not fast enough, with default timeout we can suffer from timeout error while getting a sms because method is parsing the full list and this takes long.
2024-04-05 16:46:05 +02:00
David Alonso de la Torre 5c49f161fb Increase AT timeout to 10s in AT_CellularSMS::send_sms
For some devices sending can be slow (as an example see SIM800, it can be up to 60s), command is being run properly but default timeout is returning an invalid error.
See https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf
2024-04-05 16:45:59 +02:00
Charles 61522fb297 Allow custom TCXO control parameter
Allow custom TCXO control parameter
2024-04-04 11:43:02 +02:00
Chun-Chieh Li 4712f9d62e NUVOTON: EMAC: Fix undeclared function mbed_error_printf
ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2024-03-15 10:10:52 +08:00
Mingjie Shen c7ea9c1550
ESP8266: Fix accessing uninitialized variable 2024-03-07 20:36:17 -05:00
Charles deb09a3a9c allow to override antenna gain 2023-11-30 14:52:19 +01:00
Charles 9c3c88c96e Sleep Radio in between DC scheduled 2023-11-10 11:51:42 +01:00
Charles 394cbeec6b STM32WL fix set preamble length to 8 2023-10-24 10:23:44 +02:00
Martin Kojtal b3a5d6a473
Merge pull request #15454 from world-direct/feature/cellularevents
make cellular event queue size configurable
2023-09-14 11:23:48 +02:00
Lukas Karel ab46d51253 make cellular event queue size configurable
update unit tests
2023-09-13 15:11:07 +02:00
cyliang tw 5837179e78 connectivity: drivers: Update Nuvoton M467 EMAC DMA_IE ctl
In IRQ Handler, to disable some interrupt type of DMA error.
It could avoid unexpected repeated interrupt.The masked bit of
DMA_IE could be recovered in next EMAC IRQ event.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2023-07-13 16:21:57 +08:00
Jost, Chris 67d845be32 add nullpointer check in LWIP::socket_close 2023-07-05 11:22:22 +02:00
Martin Kojtal 95f3f93c19
Merge pull request #15423 from Jookia/RFC_ipv6fix
LWIP::get_ip_addr: Prefer IPv4 over IPv6 link local addresses
2023-05-30 10:25:28 +01:00
Martin Kojtal 1768ad9e5f
Merge pull request #15406 from IVOES/fix-null-check
Fix null pointer dereferencing
2023-05-22 11:35:15 +01:00
Jookia 06593d3d68 LWIP::get_ip_addr: Prefer IPv4 over IPv6 link local addresses
When IPv6 is prefered it will choose a link local address on a network
that lacks IPv6 over a working IPv4 network, breaking networking.
Change this behaviour to prefer a link local address only as a last
resort.

This also changes LWIP::get_ipv6_addr to not return link local
addresses. Use get_ipv6_link_local_addr instead for this.
2023-05-18 22:09:26 +10:00
Martin Kojtal 70dced2225
Merge pull request #15405 from IVOES/fix-stack-address-escape
Change storage-class of secret_buf to static
2023-05-05 14:34:35 +01:00
Martin Kojtal 0ea5decbb9
Merge pull request #15404 from IVOES/fix-overrunning-write
Fix potentially overrunning write of sprintf
2023-04-26 16:48:49 +01:00
Martin Kojtal 9a82ad670c
Merge pull request #15401 from IVOES/fix-virtual-call-in-constructor
Avoid calling virtual functions from constructors and destructors
2023-04-26 09:58:15 +01:00
Mingjie Shen 378f2f579d Fix null pointer dereferencing
Add null check for return values of functions that are mostly (but not
always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id
check for null, it is likely that the function can return null values in
some cases, and omitting the check could crash the program.
2023-04-20 00:54:47 -04:00
Mingjie Shen 1b77cda621 Change storage-class of secret_buf to static
Storing the address of a local variable (`secret_buf`)
in non-local memory (`prf_ptr->secret`) can cause a
dangling pointer bug if the address is used after the function returns.
2023-04-19 17:07:42 -04:00
Mingjie Shen c958d1d5b9 Fix potentially overrunning write of sprintf
Format string "%d" requires 12 bytes (including the null terminator).
Also, use snprintf instead of sprintf to prevent buffer overflow.
2023-04-19 16:50:00 -04:00
Mingjie Shen 3a466307d2 Define default parameters of functions of derived class the same as the base class
The member function bringup() of class ThreadInterface redefines
parameter stack's default value to IPV6_STACK from the inherited default value
DEFAULT_STACK (in Interface).
The default value will be resolved statically, not by dispatch, so this
can cause confusion.
Similar arguments apply to LoWPANNDInterface and WisunInterface.
2023-04-19 01:35:19 -04:00
Mingjie Shen 4c3928ecf4 Avoid calling virtual functions from constructors and destructors
Virtual functions are resolved statically (not dynamically) in
constructors and destructors for the same class. The call should be made
explicitly static by qualifying it using the scope resolution operator.
2023-04-18 23:18:27 -04:00
Saheer Babu 5c8e60f80b
Merge pull request #15358 from akiroz/fix-stm32-emac-rmii-pins
fix(drivers/emac): [mbed6] Remove incorrect RMII RX ER initialization
2023-02-01 15:13:40 +00:00
akiroz 0431f16107
fix(drivers/emac): Add missing SPDX indetifier to ST driver files 2023-01-26 11:19:59 +08:00
Martin Kojtal a852898ad1
Merge pull request #15370 from YannCharbon/sockopt_interface_id
Fix socket default interface ID only being used partially
2023-01-16 15:44:59 +00:00
akiroz d76d5b87d1
fix(drivers/emac): Remove incorrect RMII RX ER initialization 2023-01-16 16:56:55 +08:00
YannCharbon b8b638dd41 Fix default interface ID only being used partially
If user sets the default interface ID for a socket (e.g. using setsockopt
with SOCKET_INTERFACE_SELECT), the default interface should take over
other interface selection mechanisms as a interface is bound to the socket.
This applies for both IPv6 local and global scopes for unicast messages
but not for multicast messages as these are bound to a multicast interface
using SOCKET_IPV6_MULTICAST_IF socket option.
2023-01-10 18:45:39 +01:00
Saheer Babu 4e28fbfa3c test: Disable failing tests due to echo server
Some tests are failing as echo.mbedcloudtesting.com is not serving TLS
requests anymore.

Signed-off-by: Saheer Babu <saheer.babu@arm.com>
2023-01-06 13:15:24 +00:00
Martin Kojtal 06566fc569
Merge pull request #15366 from YannCharbon/icmp_sockets
Add support of NSAPI_ICMP sockets in Nanostack
2023-01-05 16:40:52 +00:00
YannCharbon d327f3f2d2 Fix mesh connect semaphore not releasing causing blockage 2023-01-03 15:25:10 +01:00
YannCharbon aa7bf3e435 Add support of NSAPI_ICMP sockets in Nanostack 2023-01-03 15:12:26 +01:00
Martin Kojtal 7ab5260e4e
Merge pull request #15343 from daniel-starke/complete-nucleo-h723zg
Add proper support for NUCLEO-H723ZG.
2022-11-16 12:03:27 +01:00
Martin Kojtal 90837c5674
Merge pull request #15337 from OpenNuvoton/nuvoton_m467_iot
Nuvoton: Support new target NUMAKER_IOT_M467
2022-11-02 13:24:01 +00:00
Daniel Starke 53d043d3a2
Add proper support for NUCLEO-H723ZG.
- add board specific EMAC setup to connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7
  - stm32h7_eth_init.c was derived from the NUCLEO-H743ZI2 code whilst comparing to the output of STM32CubeIDE
- complete board specific code in targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H723xG
  - PeripheralPins.c and PinNames.h were created by targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py
  - ST ZIO connector pins in PinNames.h have been adapted from NUCLEO-H743ZI2
  - CONSOLE_TX and CONSOLE_RX have been interchanged in PinNames.h to match the actual board layout
  - startup_stm32h723xx.S was derived from startup_stm32h743xx.S
  - stm32h723xg.ld was completely rewritten to match the actual MCU including:
    - split heap support
    - SRAM2 and SRAM4 support
    - crash dump support
    - proper use of DTCM as stack
  - system_clock.c has been changed to support the maximal main clock speed of 550 MHz
- fix handling of HS in FS mode for the target board in targets/TARGET_STM/USBPhy_STM32.cpp
- add board definition to targets/targets.json and correct linker setup for the chip

Signed-off-by: Daniel Starke <daniel-email@gmx.net>
2022-10-27 21:22:45 +02:00
Chun-Chieh Li 1dd95465f6 M467: Fix mbedtls_ecp_point_cmp() call with null argument
Guard from null argument passed to mbedtls_ecp_point_cmp() in ECC H/W port
2022-09-01 10:02:19 +08:00
Chun-Chieh Li 196d10662e M467: Disable SCAP in RSA H/W
This is to follow designer's resolution.
2022-09-01 10:02:18 +08:00
Chun-Chieh Li 087daeacee M467: Support Crypto ECC H/W in full-module replacement
1.  Replace ecp.c full-module, and other ec modules dependent on ecp.c (ecdh.c/ecdsa.c/ecjpake.c) will improve followingly.
2.  Recover from Crypto ECC H/W failure:
    (1) Enable timed-out wait to escape from ECC H/W trap
    (2) On ECC H/W timeout, stop this ECC H/W operation
    (3) Fall back to S/W implementation on failure
3.  Support Short Weierstrass curve
4.  Support Montgomery curve
    Montgomery curve has the form: B y^2 = x^3 + A x^2 + x
    (1) In S/W impl, A is used as (A + 2) / 4. Figure out its original value for engine.
        2eb06e7620/connectivity/mbedtls/include/mbedtls/ecp.h (L219-L220)
    (2) In S/W impl, B is unused. Actually, B is 1 for Curve25519/Curve448 and needs to configure to engine.
        2eb06e7620/connectivity/mbedtls/include/mbedtls/ecp.h (L221-L222)
    (3) In S/W impl, y-coord is absent, but engine needs it. Deduce it from x-coord following:
        https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html
        https://www.rieselprime.de/ziki/Modular_square_root
    NOTE: Fix Curve448 has wrong order value
          https://github.com/Mbed-TLS/mbedtls/pull/5811
2022-09-01 10:02:18 +08:00
cyliangtw a430d70c0d M467 Support crypto AES-CCM H/W with one-shot & cascade mode 2022-09-01 10:02:18 +08:00
Chun-Chieh Li 88a529180f M467: Support Crypto RSA H/W
1.  Crypto RSA H/W supports 1024/2048/3072/4096 key bits. Fall back to software implementation for other key bits.
2.  For decrypt, if MBEDTLS_RSA_NO_CRT isn't defined, go CRT, or normal.
3.  For decrypt, when blinding (f_rng != NULL), enable SCAP mode.
4.  Recover from Crypto RSA H/W failure:
    (1) Enable timed-out wait to escape from RSA H/W trap
    (2) On RSA H/W timeout, stop this RSA H/W operation
    (3) Fall back to S/W implementation on failure

NOTE: RSA 4096 key bits can fail with default mbedtls configuration MBEDTLS_MPI_MAX_SIZE.
      Enlarge MBEDTLS_MPI_MAX_SIZE to 1024 or larger if this feature is required.
NOTE: Fixed in BSP RSA driver, for non-CRT+SCAP mode, temporary buffer for MADDR6 requires to be key length plus 128 bits.
NOTE: Fixed in BSP RSA driver, DMA buffer must be 4-word aligned, or RSA H/W will trap.
2022-09-01 10:02:18 +08:00
cyliangtw 3fe95b2fb8 Update M467 AES-GCM for H/W gcm in-buffer creteria 2022-09-01 10:02:17 +08:00
cyliangtw 655ec9098c Update M467 AES-GCM to pass AWS-IoT test 2022-09-01 10:02:17 +08:00
cyliangtw 9f01968d64 M467: GCM support one simple mode instead of using composite GHASH & CTR MODE 2022-09-01 10:02:17 +08:00