STM32-H407 I2C program not running on GD32-H407

Started by itisnt, November 10, 2022, 04:06:23 PM

Previous topic - Next topic

itisnt

Hi Guys, we have an application for the STM32-H407. And since the STM32F407 can't be delivered, we bought a couple of GD32-H407 from Olimex as spare parts.
But maybe i misinterpreted the webpage that both controllers are compatible with each other, means for me I should be able to load the binary for the STM32F407 to the GD32F407 ?

A couple of things seems to work, 1s blinking led, main loop with SVO output over the ST-Link V2 Adapter.

But with I2C I'm struggling. We have a FRAM in the I2C Bus on PF0/PF1 and this does not work. On the oscilloscope I see four short (~8ms) drops of the SDA line short behind each other and that's it.

Any idea or I'm totally wrong with putting the same binary on both boards ?
Or is there a known issue with the I2C bus on the GD device ?

Any help would be apricated.
 
Regards,
Daniel

LubOlimex

Comparing the datasheets it appears PF0 and PF1 are different I2C numbers. In STM32 it is I2C2, in GD32 it is I2C1.

You would need edit and to re-compile. Or search for the I2C1 at another location at the GD32 board - seems like PC9/PA8 and other places  :)

The datasheet for the GD chip can be found here:

https://gd32mcu.com/data/documents/datasheet/GD32F407xx_Datasheet_Rev2.5.pdf

The datasheet for the STM32 chip can be found here:

https://www.st.com/resource/en/datasheet/dm00037051.pdf

Technical support and documentation manager at Olimex

itisnt

Thanks,

That was also my first thought, but if you read the datasheet, you will see that ST has I2C1, I2C2 and I2C3 but GD has I2C0, I2C1 and I2C2

So if i take I2C2 in my STM32 based program it takes the registers which are I2C1 in GD and that should match for PF0 / PF1. Or am i wrong ?

And i see a reaction on SDA (PF1) on the oscilloscope. Maybe something with the different clock setups are different on GD ?

Daniel

LubOlimex

Could be. On a side note, we had to re-compile the test examples we used here, I think there was some memory handling difference that required it.
Technical support and documentation manager at Olimex

itisnt

I recompiled a lot, but i did not change the linker file, Makefile or anything else.

Hm, i am afraid i have to create a GCC/Makefile based I2C example with the GD Libs witch works, then i can compare what is different.

I you have some skeleton or template for the GD32-H407 with the 12MHz Osc and GCC and the GD32 libs, or know where i could find one, that would be awesome.

Daniel

itisnt

Ok, partially solved. It seems that my I2C Driver for the FRAM works on the original STM32-H407, but not with the GD32-H407. I used now an i2c.c file from an older STM32F4_Discovery project and it runs.
But i have no clue why ::)