Skip to main content
LOMO
Associate III
Mar 29, 2023 7:06 AM UTC
Solved

Unable to configure SYSCFG->CFGR1 reg when init UCPD on stm32g0

the Dead Battery Signals have been selected in stm32cubeMX, but when it run to "MODIFY_REG(SYSCFG->CFGR1, (SYSCFG_CFGR1_UCPD1_STROBE | SYSCFG_CFGR1_UCPD2_STROBE), ConfigDeadBattery);",SYSCFG->CFGR1 keeps default value.the clock is enabled. 0693W00000aPN9jQAG.png

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Mar 29, 2023 8:54 AM UTC

According to RM, these two bits are write-only (w), not read-write (rw), so even if you write 1 into them and they work as intended, they may not read 1 back.

0693W00000aPNiyQAG.png 

JW

4 replies

waclawek.jan
Super User
Mar 29, 2023 7:38 AM UTC

Which STM32? What is your hardware - a Nucleo board, or your own board?

Can you change SYSCFG->CFGR1in debugger?

Can you change other SYSCFG_CFGR1 bits?

JW

LOMO
LOMOAuthor
Associate III
Mar 29, 2023 7:52 AM UTC

stm32G071CB , my board ,i Can change other SYSCFG_CFGR1 bits in debugger.

waclawek.jan
waclawek.janBest answer
Super User
Mar 29, 2023 8:54 AM UTC

According to RM, these two bits are write-only (w), not read-write (rw), so even if you write 1 into them and they work as intended, they may not read 1 back.

0693W00000aPNiyQAG.png 

JW

LOMO
LOMOAuthor
Associate III
Mar 29, 2023 8:56 AM UTC

really appreciate!