Commit Graph

310 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 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
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
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
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
akiroz 0431f16107
fix(drivers/emac): Add missing SPDX indetifier to ST driver files 2023-01-26 11:19:59 +08:00
akiroz d76d5b87d1
fix(drivers/emac): Remove incorrect RMII RX ER initialization 2023-01-16 16:56:55 +08: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
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
cyliangtw 9dc7cd2f23 M467 Support crypto GCM H/W 2022-09-01 10:02:17 +08:00
cyliangtw 627a0b4d88 M467 H/W AES self-test pass 2022-09-01 10:02:16 +08:00
Chun-Chieh Li 24b0feb17f M467: Support Crypto SHA/ECC H/W
1.  Prepare crypto common code
2.  Support list
    -   SHA
    -   ECC
    NOTE: AES/RSA are to support in other works
    NOTE: Compared to M487, M467's SHA supports context save & restore (DMA Cascade mode) and so no software fallback is needed.
    NOTE: M467's ECC, following M487, goes partial-module replacement and it can just improve primitives e.g. point addition/doubling by 2X,
          and cannot improve high level point multiplication because MbedTLS doesn’t open it.
          To improve performance best, full-module replacement is needed.
    NOTE: Continuing above, add support for Montgomery curve
2022-09-01 10:02:16 +08:00
Chun-Chieh Li ec2c15533e M467: Fix EMAC compile error with IAR 2022-09-01 10:02:16 +08:00
cyliangtw 679c747ba0 Adjust M460 EMAC RX/TX buffer 2022-09-01 10:02:16 +08:00
cyliangtw 877541d79d Add M460 EMAC driver 2022-09-01 10:02:15 +08:00
cyliangtw 501aa00fa0 Config for M460 EMAC 2022-09-01 10:02:15 +08:00
Jerome Coutant 1bf8667136 STM32WL: fix MBED_CONF_STM32WL_LORA_DRIVER_SLEEP_MODE option 2022-08-18 14:53:58 +02:00
Martin Kojtal b482f2dcec
Merge pull request #15312 from hallard/prep_rak3172sip
STMWL32 preparation for new chip rak3172sip
2022-08-17 13:11:07 +02:00
Charles 42e11ac9bd Allow to use LowPower fix as a parameter
Allow to use TCXO Control Voltage and LowPower fix as a parameter

leave current default value to avoid breaking changes

astyle fix
2022-08-16 13:45:45 +02:00
Chun-Chieh Li 127b5aa023 M487: 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-07-26 09:23:37 +08:00
Chun-Chieh Li b402c97136 M487: Fix ECP P + P operation
Engine doesn't support P + Q when P and Q are the same. Workaround by 2*P
2022-05-24 17:38:02 +08:00
Chun-Chieh Li 3adb735d3e M487: Fix typo with DES H/W port 2022-05-24 16:37:46 +08:00
Rami Elkhatib fdf37c3217 MPS2 CM3DS ethernet words instead of bytes
The functions smsc9220_receive_by_chunks and smsc9220_send_by_chunks are
supposed to implement receiving and sending packets by chunks. However,
the functions SMSC9220_EMAC::low_level_input and SMSC9220_EMAC::link_out,
which call them respectively, already require or assemble the full packet.
Also, smsc9220_receive_by_chunks doesn't implement the "chunks" part.

This commit renames the functions to smsc9220_receive_packet and
smsc9220_send_packet. The functions now do their operations by word
instead of by bytes. The functions SMSC9220_EMAC::low_level_input and
SMSC9220_EMAC::link_out already handle allocation, continuity and word
alignment of the packet buffer.
2022-05-12 18:27:49 -04:00
Rami Elkhatib cbfda0e23b MPS2 CM3DS ethernet fix heap bug
The function SMSC9220_EMAC::low_level_input should create a heap for the
packet equal to the size of the message (most of which are couple hundred
bytes). The current code uses maximum frame size (1522 bytes) for each
packet. This will cause the heap to quickly fill up. In fact, the default
memory size (lwip.mem-size) used for this heap is 1600 bytes. This means
that once you have one other packet allocated (extremely common), the
heap allocation will always fails.

Also, it is recommend to increase the default lwip.mem-size because that
amount is very small especially if you send or receive a few large packets
in the network. This is NOT done in current commit.
2022-05-12 18:23:41 -04:00
Rami Elkhatib 14aa25b8b7 MPS2 CM3DS ethernet fix deprecation warnings
The sleep_for function is updated to use the chrono time arguments since
the regular ones are deprecated.
2022-05-12 18:18:59 -04:00
Chun-Chieh Li 0d2de99778 ESP8266: Fix serial flow control inconsistency on reconnect
The commit will address the test failure of connectivity-netsocket-tests-tests-network-interface.
In the test, serial channel will break with the sequence: ESP8266Interface::connect() > disconnect() > connect()
In the first connect, both board's and ESP8266's serial flow control default to disabled, and then enabled.
In the second connect, board's serial flow control keeps enabled but ESP8266's resets to disabled, causing inconsistency between two ends.

The approach: Explicitly disable board's serial flow control on re-power or reset in (re-)connect
2022-03-07 18:30:36 +08:00
LukaB d503495189 Fix STM32 radio driver when bandwith is 0
A bug was detected when the uint8_t SUBGRF_GetFskBandwidthRegValue( uint32_t bandwidth )
is called and the bandwith argument has a value of 0.

Comparing the code to the STMCubeWL 1.1 we can see that an if statement is missing to
address the condition where bandwith is equal to 0.

Added the if statement to the radio driver to account for this edge case.
2022-02-03 08:24:21 +13:00
Martin Kojtal fe5e648147
Merge pull request #15192 from ATmobica/master
Add option to disable WHD component for Cypress targets
2021-12-15 11:59:33 +00:00
Martin Kojtal ff061e8cf2
Merge pull request #15187 from artokin/nanostack_release_v15_1_0
Nanostack release v15.1.0 to master
2021-12-13 09:46:45 +00:00
ATmobica 78a7859fa8 Add <"WHD" IN_LIST MBED_TARGET_LABELS> condition to Cypress boards and wifi driver cmake files 2021-12-10 13:14:29 +01:00
Martin Kojtal 1c5813b33c
Merge pull request #15181 from hallard/LoRa_sx1276_LowPower_fix
Fix LoRa sx1276 Low Power sleep, now 3uA
2021-12-08 14:55:52 +00:00
Arto Kinnunen d64e8f6878 Merge commit '89eb48fe1a3ba68057029c7e475f1ec78eb95abc' into nanostack_v15_1_0
* commit '89eb48fe1a3ba68057029c7e475f1ec78eb95abc':
  Squashed 'connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/' changes from 61de9be6dc..7a1bfec754
2021-12-08 13:48:16 +02:00
Arto Kinnunen 9daf4300e3 Merge commit '75c79ac616fce0b36ca047e676069e12e1bb30c1' into nanostack_v15_1_0
* commit '75c79ac616fce0b36ca047e676069e12e1bb30c1':
  Squashed 'connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/' changes from 7d12478914..089ca0eed7
2021-12-08 13:47:47 +02:00
Arto Kinnunen a947f4845c Merge commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53' into nanostack_v15_1_0
* commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53':
  Squashed 'connectivity/drivers/802.15.4_RF/atmel-rf-driver/' changes from 834c5357c6..ccba775217
2021-12-08 13:47:18 +02:00
Jerome Coutant fb07b7ac4c STM32WL : add LORA robustness
Improvment to support extensive tests
2021-12-06 17:48:35 +01:00
Charles ccc34b9134 Fix Low Power sleep, now 3uA 2021-11-29 17:16:09 +01:00
Martin Kojtal ae5c9ec70e
Merge pull request #15153 from bakatrouble/master
STM32F722ZE port
2021-11-17 15:22:30 +00:00
bakatrouble e33088583e Allow STM32F7 targets without Ethernet 2021-10-28 19:18:24 +03:00
Ricardo Ardissone ca28a86d1b STM32WB55 HCI driver: version dependent rom size
stm32wb5x_BLE_HCILayer_fw.bin install address increased from 0x080E0000
to 0x080E1000 in version 1.12.0. Assumes any future bump to major or
minor version will maintain the new install address.
See https://github.com/STMicroelectronics/STM32CubeWB/blob/master/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/Release_Notes.html
2021-10-22 18:20:33 -03:00