This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI with DMA transmission Fails when the Process is set to User Mode.

Other Parts Discussed in Thread: TMS570LC4357

DMA is not transmitting data packets when processor in User mode. However same works fine in System mode. 

Could you please clarify do we have to enable any  PCR (Peripheral Central Resource (PCR) Control Registers) when processor is set in user mode 

processor used is  TMS570LC4357 CORTEX R5.

  • Hello Chethan,
    Did you configure DMA when the CPU is in user mode? Please note that the DMA registers and DMA control packets can only be programmed in privilege mode.
  • Hi Charles ,
    Thanks for the reply. we are using CPU privileged mode for configuring and initializing the DMA registers and DMA Control packets .
    post that we are switching the CPU to user mode and Building the TX buffers and transmitting using the DMA by updating few registers (which are already initialized in CPU privileged mode) .

    Let us know whether we can update any part of the DMA part at CPU user mode which are initialized prior in CPU privileged mode.

    The DMA registers which are updated in CPU user mode (which are already initialized in CPU privileged mode) are as below
    1) DMA RAM PCP( primary control Packets registers)
    2) DMA PAR( Port assignement registers)
    3) DMA HWCHENAS ( channel enable registers)
    4) MIB SPI 2 Interrupts are disabled and enabled back.
  • Hello Chethan, 

      Whether or not a register is protected in privilege mode is documented in the TRM. Below is an example for the DMA PAR register but if you look at any registers in any module the same information is presented. For PAR register the access legend is R/WP. This means the register can be read and written in privilege mode only. It is also R/WP for HWCHENAS and the DMA RAM PCP. Please change the CPU process state to privilege mode if you want to change the DMA configuration.

     

     

     

  • Hi Charles,
    Is there any way we can use DMA in Non Privileged mode? If we configure the DMA with the MIBSPI peripheral at startup while in privileged mode, can we, after switching to user/system mode, use DMA for SPI transfers?
  • Hello Chethan,
    Yes, once the the DMA is properly configured by the CPU in privilege mode, the DMA will operate properly independent of what later modes the CPU is switched to. There is one more note that I will mention is that the DMA itself always operates in user mode when transferring data to its detinations. This means you can only use the DMA to transfer to locations which are not privilege mode protected.