cancel
Showing results for 
Search instead for 
Did you mean: 

Problems reading data from QSPI when address over 0x91000000

Exit0815
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6

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
Up vote any posts that you find helpful, it shows what's working..

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.

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
Up vote any posts that you find helpful, it shows what's working..

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.

Thank you so much.

It works now, and i can put my custom arrays to the end of the qspi, that was never working.

The problem i had when i used the qspi up 16MB that the graphics are destroyed is also gone now. Thanks so much.

I also saw that your sector size is different to my initial external loader (which worked for the first 16MB).

I now need to find out where the problem is, i can not upload from cubeIDE

Error: failed to erase memory

But on cubeProgrammer it works.

I will try to find out where the problem at my external loader is for better understanding in the future.