Commit Graph

8443 Commits (refactor_hal_greentea_cmake)

Author SHA1 Message Date
Martin Kojtal 887bcf7f93
Merge pull request #15030 from OpenNuvoton/nuvoton_m2354_tfm_missing_lcdcp
M2354: Fix LCDCP missing in TF-M CLK pass list
2021-09-02 12:59:57 +01:00
Chun-Chieh Li 6447b3d8f3 M2354: Fix LCDCP missing in TF-M CLK pass list
Besides LCD_MODULE, add LCDCP_MODULE into TF-M pass list for below CLK driver in NSPE:

-   CLK_SetModuleClock_S
-   CLK_EnableModuleClock_S
-   CLK_DisableModuleClock_S
-   CLK_GetModuleClockSource_S
2021-09-02 09:17:18 +08:00
Konstantin Kochin 7bc773badd Improve STM32 SPI asynchronous API stability
`HAL_SPI_Receive_IT` HAL function causes dummy reads in 3-wire mode,
that causes data corruption in RX FIFO/register. It isn't possible
to fix it without signification refactoring, but we may prevent data
corruption with the following fixes:

- RX buffer/register cleanup after asynchronous transfer in 3-wire mode
- Explicit RX buffer/register cleanup after SPI initialization
  (for cases if we re-create SPI object).
2021-09-01 21:12:48 +03:00
Konstantin Kochin c60f0cc11e Fix STM32 spi_abort_asynch function
- add RX cleanup after SPI re-initialization,
  as it isn't implemented in the `HAL_SPI_Init`
- cancel SPI enabling for 3-wire mode
2021-09-01 21:12:48 +03:00
Konstantin Kochin f1c4a7fe52 Fix STM32 SPI 3-wire (synchronous API)
All STM32 families except STM32H7 has the following 3-wire SPI peculiarity in master receive mode:
SPI continuously generates clock signal till it's disabled by a software. It causes that a software
must disable SPI in time. Otherwise, "dummy" reads will be generated.

Current STM32 synchronous SPI 3-wire implementation relies on HAL library functions HAL_SPI_Receive/HAL_SPI_Transmit.
It performs some SPI state checks to detect errors, but unfortunately it isn't fast enough to disable SPI in time.
Additionally, a multithreading environment or interrupt events may cause extra delays.

This commit contains the custom transmit/receive function for SPI 3-wire mode. It uses critical sections to
prevents accidental interrupt event delays, disables SPI after each frame receiving and disables SPI during
frame generation. It adds some delay between SPI frames (~700 ns), but gives reliable 3-wire SPI communications.
2021-09-01 21:12:48 +03:00
Konstantin Kochin 179bba9189 Move common STM32 SPI operations to separate functions
- move a code that waits readable SPI state from `spi_master_write`
  function to inline functions `msp_writable` and `msp_wait_writable`
- move a code that waits writeable SPI state from `spi_master_write`
  function to inline functions `msp_readable` and `msp_wait_readable`
- move a code that writes data to SPI from `spi_master_write`
  function to inline function `msp_write_data`
- move a code that reads data from SPI from `spi_master_write`
  function to inline function `msp_read_data`
2021-09-01 21:12:48 +03:00
Lukas Karel e4f0281dd8 add RTC from HSE to target STM32F1 2021-09-01 14:42:04 +02:00
Martin Kojtal d2a88f4400
Merge pull request #15024 from OpenNuvoton/nuvoton_m2354_tfm_sdh
M2354: Enhance TF-M SDH stability
2021-08-26 10:22:48 +01:00
Martin Kojtal 43a060fe7c
Merge pull request #14926 from katherrafi/hal_callback_override
Eth: STM32: Overriding HAL callbacks in stm32xx
2021-08-26 09:51:48 +01:00
Chun-Chieh Li 259ee6b17a M2354: Enhance TF-M SDH stability
1.  Lower TF-M SDH clock to avoid premature timeout
2.  Re-initialize TF-M SDH on (timeout) failure
2021-08-26 11:02:13 +08:00
Kather Rafi Ibrahim a9f51e31fd Eth: STM32: Overriding HAL callbacks in stm32xx
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.

Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
2021-08-25 14:30:47 +05:30
cyliangtw f28181c32a M451 CAN API support mask feature 2021-08-24 19:14:27 +08:00
cyliangtw a33dc4e371 M480 CAN API support mask feature 2021-08-24 18:26:49 +08:00
Martin Kojtal 513f581bce
Merge pull request #15012 from felser/MTS_DRAGONFLY_L496VG
Add platform MTS_DRAGONFLY_L496VG
2021-08-24 09:50:58 +01:00
Leon 4b27aef0ae Add platform MTS_DRAGONFLY_L496VG 2021-08-18 12:03:48 -05:00
Martin Kojtal 5d82bd5b85
Merge pull request #14956 from jeromecoutant/PR_SCRIPT_UPDATE
STM32_gen_PeripheralPins script update
2021-08-17 20:29:54 +01:00
Martin Kojtal 4e0e21f897
Merge pull request #15000 from SamuA-AP/fix-can-api-filters
Fix Extended Message Filter count in STM CAN API
2021-08-17 11:14:31 +01:00
Martin Kojtal ca5126e2e4
Merge pull request #15003 from dustin-crossman/pr/add_missing_bt_support
Add bluetooth support files to Cypress BSPs.
2021-08-16 09:32:30 +01:00
Jerome Coutant 79d403a0db STM32_gen_PeripheralPins script update
- add CMakeLists.txt
- patch for STM32U5 boards
2021-08-16 10:28:21 +02:00
Martin Kojtal 9bcc48678a
Merge pull request #14976 from world-direct/feature/target_stm32f1
Add more uarts for STM32F103xG
2021-08-13 13:08:02 +01:00
Samu Ampio cbc0ee60b0
Fix Extended Message Filter count in STM CAN API
As per STM32H7-series reference manuals:
"Up to 64 filter elements can be configured for 29-bit extended IDs."
This commit fixes a bug which prevented receiving CAN-messages
with extended IDs.
2021-08-13 12:43:36 +03:00
Dustin Crossman 1aa67dd235 Add bluetooth support files to Cypress BSPs. 2021-08-12 10:06:40 -07:00
Martin Kojtal 4dd08c40f5
Merge pull request #14990 from ikmdani/stm32l1_usb_enable_pullups
Driver: USB: STM32L1: Managing internal pullups for usb enumeration
2021-08-12 15:54:40 +01:00
Jaeden Amero 4125fd0786
Merge pull request #14972 from OpenNuvoton/nuvoton_m2354_tfm_psa_fwu
M2354: Support PSA Firmware Update
2021-08-11 13:57:57 +01:00
Robert Walton a437ed4047 targets: Add "bare-metal" to supported_application_profiles
We weren't setting the "supported_application_profiles" correctly for
some baremetal supported targets. This didn't cause build failures with
mbed-cli 1 as it just seems to ignore this config parameter. In our CMake
build system we have added a hard dependency on the
supported_application_profiles; we fail the build if the profile we're
trying to build isn't in the list.
2021-08-11 10:15:42 +01:00
Robert Walton cfc68a0918 CMake: Use CMAKE_MODULE_PATH to locate nuvoton post build hook
We were previously relying on the global MBED_PATH variable to provide
the root for the include path to the post build hooks. We can't
guarantee that MBED_PATH will be set by any application building us, so
use CMAKE_MODULE_PATH (which we always set) like we do for the other
post-build hooks.
2021-08-11 10:15:42 +01:00
Krishna Mohan Dani 3e83108f1c Driver: USB: STM32L1: Managing internal pullups for usb enumeration
This commit adds internal pullup on DP line for usb enumeration
in nucleo_l152re platform. This platform as such does not have
usb connector (device).

This has been tested with example in https://github.com/ARMmbed/
mbed-os/blob/master/drivers/usb/include/usb/USBMouse.h#L58-L76

and mbed_app.json file

"target_overrides": {
        "*": {
            "platform.stdio-baud-rate": 115200,
            "platform.all-stats-enabled": true,
            "mbed-trace.enable": "0"
        },
        "NUCLEO_L152RE": {
            "target.device_has_add": ["USBDEVICE"]
        }
    }
}

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-08-10 17:49:36 +05:30
Chun-Chieh Li 5114e4c7c2 M2354: Support PSA Firmware Update
1.  Change from single image boot to multiple image boot
2.  SDH is configured to Secure for placing update firmware. It becomes inaccessible to Mbed.
3.  Post-build script supports both multiple image boot and single image boot
4.  Update readme to reflect above change
5.  Increase forced_reset_timeout due to longer booting time for Greentea test
2021-08-05 10:14:33 +08:00
Lukas Karel 727daf910b add more uarts for STM32F103xG 2021-08-04 09:05:59 +02:00
Martin Kojtal 7214fe9c99
Merge pull request #14970 from MubeenHCLite/USBSerial_connect_blocking_resolution
USB connect problem in non blocking mode
2021-08-02 09:52:30 +01:00
Mohammed Mubeen b429aeb5f7 Added PCD Start so that connection is established when a host is
connected in non blocking mode (cinnect_blocking = false)
2021-07-30 10:52:00 +05:30
Martin Kojtal 4822ac56a1 cypress: fix cy_syslib breakpoint undefined
CMSIS 5.8.0 requires for armcc to include compat header prior any other header.
See Known issues for the release.
2021-07-29 14:31:39 +01:00
Martin Kojtal c0187712b1 musca targets: use IsException instead of removed isIrqMode 2021-07-29 14:31:39 +01:00
Martin Kojtal e2ec3cd720
Merge pull request #14831 from jeromecoutant/PR_DISCO_WB_LED
DISCO_WB5MMG: add RGB LED
2021-07-26 13:21:09 +02:00
jeromecoutant 68529322dd DISCO_WB5MMG: add RGB LED 2021-07-23 12:34:49 +02:00
Lingkai Dong 91b8186615 Cypress: Improve `mbed_post_build_psoc6_merge_hex()`
The CMake macro `mbed_post_build_psoc6_merge_hex()` takes the name of
a Cypress target and an optional Cortex-M0 hex image as arguments. The
proper way to define and parse optional arguments of a function or
macro is `cmake_parse_arguments()`, which allows the caller to
indicate what they are passing rather than rely on an argument's
relative position within `${ARGN}` which is not rigorous.

Also, avoid duplicating the common part of the post build command
when the optional argument is passed/not passed.
2021-07-22 17:31:45 +01:00
Lingkai Dong 351680fb18 Rework post-build to support multiple executables
When building greentea tests, each test is an executable with its
own output binary path. This is also the case when a user project
produces multiple executables. But the current implementation of
post-build operations always assumes there's only one executable,
at the root of the build directory.

The post-build command depends on Mbed target, and it always takes
the the executable we build as an input file. To achieve this, we
let each Mbed target (that has a post-build command) define a function

    function(mbed_post_build_function target)

which takes a CMake executable target as an argument from which it can
get its binary path using generator expressions. It generates and adds
to the passed executable target a post-build custom command.

Notes:
* The function name needs to be exact, because CMake only supports
literal function calls - CMake can't dereference a function name from
a variable. To avoid multiple definitions of this function, each Mbed
target needs to guard it with a macro to check if the user is
building this Mbed target.
* `mbed_post_build_function()` is a function, but it is usually
defined by another macro rather than a parent function, because
nesting functions would make many variables inaccessible inside the
innermost `mbed_post_build_function()`.
* There's no more need to force regenerate images. Previously, post-
build commands were custom *targets* which always got to run, so we
force regenerated images on every build to avoid patching an image
that's already been patched once on previous build. Now post-build
commands are custom *commands* of the same executable target, and they
are only run if the executable target itself is rebuilt.
2021-07-22 17:31:22 +01:00
Martin Kojtal 16d3e998fa
Merge pull request #14915 from arduino/i2c_timing_fix
STM32 Fix i2c_compute_timing() API
2021-07-13 16:20:15 +02:00
Martin Kojtal f37b0c485b
Merge pull request #14905 from jeromecoutant/PR_STM32CUSTOM
STM32 : README updates about custom boards
2021-07-13 14:22:01 +02:00
pennam ccf8995858 STM32 Fix i2c_compute_timing() API 2021-07-13 14:07:12 +02:00
Martin Kojtal 0ea3f0cc53
Merge pull request #14787 from dustin-crossman/pr/june-asset-update
Cypress Asset Update
2021-07-13 12:53:26 +02:00
jeromecoutant 2bdd68f0d0 STM32WL README update for custom boards 2021-07-13 12:22:36 +02:00
jeromecoutant 8462a19207 STM32 README update for custom boards 2021-07-13 12:08:46 +02:00
Martin Kojtal abd32c70e4
Merge pull request #14895 from AnishKumarHCL/skip_analog_inn
ADC: STM32H7: Skip Negative input analog channels (INN)
2021-07-13 10:45:31 +02:00
Martin Kojtal 7095dc79fa
Merge pull request #14688 from MubeenHCLite/CAN_rxinterrupt_fix
Solution for mutex problem in CAN read ISR
2021-07-12 17:21:56 +02:00
anish-k ec44991a6f ADC: STM32H7: Skip Negative input analog channels (INN)
Removed INN ADC channels from PeripheralPins.c
2021-07-09 21:15:01 +05:30
anish-k f14ce30ba6 script: STM32: STM32_gen_PeripheralPins.py updated
Removed INN channel ADC
2021-07-09 21:14:24 +05:30
Martin Kojtal 0726db09fb
Merge pull request #14888 from arduino/portenta_ble_support
Portenta: Add BLE support using CYW43XXX generic transport layer
2021-07-09 17:22:55 +02:00
Martin Kojtal cf54d36bfb
Merge pull request #14899 from jeromecoutant/PR_WLE5
STM32WL: correct CMakeLists.txt for STM32WLE5xC
2021-07-09 12:26:42 +02:00
Martin Kojtal 705c61b0c2
Merge pull request #14898 from byq77/master
Fix gcc_arm linker script for stm32f407xg targets
2021-07-09 10:32:33 +02:00