Skip to main content
Exit0815
Senior
Oct 7, 2023 11:49 AM UTC
Solved

Problems reading data from QSPI when address over 0x91000000

Hello,

i am having problems to read data from the QSPI nor-flash if the address changes from 0x90FFFFFF to 0x91000000

Everything is fine from 0x90000000 to 0x90FFFFFF but beginning from 0x91000000 there is no data.

Example, i have an array stored at the qspi which is stored in 0x90 and it goes into the 0x91 address.

i try to copy the array to a local array which does not work. When i debug, i see that at 0x91000000 seems to be empty. Attached Screenshot 1

If read the with CubeProgrammer, and start from 0x90FFFF00 i see data but it also stops at 0x91000000

Attached Screenshot 2

But, when starting reading from 0x91000000 i see the data correctly.

Attached Screenshot 3

I am using a custom PCB, STM32F779, MX25L512 QSPI with touchgfx

The arrays at the qspi i want to have access are only for reading, i don't want to write to the qspi.

 

What is my problem here? How can i get access to the address over 0x90FFFFFF ?

 

Thanks for any help.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Oct 7, 2023 12:51 PM UTC

The parts default into 3-byte / 24-bit addressing mode for compatibility purposes. The 3-byte addressing mode works for devices of 16MB (128Mbit) or smaller

You need to command them into 4-byte / 32-bit addressing mode, or use secondary commands identifying as being 4-byte address ones.

At the hqspi structure level this is a STM32 QSPI Peripheral directive as how to deliver the address, the flash chip needs to be in mode to accept that.

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

6 replies

Tesla DeLorean
Guru
Oct 7, 2023 12:05 PM UTC

As presented it suggests an issue with the External Loader implementation. 

At 16MB might suggest incorrect handling of 24 / 32-bit addressing modes or commands.

Are you sure this isn't mirroring content at 0x90000000 ?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Exit0815
Exit0815Author
Senior
Oct 7, 2023 12:24 PM UTC

Thank you very much for your answer and for the very helpful tip regarding the external loader and bit addressing.

I just checked my custom external loader and indeed i use 24 bit there

uint8_t CSP_QSPI_Erase_Chip(void) {
	QSPI_CommandTypeDef sCommand;


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


	/* Erasing Sequence --------------------------------- */
	sCommand.Instruction = CHIP_ERASE_CMD;
	sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
	sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
	sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
	sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
	sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
	sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
	sCommand.AddressMode = QSPI_ADDRESS_NONE;
	sCommand.Address = 0;
	sCommand.DataMode = QSPI_DATA_NONE;
	sCommand.DummyCycles = 0;

 

That means that i need 32 bit if i use more than 16MB, right?

At my main program i use:

s_command.AddressSize = QSPI_ADDRESS_32_BITS;

That might be a reason why my custom bootloader loads the data to the correct address but the external loader used in cubeIDE and CubeProgrammer can not read the data correctly.

I will give it a try to change the bit from 24 to 32 at the custom loader.

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Oct 7, 2023 12:51 PM UTC

The parts default into 3-byte / 24-bit addressing mode for compatibility purposes. The 3-byte addressing mode works for devices of 16MB (128Mbit) or smaller

You need to command them into 4-byte / 32-bit addressing mode, or use secondary commands identifying as being 4-byte address ones.

At the hqspi structure level this is a STM32 QSPI Peripheral directive as how to deliver the address, the flash chip needs to be in mode to accept that.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Exit0815
Exit0815Author
Senior
Oct 7, 2023 1:01 PM UTC

Thank you so much.

Just saw that you have a lot of external loader files in GIT, unfortunately not my config for STM32F779AIY and MX25L512

But i will play around, looks like there is more than one mistake i did.

Tesla DeLorean
Guru
Oct 7, 2023 1:58 PM UTC
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..