Skip to main content
Arman Ilmak
Senior
October 12, 2021
Question

weird problem nand flash hal function

  • October 12, 2021
  • 1 reply
  • 1723 views

Hi

My code stops after i use the HAL_NAND_Read_ID function, Also the debugger stops working and i can see no errors to solve.

Thanks for helping me.

0693W00000FCBIjQAP.png

This topic has been closed for replies.

1 reply

Technical Moderator
October 12, 2021

Hello @Arman Ilmak​ ,

Check if you have the same conditions related to the NAND Flash as described in the STM32H743xI/G Errata sheet.

If possible to share your code if this issue is not resolved, and please provide more information to understand the cause of the error.

Which Cube example did you looked to? Which Firmware version are you using ?

Are you using CubeMX for generating the code?

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Arman Ilmak
Senior
October 12, 2021

I use cubemx v6.3.0 as code generator and stm32h7 v1.8.0 softwarepacket.

I just config the nand timing and generated the code.

Here is the main code:

int main(void)
{
 /* USER CODE BEGIN 1 */
 
	
 /* USER CODE END 1 */
 
 /* Enable D-Cache---------------------------------------------------------*/
 SCB_EnableDCache();
 
 /* MCU Configuration--------------------------------------------------------*/
 
 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();
 
 /* USER CODE BEGIN Init */
 
 /* USER CODE END Init */
 
 /* Configure the system clock */
 SystemClock_Config();
 
 /* USER CODE BEGIN SysInit */
 
 /* USER CODE END SysInit */
 
 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_DMA_Init();
 MX_USART1_UART_Init();
 MX_FMC_Init();
 /* USER CODE BEGIN 2 */
	HAL_UART_Receive_DMA(&huart1,gsm_rx_buf,sizeof(gsm_rx_buf));
	if(HAL_NAND_Read_ID(&hnand1, &my_nand_flash) != HAL_OK)
	{
		Error_Handler();
	}
 
 /* USER CODE END 2 */
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 
 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */
}

I used this document for timing and schematics.

https://www.st.com/resource/en/application_note/dm00228015-using-stm32l476486-fsmc-peripheral-to-drive-external-memories--stmicroelectronics.pdf

Technical Moderator
October 20, 2021

Hi @Arman Ilmak​ ,

Sorry for the delayed reply on this, I missed your reply.

I think your issue is related to the known limitation with CubeMX v6.3.0 when DMA is used: that the MX_DMA_Init() shall be called BEFORE any other peripheral initialization (Please see this post for more details).

I'll be waiting for your feedback and let me know if this solved your issue.

When your question is answered, please close this topic by choosing Select as Best.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks