Commit Graph

2040 Commits (d8c2c6f97fe419d682cdc11d859a4ce2952ca23d)

Author SHA1 Message Date
int_szyk df43350f28 Tweak STM watchdog implementation
Change the calculation method of rl so it is rounded up.
2019-08-14 13:02:47 +02:00
Martin Kojtal de84004be1
Merge pull request #11189 from LMESTM/pwmout_cpp_guard
__cplusplus guard fixed pwmout_device.h for STM32 families
2019-08-13 11:19:24 +02:00
Martin Kojtal f8dc035ae4
Merge pull request #11139 from sethitow/stm32f413-crash-capture
STM32F413 Crash Capture
2019-08-09 12:49:21 +01:00
Martin Kojtal 174cac7e11
Merge pull request #11103 from desowin/stm32f7-usbhost
STM32F7: Do not generate redundant IN tokens
2019-08-09 11:36:37 +01:00
Martin Kojtal 9b4373639b
Merge pull request #11072 from jeromecoutant/PULL_REQUEST_CUBE_UPDATE_L4_V1.14.0
STM32L4: update drivers version to CUBE V1.14.0
2019-08-09 11:35:00 +01:00
Laurent Meunier 319223ac16 __cplusplus guard fixed pwmout_device.h for STM32 families
This bug prevented using this header in cpp code directly.
2019-08-09 09:51:39 +02:00
Seth Itow 9a65310a85 stm32f413xh: add crash capture support for ARM_STD 2019-08-01 11:28:36 -07:00
Szymon Szantula dd2876c8ac
__cplusplus guard fixed
This error prevented using this header in cpp code directly.
2019-08-01 14:41:11 +02:00
Seth Itow 1c4ad895dd stm32f413xh: add crash capture support for IAR 2019-07-31 15:54:47 -07:00
Seth Itow 6278dacc1f stm32f413xh: add crash capture support for ARM_MICRO 2019-07-31 15:54:20 -07:00
Seth Itow 489bd3dec8 stm32f413xh: add crash capture support for GCC_ARM 2019-07-31 15:53:34 -07:00
Ireneusz Gaicki b9c4076741 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-07-24 11:40:49 +02:00
jeromecoutant 96a773a0e6 STM32L4: update drivers version to CUBE V1.14.0 2019-07-19 13:15:07 +02:00
Seppo Takalo 12d60f86ea
Merge pull request #11050 from jeromecoutant/PR_DISCO_L4R9I
DISCO_L4R9I new target
2019-07-17 23:15:45 +03:00
Seppo Takalo 987533859a
Merge pull request #10104 from kjbracey-arm/sleep_api
Sleep rework, RTOS API for bare metal, wait deprecations
2019-07-17 14:37:53 +03:00
Seppo Takalo 8efd123776
Merge pull request #11042 from caoyuan96421/bugfix
Fixed serial_device IRQ infinite loop bug due to uint8_t overflowing in STM devices
2019-07-17 14:33:21 +03:00
jeromecoutant 1a835dda4a DISCO_L4R9I new target 2019-07-15 14:06:40 +02:00
Seppo Takalo b22641ca18 Normalize line endings for IM880B startup files. 2019-07-15 14:56:22 +03:00
Kevin Bracey a522dcfa0a Replace deprecated wait calls 2019-07-15 10:13:50 +03:00
Yuan Cao 6ed21ee1c0 Fixed serial_device IRQ infinite loop bug due to uint8_t overflowing 2019-07-13 00:05:25 -04:00
Tymoteusz Bloch 878c93673b 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-10 13:30:40 +02:00
Martin Kojtal 647b5817ce
Merge pull request #10982 from jeromecoutant/PR_LPUART
STM32 LPUART minor update  for easy maintenance
2019-07-09 08:33:06 +01:00
Arto Kinnunen 1264660314
Merge pull request #10972 from 0xc0170/test_target
add new target IM880B
2019-07-08 16:34:36 +03:00
jeromecoutant 8a3fd6a040 STM32 LPUART update 2019-07-05 17:52:41 +02:00
jeromecoutant 8b6d0920a8 STM32H7: Reset Reason update 2019-07-05 14:44:45 +02:00
jeromecoutant aa31b1268a STM32H7 watchdog patch 2019-07-05 14:44:43 +02:00
jeromecoutant da9b919268 STM32H7: Increase watchdog timeout value 2019-07-05 14:44:41 +02:00
jeromecoutant 3384cea281 STM32H7 : add LSI 2019-07-05 14:44:39 +02:00
itziar c327f4f070 add new target IM880B 2019-07-05 09:19:51 +01:00
Martin Kojtal 608e4c245f
Merge pull request #10938 from tymoteuszblochmobica/iar
K64F, STM32F429: IAR linker scripts dynamic  heap fix
2019-07-03 12:00:35 +01:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal a84c239830
Merge pull request #10701 from LMESTM/STM_lp_ticker_low_level_wrapper
STM: replace C++ low power ticker wrapper with a low level wrapper
2019-07-02 12:50:11 +01:00
Tymoteusz Bloch 83057c95d0 IAR icf linker scripts modified to use dynamic heap allocation of all available memory. 2019-07-01 17:57:40 +02:00
Kevin Bracey 1ced842391 STM: Correct macro test in us_ticker_defines.h
Avoids build warning caused by #10609
2019-07-01 13:34:55 +03:00
Martin Kojtal be2c2bed30
Merge pull request #10884 from jeromecoutant/PR_H743ZI2
NUCLEO_H743ZI2 new target support
2019-07-01 09:27:31 +01:00
Martin Kojtal 9e0dc3e198
Merge pull request #10859 from malavikasajikumar/master
Removing I2C and SPI pin names in SDP-K1 PinNames.h file.
2019-07-01 09:23:06 +01:00
Laurent Meunier 58a4685811 STM32: lp_ticker optim: initialize handle once only 2019-07-01 09:33:23 +02:00
Laurent Meunier ee95c7e64a STM32: lp_ticker optim: remove irq_handler variable 2019-07-01 09:33:23 +02:00
Laurent Meunier 8616cd7655 Update comments and fix typo 2019-07-01 09:33:23 +02:00
Laurent Meunier 501881bf38 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-01 09:33:22 +02:00
Laurent Meunier d4ec62ff0c 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-01 09:31:53 +02:00
Laurent Meunier 6452eb3172 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-01 09:31:53 +02:00
Martin Kojtal 85c477c1dc
Merge pull request #10609 from kjbracey-arm/us_ticker_optimise
wait_us optimization
2019-06-28 14:29:00 +01:00
Martin Kojtal 61c4d05ce9
Merge pull request #10824 from ABOSTM/PRSTM32_PWMWRTIE_GLITCH_10734
STM32: pwmout_write: configure channel only when not already enabled
2019-06-28 14:24:14 +01:00
Martin Kojtal 924af9481e
Merge pull request #10841 from VVESTM/vve_10827_spi_count
TARGET_STM: Add DEVICE_SPI_COUNT to use SPIs without interference
2019-06-26 09:09:38 +01:00
Martin Kojtal b0073bb70d
Merge pull request #10774 from fkjagodzinski/fix-uart_irq
Fix serial IRQ handling
2019-06-25 15:49:41 +01:00
jeromecoutant d2ea0f9432 NUCLEO_H743ZI2 new target support 2019-06-24 11:00:58 +02:00
Alexandre Bourdiol a339084684 STM32: pwmout_write: configure channel only when not already enabled
Fix PWM glitch on write(), TARGET_STM/pwmout_api.c, #10734
2019-06-20 17:49:16 +02:00
Malavika Sajikumar 6632282b4a 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-06-18 08:15:01 -07:00
Vincent Veron 31eb49b918 TARGET_STM: Add DEVICE_SPI_COUNT to use SPIs without interference
Extend to all STM targets the work done on PR10752.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-06-14 14:15:56 +02:00
Kevin Bracey 8d15a2342f STM: optimize us_ticker
Provide new optimizations for us_ticker and wait_us.
2019-06-14 10:22:08 +03:00
Martin Kojtal 5a8f795976
Merge pull request #10804 from VVESTM/vve_fix_10589
TARGET_STM: SPI: update pull up config depending on clk polarity
2019-06-14 07:45:25 +01:00
Martin Kojtal 09ea361c7e
Merge pull request #10790 from jeromecoutant/PR_H7_LPUART
STM32H7 enable LPUART
2019-06-11 09:06:22 +01:00
Martin Kojtal 94d2a42fd5
Merge pull request #10793 from jeromecoutant/PR_STM32WARNING
STM32: remove compilation warnings
2019-06-11 07:36:47 +01:00
Martin Kojtal 9dfc8d0ea7
Merge pull request #10775 from jeromecoutant/PR_H7_REFACTOR
STM32H7: refactor TARGET directory
2019-06-09 18:22:04 +01:00
Martin Kojtal 356c4fb7cb
Merge pull request #10758 from toyowata/stm32f407xe
Move Seeed ARCH_MAX to TARGET_STM32F407xE MCU
2019-06-09 18:20:03 +01:00
Martin Kojtal 9ab0e09699
Merge pull request #10752 from teijokinnunen/stm32l0_target_spi_count
STM32L0: Add DEVICE_SPI_COUNT to DISCO_L072CZ_LRWAN1 + MTB_MURATA_ABZ
2019-06-09 18:19:34 +01:00
Martin Kojtal ced4c3f4e4
Merge pull request #10708 from VVESTM/vve_fix_10671
TARGET_STM: SPI: add pulse on master transmissions
2019-06-09 18:10:42 +01:00
jeromecoutant 5ac7c8c77e STM32WB warning compilation
[-Wparentheses-equality]
2019-06-07 18:11:16 +02:00
jeromecoutant ddcc63276a STM32H7 warning compilation
[-Wparentheses-equality]
2019-06-07 18:11:04 +02:00
jeromecoutant 39ee51a017 STM32L4 warning compilation
[-Wparentheses-equality]
2019-06-07 18:10:17 +02:00
jeromecoutant 43a304351a STM32L1 warning compilation
[-Wparentheses-equality]
2019-06-07 18:10:17 +02:00
jeromecoutant daf8d114c4 STM32L0 warning compilation
[-Wparentheses-equality]
2019-06-07 18:10:17 +02:00
jeromecoutant 7d05f22b31 STM32F7 warning compilation
[-Wparentheses-equality]
[-Wsign-compare]
2019-06-07 18:10:03 +02:00
jeromecoutant 09a58b5203 STM32F4 warning compilation
[-Wparentheses-equality]
2019-06-07 18:08:51 +02:00
jeromecoutant 89f554fb53 STM32F3 warning compilation
[-Wparentheses-equality]
2019-06-07 18:08:51 +02:00
jeromecoutant f3c7cc9d47 STM32F2 warning compilation
[-Wparentheses-equality]
2019-06-07 18:08:51 +02:00
jeromecoutant 8c2ee68be1 STM32F1 warning compilation
[-Wparentheses-equality]
2019-06-07 18:08:50 +02:00
jeromecoutant 7154ac65f2 STM32F0 warning compilation
[-Wparentheses-equality]
2019-06-07 18:08:50 +02:00
jeromecoutant 5d80f9e98f STM32: remove compilation warning 2019-06-07 18:08:39 +02:00
jeromecoutant a90e68e788 STM32H7 UART: enable LPUART 2019-06-07 18:05:06 +02:00
Filip Jagodzinski 14b83e7fdf 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-06-07 15:36:21 +02:00
Filip Jagodzinski 53222fa448 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-06-07 15:33:49 +02:00
Filip Jagodzinski fa0cc68657 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-06-07 15:30:03 +02:00
Filip Jagodzinski d6a48218ee 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-06-07 15:26:20 +02:00
Filip Jagodzinski b88b94eb75 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-06-07 15:17:22 +02:00
Filip Jagodzinski c387bd889f STM32F0: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-06-07 15:17:17 +02:00
Filip Jagodzinski 84384162bb STM32F7: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling
a registered handler with RxIrq or TxIrq arg.
2019-06-07 15:17:07 +02:00
Vincent Veron 82979f6415 TARGET_STM: SPI: update pull up config depending on clk polarity
Fix #10589

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-06-06 17:06:04 +02:00
jeromecoutant 25e4316963 STM32H7 directory cleanup and refactoring 2019-06-06 10:48:11 +02:00
jeromecoutant 119ff51fee STM32H7: use default files from ST drivers delivery 2019-06-06 10:48:09 +02:00
jeromecoutant 5b53b3aae0 STM32: define USE_FULL_LL_DRIVER at top level 2019-06-06 10:48:08 +02:00
toyowata f1628f0b8d Correct SPDX identifiers 2019-06-05 19:04:55 +09:00
toyowata 9acf2c325c Fix device_name and add SPDX identifiers 2019-06-05 16:48:08 +09:00
toyowata f0a06b24ba Remove ARCH_MAX files from STM32F407xG 2019-06-05 14:51:06 +09:00
toyowata db2cac45f1 Move Seeed ARCH_MAX to TARGET_STM32F407xE MCU 2019-06-05 14:35:25 +09:00
Teijo Kinnunen 728c01f9e3 STM32L0: Add DEVICE_SPI_COUNT to DISCO_L072CZ_LRWAN1 + MTB_MURATA_ABZ
Enables simultaneous use of both SPIs without interference.
2019-06-04 09:38:20 +03:00
Vincent Veron 16475829f1 TARGET_STM: SPI: add pulse on master transmissions
Add a pulse when using hardware chip select for SPI transmissions.
CS is at low level when a transmission is on-going.

Be careful, this is not compatible with all modes. It will work only
if PHA is 0, ie spi mode is 0 or 2. See stm32xx reference manual,
chapter "NSS pulse mode" for more details.

Fix #10671

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2019-06-03 10:00:06 +02:00
Martin Kojtal 93e4a8251c
Merge pull request #10697 from jeromecoutant/PR_H7FLASH
STM32H7: flash issue while erasing sector in Bank 1
2019-06-03 08:35:29 +01:00
jeromecoutant 58994d88cd STM32H7: flash issue while erasing sector in Bank 1 2019-05-29 09:31:30 +02:00
jeromecoutant d919498745 STM32: common cmsis.h and device.h 2019-05-27 16:27:41 +02:00
jeromecoutant 570e9b0bf4 STM32 WATCHDOG : increase timeout value 2019-05-24 11:35:42 +02:00
jeromecoutant 4300e5d6c4 STM32 WATCHDOG : use ST HAL in order to make code commun for all STM32 2019-05-24 11:35:41 +02:00
jeromecoutant feec85cc37 STM32 WATCHDOG : update STM32L0 HAL_IWDG_Init to a newest version 2019-05-24 11:35:41 +02:00
jeromecoutant e29d64fc19 STM32 WATCHDOG : compilation issue with typed define 2019-05-24 11:35:40 +02:00
jeromecoutant 1b8513a5a8 STM32 Watchdog : move API file to STM family level 2019-05-24 11:35:39 +02:00
Filip Jagodzinski 3d31801f4f STM: HAL: Reset_reason: Correct return values 2019-05-24 11:35:35 +02:00
Filip Jagodzinski d26dba40b2 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-05-24 11:35:29 +02:00
Steven Cartmell 2fb9fc2a8e Rename watchdog.c -> watchdog_api.c to prevent name collision with Platform API 2019-05-24 11:35:25 +02:00
Steven Cartmell e7761a1d39 Move watchdog parameter validation into the driver layer 2019-05-24 11:35:22 +02:00