I2C HardWire doesnt work with GD32F103CB

Boards based on the GigaDevices GD32F103 microcontroller
User avatar
ccanovas
Posts: 2
Joined: Sun Dec 18, 2016 11:34 am

I2C HardWire doesnt work with GD32F103CB

Postby ccanovas » Sun Dec 18, 2016 4:34 pm

After many hours and many tests, I2C HardWire doesn't work.
I use the i2c_scanner_hwire nothing happens everything freeze.

My investigations :

1 ) call _i2c_irq_priority_fixup() make the microcontroller hangs.
2) wait_for_state_change() wait for ever.
3) _i2c_irq_handler() seems to be called heavily.

The software wire works but not so stable with my I2C device.

User avatar
RogerClark
Posts: 5303
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: I2C HardWire doesnt work with GD32F103CB

Postby RogerClark » Sun Dec 18, 2016 7:40 pm

It has become clear over the last year, that the GD32 is not a direct replacement for the STM32, Despite GD's claims. so I guess I should just remove support for it from the repo.

I don't have time to resolve amy such issues, and GD32 boards are no longer available cheaply, so it seems pointless to continue with them.

User avatar
ccanovas
Posts: 2
Joined: Sun Dec 18, 2016 11:34 am

Re: I2C HardWire doesnt work with GD32F103CB

Postby ccanovas » Mon Dec 19, 2016 9:38 am

Hi Roger,

First, Thank you for yours jobs,contributions and those libraries. It makes the stm32 comes in Arduino world :D .

I agree with you about the GD32xxx , on the paper they are look like equal to the STM32xxx but in the real world that is not exactly the case.

I'd like to contribute to the GD32xxx libs improvments and bug fixes. I've downloaded the datasheets and i will dig a little bit and try to find an issue to those troubles.Gigadevice provides a libs to make the GD32xxx works with Keil. i've download that and Keil. The first things i saw is the interrupts defintion table seems to be slightly different to the STM32xxx wich can explains the behavior, because when the interrupt I2C event is enable it acts as timer interrupt or pin change state interrupt or something like this (that an hypothesis). Anyway that sounds like bad mapping of interrupt vector.
The bootstrap code provided by Gigadevice matches with your patch to make the bus works with the correct frequency (divider are the same and registers settings also).
The software I2C lib works but it is not so stable because the frequency SCLK seems to be not very stable.
The USB serial works fine.

User avatar
RogerClark
Posts: 5303
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: I2C HardWire doesnt work with GD32F103CB

Postby RogerClark » Mon Dec 19, 2016 10:32 pm

@ccanovas

Thanks.

I know the basics work on the GD32, and I made a few changes to allow clock speeds above 72MHz to work with USB, using the additional bit in the USB divider PLL.

But I couldnt get the ILI9341 display SPI example to work, so there seems to be some problem with SPI or possibly just the DMA SPI that the high speed STM32 lib for the ILI9341 uses.

Unfortunately, there are so many other things going on with the STM32 (and ST's own core for this board), as well as my work commitments that I can't find the time to work out why the G32 has problems.

But I'm happy to accept PRs as fixes, as long as those fixes are done via #ifdef's in the code.

As any change that wasnt just in an ifdef would need extensive testing on many different STM32 boards, under a variety of scenarios - and unfortunately I don't have any time :-(


Return to “GD32F103 boards”

Who is online

Users browsing this forum: No registered users and 1 guest