Firmware bypass using 2 i2c ports

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

jslee
Posts: 7
Joined: Thu Jun 11, 2020 9:54 am
Has thanked: 1 time

Firmware bypass using 2 i2c ports

Postby jslee » Fri Sep 10, 2021 3:39 am

Hello.
I'm working on FW byapss process implementation.
Below is my environment.
- Board : STM32F4 DISCOVERY
- OS : ChibiOS
- process block
[Test board] ←communication: I2CD1 port→ [stm32f4 disc] ←communication: I2CD2 port→ [sensor module]

In my case, how to set 2 I2C Ports?
I can't feel it yet. help please.

User avatar
Giovanni
Site Admin
Posts: 13751
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 922 times
Been thanked: 787 times
Contact:

Re: Firmware bypass using 2 i2c ports

Postby Giovanni » Fri Sep 10, 2021 8:14 am

Hi,

I am not sure to understand your use case. Note that there is no official slave I2C support in ChibiOS, there could be modified drivers in the community directory.

Giovanni

jslee
Posts: 7
Joined: Thu Jun 11, 2020 9:54 am
Has thanked: 1 time

Re: Firmware bypass using 2 i2c ports

Postby jslee » Mon Sep 13, 2021 5:47 am

It means chibiOS's I2C master, slave setting.

System configuration :
[Main Chip] ←(1)→ [STM32F4/Chibios/I2CD1]
(1) Main Chip : I2CD1 Master mode
STM32F4 : I2CD1 Slave mode
[STM32F4/Chibios/I2CD2] ←(2)→ [sensor]
(2) STM32F4: I2CD2 Master mode
sensor : I2CD2 Slave mode

Main chip transmits register address(including set value).
STM32F4 receives the address and transmits it to sensor.
STM32F4 receives(=read) sensor value from sensor's specific address and transmit the value to Main Chip.
Finally, Main chip receives(read) the value and use it.
I said 'Firmware bypass using 2 i2c ports' about above.

'(2)' is not difficulty.
'i2cMasterTransmitTimeout', 'i2cMasterReceiveTimeout' functions are implemented, already.
'(1)' is main problem to me.
In this case, how can I implement I2C Slave mode on ChibiOS?

User avatar
Giovanni
Site Admin
Posts: 13751
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 922 times
Been thanked: 787 times
Contact:

Re: Firmware bypass using 2 i2c ports

Postby Giovanni » Mon Sep 13, 2021 5:57 am

As I explained, there is no I2C slave support in ChibiOS. You need to implement that at register level or to import code from ST low level libraries.

Giovanni

jslee
Posts: 7
Joined: Thu Jun 11, 2020 9:54 am
Has thanked: 1 time

Re: Firmware bypass using 2 i2c ports

Postby jslee » Mon Sep 13, 2021 6:21 am

Aright, I will try.
Thank you Giovanni.

User avatar
FXCoder
Posts: 369
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 170 times
Been thanked: 125 times

Re: Firmware bypass using 2 i2c ports

Postby FXCoder » Mon Sep 13, 2021 8:08 am

Hi,
This might give you a head start on your own implementation..
viewtopic.php?t=3544

--
Bob

jslee
Posts: 7
Joined: Thu Jun 11, 2020 9:54 am
Has thanked: 1 time

Re: Firmware bypass using 2 i2c ports

Postby jslee » Tue Oct 12, 2021 11:01 am

FXCoder wrote:Hi,
This might give you a head start on your own implementation..
viewtopic.php?t=3544


Thank you, Bob.
I'm trying that. But, It's still not easy.
I will keep doing

steved
Posts: 776
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 10 times
Been thanked: 123 times

Re: Firmware bypass using 2 i2c ports

Postby steved » Tue Oct 12, 2021 5:33 pm

There's an alternative I2C slave, originally written by genosensor, and modified by me for the later I2C ports, if you search


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 13 guests