8.3.1 Design Flow
The following steps are used to enable the PDMA in the application:
- Enable PDMA by using the MSS configurator in the application, as shown in the following figure.
- Configure the AHB bus matrix master to provide weights to PDMA, as shown in the following figure.
- To configure the PDMA to transfer data between fabric peripherals (associated on FIC_0 and FIC_1) and MSS memories, select the PDMA configurator, as shown in the following figure.
- The PDMA signals in top-level instance are shown in the following figure.
- Generate the component by clicking Generate Component or by selecting . For more information on generating the component, see the latest SmartDesign User Guide on Libero SoC Documentation page. The firmware driver folder and SoftConsole workspace are included into the project. Click the highlighted Configure firmware button as shown in the following figure to find the PDMA drivers.
- Complete the following steps:
- Click Generate Bitstream under Program
Design to complete
*.fdb
file generation. - Double-click Export Firmware under Handoff Design for
Firmware Development in the Libero SoC design flow window to generate the
SoftConsole Firmware Project. The SoftConsole folder contains the mss_pdma
firmware driver. The firmware driver, mss_pdma (
mss_pdma.c
andmss_pdma.h
) which provides a set of functions for controlling the MSS PDMA transfers, can also be downloaded from the Microchip firmware catalog. The following table lists the APIs for PDMA. For more information on the APIs, see the Smartfusion2_MSS_PDMA_Driver_UG as shown in the preceding figure.Table 8-3. MSS PDMA APIs Category API Description and Usage Initialization PDMA_init() Initializes PDMA Configuration PDMA_configure() Channel priority Transfer size
Source and/or destination address increment
Source or destination of DMA transfer
Insert wait states
Selects the peripheral and direction
Selects the transfer type
PDMA_pause() Pauses PDMA transfer PDMA_resume() Resumes PDMA transfer PDMA_abort() Aborts the PDMA transfer DMA transfer and control PDMA_start() Starts PDMA transfer PDMA_load_next_buffer() Loads with next buffer of data PDMA_status() Gets the status of PDMA transfer Interrupt control functions PDMA_set_irq_handler() Register PDMA channel interrupt handler functions with the driver PDMA_enable_irq() Enables interrupt for Cortex®-M3 processor and channel interrupt. PDMA_clear_irq() Clears the Cortex-M3 processor and channel interrupts. PDMA_disables_irq() Disables the interrupts for specified channel
- Click Generate Bitstream under Program
Design to complete
- For more information on PDMA usage, the sample projects are available and can be generated, as shown in the following figure.