Commit Graph

13 Commits (de9f9dd3a248b8e4b06894b3d52d81bdace6b5e1)

Author SHA1 Message Date
jeromecoutant 3826ad23f6 STM32F3 : internal ADC channels 2017-08-09 11:01:23 +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
jeromecoutant bc40b735d4 STM32F3 : json clock source configuration
- default value is the same as before patch
- system_stm32f3xx.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:42 +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 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 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
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
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
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
Bartek Szatkowski b97ffe8fdc CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation 2017-05-30 18:55:51 +01:00
Bradley Scott 2f73d3b4a7 STM32F3: Remove dependence upon a specific flash vector table location
The STM32F3 cmsis_nvic code is currently checking for a specific flash
address when determining if the vector table is in flash or RAM.  By
changing the test to instead see if the vector table base is NOT set to
the RAM address, it simplifies the code, and removes the dependency on
the flash vectors being located at a specific address.  This becomes
important when adding a custom boot loader, which requires that the
flash vector table location in the mbed project be at a different
address.
2017-05-15 14:20:50 -04: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
adustm c596cdad36 STM32F334x8 folder struct 2017-01-27 19:38:26 +01:00