Skip to main content
Visitor II
December 4, 2025
Solved

Data transfer from SAI to DTCM using HPDMA not working

  • December 4, 2025
  • 1 reply
  • 96 views

I am using a Nucleo-N657X0-Q board to prototype a data collection system that collects samples from an ADC connected to the SAI peripheral and places the results in RAM. If I use CPU AXI RAM0 as the destination this works correctly, but if I change the destination to DTCM all I get is a buffer full of zeroes.

According to chapter-17 of the ref manual, HPDMA1 AXI port has access to the DTCM and I am setting the DAP field of HPDMA-CH0 TR1 register to Port-0 as required (setting it wrong results in a DTEF interrupt).

I have RISAF 1 and RISAF 2 set as follows:

 RISAF1->REG[0].CFGR = 0x00000000;
 RISAF1->REG[0].CIDCFGR = 0x00FF00FF; /* RW for everyone */
 RISAF1->REG[0].STARTR = 0;
 RISAF1->REG[0].ENDR = 0xFFFFFFFF; /* all-encompassing */
 RISAF1->REG[0].CFGR = 0x00000101; /* enabled, secure, unprivileged for everyone */

 RISAF2->REG[0].CFGR = 0x00000000;
 RISAF2->REG[0].CIDCFGR = 0x00FF00FF; /* RW for everyone */
 RISAF2->REG[0].STARTR = 0;
 RISAF2->REG[0].ENDR = 0xFFFFFFFF; /* all-encompassing */
 RISAF2->REG[0].CFGR = 0x00000101; /* enabled, secure, unprivileged for everyone */

 

I have the channel 0 bits in both HPDMA_PRIVCFGR and HPDMA_SECCFGR set.

 

I also have added the following to the reset handler and can read and write to DTCM OK using the CPU.

 ldr r0, =0x30000000
 ldr r1, =0x30020000
 mov	r2,#0
clear_dtcm:
 str r2,[r0]
 add r0,r0,#4
 cmp r0,r1
 bcc clear_dtcm 

 

The program is a secure domain only application.

 

Can anyone think of any other reason why this is not working?

Thanks

Nige

 

 

    This topic has been closed for replies.
    Best answer by nige_w

    In case anyone is curious, the solution is to write 0x11 to the HPDMA channel CID register

    1 reply

    nige_wAuthorAnswer
    Visitor II
    January 7, 2026

    In case anyone is curious, the solution is to write 0x11 to the HPDMA channel CID register