Skip to main content
vrai
Associate
November 1, 2023
Solved

understand mmw command

Question: I have an example here that assign TRACE_IOEN and TRACE_MODE to sync 1 bit from the DBGMCU_CR register (Address: 0xE004 2004) by using this command: mmw 0xE0042004 0x00000060 0x000000c0.

 What the 0x000000c0 doing in the mmw command ?

my basic understanding for mmw is this: mmw address setbits clearbits

Thanks

image from reference manual of stm32f4:

vrai_0-1698854082467.png

 

 

 

 

This topic has been closed for replies.
vrai
vraiBest answer
Associate
November 1, 2023

This is how mmw work:

 

mmw 0xE0042004 0x00000060 0x000000c0 is similar to this:

mmw address setbits clearbits  where the new_val = (old_val & ~clearbits) | setbits]

Result: new_val = (old_val_is & ~0x000000c0) | 0x00000060

 

mmw 0xE0042004 0x00000060 0x000000c0 is similar to this as well:

DBGMCU_APB1_FZ &= ~0x000000c0
DBGMCU_APB1_FZ |= 0x00000060

1 reply

vrai
vraiAuthorBest answer
Associate
November 1, 2023

This is how mmw work:

 

mmw 0xE0042004 0x00000060 0x000000c0 is similar to this:

mmw address setbits clearbits  where the new_val = (old_val & ~clearbits) | setbits]

Result: new_val = (old_val_is & ~0x000000c0) | 0x00000060

 

mmw 0xE0042004 0x00000060 0x000000c0 is similar to this as well:

DBGMCU_APB1_FZ &= ~0x000000c0
DBGMCU_APB1_FZ |= 0x00000060