cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 Error: Unable to get core ID when using read operation custom external loader

Silexman
Associate III

I am trying to make a custom external loader for a qspi nor flash. the erase sector and write operation is success but after I tried the read operation the operation is fail the device is disconnected and showing this message

Screenshot 2024-10-24 155648.png

 I have tried to run a program like this demo project , the program is working normally and I can read the data . buat after I comment the write section :

if (CSP_QSPI_WriteMemory(buffer_test, var * MEMORY_SECTOR_SIZE,
				sizeof(buffer_test)) != HAL_OK) {
			Error_Handler();
}

 and read the memorry, the device is disonnected and I have restart the device if I want to connect again. any one know why ?, thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Exit path for Write() should enable Memory Mapped Mode

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

8 REPLIES 8

Will need to drop out of Memory Mapped mode to erase, write and wait for completion,  and then switch back to Memory Mapped mode for the tools to Read/Verify the content.

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

Describe the specific parts involved here and the pin usage that connects them.

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

Hello , thank you for the reply. I am using HAL_XSPI_Abort(&hospi1); to exit from memory mapped mode so the code I am running look like this 

	if (CSP_QUADSPI_Init() != HAL_OK) {
		Error_Handler();
	}
	if (CSP_QSPI_EnableMemoryMappedMode() != HAL_OK) {
		Error_Handler();
	}
	HAL_XSPI_Abort(&hospi1);

the disconnect problem is clear but of course I can't see the data with read memorry fiture on stm32cubeide. if I comment the HAL_XSPI_Abort(&hospi1);, the disconnect problem occurs again after I use the read memory fiture on stm32cubeide.

Hello, thank you for the reply. I am using two W25Q128JVPIQ connected with STM32H573IIT3Q. the pin connections are :
FLASH 1,2 CLK -> PA3

FLASH 1,2 IO0 -> PF8

FLASH 1,2 IO1->PF9

FLASH 1,2 IO2 -> PF7

FLASH 1,2 IO3 -> PF6

FLASH 1 NCS -> PB10
FLASH 2 NCS -> PB6

But for now, I am trying to make an external loader for FLASH 1

Exit path for Write() should enable Memory Mapped Mode

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

Hello thank you for the reply. Sorry I don't understand. Do you mean to add write function before memory mapped mode?. since I don't wanna write anything, I made this function :

uint8_t WriteButNotWrite()
{
	XSPI_RegularCmdTypeDef sCommand ={0};
	sCommand.OperationType = HAL_XSPI_OPTYPE_COMMON_CFG;
	sCommand.IOSelect = HAL_XSPI_SELECT_IO_3_0;
	sCommand.InstructionMode = HAL_XSPI_INSTRUCTION_1_LINE;
	sCommand.Instruction = QUAD_IN_FAST_PROG_CMD;
	sCommand.InstructionWidth = HAL_XSPI_INSTRUCTION_8_BITS;
	sCommand.AddressMode = HAL_XSPI_ADDRESS_NONE;
	sCommand.AddressWidth = HAL_XSPI_ADDRESS_24_BITS;
	sCommand.AlternateBytesMode = HAL_XSPI_ALT_BYTES_NONE;
	sCommand.DataDTRMode = HAL_XSPI_DATA_DTR_DISABLE;
	//	sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
	sCommand.SIOOMode = HAL_XSPI_SIOO_INST_EVERY_CMD;
	sCommand.DataMode = HAL_XSPI_DATA_NONE;
//	sCommand.DataLength = buffer_size;
//	sCommand.Address = address;
	sCommand.DQSMode = HAL_XSPI_DQS_DISABLE;
	sCommand.DummyCycles = 0;

	if (QSPI_WriteEnable() != HAL_OK) {
		return HAL_ERROR;
	}

	/* Configure the command */
	if (HAL_XSPI_Command(&hospi1, &sCommand, HAL_XSPI_TIMEOUT_DEFAULT_VALUE)
			!= HAL_OK) {

		return HAL_ERROR;
	}

	if (QSPI_AutoPollingMemReady() != HAL_OK) {
				return HAL_ERROR;
	}

	return HAL_OK;

}

I don't know what am I doing actually, but after I call this function before enable memory mapped mode, I can read the data. but the problem still ocours if I added to the external loader. maybe I will continue later since your loader works fine. Thank you

Thank you so much, I have tried erase, read, write, and verify with your loader, it works fine