STM32 as I2C slave is supported?
Posted: Thu Apr 09, 2020 9:33 pm
Hi
I have a Particle Argon connected to an STM32F303 via I2C bus.
The Argon is configured for the instance as the master, with Baud = 100KHz.
The STM32F303 is configured as the slave as follows:
Channel = Software
Baud Select = 100KHz
Slew Rate Control = Disabled
SMBUS Inputs = Disabled
SDA = Port F.0
SCL = Port F.1
Address = 0x03
Mask = 0xFF
In the FCF I have included an I2C macro, taken precisely from the Matrix examples, that just receives the incoming byte and checks the Status (0x21) if is data or address, reads the address and sends ACK (0) and then reads the data and sends NACK (1).
The FCF is compiled successfully without errors.
In the Argon, I have flashed a test I2C code provided by Particle, which simply scans from address 0x00 to 0x7F if there is a slave connected to the bus and if yes it prints on the serial monitor its address.
I've tried many times with different configurations of STM32 but the Argon I2C scanner does not detect it. It returns always "I2C device not detected".
Please could you confirm if the I2C slave mode for STARM is working from the Flowcode side?
If yes, I could investigate the Particle Argon I2C side if there are bugs within the I2C scan firmware.
Thanks for any help.
Edit: From the hardware side, I've checked with the scope the SDA and the SCL lines and there is activity on both.
I have a Particle Argon connected to an STM32F303 via I2C bus.
The Argon is configured for the instance as the master, with Baud = 100KHz.
The STM32F303 is configured as the slave as follows:
Channel = Software
Baud Select = 100KHz
Slew Rate Control = Disabled
SMBUS Inputs = Disabled
SDA = Port F.0
SCL = Port F.1
Address = 0x03
Mask = 0xFF
In the FCF I have included an I2C macro, taken precisely from the Matrix examples, that just receives the incoming byte and checks the Status (0x21) if is data or address, reads the address and sends ACK (0) and then reads the data and sends NACK (1).
The FCF is compiled successfully without errors.
In the Argon, I have flashed a test I2C code provided by Particle, which simply scans from address 0x00 to 0x7F if there is a slave connected to the bus and if yes it prints on the serial monitor its address.
I've tried many times with different configurations of STM32 but the Argon I2C scanner does not detect it. It returns always "I2C device not detected".
Please could you confirm if the I2C slave mode for STARM is working from the Flowcode side?
If yes, I could investigate the Particle Argon I2C side if there are bugs within the I2C scan firmware.
Thanks for any help.
Edit: From the hardware side, I've checked with the scope the SDA and the SCL lines and there is activity on both.