Commit Graph

1961 Commits (mbed-os-5.13.4)

Author SHA1 Message Date
int_szyk a59ad17d7a Tweak stm_spi_api Coverity issue.
Coverity warining: "memset fill truncated (NO_EFFECT)".
Changed SPI_FILL_WORD to SPI_FILL_CHAR.
2019-08-23 11:41:08 +01:00
Vincent Veron fd70de0c86 STM32H7 : update linker script files to use right location for lwip_ram_heap
Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-08-23 11:37:41 +01:00
Vincent Veron d7b0d236fe Add EMAC support for NUCLEO_H743ZI
This port is based on :
    * CurryGuy ethernet branch :
        https://github.com/CurryGuy/mbed-os/tree/feature-stm32h7-emac
    * STM32 Cube example :
        Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS example

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-08-23 11:37:41 +01:00
int_szyk 9cd2473caa Tweak STM watchdog implementation
Change the calculation method of rl so it is rounded up.
2019-08-23 11:37:41 +01:00
Laurent Meunier 47b63e9b72 __cplusplus guard fixed pwmout_device.h for STM32 families
This bug prevented using this header in cpp code directly.
2019-08-23 11:37:41 +01:00
Seth Itow ec35930848 stm32f413xh: add crash capture support for IAR 2019-08-12 12:54:49 +01:00
Seth Itow 748971d6ce stm32f413xh: add crash capture support for ARM_MICRO 2019-08-12 12:54:48 +01:00
Seth Itow cc5b134cac stm32f413xh: add crash capture support for GCC_ARM 2019-08-12 12:54:47 +01:00
Ireneusz Gaicki 5090d5c190 STM32F7: Do not generate redundant IN tokens
When STM32F746-DISCO board was being used in (unsupported) USBHost mode,
the communication was unreliable. Our investigation revealed that the
problem lied in redundant IN tokens that the host generated even though
it shouldn't. This could lead to endless high-frequency NAKs being
received from device, which caused watchdog reset as USBHost spent all
time in interrupt handlers.

In our application the clocks frequencies are:
  * HCLK = 48 MHz
  * APB1 = 6 MHz
  * APB2 = 12 MHz

We have captured the raw USB High-Speed traffic using OpenVizsla.
Without this change, when USB MSD device connected to the system
responded to IN with NAK, there were excessive IN tokens generated about
667 ns after the NAK. With this commit the IN tokens are generated no
sooner than 10 us after the NAK.

The high frequency of the IN/NAK pairs is not the biggest problem.
The biggest problem is that the USB Host did continue to send the IN token
after DATA and ACK packets were received from device - *without* any request
from upper layer (USB MSD).

The USB MSD devices won't have extra data available on Bulk IN endpoint
after the expected data was received by Host. In such case IN/NAK cycle
time is only houndreds of nanoseconds, the MCU has no time for anything else.

The problem manifested not only on Bulk endpoints, but also during
Control transfers. Example correct scenario (when this fix is applied):
  * SETUP stage
    * SETUP [host -> address 0 endpoint 0]
    * DATA0 [80 06 00 01 00 00 08 00] [CRC16: EB 94]
    * ACK
  * DATA stage
    * IN
    * NAK
    ... the IN/NAK repeated multiple time until device was ready
    * IN
    * DATA1 [12 01 10 02 00 00 00 40] [CRC16: 55 41]
    * ACK
  * STATUS stage
    * OUT
    * DATA1 ZLP
    * ACK

Without this commit, in DATA stage, after the ACK was received, the host
did send extra IN to which device responded with STALL. On bus it was:
  * DATA stage
    ...
    * IN
    * DATA1 [12 01 10 02 00 00 00 40] [CRC16: 55 41]
    * IN
    * STALL
    * IN
    * STALL
  * STATUS stage
    * OUT
    * DATA1 ZLP
    * STALL

In the fault case the next SETUP was sent only after 510 ms, which
indicates timeout in upper layer.

With this commit the next SETUP is sent 120 us after the STATUS stage ACK.
2019-08-12 12:54:47 +01:00
Szymon Szantula 5f4825c5bf __cplusplus guard fixed
This error prevented using this header in cpp code directly.
2019-08-12 12:54:46 +01:00
Yuan Cao 06193b6601 Fixed serial_device IRQ infinite loop bug due to uint8_t overflowing 2019-07-25 15:18:27 +01:00
Tymoteusz Bloch fb6bfb6098 Reverted "K64F, STM32F429: IAR linker scripts dynamic heap fix"
due to side effect with K64F bootloader application jump after three consecutive HW resets.
2019-07-11 12:20:26 +01:00
jeromecoutant dc6cdab128 STM32H7: Reset Reason update 2019-07-11 12:14:28 +01:00
jeromecoutant 485bc1103e STM32H7 watchdog patch 2019-07-11 12:14:18 +01:00
jeromecoutant 390928685c STM32H7: Increase watchdog timeout value 2019-07-11 12:14:06 +01:00
jeromecoutant 6d2a128698 STM32H7 : add LSI 2019-07-11 12:13:55 +01:00
jeromecoutant db89bdf890 STM32 WATCHDOG : increase timeout value 2019-07-11 11:55:07 +01:00
jeromecoutant 43fa151efd STM32 WATCHDOG : use ST HAL in order to make code commun for all STM32 2019-07-11 11:55:07 +01:00
jeromecoutant 3a958c7f86 STM32 WATCHDOG : update STM32L0 HAL_IWDG_Init to a newest version 2019-07-11 11:55:07 +01:00
jeromecoutant 32a314d465 STM32 WATCHDOG : compilation issue with typed define 2019-07-11 11:55:07 +01:00
jeromecoutant 0071502e0b STM32 Watchdog : move API file to STM family level 2019-07-11 11:55:07 +01:00
Filip Jagodzinski ba1a79d569 STM: HAL: Reset_reason: Correct return values 2019-07-11 11:55:06 +01:00
Filip Jagodzinski 749bc03c9a STM32F4: watchdog HAL: Fix issues found with tests
Fix WATCHDOG_STATUS_INVALID_ARGUMENT for timeout values from 1 ms to
407 ms (fix inability to set prescaler bits to zero).
Fix timeout <-> IWDG registers conversions.
Fix read & write access to IWDG_PR and IWDG_RLR registers.
Fix LSI RC frequency setting.
Limit MAX_TIMEOUT_MS to UINT32_MAX.
2019-07-11 11:55:05 +01:00
Steven Cartmell be157898c1 Rename watchdog.c -> watchdog_api.c to prevent name collision with Platform API 2019-07-11 11:55:04 +01:00
Steven Cartmell a56da4f3fd Move watchdog parameter validation into the driver layer 2019-07-11 11:55:04 +01:00
Steven Cartmell c01db25544 Add missing license headers 2019-07-11 11:55:04 +01:00
Steven Cartmell 0128edd996 Remove window and sleep mode options for watchdog API 2019-07-11 11:55:04 +01:00
Steven Cartmell 0a140b97d8 Add Watchdog driver API 2019-07-11 11:55:03 +01:00
Steven Cartmell c67016eca6 Add independent watchdog reference implementation for STM32 2019-07-11 11:55:03 +01:00
Steven Cartmell c16c5184d8 Add function to fetch platform specific reset reason register values 2019-07-11 11:55:03 +01:00
Steven Cartmell 337676716c Add reset reason reference implementation STM32 2019-07-11 11:55:03 +01:00
jeromecoutant 854ebf4e7a STM32 LPUART update 2019-07-11 11:41:30 +01:00
itziar 1348db5af7 add new target IM880B 2019-07-11 11:41:30 +01:00
Tymoteusz Bloch f7fced62a6 IAR icf linker scripts modified to use dynamic heap allocation of all available memory. 2019-07-11 11:40:54 +01:00
Laurent Meunier 06e23fbde3 STM32: lp_ticker optim: initialize handle once only 2019-07-11 11:40:54 +01:00
Laurent Meunier 95fc693c9d STM32: lp_ticker optim: remove irq_handler variable 2019-07-11 11:40:54 +01:00
Laurent Meunier c279c97404 Update comments and fix typo 2019-07-11 11:40:54 +01:00
Laurent Meunier 16f2f0b1d3 Update warning now that C++ wrapper is not needed anymore
Now we'd rather not use this wrapper and use instead the low level
wrapper implemented in this driver.
2019-07-11 11:40:54 +01:00
Laurent Meunier deab60901c Manage lp_ticker delay at low level
LP TICKER mbed-os wrapper needs to be disabled as it introduces too much latencies.

LP TICKER wrapper has been disabled and we need to managed the HW constraints at low level:
- main HW constraint is that once the comparator has been programmed once,
driver cannot program it again before CMPOK HW flag is set, which takes about 3 30us cycles.

To make it even more complex, the driver also needs to cope with "LP ticker workaround"

See commit:

LP ticker workaround

    There is an errata in LPTIM specification that explains that CMP Flag
    condition is not an exact match (COUNTER = MATCH) but rather a
    comparison (COUNTER >= MATCH).

Also the disable interrupt is more complete now:
- always check sleep manager status and restore it
- remove irq_handler as comparator is always programed and might get called
eventually when LP TICK is restarted
- reset delayed_prog

Also in set_interrupt, make sure interrupt does not fire early.
If needed, we decide to slightly delay the tick to cope with the HW limitation to
make sure it will fire as soon as HW is capable.

Functions are called under critical section as they may be called from
the IRQ handler now, not only from driver layer.
2019-07-11 11:40:54 +01:00
Laurent Meunier c4073fccd5 LP ticker workaround
There is an errata in LPTIM specification that explains that CMP Flag
condition is not an exact match (COUNTER = MATCH) but rather a
comparison (COUNTER >= MATCH).

As a consequence the interrupt is firing early than expected when
programing a timestamp after the 0xFFFF wrap-around.

In order to
work-around this issue, we implement the below work-around.
In case timestamp is after the work-around, let's decide to program the
CMP value to 0xFFFF, which is the wrap-around value. There would anyway be
a wake-up at the time of wrap-around to let the OS update the system time.
When the wrap-around interrupt happen, OS will check the current time and
program again the timestamp to the proper value.
2019-07-11 11:40:54 +01:00
Kevin Bracey d65a7d36dc STM: Correct macro test in us_ticker_defines.h
Avoids build warning caused by #10609
2019-07-11 11:40:54 +01:00
jeromecoutant dc6441bfc8 NUCLEO_H743ZI2 new target support 2019-07-11 11:40:54 +01:00
Malavika Sajikumar 4251b8cf5e Removing I2C and SPI pin names in SDP-K1 PinNames.h file. This is to ensure the use of Arduino pin names Dxx for I2C and SPI pins in programs written for SDP-K1 board. 2019-07-11 11:40:54 +01:00
Kevin Bracey 77877614b8 STM: optimize us_ticker
Provide new optimizations for us_ticker and wait_us.
2019-07-11 11:40:54 +01:00
Alexandre Bourdiol 22a8e19ebe STM32: pwmout_write: configure channel only when not already enabled
Fix PWM glitch on write(), TARGET_STM/pwmout_api.c, #10734
2019-07-11 11:40:53 +01:00
Filip Jagodzinski 9a4db66bf5 STM32WB: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-07-11 11:40:53 +01:00
Filip Jagodzinski 9c1664f21e STM32L4: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-07-11 11:40:53 +01:00
Filip Jagodzinski 69582c3eed STM32H7: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-07-11 11:40:53 +01:00
Filip Jagodzinski 3bc4f9599f STM32F3: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-07-11 11:40:53 +01:00
Filip Jagodzinski b006fe2a31 STM32L0: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-07-11 11:40:53 +01:00