cancel
Showing results for 
Search instead for 
Did you mean: 

no write access to ADC12_CCR registers of STM32G473QE

SMein.1
Associate II

Hello,

my problem is that i can't get access to the ADC12_CCR register. I activated the corresponding Clock in the RCC_AHB2ENR register. In addition I compare the addresses of the register from the library with the data of the reference manual, they are the same. I tried the same with the ADC345_CCR register, that access succeeded.

My minimal code is very simple without HAL or LL Library, so it's very clearly to understand.

PS: I also tried it with the HAL library, but the HAL Library also don't get access to this register.

#include "stm32g473xx.h"

void main(void)

{

RCC->AHB2ENR|=RCC_AHB2ENR_ADC12EN;

  ADC12_COMMON->CCR=0x1C0000;

}

This CODE above don't work.

But the following code below is working...

#include "stm32g473xx.h"

void main(void)

{

RCC->AHB2ENR|=RCC_AHB2ENR_ADC345EN;

  ADC345_COMMON->CCR=0x1C0000;

}

I don't no, it's a mysterium. I don't found a reason for a defect in the errata sheet.

Do i have miss some important information from the reference manual? Maybe is the address of the ADC12_CCR register (0x50000208) wrong?

Is there some clock I have to activate in addition?

On further try was with direct addressing of the register

#include "stm32g473xx.h"

void main(void)

{

RCC->AHB2ENR|=RCC_AHB2ENR_ADC12EN;

  *((uint32_t*)0x50000208)=0x1C0000;

}

1 ACCEPTED SOLUTION

Accepted Solutions
SMein.1
Associate II

Ok, i find the fault. The address in the STM32G473xx_Peripherals.xml line was wrong.

And with direct addressing in my last minimal code, i also use the wrong address.

in this file #include "stm32g473xx.h" the address is correct and equal to the information given in the Reference Manual.

The .xml File which is used by the debugger from CrossStudio located in C:\Users\"your username"\AppData\Local\Rowley Associates Limited\CrossWorks for ARM\v4\packages\targets\STM32\include\STM32G473xx_Peripherals.xml has the wrong address. I update the address see below and now it works!

Line9728  <RegisterGroup name="ADC12_Common" start="0x50000200" description="Analog-to-Digital Converter"> is wrong

Line9728  <RegisterGroup name="ADC12_Common" start="0x50000300" description="Analog-to-Digital Converter"> is correct

View solution in original post

3 REPLIES 3
SMein.1
Associate II

Ok, i find the fault. The address in the STM32G473xx_Peripherals.xml line was wrong.

And with direct addressing in my last minimal code, i also use the wrong address.

in this file #include "stm32g473xx.h" the address is correct and equal to the information given in the Reference Manual.

The .xml File which is used by the debugger from CrossStudio located in C:\Users\"your username"\AppData\Local\Rowley Associates Limited\CrossWorks for ARM\v4\packages\targets\STM32\include\STM32G473xx_Peripherals.xml has the wrong address. I update the address see below and now it works!

Line9728  <RegisterGroup name="ADC12_Common" start="0x50000200" description="Analog-to-Digital Converter"> is wrong

Line9728  <RegisterGroup name="ADC12_Common" start="0x50000300" description="Analog-to-Digital Converter"> is correct

Thanks for sharing the solution.

You may perhaps want to let Rowley know, too.

JW

Imen.D
ST Employee

Hello @SMein.1​ and welcome to the STM32 Community =)

Thanks for bringing this error to our attention.

I have passed this along to our development team for fix.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen