cancel
Showing results for 
Search instead for 
Did you mean: 

How to find correct register address in stm32 G431 MCU?

TuomasSun
Associate

Hi,

We are working with B-G431B-ESC1 motor control board and have performed the motor profiling in ST MC Workbench 6.1.2 and it finished successfully, reaching 100% completeness.

 

The problem:

When trying to run the motor in motor pilot, the power supply (6S-battery) is connected and no drive commands are given, the motor keeps "ticking" in a consistent manner. About every 0.5 seconds or so.

We have not figured out why this could be, and the plan is to monitor the MCU and the motor driver I/O to see what is giving the "drive pulses". We are supposed to drive the motor with a PWM signal.

We installed STM32CubeMonitor software, and are trying to follow the instructions given in this post:
Solved: Setting up variables - STMicroelectronics Community

 

The plan is to monitor all of the GPIO ports in the Pull-up/ Pull-down Register (PUPDR) of the MCU, to get a clear picture of what is actually happening at that level. Our understanding is that we need to create variables in CubeMonitor, and the variables need desired register addresses. We have not successfully figured out how to determine the addresses.

For example, what would be the addresses of say, GPIOA_PUPD2 bit1, bit2 ?

 

This is all pretty new for us and there's a lot to take in at once in a short amout of time, so please do excuse the helplessness :)

 

Please find the attached image, in which we have multiple sources of addresses open. Are we on the right track?

 

Best regards,

Tuomas

 

2 REPLIES 2
TDK
Guru

This would be a lot easier in a debugger.

The addresses are listed in the reference manual. First locate the address of GPIOA, then the relative offset of the PUPD register.

If you feel a post has answered your question, please click "Accept as Solution".

printf("%p\n", &GPIOA->PUPDR);

Or GPIOA_BASE + 0x0C

Probably 0x4800000C   

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..