Commit Graph

809 Commits (de9f9dd3a248b8e4b06894b3d52d81bdace6b5e1)

Author SHA1 Message Date
jeromecoutant df6a570a41 STM32F2 : json clock source configuration
- default value is the same as before patch
- system_stm32f2xx.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:41 +02:00
jeromecoutant 68e1b2b465 STM32F1 : json clock source configuration
- default value is the same as before patch
- system_stm32f1xx.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:41 +02: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
Jimmy Brisson 953b9250f1 Merge pull request #4751 from andreaslarssonublox/ublox_remove_redundant_odin_target_folder
Remove redundant ODIN-W2 target folder
2017-07-17 11:09:58 -05:00
Jimmy Brisson a0231db0b9 Merge pull request #4727 from u-blox/c030_peripheral_pins
Update UART3 pins for UBLOX_C030 platform.
2017-07-17 11:09:19 -05:00
Jimmy Brisson 1f23f74b93 Merge pull request #4732 from theotherjimmy/bcostm-pinmap
Correct DAC pin assignment
2017-07-17 11:08:57 -05:00
Jimmy Brisson 775b935ed0 Merge pull request #4687 from bcostm/update_mbed_rtx_h
STM: cleanup mbed_rtx.h file
2017-07-17 11:07:07 -05:00
Jimmy Brisson 185b7233da Merge pull request #4676 from LMESTM/issue_2959
Correctly enable / disable InterruptIn Edges detection
2017-07-17 11:06:27 -05:00
Jimmy Brisson a75f935348 Merge pull request #4664 from bperry730/fix/st_can_api_freq
STM32: Fix the CAN initializing to the wrong frequency
2017-07-17 11:06:04 -05:00
Jimmy Brisson adfed0f9de Merge pull request #4644 from 0xc0170/fix_ticker_delta_negative
Ticker: add fire interrupt now function
2017-07-17 11:05:46 -05:00
Jimmy Brisson 6593d5bc7f Merge pull request #4640 from chrissnow/xDot-Bootloader
STM32L1 Flash API and xDot bootloader support
2017-07-17 11:04:53 -05:00
Laurent MEUNIER b9d801fe72 STM32: L0: adc struct member does not exist anymore 2017-07-17 16:29:09 +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
jeromecoutant a98594d132 DISCO_L475VG_IOT: remove unavailable pins 2017-07-17 14:09:01 +02:00
jeromecoutant e0e332f5d9 STM32L4 AnalogIn init issue with _ALT pins 2017-07-17 13:33:50 +02:00
Laurent MEUNIER ea33f8bf94 STM32: F2: adc; struct member not needed
Same as other families applied here
2017-07-17 13:27:22 +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 1e821499df Merge pull request #4668 from bcostm/update_f429zi_pinouts
DISCO/NUCLEO_F429ZI: Enable all alternate functions and pins
2017-07-13 16:45:59 +02:00
Martin Kojtal 42548f3dce Merge pull request #4691 from LMESTM/analogin_sample_time
STM32: F4: Increase ADC sampling time for VBAT
2017-07-13 16:43:40 +02:00
Rob Meades 1c7a7bc6a3 Add bootloader support for the UBLOX_C030 platforms. 2017-07-13 15:42:54 +01:00
Martin Kojtal 58d0aa5ce8 Merge pull request #4694 from bcostm/typo_pins_disco_l475vg
DISCO_L475VG_IOT01A: typo corrections in PeripheralPins.c
2017-07-13 16:42:00 +02:00
Martin Kojtal 29fefe8639 Merge pull request #4699 from jeromecoutant/PR_L0_InternalADC
STM32L0 : internal ADC channels
2017-07-13 16:40:54 +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
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
andreas.larsson 969d44d833 Remove redundant ODIN-W2 target folder 2017-07-12 15:05:25 +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 668d47305b Correct DAC pin assignment 2017-07-10 13:33:21 -05: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 3d86959dd8 Merge pull request #4485 from kegilbert/f429_sdk_flash_driver-rebase
Replace CMSIS flash driver by SDK flash driver
2017-07-10 12:03:03 -05:00
Rob Meades f920cc65af UBLOX_C030: correct UART 3 Tx & Rx pins (they were the wrong way around) and add the flow control lines for UART 3. 2017-07-08 11:32:46 +01:00
Laurent MEUNIER 61648a53f5 Fix alignement 2017-07-07 17:27:46 +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
Bradley Scott 251459e8aa STM32: Remove i2c_read() and i2c_write() redirects to HAL_I2C_IsDeviceReady()
Some I2C devices require specific zero length read/write sequences which
the HAL_I2C_IsDeviceReady() redirect interferes with.  After Removing
these redirects, it was confirmed that zero length reads and writes
would both still work correctly for detecting presence/absence of an
I2C device on a bus.
2017-07-05 14:02:34 -04:00
bcostm 98aa178127 NUCLEO_F429ZI: comments corrections 2017-07-05 10:03:30 +02:00
bcostm a86fc17e99 DISCO_F429ZI: Typo correction 2017-07-05 10:03:27 +02:00
bcostm e8c817b105 NUCLEO_F429ZI: Add alternate pins and enable all pins 2017-07-05 10:03:23 +02:00
bcostm 20ef523195 DISCO_F429ZI: Typo corrections + add missing ALT pins 2017-07-05 10:03:21 +02:00
bcostm b11151a96d DISCO_F429ZI: Add missing ADC alternate pins 2017-07-05 10:03:17 +02:00
bcostm 3cdf90dc2f DISCO_F429ZI: Add alternate pins and enable all pins 2017-07-05 10:03:15 +02:00
bcostm 7b09a10360 DISCO_F429ZI: Add 'Connected to' comment 2017-07-05 10:03:11 +02:00
bcostm d58070b658 DISCO_L475VG_IOT01A: typo corrections in PeripheralPins.c 2017-07-03 16:12:14 +02:00
Laurent MEUNIER f8d6f95102 STM32: F4: Increase ADC sampling time
To get a valid VBAT measurement on F4 targets, it is required to increased
the sampling time to its maximum value.
2017-07-03 15:51:14 +02:00
bcostm bd8fd08fe4 STM: cleanup mbed_rtx.h file 2017-07-03 11:16:35 +02:00
Chris 2a2d904b91 Tidy from rebase 2017-06-30 22:31:21 +01:00
Chris a516dcac84 Code tidy 2017-06-30 22:28:06 +01:00
Chris e59c059d3f Incorrect comments removed. 2017-06-30 22:28:06 +01:00
Chris 8484467fdd GCC Bootloader support 2017-06-30 22:28:06 +01:00
Chris 82a33b2a70 IAR Bootloader support 2017-06-30 22:28:06 +01:00
Chris a4c7a29144 uArm Bootloader support 2017-06-30 22:28:06 +01:00
Chris ed51bcb1d0 Formatting tidy up. 2017-06-30 22:28:06 +01:00
Chris 65ab95572c added missing FLASH_FLAG_OPTVERR 2017-06-30 22:28:06 +01:00
Chris 5803bdd715 clear additional flags on erase to prevent errors 2017-06-30 22:28:06 +01:00
Chris 802000b059 GCC_ARM VTOR fixed, doesnt fit in the bootloader region though.. 2017-06-30 22:28:06 +01:00
Chris 0ff055115a VTOR bootloader aware
Attempt to add flash API but not working properly
2017-06-30 22:28:06 +01:00
Chris 18998411d8 added flash algorithm 2017-06-30 22:25:53 +01:00
Chris c1e32a75df initial commit of xDot bootloader 2017-06-30 22:25:53 +01: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
Laurent MEUNIER cea91306de STM32: Raise error in case of spurious interrupt
In case we've run through the entire GPIOs loop, withouth finding a
matching interrupt, we're in the case of a spurious interrupt, let's
raise an error to track it down.
2017-06-30 13:26:09 +02:00
Laurent MEUNIER ade981dc9e STM32: Store and restore rising falling config of gpio_irq
Now that rising / falling edge detection is disabled in the
gpio_irq_disable function, we also need to restore it when gpio_irq_enable
gets called.
2017-06-30 13:26:09 +02:00
Laurent MEUNIER 88770528bd STM32 Fuly disable GPIO irq settings
When disabling GPIO irq, also the falling / rising edge settings need
to be reset (EXTI_RTSR and EXTI_FTSR registers).

If not reset, the same EXTI line can be later enabled again with a wrong
Rising / Falling configuration. This was especially seen and reported in
ci-test tests-api-interruptin on NUCLEO_F446RE target where DIO2=PA_10 and
DIO6=PB_10 were successively tested: as they are sharing the same EXTI_LINE
(EXTI_10), this resulted in calling the irq_handler with wrong
IRQ_FALL/IRQ_RAISE parameter and donothing being called in loop.
2017-06-30 13:26:09 +02:00
jeromecoutant aefb13ab2a STM32L0 : internal ADC channels 2017-06-30 11:07:31 +02:00
adustm 90bc8ca7ae Replase CMSIS flash driver by SDK flash driver 2017-06-29 14:25:27 -05:00
adustm 4860e6a485 Rebase of: cb3907ef70
typo in flash_s struct
2017-06-29 14:24:40 -05:00
adustm e7fb5b4edd Rebase of: dfd0cf63e9
fix STM32F439 flash HAL
2017-06-29 14:24:40 -05:00
adustm 64e902edda Rebase: 0d1c6c2d34
This commit completely rewrote flash_api.c in a few places so kicked out changes from Master and accepted the branch changes.

F429 + F439 : changes after code review
GetSector has been rewritten
2017-06-29 14:24:40 -05:00
adustm 565c3c11ad Allow UBLOX to use SDK flash driver 2017-06-29 14:24:40 -05:00
Jimmy Brisson 9b082fff55 Merge pull request #4656 from LMESTM/update_flash_comments
Correct comments in flash api for STM32 L0 targets
2017-06-29 11:09:23 -05:00
Jimmy Brisson 0c5fc5b05a Merge pull request #4641 from LMESTM/Increase_STM32L0_analogin_sampling_time
Increase L0 ADC sample time
2017-06-29 11:09:03 -05:00
Jimmy Brisson d52ed5394c Merge pull request #4632 from 0xc0170/fix_stm32_32bitticker
STM32: fix us ticker set event timestamp double ISR possibility
2017-06-29 11:08:42 -05:00
Jimmy Brisson 041737b248 Merge pull request #4577 from MultiTechSystems/xdot-enable-hsi
XDOT_L151CC: enable HSI after waking from stop mode so ADC functions
2017-06-29 11:07:17 -05:00
Jimmy Brisson ea5c2cf328 Merge pull request #4421 from jeromecoutant/PR_CONFIG_CLOCK
STM32 : Clock source selection in json config file
2017-06-29 11:04:24 -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 2ae2d9896e STM32F4: json clock source configuration
- default value is the same as before patch
- system_stm32f4xx.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
- nvic_addr.h file is now in TARGET_STM level, and can be used everywhere
2017-06-29 09:57:40 +02:00
Brad Perry f7d76b5d29 Fixing the problem where the CAN is initialized to the wrong frequency at startup regardless of the value set in the constructor. Issue #3863 2017-06-28 12:07:14 -07:00
jeromecoutant b5ef7a675a Add the correct startup s file in TARGET_STM32F767 2017-06-28 17:13:02 +02:00
Jimmy Brisson bb3bedad79 Merge pull request #4638 from bcostm/fix_cmsis5_disco_l475vg
DISCO_L475VG_IOT01A: Fix startup files for cmsis5
2017-06-28 09:20:05 -05:00
Laurent MEUNIER c5d76a2950 Correct comments in flash api for STM32 L0 targets
The initial comments were copied from L4 implementation but do not apply
to L0 targets where 1 sector is composed of a constant number of pages.
2017-06-28 09:41:52 +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
Martin Kojtal 0591b2bcd4 STM32: fix us ticker set event timestamp
While we are handling new timestamp, disable ticker's interrupt.
2017-06-27 09:54:29 +01:00
Laurent MEUNIER ca26db620b Increase L0 ADC sample time
With default sampling time, the MBED2 and CI test shield tests would fail
because the stabilization slope of ADC is relatively slow.
ERROR (out:0.8000) - (in:0.7407) = (0.0593)
ERROR (out:0.9000) - (in:0.8354) = (0.0646)
ERROR (out:1.0000) - (in:0.9289) = (0.0711)

This is related to the 10kOhms resistors used to connect Ain to
Aout mounted on the CI shileds, and internal capacitance of L0 targets.
If connecting Ain and Aout with wires, bypassing the resistors, the test
is passed. So we're increasing the sampling time to let the automated
ci shiled tests PASS.

OK    (out:0.8000) - (in:0.7863) = (0.0137)
OK    (out:0.9000) - (in:0.8869) = (0.0131)
OK    (out:1.0000) - (in:0.9844) = (0.0156)
2017-06-27 10:33:42 +02:00
Laurent MEUNIER 4238216ad8 STM32: STM32F413xH dac_s common definition
Fixing conflict as STM32F413xH target has been merged after the first
version of moving dac_s structure definition to common_ojects.h
2017-06-27 09:30:45 +02:00
Laurent MEUNIER 07575b33f0 STM32: STM32L475xG dac_s common definition
Fixing conflict as STM32L475xG target has been merged after the first
version of moving dac_s structure definition to common_ojects.h.
2017-06-27 09:27:46 +02: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
Laurent MEUNIER b51d676dc0 STM32: analog_out: Enable Buffer and switch
ADC1 channel2 and ADC2 of few targets only have an output switch and no
buffer. This switch needs to be enabled, and also the buffer can be enabled
in order to reduce the output impedance on output, and to drive external
loads directly without having to add an external operational amplifier.
2017-06-27 09:27:46 +02:00
Laurent MEUNIER cdd581b244 STM32: analag_out: Use dynamic handle in object rather than static
This allows a proper handling of multiple instances. Also this commit
stores the channel in the HAL format so that it can be re-used more easily
and call to HAL are straightforward.
2017-06-27 09:27:46 +02:00
bcostm 03930b88f6 DISCO_L475VG_IOT01A: Add missing nvic_addr.h file 2017-06-26 20:14:08 +02:00
bcostm 72be051088 DISCO_L475VG_IOT01A: Update system init for cmsis5 2017-06-26 19:04:44 +02:00
bcostm bd6d7382a3 DISCO_L475VG_IOT01A: Update toolchain files for cmsis5 2017-06-26 19:02:52 +02:00
Jimmy Brisson fc39ad1625 Merge pull request #4422 from jeromecoutant/PR_F4_HSE_TIMEOUT
STM32F4 set HSE timeout value to 100ms
2017-06-26 10:29:13 -05:00
Jimmy Brisson d103979e92 Merge pull request #4572 from bcostm/add_usb_disco_l072cz
DISCO_L072CZ_LRWAN1: Add support of USB Device
2017-06-26 10:28:31 -05:00
Jimmy Brisson 50ec6db4d3 Merge pull request #4405 from arostm/Fix_Issue_4404
DISCO_L072CZ_LRWAN1: PC_13 definition missing in PinNames.h fix
2017-06-26 10:21:53 -05:00
Jimmy Brisson 0d2fb2d0a7 Merge pull request #4390 from mickeyln/patch-1
Nucleo-F070RB It doesn't work when use internal clock
2017-06-26 10:20:50 -05:00
Anna Bridge f1d0314783 Merge pull request #4410 from arostm/dev_disco_f413ZH
DISCO_F413ZH: Add new platform
2017-06-23 11:41:50 +01: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
arostm b5af4c40ec DISCO_F413ZH: Add include of LL timer file 2017-06-22 09:23:09 +02:00