Commit Graph

109 Commits (6ee4c7e21963b184b1f93c0bf9375b583dbc9051)

Author SHA1 Message Date
Martin Kojtal 5d09014bf1 Merge pull request #3631 from LMESTM/dev_stm32_hal_F3_V1.7.0
F3 CUBE update V1.7.0
2017-01-26 10:37:49 +02:00
Martin Kojtal bdcda386d5 Merge pull request #3618 from LMESTM/dev_stm32_PinNamesTypes
STM32: Move types definitions to a common file
2017-01-26 10:35:59 +02:00
Laurent MEUNIER 42f6622f8e STM32: Move types definitions to a common file
Only one point of attention:
STM_MODE_ANALOG_ADC_CONTROL is a specific mode that is only supported on L4.
So STM_MODE_ANALOG_ADC_CONTROL was moved to index 13 (last entry)
of gpio_mode table so that all the other modes are common and only the last
one is specific.
2017-01-24 10:58:36 +01:00
Laurent MEUNIER c6a898d71b STM32: remove F3 spi_api.c warning
Solve below warning:

"...\targets\TARGET_STM\TARGET_STM32F3\spi_api.c", line 73:
Warning:  #111-D: statement is unreachable
2017-01-23 17:07:46 +01:00
Laurent MEUNIER 9640936714 F3 CUBE update V1.7.0
CMSIS v2.3.0 => v2.3.1
    HAL   v1.3.0 => v1.4.0
    LL    v1.4.0
2017-01-23 16:44:21 +01:00
Laurent MEUNIER 5d04b97b80 STM32: make PortNames.h a common file
the same file can be used for all targets
2017-01-19 15:27:19 +01:00
Martin Kojtal 3933ccf76e Merge pull request #3584 from LMESTM/dev_stm32_common_peripheralpins
STM32: make PeripheralPins.h a common file
2017-01-16 16:29:28 +00:00
Martin Kojtal cc8a132f10 Merge pull request #3575 from LMESTM/dev_stm_factorize_gpio
Dev stm factorize gpio
2017-01-16 16:28:27 +00:00
Laurent MEUNIER 1a4394a4a2 STM32: make PeripheralPins.h a common file
Simple effort to avoid duplicate code.
2017-01-13 13:25:33 +01:00
Brian Daniels 24a9a4824f Fixes linking errors when building with debug profile
When building with the debug profile, certain ST plaforms error with
'get_i2c_timing' not being defined. This is because the function is not
defined as 'static inline', but just 'inline'.
2017-01-12 15:09:28 -06:00
Laurent MEUNIER 57e0225248 STM32: gpio: factorize gpio_api.c and gpio_object.h
Let's make the code more common for gpios.

The only difference between STM32 families is that BRR register may
not be available. In case BRR is not available, we use the 16 left bits
of BSRR instead. We could always use BSRR, but BRR saves one left-shift
operation, so let's use it when available.

By default we will consider using BRR, except for platforms that define
GPIO_IP_WITHOUT_BRR.
2017-01-12 19:24:32 +01:00
Laurent MEUNIER 7a36614e74 STM32: remove useless include
gpio_object.h is included from common_objects.h,
so no need to have it here.
2017-01-12 19:11:36 +01:00
Sam Grove cefae22703 Merge pull request #3492 from Nodraak/fix/3463/can_read_return_value
Fix #3463 CAN read() return value
2017-01-09 10:17:27 -06:00
Sam Grove ddcd3ad711 Merge pull request #3488 from LMESTM/dev_stm_i2c_v2_unitary_functions
Dev stm i2c v2 unitary functions
2017-01-09 10:15:55 -06:00
Adrien Chardon 885b018f77
Set bit without reseting the whole register 2017-01-03 11:46:27 +01:00
Adrien Chardon 7e0b4fe3c9
Fix can_read() return value for STM32 boards 2017-01-03 11:46:25 +01:00
jeromecoutant ab28a5e5cb STM32: Refactor lp_ticker.c + rtc_api.c + sleep.c + rtc_api_hal.h files 2016-12-21 16:54:18 +00:00
Laurent MEUNIER 20c9af8bec STM32: I2C unitary functions for IP V2
STM32 supported targets have 2 possible versions of I2C.
This patch makes the start / stop / read and write byte work ok for IP V2.
This was not working before and does not seem to be widely used.
2016-12-21 09:27:52 +01:00
Anna Bridge 9e03765d04 Merge pull request #3422 from szechyjs/disco_f303vc_can
Enable CAN on DISCO_F303VC
2016-12-19 17:37:48 +00:00
Anna Bridge a915fa86e4 Merge pull request #3390 from jeromecoutant/PR_ST_F3_ASSERT
STM32F3 : map ST HAL assert into MBED assert
2016-12-19 17:24:26 +00:00
Jared Szechy f941960d1c
Add alternative CAN pins to DISCO_F303VC 2016-12-13 11:20:22 -05:00
Jared Szechy f5f3dc8143 Enable CAN on DISCO_F303VC 2016-12-11 22:03:29 -05:00
Martin Kojtal 04f940de2d Merge pull request #3324 from LMESTM/dev_i2c_common_code
Dev i2c common code
2016-12-09 15:30:00 +01:00
jeromecoutant 4ea65df99d STM32F3 : correct ST HAL API call
- CAN: compilation issue with assert enabled
- GPIO: mode was not allowed by ST HAL API
2016-12-09 14:56:52 +01:00
jeromecoutant d30c34c5d1 STM32F3 : map ST HAL assert into MBED assert 2016-12-07 15:09:55 +01:00
Martin Kojtal 1c2c121741 Merge pull request #3303 from adustm/stm_fix_interrupt_in
Fix #2956 #2939 #2957 #2959 #2960: Add HAL_DeInit function in gpio_irq destructor
2016-12-02 15:47:50 +01:00
Laurent MEUNIER 3fad50287c [STM32] Make most of the I2C code into a common file
Since most of the code in i2c_api.c is now relying on STM32 HAL, there
is now a possibility to make a common usage of this code accross families.

The IP version definition is introduced per family, to allow a switch of
functionnalities, especially the frequency management which differs.
BTw, we fix the F0 frequency settings at the same time.

F1 is managed for now as an exception as the HAL API for sequential transmit
/receive is not yet available (coming soon)
2016-11-30 08:23:13 +01:00
Laurent MEUNIER 23926a2418 [STM32] HAL I2C (V2) sequential transmit / receive
In case of sequential transmit / receive, there is a need to:
- not use the reload option
- generate a new START on each new transaction

This applies to all HAL supporting the IP version V2.
2016-11-30 08:23:13 +01:00
Martin Kojtal 519b500d4c Merge pull request #3320 from bcostm/fix_vref_label
STM32 - Add ADC_VREF label
2016-11-29 18:24:52 +01:00
Martin Kojtal a8ebfaa058 Merge pull request #3288 from LMESTM/dev_spi_asynch_l0l1
Dev spi asynch l0l1
2016-11-29 18:17:06 +01:00
Martin Kojtal bb2d03f34b Merge pull request #3213 from bcostm/factorize_ticker
STM32: Refactor us_ticker.c + hal_tick.c files
2016-11-29 18:10:45 +01:00
Martin Kojtal 93c08f340a Merge pull request #3062 from jamike/TARGET_STM_USBDEVICE_FS
TARGET_STM :USB device FS
2016-11-29 18:07:11 +01:00
bcostm 92d39e2390 Add ADC_VREF label 2016-11-24 10:30:23 +01:00
adustm 0219b64af4 fix #2956. Add HAL_DeInit function if gpio_irq destructor
This allows ci-test-shield tests-api-interruptin to pass
2016-11-21 15:55:15 +01:00
Laurent MEUNIER 7cdaba8474 [stm32] remove unused module member in spi_s struct 2016-11-18 09:59:53 +01:00
bcostm 896293d5be Replace TIM_MST_GET_PCLK_FREQ macro with TIM_MST_PCLK macro 2016-11-14 09:31:14 +01:00
bcostm 0524811c75 STM32xx - Remove hal_tick.c files and update hal_tick.h with new macro 2016-11-14 09:31:14 +01:00
bcostm bb10409954 Replace all devices us_ticker files with a common 16b and 32b file 2016-11-14 09:31:14 +01:00
Michel Jaouen 182c311fbd TARGET_STM : USB FS STM HAL changes 2016-11-09 12:08:45 +01:00
Bradley Scott 6d3f03c73d STM32F3: DISCO_F303VC - Add missing ADC pin muxing options
Corrects the incorrect PA_5 ADC channel mapping, and removes the
non-existent PB_11 ADC channel mapping.
2016-11-08 17:07:15 -05:00
Bradley Scott 130fddc467 STM32F3: DISCO_F303VC - Add missing UART pin muxing options 2016-11-08 17:04:21 -05:00
Martin Kojtal 4a4d09f6d1 Merge pull request #3074 from jamike/TARGET_STM_INIT_GCC_ALIGNEMENT
Target STM - init gcc alignement
2016-10-28 11:04:50 +02:00
Michel Jaouen 4a69072161 INIT:GCC add call to HAL_Init
system_init, stops all on going timer.
gcc _start , perform zero initialized.
=> HAL_Init must be done again also in GCC toolchain
2016-10-27 10:40:28 +02:00
Bradley Scott 97eaed7b0a STM32F3: Eliminate two unused variable warnings 2016-10-25 10:59:19 -04:00
Bradley Scott 4f9bdf5ee0 STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH 2016-10-25 10:58:38 -04:00
Michel Jaouen 26f3352f83 STM32F3xxx : GCC_ARM remove zero bss, in startup.
zero bss is done in libc init after call _start.
2016-10-19 14:54:43 +02:00
Sam Grove f1d678f8a4 Merge pull request #3056 from LMESTM/fix_stm32_pull_overwrite
Fix stm32 pull overwrite
2016-10-19 05:50:30 -05:00
Sam Grove 2ae71777aa Merge pull request #3013 from bcostm/check_adcintch_pins
STM32xx - Change how the ADC internal pins are checked before pinmap_…
2016-10-19 05:43:15 -05:00
Laurent MEUNIER af51027f61 [STM32] Fix pull over write to all families
This applies the same fix as was done for F4 to solve issue #2638.
The fix applies ell to all other families excpet STM32F1.

Basically, to avoid over-writing the pull-up/-down settings, we read the
current state from HW.
2016-10-18 12:16:58 +02:00
Sam Grove 0ef0c617a9 Merge pull request #2999 from jeromecoutant/PR_F303ZE_I2C
NUCLEO_F303ZE: Enable all I2C instances
2016-10-13 11:14:46 -05:00
bcostm a484f51904 STM32xx - Change how the ADC internal pins are checked before pinmap_pinout 2016-10-13 16:28:57 +02:00
Laurent MEUNIER aeac255509 [STM32F303ZE] Update objects definition
STM32F303ZE was introduced in parallel to the changes which consist in
having family wide definitions like device.h file and a common objects
definition.

This target is updated accordingly now to benefit of SPI definitions.
2016-10-13 14:21:02 +02:00
Laurent MEUNIER 0aeea4950c [STM32] Deploy SPI_ASYNCH to all family
the SPI_ASYNCH feature has been already activated for STM32F4.
This patchset makes it supported on all STM32 families by:
- moving spi_s structure at family level instead of board level
- using the F4 spi_api.c reference implementation and making it a common
stm_spi_api.c file which makes maintenance a lot easier.
- the only part that needs to be implemented for each family is the computation
of the clock frequency input to the spi peripheral which is not the same
accross families. So this is what remains in the spi_api.c of each family.

Because of the introduction of the common file, all the above modifications
needs to be done at once.
2016-10-13 14:18:21 +02:00
jeromecoutant 366f04f60b NUCLEO_F303ZE: Enable all I2C instances 2016-10-12 16:52:26 +02:00
Sam Grove eee4db1fe0 Merge pull request #2896 from geky/restructure-cmsis
restructure - Restructure cmsis directory
2016-10-07 11:13:09 -05:00
Christopher Haster 26ced98734 restructure - Restructured cmsis directory
targets/cmsis -> cmsis
targets/cmsis/TARGET_* -> targets/TARGET_*/device
targets/cmsis/TARGET_*/mbed_rtx.h -> targets/TARGET_*/mbed_rtx.h
2016-10-04 17:51:44 -05:00
Laurent MEUNIER e8675033f4 [STM32] remove superfluous calls to SystemCoreClockUpdate
Supported toolchains initialization steps have been modified to make sure
that mbed_sdk_initi is called _after_ RAM initialization and _before_ C++
objects creation.

since this was done, there is no need to redundant SystemCoreClockUpdates
in the drivers
2016-10-04 15:08:28 -05:00
Laurent MEUNIER fe9d3174bf INIT:GCC no rtos: Align pre-main initialization steps between TCs
Various toolchains supported in MBED don't follow the same initialization
steps. This can have impacts on platform behavior.

For STM32, it is needed to call the HAL_Init() _after_ the  RAM has been
initialized (sdata from flash / zero initialized data) and _before_ the C++
objects are being created, especially if those objects require support
of tickers for instance.

In GCC, this is easily done because SystemInit is called after the ram
initialisation, so HAL_Init does not need to called from mbed_sdk_init.
this is covered by the changes in mbed_overrides.c files.

This series should solve issue reported here:
STM32 (At least F401) breaks if Tickers are activated in a global object #2115
2016-10-04 14:55:20 -05:00
Christopher Haster 0bad622a16 restructure - Moved targets out to top level
hal/targets -> targets
hal/targets.json -> targets/targets.json
2016-09-30 19:18:09 -05:00