I have an application on an stm32l432 which uses both i2c and adc. i2c works fine except if I execute
adcStart(&ADCD1, NULL)
the adc works fine once I start it, but if the adc is started, the i2c i2cMasterTransmitTimeout(..) command returns an error code -- even if the only adc command executed is the adcStart command. Something in the initialization code is stepping on the i2c, but I haven't got a clue where to look.
Kernel: 4.0.0
Compiler: GCC 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]
Architecture: ARMv7E-M
Core Variant: Cortex-M4
Port Info: Advanced kernel mode
Platform: STM32L4xx Ultra Low Power
Board: STMicroelectronics STM32 Nucleo32-L432KC
Build time: May 30 2017 - 18:45:04
adcStart breaks i2c on stm32l432 ?
Moderator: RoccoMarco
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: adcStart breaks i2c on stm32l432 ?
Hi,
Is there a DMA conflict? check the channel assigned in mcuconf.h.
Moved in STM32 support.
Giovanni
Is there a DMA conflict? check the channel assigned in mcuconf.h.
Moved in STM32 support.
Giovanni
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
Re: adcStart breaks i2c on stm32l432 ?
There doesn't seem to be a channel conflict -- ADC1 is on channel 1, I2C1 on channels 6 & 7.
Geoffrey
Geoffrey
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: adcStart breaks i2c on stm32l432 ?
I have no clue of what could cause this...
Is it just adcStart() or also some pin mode change or other things?
Giovanni
Is it just adcStart() or also some pin mode change or other things?
Giovanni
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: adcStart breaks i2c on stm32l432 ?
Is adcStart() placed before i2cStart() or after? does it make a difference? are debug options enabled in chconf.h?
Giovanni
Giovanni
Re: adcStart breaks i2c on stm32l432 ?
Students of mine have made a project, (an autonomous stoplight for bicycle) using stm32l432, they use I²C for IMU access, and ADC for testing battery level, and they did not mention me any incompatibility problem between I²C and ADC on stm32l432.
Alexandre
Alexandre
-
geoffrey.brown
- Posts: 122
- Joined: Thu May 07, 2015 9:47 pm
- Has thanked: 3 times
- Been thanked: 18 times
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times