cancel
Showing results for 
Search instead for 
Did you mean: 

S28HS512T Issues with STM32H7S7

bcompter
Associate

After encountering an issue with a Hyperbus flash chip we moved our flash to what we thought would be a simpler OctoSpi Nor Flash. I am working with an STM32H7S7 chip with a NOR Flash S28HS512T. I cannot get the chip to communicate in the desired mode. Here are my steps so far:

Configuration code from CubeMX:

/* XSPI1 parameter configuration*/
  hxspi1.Instance = XSPI1;
  hxspi1.Init.FifoThresholdByte = 4;
  hxspi1.Init.MemoryMode = HAL_XSPI_SINGLE_MEM;
  hxspi1.Init.MemoryType = HAL_XSPI_MEMTYPE_MICRON;
  hxspi1.Init.MemorySize = HAL_XSPI_SIZE_512MB;
  hxspi1.Init.ChipSelectHighTimeCycle = 3;
  hxspi1.Init.FreeRunningClock = HAL_XSPI_FREERUNCLK_DISABLE;
  hxspi1.Init.ClockMode = HAL_XSPI_CLOCK_MODE_0;
  hxspi1.Init.WrapSize = HAL_XSPI_WRAP_NOT_SUPPORTED;
  hxspi1.Init.ClockPrescaler = 3;
  hxspi1.Init.SampleShifting = HAL_XSPI_SAMPLE_SHIFT_NONE;
  hxspi1.Init.DelayHoldQuarterCycle = HAL_XSPI_DHQC_ENABLE;
  hxspi1.Init.ChipSelectBoundary = HAL_XSPI_BONDARYOF_NONE;
  hxspi1.Init.MaxTran = 0;
  hxspi1.Init.Refresh = 0;
  hxspi1.Init.MemorySelect = HAL_XSPI_CSSEL_NCS1;
  if (HAL_XSPI_Init(&hxspi1) != HAL_OK)
  {
    Error_Handler();
  }
  sXspiManagerCfg.nCSOverride = HAL_XSPI_CSSEL_OVR_NCS1;
  sXspiManagerCfg.IOPort = HAL_XSPIM_IOPORT_1;
  if (HAL_XSPIM_Config(&hxspi1, &sXspiManagerCfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    Error_Handler();
  }

I perform software reset commands to make sure the chip is in a default state. This means that the chip is in SPI mode. Prescaler of 3 means I am running 50MHz.

Write 0x88 to CFR2 to force 32 bit address mode.

I read the Device Ids and all 5 configuration registers successfully. Zero dummy cycles.

  • Device Ids, (0x34, 0x5B, 0x1A, 0x0F, 0x03, 0x90)
  • CFR1, 0x00
  • CFR2, 0x88
  • CFR3, 0x00
  • CFR4, 0xA8
  • CFR5, 0x40

At this point I write 0x43 to CFR5 to go to octal DDR mode. I then set the prescaler to 1, for a clock of 200MHz.

I then use octal commands to get the device ids, which come back exactly as I expect. Three dummy cycles.

I then try to verify the configuration registers again with 3 or 6 dummy cycles (I've actually tried everything from 0 to 32 dummy cycles), and they are scrambled or zero.

I've tried updating the non-volatile latency setting by moving 0xC0 to CFR3.  No change in results. I'm confused that the device id commands work while read any register seem to fail.

My goal is to memory map this flash but I can't get past this issue talking to the registers.  Looking for whatever advice you can provide.  Thanks.

2 REPLIES 2
NesrynELMK
ST Employee

Hello @bcompter ?

 

Could you please share the S28HS512T datasheet.

Br,

 

https://www.mouser.com/datasheet/2/100/CYPR_S_A0011119728_1-2541140.pdf

 

If you feel a post has answered your question, please click "Accept as Solution".