Commit Graph

62 Commits (0b0db77a6ed1f8b93016ff186791403a3ef3bb36)

Author SHA1 Message Date
Martin Kojtal 5750f31d6d Merge pull request #3238 from LMESTM/dev_i2c_stm32f4hal
Dev i2c stm32f4hal
2016-11-16 17:42:12 +00:00
Sam Grove e875dbc90d Merge pull request #3237 from javierpedrido/master
Added back USART 6 pins
2016-11-14 21:46:59 -06:00
Laurent MEUNIER e293e07749 stm32f4 make comment more explicit
As reported during review, this was not understandable as it is.
the get_i2c_obj allows to get a pointer to i2c_s struct from the
handle pointer. This therefore makes a hard-coded assumption
about the struct itself
2016-11-10 17:30:04 +01:00
Brian Daniels 52dc7c5423 Renames all prebuilt binaries to be prefixed with 'lib'
This fixes an issue with make_iar, since IAR requires all libraries that
are linked to be prefixed with 'lib'.
2016-11-09 11:08:01 -06:00
Laurent MEUNIER b491165eac [STM32F4] Add few prints for I2C debug 2016-11-09 18:03:04 +01:00
Laurent MEUNIER a65bacc032 [STM32F4] Master receive sequential - fix for HAL I2C
in case of 2 consecutives calls to HAL_I2C_Master_Sequential_Receive_IT
with the Xfer mode I2C_FIRST_AND_LAST_FRAME, the second trasnfer does
not start at all.

It seems this is because the previous state is maintained as I2C_STATE_MASTER_BUSY_RX
and therefore the START condition will not be generated
2016-11-09 18:03:02 +01:00
Laurent MEUNIER a50dc77c60 STM32: I2C: Change the master sync implementation to use ITs
With this new implementation, as in slave implementaiton, we use the
interrupts instead of accessing to registers continuously.

This has 2 main advantages:
- this shall improve performances overall and allows for sleep
time in the future
- this also removes some direct registers access from this
layer of code and makes it more generic among families
2016-11-09 18:02:59 +01:00
Laurent MEUNIER ec95aa5701 STM32: I2C: Reset I2C in case of errors to recover
This is to avoid an IP / bus deadlock.

This requires to store scl and sda in order to call the init function.
2016-11-09 18:02:57 +01:00
Laurent MEUNIER 42d89b0665 STM32: I2C: Update Timeout computation
The timeout values are based on for loops and therefore should depend
on the core frequency and the I2C interface frequency.

This patch introduces this computation and base the timeout on the time
it should take to send a byte over the I2C interface. When sending a
number of bytes, this value can also be used.

In the loops, the timeout should also be decreased before the while
condition so that its value is 0 in case the timeout elapsed and this
can be treated as an error.
2016-11-09 18:02:54 +01:00
Laurent MEUNIER 79504a6a38 STM32: I2C: Change the slave API implementation to use ITs
With this new implementation, the slave use the Interrupt
to be notified of a request from master, instead of
accessing to registers continuously.

This has 2 main advantages:
- this shall improve performances overall and allows for sleep
time in the future
- this also removes some direct registers access from this
layer of code and makes it more generic among families
2016-11-09 17:22:28 +01:00
Laurent MEUNIER d71537bb00 STM32: I2C: use irq helper function 2016-11-09 17:22:28 +01:00
Laurent MEUNIER c2060e34a3 STM32: I2C: Add-up irq handlers
With this commit we define I2C irq handlers that can be used by the driver
in sync mode. This also provides a mecanism for enabling and/or disabling
these handlers

Those handlers will be superseded by MBED ones in case of async mode usage.
2016-11-09 17:22:28 +01:00
Laurent MEUNIER 490437ae29 STM32: I2C: Move up get_i2c_obj
so that it can be used as well in sync mode
2016-11-09 17:22:28 +01:00
Laurent MEUNIER 0bee69023c STM32: I2C: Don't use global init variables
No need to store the init status of each IP.
Init can be called again in case we try to recover.
2016-11-09 17:22:28 +01:00
Laurent MEUNIER 2b53dfc453 STM32: I2C: configure slave address with HAL API
Instead of direct registers access, let's use HAL API.
This makes the code more generic accross STM32 families.
2016-11-09 17:22:28 +01:00
javierpedrido b7882d6e9b Added back USART 6 pins 2016-11-09 12:14:35 -03:00
andreas.larsson 31a7cd017e Tab -> spaces 2016-11-07 21:59:27 +01:00
andreas.larsson baf519f4c5 Updated ublox ODIN-W2 binaries 2016-11-07 19:11:39 +01:00
Andreas Larsson fde39602b9 Fixed dynamic message queue for scan results 2016-11-07 15:52:59 +01:00
Andreas Larsson a4f09b5fdb Added cbMAIN_dispatchEventQueue 2016-11-07 15:52:58 +01:00
andreas.larsson 32dfe73b09 Added missing checks for wifi_link_out when allocating packets 2016-11-07 15:52:57 +01:00
andreas.larsson fd7c9cc13a Added copying of the wifi_link_out buffer since the buffer might change after call chain has ended. 2016-11-07 15:52:56 +01:00
Martin Kojtal 7eaf32baa0 Merge pull request #3075 from geky/nsapi-error-size-types-2
nsapi - Add standardized return types for size and errors
2016-11-07 11:13:40 +00:00
Christopher Haster b045c8ba00 nsapi - Adopted standardized return types in the Odin wifi interface 2016-11-02 15:37:34 -05:00
Mike Fiore 6cddb4df8b [MTS_MDOT_F411RE] add back SPI3 pins that shouldn't have been removed 2016-11-02 13:41:04 -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
Michel Jaouen ee22d0a054 STM32F4xx: GCC_ARM remove zero bss, in startup.
zero bss is done in libc init after call to _start.
2016-10-26 14:41:45 +02:00
Martin Kojtal 4d1d1c5b69 Merge pull request #3068 from MultiTechSystems/mdot-pin-updates
MultiTech mDot - clean up PeripheralPins.c and add new pin names
2016-10-25 10:47:59 +02:00
Martin Kojtal 5b67832959 Merge pull request #3054 from andreaslarssonublox/ublox_fix_odin_mbedtls_config
Moved mbedtls config for u-blox ODIN-W2 to macros in target.json
2016-10-20 10:59:05 +01:00
Sam Grove fc39f6b736 Merge pull request #3064 from c1728p9/f429_heap
NUCLEO_F429 - Increase IAR heap size
2016-10-19 05:51:20 -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
Russ Butler d854547b0c NUCLEO_F429 - Increase IAR heap size
Increase the IAR heap size from 48KiB to 64KiB. This give enough heap
space to run the TLS encryption examples.
2016-10-18 16:43:28 -05:00
Mike Fiore c6fde7cfce [MTS_MDOT_F411RE] remove duplicate PWMs, fix swapped pins 2016-10-18 09:34:46 -05:00
andreas.larsson cb113d738e Moved mbedtls config for u-blox ODIN-W2 to macros in target.json 2016-10-18 01:07:48 +02:00
andreas.larsson b8355c2073 Fixed the emac_interface_t struct so that the struct constructor is not used.
We can not rely on the struct constructor to be run since wifi_emac_get_interface can be run from the OdinWiFiInterface constructor before that.
2016-10-18 00:36:30 +02:00
Mike Fiore b6f7b8c463 [MTS_MDOT_F411RE] clean up peripheral pins & add new pin names 2016-10-17 15:36:28 -05:00
Russ Butler 7bcc63b202 Merge pull request #2977 from andreaslarssonublox/ublox_drivers
Ublox drivers
2016-10-14 14:56:06 -05:00
andreas.larsson 394796f47e Added guard for DEVICE_EMAC in wifi_emac_api.cpp 2016-10-14 02:42:53 +02:00
andreas.larsson 62bc6869e8 Added u-blox ODIN-W2 drivers for all toolchains 2016-10-13 23:37:42 +02:00
adustm a07a271fe5 ADD NEW TARGET : NUCLEO_F439ZI, based on existing NUCLEO_F429ZI 2016-10-13 18:29:09 +02: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 1fb5b3f2d0 [STM32F4] SPI Peripheral pin - allow SPI3 to be used
Let's swap default PA_4 pin mapping to SPI_3 otherwise SPI3 cannot be used
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
Sam Grove 217a8fba8e Merge pull request #2972 from betzw/betzw_i2c_wb
Make (synchronous) I2C work again
2016-10-12 17:16:10 -05:00
Sam Grove 35d6682d61 Merge pull request #2970 from andreaslarssonublox/ublox_enable_hw_entropy
Enabled TRNG functionality for UBLOX_EVK_ODIN_W2 target.
2016-10-12 17:15:55 -05:00
Sam Grove f9ee683fa7 Merge pull request #2611 from adustm/STM32_entropy
STM32 hw entropy
2016-10-12 17:06:51 -05:00
Wolfgang Betz d258c14e1e [STM32F4]: I2C bugfix 'i2c_stop()' timeout
- Remove waiting for 'BTF' flag in 'i2c_stop()':
  When 'i2c_stop()' is called from 'i2c_read()' or 'i2c_write()' flag 'BTF'
  has already been cleared (indirectly) by the calling functions and therefore
  'i2c_stop()' would mistakenly always run into a timeout.
- Delay clock enabling until pins are configured:
  Enabling the I2C bus clock before configuring its pins might in rare
  cases lead to HW faults on the bus.
- Move initialization of 'handle->Instance' to function 'i2c_reset()':
  As 'i2c_reset()' uses '__HAL_I2C_GET_FLAG(handle, I2C_FLAG_BUSY)' field
  'handle->Instance' must have been initialized before doing so. Therefore,
  this operation has been anticipated by moving it from function
  'i2c_frequency()' to function 'i2c_reset()'.
2016-10-12 07:02:42 +02:00
andreas.larsson 84a25e72f7 Fixed wrong stack pointer 2016-10-10 18:55:46 +02:00
Sam Grove 4297042096 Merge pull request #2932 from bcostm/adcintch_F4
STM32F4xx - Fix issue with ADC internal Temperature and VBat channels.
2016-10-10 10:35:06 -05:00