When I was looking into microcontrollers with 32F103 peripherals, but with a RISCV-core, I ran the stm32f1xx HAL on them. The assumption was, their peripherals were the same. (Except USB). Using this on a GD32VF103, I was able to communicate with most I²C sensors I connected to the bus, but I ran into issues with certain sensors, such as the ccs811 and hcd1080.

Further testing revealed the same results running on GD32F103. This suggests there is some kind of issue with GigaDevice’s I²C implementation in combination with said sensors. I’ve mentioned this in a post of May 2022.

Anyhow, I decided to take up this issue again. I hooked up my boards, attached a logic analyser, and ran my tests. Now guess what? It succeeds on a GD32F103. Why? What has changed since I last ran my tests. One thing that changed is I’ve updated the stm32f1xx HAL. It would be curious to see STM’s HAL fixing issues with their competitors hardware.

I’ve been trying to reproduce the bug by building older versions of the stm32f1x HAL, all the way back to version 1.1.4 from January 2020, without any success. Everything works, while my notes from last May say it shouldn’t work on a GD32F103. So, it seems all good on the GD32F103. No problems to be found reading the CSS811 or the HCD1080, which would have given me trouble last May.

However, on the GD32VF103, the RISCV variant from GigaDevice, I’m experiencing some trouble. Partly these are toolchain issues, but I am able to build some code now, and now the LM75B temperature sensor is giving me issues.

For now, the issues on the Cortex-M3 GD32F103 cannot be replicated. Everything works for the ARM device. No answers on why there were issues or why they are gone now.