Commit Graph

130 Commits (de9f9dd3a248b8e4b06894b3d52d81bdace6b5e1)

Author SHA1 Message Date
jeromecoutant 27bf7d21d1 STM32F7 : internal ADC channels 2017-08-09 11:01:32 +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 456607b170 Merge pull request #4794 from jeromecoutant/PR_F767
NUCLEO_F767ZI : boot issue with GCC
2017-07-24 10:59:23 -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 9e334a6b4a NUCLEO_F767ZI : boot issue with GCC 2017-07-21 14:46:39 +02:00
Laurent MEUNIER 7414b1266b STM32: ADC: Fix PinMap_ADC_Internal
The instance needs to be searched in PinMap_ADC_Internal, not PinMap_ADC.
This was a copy paste error...
2017-07-20 14:15:37 +02:00
jeromecoutant 26cd51f42a STM32F7 : json clock source configuration
- default value is the same as before patch
- system_stm32f7xx.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:43 +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 e0f56d1ab7 Merge pull request #4659 from jeromecoutant/PR_F767
Add the correct startup s file in TARGET_STM32F767
2017-07-06 10:18:08 -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 88268bd3eb Merge pull request #4625 from adustm/PULL_REQUEST_CUBE_UPDATE_F7_V1.7.0
Update STM32F7 cube from v1.6.0 to v1.7.0
2017-06-29 11:04:02 -05:00
jeromecoutant b5ef7a675a Add the correct startup s file in TARGET_STM32F767 2017-06-28 17:13:02 +02: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
Anna Bridge 55355d7374 Merge pull request #4401 from jeromecoutant/PR_USB_PIN
STM32 : Add USB used pins in PinNames.h files
2017-06-23 11:37:19 +01:00
Anna Bridge 4f5d4f040e Merge pull request #4375 from LMESTM/STM32_SPI_LL
Stm32 spi : use LL API to improve performances
2017-06-23 11:33:55 +01:00
adustm 8058e04238 F7 ST CUBE V1.7.0 2017-06-23 09:49:31 +02:00
jeromecoutant 18572cc65b STM32 : mbed_overrides.c is common for all families 2017-06-21 16:03:05 +02:00
Martin Kojtal d121a43e37 Merge pull request #4597 from theotherjimmy/travis-upcase-asm
Assert that all assembly files are named correctly in travis
2017-06-21 09:50:47 +02:00
Jimmy Brisson c7d6bbe295 Upcase all assembler file extensions 2017-06-20 14:50:08 -05:00
Jimmy Brisson 737a64c988 Merge pull request #4502 from LMESTM/issue_899
STM32: serial: clear Overrun flag if it is set when checking if readable
2017-06-19 11:00:23 -05:00
Laurent MEUNIER 20bd774a6c STM32 SPI specific mode for higher performance
This commit implements a SPI mode which will offer better performance
thanks to usage of Lower Layer API which use fewer registers access,
at the cost of lower robustness (no error management).
2017-06-16 10:23:48 +02:00
Russ Butler 47b78a2d17 Fix STM32 crashes on boot due to unset VTOR
Remove HAL_Init and related code from SystemInit and move it to
mbed_sdk_init. The function SystemInit is called early in the boot
sequence before RAM is initialized or the VTOR is setup, so it should
not be used to perform the HAL initialization.

This fixes crashes due the vector table being used before it has been
relocated.
2017-06-13 12:12:20 -05:00
jeromecoutant 8301ee04ca STM32 Add USB pins name in PinNames.h files 2017-06-13 17:15:27 +02:00
Laurent MEUNIER f77ecf4e12 STM32: Put some serial code in common between families 2017-06-09 13:30:54 +02:00
Laurent MEUNIER c5c33f1d0f STM32: serial: clear Overrun flag if it is set when checking if readable
Note that this could have side effects on the application as it would
not be aware that data has been missed. This may be later solved by
adding an error management parameter to the Serial API in mbed.

The advantage is that the serial link can work again.
2017-06-08 17:01:30 +02:00
Sam Grove 8232afa53e Merge pull request #4216 from fmanno/issue-4189
STM32s Serial: Correct handling of parity bits
2017-06-06 20:00:19 -05:00
Sam Grove 72de85c62f Merge pull request #4417 from monkiineko/master
STM32: Fix 32-bit us ticker interrupt scheduling
2017-06-06 19:59:52 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Bradley Scott 260378e774 STM32: Fix 32-bit us ticker interrupt scheduling
For STM32 targets using a 32-bit timer for the microsecond ticker, the
driver did not properly handle timestamps that are in the past.  It
would just blindly set the compare register to the requested timestamp,
resulting in the interrupt being serviced up to 4295 seconds late
(i.e. after the 32-bit timer counts all the way around to hit the
timestamp again).

This problem can easily be reproduced by creating a Timeout object
then calling the timeout's attach_us() member function to attach a
callback with a timeout of 0 us.  The callback will not get called for
over 2147 seconds, and possibly up to 4295 seconds late if no other
microsecond ticker events are getting scheduled in the meantime.

Now, after the compare register has been set, the timestamp is checked
against the current time to see if the timestamp is in the past, and
if so, the compare event is manually set.

NOTE: By checking if the timestamp is in the past after configuring the
capture register, we ensure proper handling in the case where the timer
updates past the timestamp while setting the capture register.
2017-06-01 12:52:03 -04:00
Jimmy Brisson 944a17fe3c Merge pull request #4402 from LMESTM/STM32_F2_CUBE_v160
Stm32 f2 cube sdk update to v1.6.0
2017-05-31 11:28:36 -05:00
Bartek Szatkowski b97ffe8fdc CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation 2017-05-30 18:55:51 +01:00
Francisco J. Manno 5e98da14d3 STM32s Serial does not properly handle parity bits
Reworked the serial_format() function for STM32F0x
devices to take the format in the form:
data_bits - parity - stop_bits

E.g. 8 - N - 1

where data_bits exclude the parity bit.
Added a case for 7 bits data as at least the chips
STM32F0x1/STM32F0x2/STM32F0x8 support 7 bits data.

Consolidated serial_format() and uart_init()
functions into a general TARGET_STM serial_api.c
file since the functions are common to all STM targets.

Fixes #4189
2017-05-30 17:17:20 +01:00
Laurent MEUNIER 8576993a1a Introduce stm32_assert.h for MBED port
When we want to activate USE_FULL_ASSERT macro in STM32 CUBE, there is a
need to have the assert map to MBED.

The easiest way to have this definition in a single place for all STM32
HAL and LL files using it, is to add a specific header file where the
porting to MBED is done.
2017-05-29 13:48:29 +02:00
adustm 897625cc96 Give access to HAL_GetTick function 2017-05-29 10:24:03 +02:00
Martin Kojtal 1705d10790 Merge pull request #4272 from jeromecoutant/PR_F429_D11
STM32 NUCLEO boards with Ethernet connector: solve conflict with D11 arduino pin
2017-05-15 16:12:06 +01:00
jeromecoutant 00163067fb STM32 NUCLEO boards with Ethernet connector: solve conflict with D11 arduino pin
If you are using Ethernet, and not SPI Arduino pins:
=> keep your board with the default configuration

If you are using SPI Arduino pins, and not Ethernet:
=> you should remove the JP6 bridge on the front side of the board

If you need SPI Arduino and Ethernet:
=> you have to patch the NUCLEO board on the back side: set solder bridge SB121 to off, and SB122 to on
=> D11 is no more connected to PA_7 but to PB_5
=> overwrite d11_configuration config value in json file
2017-05-10 11:15:14 +02:00
Michel Jaouen c581230cd3 USBHOST: TARGET_STM fix in hal for hub support 2017-05-09 16:18:33 +02:00
Anna Bridge a85873c863 Merge pull request #4248 from screamerbg/fix/stm32-usb-support
Fixed STM32 USB Device support for mbed Classic
2017-05-05 13:51:38 +01:00
Jimmy Brisson 0c2af26523 Merge pull request #4249 from kegilbert/button-mapping-kg
Add consistent button names across targets
2017-05-03 11:26:36 -05:00
Kevin Gilbert 28d1ac5a44 Added mapping to USER_BUTTON-labelled switches
Revert HRM1017 file source deletion

Added in small comment next to additions

Added mapping to BTN-labelled switches

Added mapping to USER_BUTTON-labelled switches

Undo incorrect mapping to SWIO pin in NORDIC target
2017-04-28 11:37:23 -05:00
Mihail Stoyanov 301ce550c9 Fixed STM32 USB Device support by migrating all specific target headers to unsupported features where they belong until USB support is officially introduced in mbed OS 5 2017-04-28 17:23:07 +01:00
Laurent MEUNIER 4eea8fa863 STM32 Fixed warning related to __packed redefinition
Before this patch, many warnings like below were generated
during compilation with ArmCC
[Warning] lwip_ethernet.h@57,0:  #3135-D: attribute does not apply to any entity

This happens here as ``--gnu`` option of ArmCC is being used, which
enables the GNU compiler extensions that the ARM compiler supports.

This is solve by adding a extra check on __CCARM .
2017-04-27 10:32:00 +02:00
Anna Bridge e3f457b4d5 Merge pull request #4154 from jeromecoutant/PR_F7_LEVEL0
STM32F7 Internal ADC channels rework
2017-04-20 16:50:34 +01:00
Anna Bridge 6a6455dfc2 Merge pull request #4031 from jeromecoutant/PR_IAR_BIG_HEAP
STM32 increase IAR heap size for big RAM targets
2017-04-20 15:50:21 +01:00