Datasheet

538
SAM9X25 [DATASHEET]
11054E–ATARM–10-Mar-2014
Figure 32-6. Allocation and Reorganization of the DPRAM
1. The endpoints 0 to 5 are enabled, configured and allocated in ascending order.
Each endpoint then owns a memory area in the DPRAM.
2. The endpoint 3 is disabled, but its memory is kept allocated by the controller.
3. In order to free its memory, its UDPHS_EPTCFGx.BK_NUMBER field is written to zero. The endpoint 4 memory
window slides down, but the endpoint 5 does not move.
4. If the user chooses to reconfigure the endpoint 3 with a larger size, the controller allocates a memory area after the
endpoint 2 memory area and automatically slides up the endpoint 4 memory window. The endpoint 5 does not
move and a memory conflict appears as the memory windows of the endpoints 4 and 5 overlap. The data of these
endpoints is potentially lost.
Notes: 1. There is no way the data of the endpoint 0 can be lost (except if it is de-allocated) as the memory allocation
and de-allocation may affect only higher endpoints.
2. Deactivating then reactivating the same endpoint with the same configuration only modifies temporarily the
controller DPRAM pointer and size for this endpoint. Nothing changes in the DPRAM, higher endpoints
seem not to have been moved and their data is preserved as far as nothing has been written or received into
them while changing the allocation state of the first endpoint.
3. When the user writes a value different from zero to the UDPHS_EPTCFGx.BK_NUMBER field, the Endpoint
Mapped bit (UDPHS_EPTCFGx.EPT_MAPD) is set only if the configured size and number of banks are cor-
rect as compared to the endpoint maximal allowed values and to the maximal FIFO size (i.e. the DPRAM
size). The UDPHS_EPTCFGx.EPT_MAPD value does not consider memory allocation conflicts.
Free Memory
EPT0
EPT1
EPT2
EPT3
EPT4
EPT5
Free Memory
EPT0
EPT1
EPT2
EPT4
EPT5
Free Memory
EPT0
EPT1
EPT2
EPT4
EPT5
Endpoint 3
Disabled
Endpoint 3
Memory Freed
Free Memory
EPT0
EPT1
EPT2
EPT3 (larger size)
EPT5
Endpoint 3
Activated
EPT4 Lost Memory
EPT4
Conflict
EPT3
(always allocated)
Endpoints 0..5
Activated
Device:
UDPHS_EPTCTLENBx.EPT_ENABL = 1
Device: Device:
Device:
UDPHS_EPTCTLDIS3.EPT_DISABL = 1
UDPHS_EPTCFG3.BK_NUMBER = 0 UDPHS_EPTCTLENB3.EPT_ENABL = 1
UDPHS_EPTCFGx.BK_NUMBER <> 0
UDPHS_EPTCFG3.BK_NUMBER <> 0