gd32-rs icon indicating copy to clipboard operation
gd32-rs copied to clipboard

GDF30x HAL

Open romainreignier opened this issue 6 months ago • 2 comments

Hello dear gd32-rust community!

For a personal project, I would like to use Rust on a GD32F303. I have discovered your project and seen that the PAC it here but not the HAL. I have also found that the gd32-rs/gd32-hal has some support for it but seems very minimal.

I understand that I will need to write the HAL myself.

But as of 2025, I feel that embassy-stm32 is nicer to use and might be a better starting point. As I understand, if I want to borrow has much code as possible from embassy-stm32, I would need to generate a PAC generated with chiptool.

Have you experienced any of these solutions on GD32 devices?

As a first step, I might start from the gd32f1x0-hal as the gd32f3 peripherals seems to be close to the gd32f1 ones and use RTIC framework.

romainreignier avatar May 13 '25 13:05 romainreignier

Hi there, I'm afraid I haven't yet had a chance to try embassy or chiptool myself. You could try running chiptool on the patched SVD files from this repository and see if it works. If so, a patch to run it automatically so we can release PAC crates based on that as well would be welcome.

Otherwise yeah, adding a new HAL based on gd32fx0-hal seems like a good approach. Let me know if you'd like a repository within this org to put it in.

qwandor avatar May 17 '25 10:05 qwandor

Hi, Thanks for the feedback. I have read a bit about the subject and a PAC generated by chiptool is not mandatory for embassy support, several embassy hals have been generated by svd2rust and I have seen this PR https://github.com/gd32-rust/gd32f1x0-hal/pull/53 that goes in that direction. So I will compare the peripherals of gd32f30x and gd32f10x to create a hal based on gd32f1x0-hal. Once I have something ready (it might take me some time), I will report back to you to get a repo in this organization.

romainreignier avatar May 17 '25 11:05 romainreignier