cancel
Showing results for 
Search instead for 
Did you mean: 

How to make external OctoSPI loader for STM32H7?

Freedom_Neo
Senior

I am using below componnet tools

MCU: STM32H7B3IIT6

IDE: STM32CubeIDE Version: 1.8.0

GUI: TouchGFX Version: 4.18.1

SDRAM: IS45S16800F-7CTLA1-TR

FLASH: MX25LM51245GMI00 (OctoSPI)

I am using below pins

// STM32H7B3IIT6 PIN CHART
// MX25LM51245GMI00
 
// OCTOSPIM P1
// D0   PD11:AF9   
// D1   PD12:AF9    
// D2   PE2:AF9    
// D3   PD13:AF9
// D4   PC1:AF10   
// D5   PC2:AF11   
// D6   PC3:AF11   
// D7   PD7:AF10
// CLK  PB2:AF9
// NCLK NOT USED
// NCS  PB10:AF9  
// DQS  PC5:AF10

I am using below configuration

0693W00000KcDD9QAN.jpg0693W00000KcDDEQA3.pngThere is source for QSPI but dont have OctoSPI.

I created external loader for custom board. But it didnt work. I am getting below errror.

0693W00000KcCqzQAF.pngI shared external loader project file at attachment. Can you review it please? I need your support.

https://drive.google.com/file/d/1m1aCF1FueA2xE2qVvX7kWM_29_l7sNRr/view?usp=sharing

1 ACCEPTED SOLUTION

Accepted Solutions
30 REPLIES 30

Created this fork, and modified the loader with the pins as described

https://github.com/cturvey/stm32extldr/blob/main/h7_mx25lm51245g/README.md

This thread is a follow on from the following one

https://community.st.com/s/question/0D53W00001PXEgKSAX/how-external-octo-spi-flash-activete-for-custom-board-design

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

The above modified the H7A3-DK loader

Looking at your project, but the loader gets to be quite large

This uses the 0x20000004 RAM base, H7 loaders typically use 0x24000004

STM32H7B3IIT6_External_Loader\linker.ld

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dear @Community member​ Thank you very much for support. I think the St team should prepare training on how to prepare an external loader for OctoSPI in OctoSPI like QSPI. Because there is for QSPI but there is not for OctoSPI

/* Definition for OSPI Pins */
 
#define OSPI_CS_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOB_CLK_ENABLE()
#define OSPI_CLK_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOB_CLK_ENABLE()
#define OSPI_D0_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
#define OSPI_D1_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
#define OSPI_D2_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOE_CLK_ENABLE()
#define OSPI_D3_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
#define OSPI_D4_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
#define OSPI_D5_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
#define OSPI_D6_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
#define OSPI_D7_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
#define OSPI_DQS_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOC_CLK_ENABLE()
 
#define OSPI_CS_PIN                 GPIO_PIN_10
#define OSPI_CS_GPIO_PORT           GPIOB
#define OSPI_CS_PIN_AF              GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_CLK_PIN                GPIO_PIN_2
#define OSPI_CLK_GPIO_PORT          GPIOB
#define OSPI_CLK_PIN_AF             GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_D0_PIN                 GPIO_PIN_11
#define OSPI_D0_GPIO_PORT           GPIOD
#define OSPI_D0_PIN_AF              GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_D1_PIN                 GPIO_PIN_12
#define OSPI_D1_GPIO_PORT           GPIOD
#define OSPI_D1_PIN_AF              GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_D2_PIN                 GPIO_PIN_2
#define OSPI_D2_GPIO_PORT           GPIOE
#define OSPI_D2_PIN_AF              GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_D3_PIN                 GPIO_PIN_13
#define OSPI_D3_GPIO_PORT           GPIOD
#define OSPI_D3_PIN_AF              GPIO_AF9_OCTOSPIM_P1
 
#define OSPI_D4_PIN                 GPIO_PIN_1
#define OSPI_D4_GPIO_PORT           GPIOC
#define OSPI_D4_PIN_AF              GPIO_AF10_OCTOSPIM_P1
 
#define OSPI_D5_PIN                 GPIO_PIN_2
#define OSPI_D5_GPIO_PORT           GPIOC
#define OSPI_D5_PIN_AF              GPIO_AF11_OCTOSPIM_P1
 
#define OSPI_D6_PIN                 GPIO_PIN_3
#define OSPI_D6_GPIO_PORT           GPIOC
#define OSPI_D6_PIN_AF              GPIO_AF11_OCTOSPIM_P1
 
#define OSPI_D7_PIN                 GPIO_PIN_7
#define OSPI_D7_GPIO_PORT           GPIOD
#define OSPI_D7_PIN_AF              GPIO_AF10_OCTOSPIM_P1
 
#define OSPI_DQS_PIN                GPIO_PIN_5
#define OSPI_DQS_GPIO_PORT          GPIOC
#define OSPI_DQS_PIN_AF             GPIO_AF10_OCTOSPIM_P1

Hi @Community member​ I checked this file but I make same error

0693W00000KcepGQAR.png

Ok, I will double check my work, but working blind here.

Were you using the SFIx version of the loader on the DISCO/DK board?

Does your own BSP code work with the part on your board?

@mattias norlander​  What's the difference between these two loaders?

MX25LM51245G_STM32H7B3I-DISCO.stldr

MX25LM51245G_STM32H7B3I-DISCO-SFIx.stldr

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dear @Community member​ 

Were you using the SFIx version of the loader on the DISCO/DK board?

Yes, I used SFIx version on the DISCO/DK board

MX25LM51245G_STM32H7B3I-DISCO-SFIx, 0x90000000, NOR_FLASH, MX25LM51245G_STM32H7B3I-DISCO-SFIx.stldr

Does your own BSP code work with the part on your board?

Yes, work on my board.

To test if OctoSPI FLASH works, I made my pin connections the same as the DK development board. I made the pin connections with jumpers as space mounts. Then I was able to load FLASH with the external loader of the DK card. OctoSPI FLASH worked.(Shows some data incorrect or missing due to jumpers)

MX25LM51245G_STM32H7B3I-DISCO-SFIx, 0x90000000, NOR_FLASH, MX25LM51245G_STM32H7B3I-DISCO-SFIx.stldr

#define OSPI_CS_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
#define OSPI_CLK_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOB_CLK_ENABLE()
#define OSPI_D0_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOD_CLK_ENABLE()
#define OSPI_D1_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
#define OSPI_D2_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
#define OSPI_D3_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOF_CLK_ENABLE()
#define OSPI_D4_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
#define OSPI_D5_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOH_CLK_ENABLE()
#define OSPI_D6_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
#define OSPI_D7_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOG_CLK_ENABLE()
#define OSPI_DQS_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOC_CLK_ENABLE()
 
/* Definition for OSPI Pins */
/* OSPI_CLK */
#define OSPI_CS_PIN                 GPIO_PIN_6
#define OSPI_CS_GPIO_PORT           GPIOG
#define OSPI_CS_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_CLK_PIN                GPIO_PIN_2
#define OSPI_CLK_GPIO_PORT          GPIOB
#define OSPI_CLK_PIN_AF             GPIO_AF9_OCTOSPIM_P1
#define OSPI_D0_PIN                 GPIO_PIN_11
#define OSPI_D0_GPIO_PORT           GPIOD
#define OSPI_D0_PIN_AF              GPIO_AF9_OCTOSPIM_P1
#define OSPI_D1_PIN                 GPIO_PIN_9
#define OSPI_D1_GPIO_PORT           GPIOF
#define OSPI_D1_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_D2_PIN                 GPIO_PIN_7
#define OSPI_D2_GPIO_PORT           GPIOF
#define OSPI_D2_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_D3_PIN                 GPIO_PIN_6
#define OSPI_D3_GPIO_PORT           GPIOF
#define OSPI_D3_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_D4_PIN                 GPIO_PIN_1
#define OSPI_D4_GPIO_PORT           GPIOC
#define OSPI_D4_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_D5_PIN                 GPIO_PIN_3
#define OSPI_D5_GPIO_PORT           GPIOH
#define OSPI_D5_PIN_AF              GPIO_AF9_OCTOSPIM_P1
#define OSPI_D6_PIN                 GPIO_PIN_9
#define OSPI_D6_GPIO_PORT           GPIOG
#define OSPI_D6_PIN_AF              GPIO_AF9_OCTOSPIM_P1
#define OSPI_D7_PIN                 GPIO_PIN_7
#define OSPI_D7_GPIO_PORT           GPIOD
#define OSPI_D7_PIN_AF              GPIO_AF10_OCTOSPIM_P1
#define OSPI_DQS_PIN                GPIO_PIN_5
#define OSPI_DQS_GPIO_PORT          GPIOC
#define OSPI_DQS_PIN_AF             GPIO_AF10_OCTOSPIM_P1

 So if the external loader was correct, it would work with the external loader you sent. But dont work

My hope was that it would. But I'm doing it blindly without a reference board/chip.

I checked the pin list.

I will patch the SFIx loader next, and will look at the clocking in case that's wrong.

What frequency is your HSE clock source?

Do you have a UART that's usable for debug/diagnostic output? Which one/pins?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Dear @Community member​ 

What frequency is your HSE clock source?

My HSE clock is 25MHz

Do you have a UART that's usable for debug/diagnostic output? Which one/pins?

No I dont have. Why do you say this question?