cancel
Showing results for 
Search instead for 
Did you mean: 

SAI DMA Error (STM32H743BIT MCU)

Edwin kaus
Associate II
Posted on May 26, 2018 at 08:43

Hello.,..,

We were working with STM32F765BIT MCU SAI interface to capture 4 channel audio data and it was working fine , But now we are upgrading to STM32H743BIT MCU(both are same package) and made same configuration ,It seems the SAI interface works fine with Interrupt mode , But when I tried with DMA to receive audio data its getting DMA error .

I used STM cubeMX to generate driver file and used the same procedure as I used for earlier one. I have been stuck in this issue for a long while , and also raising this issue on community but not getting any response.,

If ST people can spare some time to resolve this issue it would be appreciated lot.

Thank you.,

#stm32

Note: this post was migrated and contained many threaded conversations, some content may be missing.
9 REPLIES 9
Posted on May 26, 2018 at 13:11

This is primarily a user to user forum, suggest you link to existing threads if you refer to them, provide a complete ZIPed project minimally illustrating the failure, that compiles, and a dump of the related registers and error statuses.

This thread?

https://community.st.com/0D50X00009XkXYlSAN

 

The H7 is more complex than any other STM32 part, DMA has new routing options, there may be issues with specific memory locations. DMA 'Error' conditions typically revolve about using an address that is not supported. Check the bus matrix diagrams for memory/bus connectivity, and the DMA channel matrix. Try different SRAM blocks.

The data provided so far is NOT sufficient to get involved in diagnostic work. There only a handful of users here using H7 parts. People aren't going to spend hours on your problems, including ST staff, your goal would be to provide sufficient material that 5-10 minute of build/review might provide definitive answers. The number of people wanting to get involved in CubeMX code is even smaller.

Review, test and evaluate examples provided by ST, determine if these work or replicate the failure you observe

STM32Cube_FW_H7_V1.2.0\Projects\STM32H743I_EVAL\Examples\SAI

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 29, 2018 at 15:58

Hello

karthikshivanna.94

,

The problem that you have,it may

be due to an error in the DMA configuration. The configuration of

STM32F7 is not the same as inSTM32H7.

You should check the

DMA configuration,DMA stream notion and channel which are different. Also the DMA request should be enabled for STM32H7.

For STM32H7, the adress

@0x20000000 DTCM is not accessible by the DMA.

You may refer to the reference manual to check the right adress on section ''Embedded SRAM

''.

0690X0000060BPMQA2.png

I suggest that you have a look to the working SAI example within STM32CubeH7 firmware package, it may help you:

STM32Cube_FW_H7_V1.2.0\Projects\STM32H743I_EVAL\Examples\SAI

You find there a readme.txt file describing how to use the example and you should

follow the instructions and notes.

Then, you may update the example orre-use it according to your needsandget inspiredtocheck the DMA configuration.

Hope this bring you some help.

With Regards

,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 30, 2018 at 09:30

Hai Imen D.,.,

Yes it is ri8 , the problem resolved by changing the RAM address area, Now its working fine, Also I found some bugs in Cube MX while generating code for ethernet interface,

Bug 1: All ethernet GPIO pins mode should be set to High speed(In GPIO configuration) , but by default it set as low speed mode. 

Bug 2: By default in cube 4 TX & RX descriptors are taken , But it works only when I changed to 2 TX & RX descriptors.

Thank you.,.,

Posted on May 30, 2018 at 10:24

Hi

karthikshivanna.94

,

Well, I'm glad that you solved your problem.

Can you please create a new discussion describing the CubeMXbugs that you have foundwith more details about the version used andioc file attached, then I will raise your issuesinternallyto CubeMX teeam for more check.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on June 03, 2018 at 09:22

Hello.,.,

 I am facing some issue with STM32H743BIT MCU Ethernet interface, I am using LWIP stack and cube MX generated project. But the code hangs (going to hard fault handler )  at fallowing line which present in  low_level_output(struct netif *netif, struct pbuf *p)  function.

/* Clean and Invalidate data cache */

  SCB_CleanInvalidateDCache();

Can you please suggest what might be the wrong and how to come out from this issue. I have checked by enabling & disabling the DCACHE memory and all but still it is unresolved.

Thank you 

Posted on June 03, 2018 at 13:41

You might want to use something a bit more selective that doesn't trash the cache/buffers used by the stack

ie consider SCB_InvalidateDCache_by_Addr

() rather than

SCB_InvalidateDCache().

Consider also where the stack is situated, perhaps use DTCM RAM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 03, 2018 at 13:52

Hello Clive One.,.,

I am bit confused, Can you please give some more brief explanation, This problem occur only when I use LWIP initialization, How could I know the address used by stack. I used Cube MX generated code. Please help me to come out of this issue.

Thank you.,

Posted on June 03, 2018 at 14:15

>>How could I know the address used by stack.

Presumably by inspection, debugger should provide insight to what you are using, and the linker script/scatter file, along with attributes for the stack section should control where it is placed.

>>I am bit confused, Can you please give some more brief explanation

Salient documentation

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0646b/ch04s08shtml

Make a more specific determination about the cause of the Hard Fault.

With cache coherency between CPU and DMA/Ethernet try to be narrow and specific about the memory involved rather than invalidate everything.

>>I used Cube MX generated code.

Unfortunately you may still need to understand the processor and memory allocations used for specific buffers, and tuning/settings for specific tool chains. The HAL example code may have more actual testing done on it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 03, 2018 at 14:30

Hello Clive.,

Thanks for the suggestion, As per your suggestion I have done fallowing changes, I am now clearing only Tx & Rx descriptor locations only , But still the issue remain unresolved. Can you please confirm whether I am doing an wrong.

// /* Clean and Invalidate data cache */

// SCB_CleanInvalidateDCache();

/* Invalidate data cache for ETH Rx Buffers */

SCB_InvalidateDCache_by_Addr((uint32_t *)Txbuffer, (ETH_TX_DESC_CNT*ETH_MAX_PACKET_SIZE));

// /* Clean and Invalidate data cache */

// SCB_CleanInvalidateDCache();

/* Invalidate data cache for ETH Rx Buffers */

SCB_InvalidateDCache_by_Addr((uint32_t *)Rx_Buff, (ETH_RX_DESC_CNT*ETH_MAX_PACKET_SIZE));

Thank you.,