cancel
Showing results for 
Search instead for 
Did you mean: 

Have anybody QSPI loader algorythm for Keil?

EEuge
Senior

Have anybody QSPI loader algorythm for Keil?

I can't create workable code....

1 ACCEPTED SOLUTION

Accepted Solutions

https://www.keil.com/pack/Keil.STM32H7xx_DFP.2.7.0.pack

Tip: It's a .ZIP file...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

12 REPLIES 12
MM..1
Chief III

When you have installed stlink utility try read readme.txt in

c:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ExternalLoader\MX25LM51245G_STM32L4R9I-DISCO 

here exist too keil project...

EEuge
Senior

I want for STM32H743 and MT25QL

thanks for link, a used this sample when I worked with F746 and w25q - without problems.

But H743 and MT25QL.......

void QSPI_WriteEnable(void)
{
  QUADSPI_ComConfig_InitTypeDef QUADSPI_ComConfig_InitStructure;
	
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_FMode = QUADSPI_ComConfig_FMode_Indirect_Write;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_DDRMode = QUADSPI_ComConfig_DDRMode_Disable;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_SIOOMode = QUADSPI_ComConfig_SIOOMode_Disable;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_DummyCycles = 0;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_ABSize = QUADSPI_ComConfig_ABSize_8bit;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_ADSize = QUADSPI_ComConfig_ADSize_24bit;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_DMode = QUADSPI_ComConfig_DMode_NoData;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_ADMode = QUADSPI_ComConfig_ADMode_NoAddress;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_ABMode = QUADSPI_ComConfig_ABMode_NoAlternateByte;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_IMode = QUADSPI_ComConfig_IMode_1Line;
 
 
  
  QUADSPI_SetFIFOThreshold(0);
  QUADSPI_SetDataLength(0);
  
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_Ins = WRITE_ENABLE_CMD ; 
  QUADSPI_ComConfig_Init(&QUADSPI_ComConfig_InitStructure);
  while(QUADSPI_GetFlagStatus(QUADSPI_FLAG_BUSY)==SET);
 
sprintf((char *)str, "WR1:  0x%08X   \r\n ",QUADSPI_GetFMode());
 
			       HAL_UART_Transmit(&huart7, str, strlen((char *)str), 3000);      
 
 
  QUADSPI_AutoPollingMode_Config(0x02,0x02,QUADSPI_PMM_AND);
  QUADSPI_AutoPollingModeStopCmd(ENABLE);
  QUADSPI_SetDataLength(0x00);
 
 
 
 
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_FMode = QUADSPI_ComConfig_FMode_Auto_Polling;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_ADMode = QUADSPI_ComConfig_ADMode_NoAddress;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_DMode = QUADSPI_ComConfig_DMode_1Line;
  QUADSPI_ComConfig_InitStructure.QUADSPI_ComConfig_Ins = READ_STATUS_REGISTER_CMD;
  QUADSPI_ComConfig_Init(&QUADSPI_ComConfig_InitStructure); 
 
sprintf((char *)str, "WR2:  0x%08X   \r\n ",QUADSPI_GetFMode());
 
			       HAL_UART_Transmit(&huart7, str, strlen((char *)str), 3000);      
 
 
  while(QUADSPI_GetFlagStatus(QUADSPI_FLAG_SM)==RESET);
	
	
  QUADSPI_ClearFlag(QUADSPI_FLAG_SM);
  QUADSPI_ClearFlag(QUADSPI_FLAG_TC);
  while(QUADSPI_GetFlagStatus(QUADSPI_FLAG_BUSY)==SET);
	
	sprintf((char *)str, "WR3:  0x%08X   \r\n ",QUADSPI_GetFMode());
 
			       HAL_UART_Transmit(&huart7, str, strlen((char *)str), 3000);      
 
}

it halts on

  while(QUADSPI_GetFlagStatus(QUADSPI_FLAG_SM)==RESET);
	

On what pins? Don't they have some in the "Packs" directories for the H7 related to the EVAL or DISCO boards?

C:\Keil5xx\Arm\Packs\Keil\STM32H7xx_DFP\2.7.0\CMSIS\Flash\STM32H747I_Disco_QSPI\QSPI

C:\Keil5xx\Arm\Packs\Keil\STM32H7xx_DFP\2.7.0\CMSIS\Flash\STM32H7xx_MT25TL01G.FLM

The QL's should be a relatively short walk

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Your second link is for MT25TL01G, but I have MT25QL128

Yor first link - my DFP version is 2.4.0, updater list contains onl 2.5.1. Where you got 2.7.0 version?

Folder STM32H747IDisco_QSPI\QSPI contains SOURCE or .FLM?

My pins

0693W000007EC0nQAG.png

Source code/project, the top level has .FLM's

Using MDK 5.33, pulling most current packs itself.

>>Your second link is for MT25TL01G, but I have MT25QL128

Sure, but you were looking for working examples, and this should be relatively close, the QL128 only needing 3-byte addressing. These are half a dozen or more examples under the CMSIS\Flash trees.

I could code something exact if the bounty was compelling.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Can you attach Source with project here?

https://www.keil.com/pack/Keil.STM32H7xx_DFP.2.7.0.pack

Tip: It's a .ZIP file...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..