Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add G0B1 Variant #135

Open
kiranshila opened this issue Mar 15, 2023 · 4 comments
Open

Add G0B1 Variant #135

kiranshila opened this issue Mar 15, 2023 · 4 comments

Comments

@kiranshila
Copy link

Hey everyone,

I'm starting a project based on the g0b1 variant (as it's the chip in the series with native USB support (along with the C1) and also a Nucleo board and as such, I think it would make sense to start here in the expansion of this HAL to other chips in the G0 PAC.

I started giving it a go, but this patch seems non-trivial. Apparently, the SVD for the B1 is quite different from the previous chips:

stm32-rs/stm32-rs#548
stm32-rs/stm32-rs#785
stm32-rs/stm32-rs#789

As such, more than just feature-gating various sections of code is needed to describe the discrepancies. For example, I'm working on fixing the USARTs right now, but several assumptions are incorrect:

  1. There are now up to 6 USARTs and 2 LPUARTs. This means in certain cases LPUART -> LPUART1
  2. There is the addition of SPI3 and I2C3
  3. Both of these require access to Port E and Alternative Function 8-15

All of these require additions to the DMAMUX. I've done all of this, but I need help with register naming discrepancies. For example, CR1 is no longer a field on the USARTs as the CR1 register layout is different whether or not the FIFO is enabled. One of the SVD patches defaults that register to the disabled case, but then how would we use the FIFO? The same is true for the ISR register in the USART. I'm sure there are other things I still need to run into, but that was the first blocker.

So, we can write code that has to save some state about the FIFIO configuration and then select the correct register, but that will be quite a bit of complexity to something that might simply be an SVD patch.

Any advice on how to proceed on this would be appreciated. Technically for my project, I need the ADC, DAC, GPIO, and USB UART, which I could hack together - but I would prefer to help get this variant off the ground.

Thanks!

@electroCutie
Copy link

I've got a project that I'd like to use a G0B1 part on. Can you share your work so far? I might give you a hand

@kiranshila
Copy link
Author

I would appreciate it! I opened a draft PR #138

@Dirbaio
Copy link

Dirbaio commented Apr 5, 2023

fyi: embassy-stm32 supports G0Bx/G0Cx, including USB.

@kiranshila
Copy link
Author

Oh this is great, I had no idea! Time to throw out my arduino code...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants