cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f303xx pma address calculation conflict

armindavatgaran
Associate III
Posted on November 09, 2016 at 18:49

Hello

As i inspected through stm32cubef3_1.6 and tested with keil uvision, pma address caculation is as follows:

USB_ADDRn_TX: 0x40006000(usb PMA base) + (BTABLE + 8*n) * 2

USB_COUNTn_TX: 

0x40006000(usb PMA base) + 

(BTABLE + 8*n + 2) * 2

USB_ADDRn_RX: 0x40006000(usb PMA base) + (BTABLE + 8*n + 4) * 2

USB_COUNTn_RX: 

0x40006000(usb PMA base) + 

(BTABLE + 8*n + 6) * 2

But as it seems, it is written wrong in RM0316(REV7, Pages1087 to 1089):

USB_ADDRn_TX(offset): 

 (

BTABLE + 16*n)

USB_COUNTn_TX

(offset)

(BTABLE + 16*n + 4)

USB_ADDRn_RX(offset): 

 (

BTABLE + 16*n + 😎

USB_COUNTn_RX

(offset)

(BTABLE + 16*n + 12)

1 REPLY 1
slimen
Senior
Posted on November 15, 2016 at 16:27

Hello,

What is the problem that you have? Have you an issue with the address calculation in CubeF3?

As mentioned in the RM0316 in the (32.6.2 Buffer descriptor table) section, to obtain the correct memory address value, the actual memory location address must be multiplied by two: 

''

In the following pages, two address locations are reported for devices with “1 x 16 bits/wordâ€� access scheme: the one to be used by application software while accessing the packet memory, and the local one relative to USB peripheral access. To obtain the correct memory address value to be used in the application software while accessing the packet memory, the actual memory location address must be multiplied by two.

''

Regards