2022-03-04 04:40 AM
I am using below development tools
MCU: STM32H7B3IIT6
IDE: STM32CubeIDE Version: 1.8.0
GUI: TouchGFX Version: 4.18.1
SDRAM: IS45S16800F-7CTLA1-TR
FLASH: MX25LM51245GMI00
Schematic
static void MX_OCTOSPI1_Init(void)
{
/* USER CODE BEGIN OCTOSPI1_Init 0 */
/* USER CODE END OCTOSPI1_Init 0 */
OSPIM_CfgTypeDef sOspiManagerCfg = {0};
/* USER CODE BEGIN OCTOSPI1_Init 1 */
/* USER CODE END OCTOSPI1_Init 1 */
/* OCTOSPI1 parameter configuration*/
hospi1.Instance = OCTOSPI1;
hospi1.Init.FifoThreshold = 1;
hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi1.Init.DeviceSize = 26;
hospi1.Init.ChipSelectHighTime = 2;
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi1.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;
hospi1.Init.ClockPrescaler = 3;
hospi1.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
hospi1.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi1.Init.ChipSelectBoundary = 0;
hospi1.Init.ClkChipSelectHighTime = 0;
hospi1.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
hospi1.Init.MaxTran = 0;
hospi1.Init.Refresh = 0;
if (HAL_OSPI_Init(&hospi1) != HAL_OK)
{
Error_Handler();
}
sOspiManagerCfg.ClkPort = 1;
sOspiManagerCfg.DQSPort = 1;
sOspiManagerCfg.NCSPort = 1;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
sOspiManagerCfg.IOHighPort = HAL_OSPIM_IOPORT_1_HIGH;
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN OCTOSPI1_Init 2 */
BSP_OSPI_NOR_Init_t Flash;
Flash.InterfaceMode = BSP_OSPI_NOR_OPI_MODE;
Flash.TransferRate = BSP_OSPI_NOR_DTR_TRANSFER;
BSP_OSPI_NOR_DeInit(0);
int32_t RetVal = BSP_OSPI_NOR_Init(0, &Flash);
if(RetVal != BSP_ERROR_NONE)
{
Error_Handler();
}
RetVal = BSP_OSPI_NOR_EnableMemoryMappedMode(0);
if(RetVal != BSP_ERROR_NONE)
{
Error_Handler();
}
/* USER CODE END OCTOSPI1_Init 2 */
}
I am trying to activate octospi as custom board design, but the program gives an error. The program gets an error at the following place? What do you think could be the reason?
Solved! Go to Solution.
2022-03-07 06:13 PM
If BSP_OSPI_NOR_Init() function fail then you can not do anything.
We need detail to known which point failed.
I think this Flash is damaged. Please replace it.
And, Make sure the Flash was come from authorized channel.
2022-03-08 03:45 AM
Hello @molecule.192g I replaced with new FLASH. But this problem continues. FLASH came from Macronicx sample
2022-03-08 06:00 AM
Hi @Patrickhiapello
These files for board not for STM32H7B3IIT6. Wouldn't it cause the same situation?
2022-03-08 07:09 AM
The loaders are highly implementation specific, both MCU, pinning, and memory device. The H74x / H75x devices use QSPI, not OSPI, and the peripherals and pin configuration are different.
You'd need to look at the BSP and Schematics for these other boards to see what pins they use, and how these differ from your design.
You've not listed your pin utilization. These get to the be the "details" that are important.
You get to review the data sheets and function for the parts you have chosen.
You can't debug this with top-level error reporting logs from the programmer, it is far too vague and non-specific.
You CAN debug the underlying BSP code outside of the programmer, and fully validate that.
You CAN build a harness to test/stress loader code
You CAN output debug/diagnostic information from your own loader via USART to understand what's happening internally. You can add instrumentation to understand specific flow, and device responses.
You CAN'T single-step or breakpoint debug the loader in the programmer. But you can get registers and other details with Verbose Level of 3.
2022-03-08 07:04 PM
2022-03-08 10:41 PM
Dear @molecule.192g
So, finally you solve external loader problem by set Flash interface to SPI-STR mode.
I am useing OPI-DTR. But For try I changed from OPI-DTR to SPI-STR. There was no change.Problem continues.
// BSP_OSPI_NOR_Init_t Flash;
// Flash.InterfaceMode = BSP_OSPI_NOR_OPI_MODE;
// Flash.TransferRate = BSP_OSPI_NOR_DTR_TRANSFER;
BSP_OSPI_NOR_Init_t Flash;
Flash.InterfaceMode = BSP_OSPI_NOR_SPI_MODE;
Flash.TransferRate = BSP_OSPI_NOR_STR_TRANSFER;
It means OPI-DTR work in your project, but it can not work in external loader. Am I right ?
I work with OPI-DTR. Why cant work im external loader. STM32H7B3-DK development board works external loader with OPI-DTR. So I sampled it
If yes then it's a very strange things.
Yes. I work on this problem for 1 week
2022-03-09 01:12 AM
2022-03-09 03:38 AM
Dear @Community member
Do you have ant opinion this problem?
2022-03-09 03:44 AM
Hi @Community member
at which point you are?
I mean, your code is working with BSP_OSPI_NOR_Init() ?
When you have this working you have to do the external loader.
You post " These files for board not for STM32H7B3IIT6."
Okay.
You have to see the more simular to your application, take the example code and modify for your application to have extenal loader
okay?
2022-03-09 03:53 AM
Hi @Patrickhiapello Thank you for support. I am working on external loader for my board. The reason for this problem my board pins different of STM32H7B3-DK has pins.