I2C4 in ST_STM32F769I_DISCOVERY Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

I2C4 in ST_STM32F769I_DISCOVERY

Post by josesimoes »

Hello,

Was trying to use I2C4 on this Discovery board to enable the touch screen controller.
It's throwing a hard fault when calling line 835 @ os\hal\ports\STM32\LLD\I2Cv2\hal_i2c_lld.c

dmaStreamSetPeripheral(i2cp->dmatx, &dp->TXDR);

I've tried to tweak the DMA assignments without success.
If it's worth it I can use I2C1 just fine.

Couldn't find anything that looks obvious to me on what could be causing this.
Any hints?

BTW, I'm using the latest 19.1.3.

Thanks!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Giovanni »

Could you compile with -O0 and see what exactly is throwing the hard fault?

That function does not touch I2C4, it just sets DMA registers.

Giovanni
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by josesimoes »

Giovanni,

I've just compiled with -O0 as suggested. The hard fault is still there, but I couldn't see any indication on what could be causing it...
I do have a fault handler but I couldn't find anything from the output.


In the mean time I've stumbled on this:
viewtopic.php?f=35&t=5443

It's on a different series and I2C driver, I know, but could it be related?
I've checked the vectors myself and haven't found anything suspicious...
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Giovanni »

Hi,

I tried adding an i2cStart() to the RT-STM32F746G-DISCOVERY demo and it goes past i2cStart() without problems. I tested on trunk and the latest 19.1.x.

Could you give trunk code a try? or update to latest 19.1.x which will become 19.1.4 soon.

Giovanni
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by josesimoes »

Thanks for looking into this.

I'm already using the latest on 19.1.x...

A question that may be stupid, but just to be sure: your test was with I2C4, correct?

Thanks!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Giovanni »

Yes, I2CD4.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Giovanni »

Any news on this?

Giovanni
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by josesimoes »

Nope. Keeping throwing a hard fault...
User avatar
Abusous2000
Posts: 15
Joined: Fri Jul 05, 2019 1:26 am
Has thanked: 7 times
Been thanked: 3 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Abusous2000 »

I got it to work on both STM32F746g-discovery and STM32F769i (with LCD & Audio decoder wm8994) on I2C4. Make sure that you have enabled the pins with open drain and highest speed only; and you will be OK
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C4 in ST_STM32F769I_DISCOVERY

Post by Giovanni »

Closing until/unless there is confirmation of this problem.

Giovanni
Post Reply