Commit Graph

152 Commits (5bb3ede8904d2488c60b1d7539dff2edcce87062)

Author SHA1 Message Date
jeromecoutant c2ee8f34b6 STM32F0 : correct compilation warnings 2018-04-11 09:57:54 +02:00
Cruz Monrreal f907012e55
Merge pull request #5962 from bcostm/fix_usart_irq_index
STM32: Fix usart irq index
2018-01-31 12:16:17 -06:00
bcostm 78a5516726 STM32 serial: improve irq index management for F0 devices 2018-01-29 17:23:21 +01:00
jeromecoutant 8f647beacb STM32 : set all PinMap structures as weak
This allow custom overwrites
2018-01-29 09:26:49 +01:00
bcostm 7ff1cf52c0 STM32F0 uart irq: test IT flags for usart3/4 2018-01-25 11:23:53 +01:00
bcostm 18659ab16b STM32F0: manage better uart3 & 4 irqs
Manage the case where both uart3 and uart4 interrupts are arriving at the same time.
2018-01-25 11:15:55 +01:00
bcostm eaa3e9d2b2 STM32F0 usart irq: fix issue with F070/F072 2018-01-25 11:15:55 +01:00
bcostm b6c9178d88 STM32F0: fix usart irq management 2018-01-25 11:15:54 +01:00
Cruz Monrreal f01fbde3c5
Merge pull request #5795 from jeromecoutant/PR_USER_DEFINED_STDIO
STM32 STDIO pins number are now configurable
2018-01-16 16:15:17 -06:00
jeromecoutant 88678315f1 STM32F0: STDIO_UART_TX and STDIO_UART_RX can be now user defined 2018-01-08 11:11:43 +01:00
jeromecoutant 9f4bec2f2e STM32F0 : ST CUBE version update to V1.9.0
- Previous ST Cube version: V1.7.0
- CMSIS part update from 2.3.1 to 2.3.3
- HAL part update from 1.5.0 to 1.7.0
2018-01-05 14:46:33 +01:00
Jimmy Brisson 62a7ecddd3
Merge pull request #5570 from jeromecoutant/PR_STDIO
STM32 UART init update
2018-01-04 09:50:18 -06:00
bcostm ca24ee4cd7 STM32F0: Remove flash functions doc 2018-01-04 15:43:54 +00:00
bcostm a47f9b3480 STM32F0: Add Flash API support 2018-01-04 15:43:54 +00:00
jeromecoutant 1cf47f6209 STM32 uart: update after code review 2017-11-24 13:39:33 +01:00
jeromecoutant 6d64c2fbf4 STM32 UART init update
- serial_init, serial_free and serial_baud function moved from serial_device.c (specific to each STM32 family) to serial_api.c (common STM32 file)
- default baudrate value was hardcoded to 9600
  - Value is set now to MBED_CONF_PLATFORM_STDIO_BAUD_RATE for STDIO
  - Value is set now to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE for other use
- UART init will not be stopped before calling serial_baud function
2017-11-23 14:47:54 +01:00
bcostm c54e9079b8 STM32 ADC: replace flags type from int to bool 2017-11-17 13:50:59 +01:00
bcostm 1d3eb508bf STM32: fix linker error with adc_read() 2017-11-17 13:50:59 +01:00
bcostm 34fdcc926b STM32: move analogin_read functions in a common file 2017-11-17 13:50:59 +01:00
bcostm 4dbe95dded STM32: rename analogin_api.c in analogin_device.c 2017-11-17 13:50:59 +01:00
bcostm 2e2744ccbe STM32F0 ADC: remove adc_inited flag 2017-11-17 13:50:58 +01:00
bcostm be2a6ae273 STM32: Use CAN3_BASE + typos 2017-11-14 09:48:02 +01:00
bcostm ad55bc26dc STM32: Remove GCC_ARM compilation warnings 2017-10-17 14:04:59 +02:00
Jimmy Brisson de3784f6da Merge pull request #5288 from bcostm/NUCLEO32_add_ALT_pins
STM32: Add alternate pins on NUCLEO 32pins boards
2017-10-13 09:27:53 -05:00
bcostm 0155a416e6 NUCLEO_F042K6: add ALT pins + cleanup 2017-10-10 14:13:10 +02:00
bcostm 88b82e312d fix init struct analogout 2017-10-05 16:35:05 +02:00
Jimmy Brisson cc0b3d05aa Merge pull request #5130 from bcostm/freeze_timer_in_debug
STM32: Freeze master timer on stop/breakpoint
2017-10-02 10:38:57 -05:00
Jimmy Brisson a2cdb10bf7 Merge pull request #4932 from LMESTM/can_reset
Fix STM32 CAN reset to not lose context
2017-09-20 16:24:40 -05:00
bcostm 9f86a32baf Add freeze timer on debug for all STM32 devices
This is a continuation of the work done on the STM32F401xE devices only.
2017-09-18 13:31:46 +02:00
Jimmy Brisson 15a9a0382b Enable Compiling with ARMC6 across all targets
remove duplicate sys.cpp
2017-09-11 13:20:32 -05:00
Russ Butler 72f07ec4d9 Make room on stm32f07 for tickless
Decrease the interrupt stack from 2k down to 1k so there is enough
ram to build all the tests with tickless enabled. In general, targets
should not need an interrupt stack greater than 1k with mbed-os.
2017-09-07 21:35:06 -05:00
Laurent MEUNIER 04ac65a4e6 STM32: CAN: restore registers after can_reset
After reset the MCR register content needs to be restored so we're
introducing the can_registers_init function to be called at the first
init stage, but also after reset. We also store the can frequency to
go through the initialisation phase again.
2017-09-05 10:27:21 +02:00
Laurent MEUNIER 759642af8e STM32: Define CAN handle as part of can object
Instead of a static object, this will make driver
instantiation more robust and allow to re-use init
configuration on a need basis.

The CANName struct member is actually the CAN registers base address,
which is now available in the CanHandle.Instance field, so we don't need
CANName anymore.
2017-09-05 10:27:21 +02:00
Laurent MEUNIER 66162c6b1d STM32: move can_s definition to common_objects.h
This will ease up further changes to the structure.
2017-09-05 10:27:21 +02:00
jeromecoutant aff3478519 STM32F0 : internal ADC channels 2017-08-09 11:01:14 +02:00
Jimmy Brisson f08d5a496c Merge pull request #4623 from LMESTM/analogin_handle
Improve management handling of multiple instances of analogin ojects
2017-07-31 15:23:31 +00:00
Jimmy Brisson 2098af5919 Merge pull request #4764 from jeromecoutant/PR_F0_PIN
STM32F0 : remove unavailable pins
2017-07-24 10:57:31 -05:00
Jimmy Brisson 9e443e9d14 Merge pull request #4734 from LMESTM/stm32_uart_irq
Avoid data loss with serial interrupt used at high baudrates
2017-07-24 10:55:07 -05:00
jeromecoutant c13998f306 STM32F0 : json clock source configuration
- default value is the same as before patch
- system_stm32f0xx.c file is copied to family level with all other ST cube files
- specific clock configuration is now in a new file: system_clock.c (target level)
2017-07-19 16:23:40 +02:00
jeromecoutant 7da7af6cc4 STM32F0 : remove unavailable pins
Pins used for STDIO_UART_TX and STDIO_UART_RX are not available
2017-07-17 16:19:15 +02:00
Laurent MEUNIER efbeb0d057 STM32: analogin: adc struct member not needed anymore
The adc in analogin_t has the same value as the Instance member of
ADC_HandleTypeDef. So we can only rely on the later one.
2017-07-17 13:27:22 +02:00
Laurent MEUNIER 8540e8a1dd STM32: Analogin - define handle in object not as a global
In this commit, the analogin_s structure is moved to commonn_objects.h file
to limit the duplicaion.

The ADC handle is moved from a global variable to a struct member of the
analogin object. This allows multiple ADC instances to work correctly.

Note that State needs to be explicitely set to HAL_ADC_STATE_RESET
because the object is not zero initialized.
2017-07-17 13:23:45 +02:00
Laurent MEUNIER b5cbaaa0d0 STM32: Serial - use TXE as tx_irq instead of TC
TXE indicates that a byte can be written to UART register for sending,
while TC indicates that last byte was completely sent. So the TXE flag
can be used in case of interrupt based Serial communication, to allow
faster and efficient application buffer emptying.

Also TXE flag will be erased from the interrupt when writing to register.
In case there is nothing to write in the register, the application is
expected to disable the interrupt.
2017-07-17 08:46:00 +02:00
Laurent MEUNIER 85711eb09e STM32: Serial - do no clear RXNE flag
The RXNE flag is getting cleared when reading Data Register so it should
not be cleared here. Especially in case of high data rate, another byte of
data could have received during irq_handler call and clearing the flag
would read and discard this data which would be lost for application.
2017-07-17 08:46:00 +02:00
Martin Kojtal 59dd859210 Merge pull request #4707 from LMESTM/stm32_serial_it_source
STM32: serial: use proper macro to check  interrupt
2017-07-13 16:40:16 +02:00
Laurent MEUNIER be8024de28 STM32: serial: use proper GET_IT macro
Depending on families, different HAL macros are defined to check the
state of serial interrupts. In several cases, we can find only 1 macro:
__HAL_UART_GET_IT_SOURCE
Checks whether the specified UART interrupt has occurred or not

But in F0, F3, F7, L0, L4 there are 2 different macros
__HAL_UART_GET_IT
Checks whether the specified UART interrupt has occurred or not
__HAL_UART_GET_IT_SOURCE
Checks whether the specified UART interrupt source is enabled.

In the later case, __HAL_UART_GET_IT_SOURCE was being used so far,
but actually needs to be replaced by __HAL_UART_GET_IT. Using the right
macro, we also check the proper flags accordingly.
2017-07-11 17:22:33 +02:00
Jimmy Brisson b38c85cafe Merge pull request #4525 from fahhem/patch-1
Improve the startup code on the STM32F070
2017-07-10 12:04:42 -05:00
Jimmy Brisson d382d44f06 Merge pull request #4529 from LMESTM/issue_1083
Manage multiple instances of analog out
2017-06-30 13:53:46 -05:00
Jimmy Brisson e907079456 Merge pull request #4603 from jeromecoutant/PR_OVERRIDE
STM32 : mbed_overrides.c is common for all families
2017-06-27 14:59:24 -05:00
Laurent MEUNIER 024b3da5f1 STM32: analog_out: generalize code for multiple instance handling
Moving some code in common to be able to manage several ADC instances,
or several channels of an instance.

The change involves:
- moving dac_s structure definition to common_object.h
- create TARGET_STM/analogout_api.c and move fully common analog_out
functions in there
- rename analogout_api.c of each target family into analogout_device.c
to keep platform specific code
- update analogout_device.c to rely on obj->handle and obj->channel
- align analogout_init function as much as possible between families in
analogout_device.c files
2017-06-27 09:27:46 +02:00