2018-07-06 04:39 PM
Trying to figure out reasons why a CubeMX build cannot replicate the functionality of the repo application:
STM32Cube\Repository\STM32Cube_FW_H7_V1.2.0\Projects\STM32H743I_EVAL\Applications\FatFs\FatFs_uSD_DMA_RTOS.
The CubeMX generation has the file operations code exactly matching the code found in the example project noted. I found missing code in stm32h7xx_it.c built by CubeMX. There is no handler for the SD Detect set up in stm32h743i_eval.c (see lines 1078 - 1100). CubeMX contains all the board specific assignments and generates code to call the initializing function MFX_IO_ITConfig() so why leave out the interrupt handler. I am sure this is an oversight.
It is fixed by adding to the end of stm32h7xx_it.c in the user section as shown:
/* USER CODE BEGIN 1 */
/** * @brief This function handles SD detection interrupty * @param None * @retval None */void EXTI9_5_IRQHandler(void){ SD_DetectIRQHandler();}/* USER CODE END 1 */
This is the same code used in the repo application example noted.
Now the application does not hang when the card is removed or inserted.
Unfortunately it does not fix the inability to open/read/write with out returning FR_NOT_READY!
2018-07-09 06:39 AM
Hello
greenwood.greg
,I raised this issue internally for check.
Thank you for your contribution.
With Regards,
Imen
2018-07-11 02:37 AM
Hi
greenwood.greg
,Thanks for your feedback,
In fact, there are some differences in the project organization between those generated by cubeMX and those in the repository folder.
As you can see, there are USER TAGs where user can add his own code depending on his requirements.
With Regards,
Mohamed
2018-07-11 11:27 AM
What you say is true and is fixed in like manner, however, this code is not based on my own requirements but the requirements of the hardware and therefore should be added by CubeMX based on my selection of the eval board in CubeMX.