Accessing the QSPI Flash on the Giga

Hello All,

In brief:
I've successfully accessed to the on-board flash but I cannot get access to the QSPI flash. Anyone got the QSPI flash working on the Giga?

In detail:
I have successfully tested the first sketch from this page:

Serial Output:

FlashIAPBlockDevice Test
------------------------
Flash Size: 2.00 MB
FlashIAP Start Address: 0x8060000
FlashIAP Size: 1.50 MB
Block device size: 1.50 MB
Readable block size: 1 bytes
Programmable block size: 32 bytes
Erasable block size: 128 KB
Reading previous message...

Writing new message...
Random number: 361
Done.

The second section of the page is about accessing the QSPI flash and again provides a handy sketch, which compiles fine but gives this output on the Serial:

QSPI Block Device Test
------------------------
Partitioning block device...
Block device size: 0 KB
Readable block size: 0 bytes
Programmable block size: 0 bytes
Erasable block size: 0 KB
Reading previous message...
������
Writing new message...
Random number: 542
Done.

I'm assuming that this means it's not quite working but I'm unable to work out why, other than I'm using a Giga R1 not an H7... Anyone got the QSPI flash working with the Giga R1?

Hello,

Can you please run this sketch and post the output?

Thank you!

Hello @jorgetrujilloroman - thank you - here is the output:

Looking for Partitions on the Flash Memory... MBR Found

Boot Signature: 0x55AA

Printing Partitions Table and Info...

================================

Partition: 1

Bootable: No

Type: 0x0B

Size [KBytes]: 4

Start [C/H/S]: 0/2/0

Stop [C/H/S]: 0/2/0

================================

Partition: 2

Bootable: No

Type: 0x00

================================

Partition: 3

Bootable: No

Type: 0x00

================================

Partition: 4

Bootable: No

Type: 0x00

No more partitions are present.

Total Space [KBytes]: 16384

Allocated Space [KBytes]: 4

Unallocated Space [KBytes]: 16380

Hello,

Thank you for the feedback. It seems to be right, as you can see there are 4 Kb of memory on the Partition 1, as defined on line 20 on the "Programming the QSPI Flash" full sketch:

QSPIFBlockDevice root(PD_11, PD_12, PF_7, PD_13,  PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000);

You can try to change the partition number on line 28 to 2 by replacing the line for:

MBRBlockDevice::partition(&root, 2, PARTITION_TYPE, 0, BLOCK_DEVICE_SIZE);

And then run the read partitions sketch again to probe that the space has been now allocated on the partition 2.

To format the partitions you can run the QSPIformat sketch.

I hope this information helps you.

Thanks @jorgetrujilloroman that seems to be working to create the partitions. I chose option 2 so that there are 3 partitions with an 8Mb data partition. Is there a simple sketch that shows how to read/write data to the partition? I've taken a good look through the files provided but they mainly seem to create a new set of partitions and if I stop that bit from working then the rest of it fails to compile. kind regards, Giles

The addressing part is not completely clear for me.
The size is 4KB and starts from 0, how to address the others? And what is the meaning of 4/1/0?