cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 QUADSPI two independent bank operation example code

JTse.1
Associate II

do anyone have example stm32h43 or even any stm32xxx QUADSPI example code

i am using STM32H43 QUADSPI and i have configured BK1 to control a flash and BK2 to control a ram

BK1 works flawlessly when FSEL - 0 (U4, flash1 selected) but BK2 cannot work properly when FSEL = 1 (U5, flash2 selected)

just sending a read status register 1 instruction (common for both devices) only command to the devices is the easiest way to check the hardware working proper or not

the same code works on BK1, i got toggle the WREN bit and read it out but not on BK2

i can see all the correct waveform on BK1 but when flash2 is selected, BK2-IO0 which is the SI for the ram U5 do not have the instruction bits which was present on BK1-IO0 when flash1 was selected

so, the only way to find out what is happening is to get sample working code to use it confirm if my setup is correct

my schematic follows the recommended connection in the ST reference documents for two independent flash

the only connection that is common is the quadspi-clk, see attachment

thanks

john 

8 REPLIES 8
KDJEM.1
ST Employee

Hello @JTse.1,

 

In case of two different memories, before switching from quad-SPI memory to another, it’s recommended to reconfigure the QUADSPI interface accordingly the desired memory specification.

Also, make sure that:

  • The Dual_Flash mode must be disabled (DFM=0)
  • The data transmission to be completed before switching from quad-SPI memory to another.

Also, I advise you to decrease the QUADSPI clock frequency that may help you to solve the issue.

Could you please share the QUADSPI configuration and memories datasheets?

 

Thanks and best regards,

Kaouthar

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JTse.1
Associate II

i tried at all frequencies and i have tested all modes I tried to use Dual flash mode only to check the BK1 & Bk2 IO with a scope to see if all of them are toggling properly, logically, in Dual Fash mode, both BK1 and BK2 should be working identically.

but no use, the BK2-IO0 and BK2-IO3 is still not working, even in dual flash mode.

i am currently using 80Mhz only to ensure that there are no timing issues even though it can work at higher frequencies

the main problem is that BK1 works completely, in single line classic SPI mode or quad line QSPI mode

but BK2 totally cannot work even with the same code but with FSEL = 1

i have tested all BK2 IO lines with dedicated IO mode and confirmed that all those lines are working and not shorted or OC

situation is that during FSEL = 1

QUADSPI CLK is common and so it is working

BK2-NCS is working, so confirmed that device 2 is selected

just in single line mode, exactly the same as a classic SPI,

BK2-IO0 do not have any 8-bit instruction out at all, always low

also, BK2-IO3 is low, which is the chip rst in classic spi mode, so the chip is always in reset, this do not happen in BK1-IO3 when FSEL = 0

there is why, it is impossible to carry on without manufacturer's help, at least give me some proven code examples to test!!!

has anyone actually used QUADSPI in independent mode at all?

 

 

KDJEM.1
ST Employee

Hello @JTse.1 ,

 

As I mentioned in my pervious reply, to check the issue could you please share your project and the memories datasheets?

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JTse.1
Associate II

dear Kaouthar

i do not understand your question

i have even attached my schematics, which not only have all the part numbers, also all the io names and connection

is it not good enough?

i cannot attach my stmcubeIDE project because i am doing raw register level code to be sure that there is no hidden code in my testing.

in fact, to be totally transparent and low level, i am using Forth language debug code that is only one level above assembly. low enough that everything is visible and there are no hidden support code.

if you still want it, i do not mind posting it at all.

like i said, my code works in single line classic spi and quad spi mode for FSEL = 0

all commands works

but FSEL = 1, my code fails, 

if the QUADSPI banks can work independently, why did this happen.

so, it should not be a hardware circuit connection issue

more likely a config issue or worst, undocumented setting issue.

therefore, the only way to be sure is to get demo code that works and use it to compare the settings and operation

this will overcome any connection, pcba or timing issues.

that is why i want example working code, dont tell me ST do not have working demo code?

 

 

 

 

john

KDJEM.1
ST Employee

Hello @JTse.1,

 

Thank you for updating post.

I thought the flash2 is wrongly configured. That's why I asked to share your project to check the configuration.

I've only found these two examples that use the DUAL mode may help you.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JTse.1
Associate II

Dear Kaouthar

i will try them and let you know the result

at least i hope that they will be able to show me where i go wrong

i assume that those examples has been proven to work

can you tell me where was these examples taken from,

if it is from some demo kit, i may have to buy a kit to test it exactly

at least, it is a working example.

anyway, if i run those examples and it does shows BK2-IO3 and BK2-IO0 has activities

it will indicate that somewhere i did wrong and i will really have to take apart the code to see where

john

JTse.1
Associate II

dear Kaouthar

unfortunately, all the examples are non-configurable

so, i am not able to actually run it due to IO different.

i am using the QSPI_MemoryMappedDual example to check out the setting, 

just ported all the settings to my hardware but using my IO so that i can monitor it on the scope.

it is not important that the example do not completely work, i just want to monitor the physical IO to see if they work as expected which in dual flash mode should meant that both flash data lines must operate correctly.

i could only single step up up to all the config part and get the setting for all the registers

and also see the first command and assembled the same command to send

still, when i do the same setting in my code for dual flash mode, single line classic SPI mode

the BK1 part works fine but the BK2 only partly works

BK1-NCS and BK2-NCS is working fine and so both chip is selected

BK1-IO3 is high as expected 

BK1-IO2 is low as expected 

BK1-IO0 has pulses as expected which is the instruction byte being send to the chip

but BK2-IO3 (RST in single line mode) is constant low = should be high as in BK1-IO3

also, BK2-IO0 (SI in single line mode) is constant low = should have the same pulses as in BK1-IO

this supposed to be dual flash mode, yet BK2-IO0 & IO3 is not the same as BK1-IO0 & IO3

so, flash 1 all lines worked as expected but flash 2 two lines did not work at all.

the final step i am going to take is to buy an exact demo kit to test the example in and measure the IO lines to see if it works 

but it seems that the H743 demo kit is obsolete, 

Can the new demo kit with H745 CPU runs those existing examples?  are the IO configured the same?

pls let me know the exact kit to buy?

if the kit does not work, that is for me with ST. it is too difficult, there is nothing else that i have not tried.

john

 

KDJEM.1
ST Employee

Dear john @JTse.1;

 

QSPI_MemoryMappedDual example has tested with various ST boards, such as:

    • STM32H745I-DISCO: Cortex®‑M7 and Cortex®‑M4 core-based STM32H745XI (STM32H745XIH6 order code)
    • STM32H750B-DK Cortex®‑M7 core-based STM32H750XB (STM32H750XBH6 order code).

 

 

Thank you.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.