953 views|5 replies

6830

Posts

11

Resources
The OP
 

[ST NUCLEO-U5A5ZJ-Q development board review] Solving SPI GPDMA transmission [Copy link]

[ST NUCLEO-U5A5ZJ-Q Development Board Review] How to configure SPI DMA transmission

I encountered a problem here. I used a logic analyzer to analyze the timing and found that it stopped after only one byte was transmitted. I found the official routine and analyzed it, and found the reason. Now I configure the record as follows:

Also, the interrupt callback function needs to be rewritten:

void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{

  /* Set the SSD1306 state to ready */
  SSD1306_Disp.state = SSD1306_STATE_READY;
}

void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi)
{
	SSD1306_Disp.state = SSD1306_SPI_ERROR;
}

void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi) /* Derogation MISRAC2012-Rule-8.13 */
{
  /* Prevent unused argument(s) compilation warning */
	//SSD1306_Disp.state = SSD1306_STATE_READY;

  /* NOTE : This function should not be modified, when the callback is needed,
            the HAL_SPI_TxHalfCpltCallback should be implemented in the user file
   */
}

This solves the problem. However, if there is no delay of 1 millisecond after the interrupt transmission, it will get stuck, which will affect the performance a bit:

This post is from stm32/stm8

Latest reply

Yes, Chinese documents read much more fluently than English ones.   Details Published on 2024-2-19 09:10
 

6748

Posts

2

Resources
2
 

Did you use STM32CubeMX to configure this? It looks a bit different.

This post is from stm32/stm8

Comments

It was configured using STM32CubeMAX in STM32CubeIDE. Now the newly configured MDK project is missing something and is tied up.  Details Published on 2024-2-18 17:03
 
 

6830

Posts

11

Resources
3
 
wangerxian posted on 2024-2-18 17:00 Did you use STM32CubeMX to configure this? It looks a little different.

It was configured using STM32CubeMAX in STM32CubeIDE. Now the newly configured MDK project is missing something and is tied up.

This post is from stm32/stm8

Comments

Many of them are hardcoded at the bottom level, and both advantages and disadvantages exist. Because the bottom level cannot be modified, you cannot see which registers are configured.  Details Published on 2024-2-18 17:17
 
 

6748

Posts

2

Resources
4
 
lugl4313820 posted on 2024-2-18 17:03 It was configured using STM32CubeMAX in STM32CubeIDE. Now the newly configured MDK project will be missing something and is tied up.

Many of them are hardcoded at the bottom level, and both advantages and disadvantages exist. Because the bottom level cannot be modified, you cannot see which registers are configured.

This post is from stm32/stm8

Comments

Now ST wants developers to get started quickly, which is quite friendly for novices like us. But I saw that our domestic Wuhan Xinyuan's documents are better than ST, and I feel that they are more suitable for Chinese developers.  Details Published on 2024-2-18 19:38
 
 
 

6830

Posts

11

Resources
5
 
wangerxian posted on 2024-2-18 17:17 Many of them are hard-coded at the bottom level, and both advantages and disadvantages exist. Because the bottom level cannot be modified, it is also impossible to see which registers are configured.

Now ST wants developers to get started quickly, which is quite friendly for novices like us. But I saw that our domestic Wuhan Xinyuan's documents are better than ST, and I feel that they are more suitable for Chinese developers.

This post is from stm32/stm8

Comments

Yes, Chinese documents read much more fluently than English ones.  Details Published on 2024-2-19 09:10
 
 
 

6748

Posts

2

Resources
6
 
lugl4313820 posted on 2024-2-18 19:38 Now ST wants developers to get started quickly, which is quite friendly for novices like us. But I saw our domestic Wuhan Xinyuan, their...

Yes, Chinese documents read much more fluently than English ones.

This post is from stm32/stm8
 
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list