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

STM32C0xx family missing ADC module. #568

Open
Cydget opened this issue Feb 14, 2025 · 2 comments
Open

STM32C0xx family missing ADC module. #568

Cydget opened this issue Feb 14, 2025 · 2 comments

Comments

@Cydget
Copy link

Cydget commented Feb 14, 2025

I'm not sure if this is a simple change and overlooked, or if it is significantly different from all other ADC modules and thus needs its own chip specific driver. I don't believe I have the technical know how on how to add support myself, but I'm willing to learn if anyone is willing to help offer guidance.

@Cydget
Copy link
Author

Cydget commented Feb 14, 2025

Looking at https://github.com/STMicroelectronics/stm32c0xx-hal-driver/blob/main/Src/stm32c0xx_hal_adc.c and comparing it to https://github.com/STMicroelectronics/stm32g0xx-hal-driver/blob/master/Src/stm32g0xx_hal_adc.c I see almost no differences, so I think it would be V5, but thats just a guess. I haven't started following the "how to add peripheral" steps from the read me yet. I'm still at the point where I want to see how much work it would be to add it stage before I dig in deeper.

Looking at the excel tracker it looks like the c0xx is pretty new and hasnt had much work done on adding it yet. https://docs.google.com/spreadsheets/d/1-R-AjYrMLL2_623G-AFN2A9THMf8FFMpFD4Kq-owPmI/edit?gid=1972450814#gid=1972450814

@Cydget
Copy link
Author

Cydget commented Feb 14, 2025

Ok, after following the read me steps, I've confirmed the /ADC/c011.yaml and /ADC/C031.yaml are identical. Additionally the c011.yaml is only different from /ADC/g0c1 by the following(excluding enum)
`Added in c011.yaml

AWD2CH19
AWD2CH20
AWD2CH21
AWD2CH22

AWD3H19
AWD3H20
AWD3H21
AWD3H22

CHSEL19
CHSEL20
CHSEL21
CHSEL22

SMPSEL19
SMPSEL20
SMPSEL21
SMPSEL22

VBATEN <- does not exist on C011 but does on g0c1

`
From this, I'm thinking the c0xx family is the same as g0xx, but with a few more channels.

I've tried modifying /perimap.rs
by adding lines 114 and 110

Image
But when I go to generate with

Image
I get an error on loading adc c0

Any clue on what that might be from? I'v e tried copying adc_g0.yaml in /stm32-data/data/registers/ as adc_g1.yaml just to see if it was looking for a file like that, but it did not work, and I still get the error.

I dont know what "Make sure the block" means in the readme. Maybe I'm missing something

Image

@Cydget Cydget closed this as completed Feb 14, 2025
@Cydget Cydget reopened this Feb 14, 2025
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

1 participant