cancel
Showing results for 
Search instead for 
Did you mean: 

RM0477 Reference manual documentation error

Intector
Senior

Hello STM,

I'm working on a project using the STM32H7R3L8H6H MCU with a PSRAM chip connected via HEXASPI to XSPM1. I'm encountering massive issues with the PSRAM initialization, which I described in a different post. I found a discrepancy between the RM0477 Reference manual documentation and the STM32CubeProgrammer during my tests. 

The XSPI_TCR register is described like this in the RM0477:

Intector_0-1737788347282.png

If I open the STM32CubeProgrammer register window, I find a DHQC flag on the register bit 28 position.

Intector_1-1737788477897.png

This bit is set to 1 all the time, and I have no information about its meaning.

Can someone please explain the function of this flag?

The STM32H7Rx/7Sx Arm®-based 32-bit MCUs are somewhat complex devices, and one would expect an actual reference manual. This isn't just some kind of "typo" in the documentation; it's another flag that probably has some functionality attached to it.

 

 

Be vigilant and always remember:

"Always be yourself. Unless you can be a pirate. Then always be a pirate."

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @Intector;

I think that the first request answered for DHQC bit is answered. So, click on Accept as Solution on the reply which solved your issue or answered your question.

For the second issue with clock prescaler, I recommend you to create a new thread.

Could you please check HAL_XSPI_SetClockPrescaler function in stm32h7rsxx_hal_xspi.c file.

 

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.

View solution in original post

4 REPLIES 4
KDJEM.1
ST Employee

Hello @Intector ,

 

Thank you for bringing this issue to our attention.

I reported this issue internally. And, I will come back to you with details as soon as possible.

Internal ticket number: 201430 (This is an internal tracking number and is not accessible or usable by customers).

 

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.

KDJEM.1
ST Employee

Hello @Intector,

 

The DHQC is not supported by the XSPI interface for STM32H7RS MCUs.

So, the RM0477 is correct and DHQC should be removed from bit list, STM32CubeMx XSPI parameter settings and  STM32H7RSxx_HAL_Driver.

Thank you for your contribution in the community.

 

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.

Hey @KDJEM.1 

Thank you for that information. It'll probably cause less confusion if those settings for XSPI1 and XSPI2 are not available in MX:

 

Intector_1-1738589971127.png

Also, the Clock Prescaler settings shouldn't be in here because they're not used in the firmware.

HAL_StatusTypeDef SAL_XSPI_SetClock(SAL_XSPI_ObjectTypeDef *SalXspi, uint32_t ClockIn, uint32_t ClockRequested, uint32_t *ClockReal)
{
  HAL_StatusTypeDef retr = HAL_OK;
  uint32_t divider;

  if (ClockRequested == 0u)
  {
    retr = HAL_ERROR;
  }
  else
  {
    divider = (ClockIn / ClockRequested);
    if (divider >= 1u)
    {
      *ClockReal = ClockIn / divider;
      if (*ClockReal <= ClockRequested)
      {
        divider--;
      }
    }

#if 0  /* Only used for debug purpose */
    divider=+5;
    divider++;
    divider++;
    divider++;
    divider++;
    divider++;
    divider++;
    divider++;
    divider++;
#endif

    /* real clock calculation */
    *ClockReal = ClockIn / (divider + 1u);

    DEBUG_PARAM_BEGIN(); DEBUG_PARAM_DATA("::CLOCK::"); DEBUG_PARAM_INT(divider); DEBUG_PARAM_END();
    MODIFY_REG(SalXspi->hxspi->Instance->DCR2, XSPI_DCR2_PRESCALER, (uint32_t)divider << XSPI_DCR2_PRESCALER_Pos);
  }

  return retr;
}

The SAL_XSPI_SetClock function in the stm32_sal_xspi.c file calculates the Prescale Factor for the XSPI_DCR2 register. This calculation is based on the actual frequency input settings for the XSPIx. This always leads to a prescaler factor of "0," which is the original XSPIx input frequency.

If one selects those settings:

Intector_2-1738591306985.png

The memory connected to XSPI will probably not work. The poor soul will never know why because the function calls in extmem_manager.c looking like this:

EXTMEM_Init(EXTMEMORY_1, HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_XSPI2));
EXTMEM_Init(EXTMEMORY_2, HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_XSPI1));

 

 

Never forget:

"Always be yourself. Unless you can be a pirate. Then always be a pirate."

KDJEM.1
ST Employee

Hello @Intector;

I think that the first request answered for DHQC bit is answered. So, click on Accept as Solution on the reply which solved your issue or answered your question.

For the second issue with clock prescaler, I recommend you to create a new thread.

Could you please check HAL_XSPI_SetClockPrescaler function in stm32h7rsxx_hal_xspi.c file.

 

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.