cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7A3 DCMI, CubeIDE generates faulty DCMI.c with wrong DMA initialization

Johannes
Senior

I use CubeIDE 1.9.0

MCU packate STM32H7 V1.10.0

My project generates separate files for each hardware. In this case "dcmi.c" and "dcmi.h"

DCMI is set to Slave 10 bits External Synchro

I use DCMI_PSSI DMA1 Stream 2 Perpheral to Memory

CubeIDE generates following lines in HAL_DCMI_MspInit

  __HAL_LINKDMA(dcmiHandle,hdmarx,hdma_dcmi_pssi);

  __HAL_LINKDMA(dcmiHandle,hdmatx,hdma_dcmi_pssi);

Both of these lines fail with

../Core/Src/dcmi.c:161:5: note: in expansion of macro '__HAL_LINKDMA'
  161 |     __HAL_LINKDMA(dcmiHandle,hdmarx,hdma_dcmi_pssi);
      |     ^~~~~~~~~~~~~
../Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h:65:43: error: 'DCMI_HandleTypeDef' {aka 'struct __DCMI_HandleTypeDef'} has no member named 'hdmatx'
   65 |                               (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \

What is the correct way of handling this?

For now, I just comment these lines out. DMA seems to work...

dcmi.c

   /* Several peripheral DMA handle pointers point to the same DMA handle.
     Be aware that there is only one channel to perform all the requested DMAs. */
    __HAL_LINKDMA(dcmiHandle,DMA_Handle,hdma_dcmi_pssi);
    //__HAL_LINKDMA(dcmiHandle,hdmarx,hdma_dcmi_pssi);
    //__HAL_LINKDMA(dcmiHandle,hdmatx,hdma_dcmi_pssi);

Is this a bug in FW-Package?

Is "commenting out" the correct workaround?

Thanks for your help

Johannes

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello @Johannes​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

View solution in original post

4 REPLIES 4
Amel NASRI
ST Employee

Hi @Johannes​ ,

That looks like an issue with STM32CubeMX generated code.

@Sara BEN HADJ YAHYA​ do you confirm it?

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Sara BEN HADJ YAHYA
ST Employee

Hello @Johannes​ ,

Thanks for your feedback,

These three lines are generated whereas the Request is for DCMI IP or for PSSI IP . A specific comment is added to inform that only one LINK will be useful.

* Several peripheral DMA handle pointers point to the same DMA handle.
     Be aware that there is only one channel to perform all the requested DMAs. */
    __HAL_LINKDMA(hpssi,DMA_Handle,hdma_dcmi_pssi);
    __HAL_LINKDMA(hpssi,hdmarx,hdma_dcmi_pssi);
    __HAL_LINKDMA(hpssi,hdmatx,hdma_dcmi_pssi);

The needed request should be kept and the others should be commented as you did. Please make sure to comment the unneeded lines each time you re-generate the code.

I submitted a ticket to the dev team to see if they can change the code generation and keep only the needed DMA request. I will keep you posted.

Internal ticket number: 128188 (This is an internal tracking number and is not accessible or usable by customers).

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

Sara BEN HADJ YAHYA
ST Employee

Hello @Johannes​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

baydı.1
Associate III

 

Hello, 

I am using V6.9.0. However, still encountering problem that occurs during initialization from CUBEMX. Following lines are generate the error. 

 /* DCMI DMA DeInit */
HAL_DMA_DeInit(hdcmi->DMA_Handle);
HAL_DMA_DeInit(hdcmi->hdmarx);
HAL_DMA_DeInit(hdcmi->hdmatx);

Error code is:
../Core/Src/stm32h7xx_hal_msp.c: In function 'HAL_DCMI_MspDeInit':
../Core/Src/stm32h7xx_hal_msp.c:226:25: error: 'DCMI_HandleTypeDef' has no member named 'hdmarx'
226 | HAL_DMA_DeInit(hdcmi->hdmarx);
| ^~
../Core/Src/stm32h7xx_hal_msp.c:227:25: error: 'DCMI_HandleTypeDef' has no member named 'hdmatx'
227 | HAL_DMA_DeInit(hdcmi->hdmatx);
| ^~

 After commenting lines that generate the error, DCMI is somehow works but other code blocks are not working. I there another solution beyond updating CubeMx or commenting those lines?