cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 external loader

AMend.7
Associate III

Hi,

 I need the project used to generate the external loader: MX25LM51245G_STM32H573I-DK.stldr. My custom board uses a STM32H563VIT6 and the same octo-spi flash from Macronix used in the STM32H573I-DK board. But with different gpios connections. So this project would be of great help to develop the external flash loader for my board.

 

Ari

29 REPLIES 29
KDJEM.1
ST Employee

Hi @AMend.7 ,

I noted that the same request is already shared with your FAE.

For sure he will get back to you if a project is available.

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.

Yes, having in the OSPI / XSPI Examples directory would be the way to go, using the BSP/CSP code or whatever so there's a single point of change for porting. Ideally putting code here would force the dog-fooding of tools/resources, ie one where ST has to get it right and tested because it's what they have to use day in and out.

I did order up some additional NUCLEO-H5's from DigiKey, but I should be able to patch the .STLDR before they get here.

; ARI STM32H563VIT6 MX25LM51245G
;
; PE11 ------> OCTOSPI1_NCS AF6
; PB2  ------> OCTOSPI1_DQS AF10
; PA3  ------> OCTOSPI1_CLK AF3
; PD11 ------> OCTOSPI1_IO0 AF9
; PD12 ------> OCTOSPI1_IO1 AF9
; PC2  ------> OCTOSPI1_IO2 AF9
; PD13 ------> OCTOSPI1_IO3 AF9
; PE7  ------> OCTOSPI1_IO4 AF10
; PE8  ------> OCTOSPI1_IO5 AF10
; PE9  ------> OCTOSPI1_IO6 AF10
; PE10 ------> OCTOSPI1_IO7 AF10
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I discovered that there is an MX25LM51245G driver equivalent to the one used in the flash loader project for the U5 dev boards, but adapted for the XSPI interface. I'll try to make the flash loader from this driver.

\STM32Cube_FW_H5_V1.1.1\Drivers\BSP\Components\mx25lm51245g

I don't understand why ST changed from OSPI to XSPI in the STM32H5's HAL library, if the H5's OSPI hardware is the same as the U5's.

That and I could only find 8 IO pins on the H5 I was looking at. The code churn drives me mental..

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

Ok, try this, this is a patched version of the DK STLDR with a Pin List processed via OSPI_NOR_MspInit / OSPI_NOR_MspDeInit instead of hard coded. Has the same clocking assumptions as the DK board.

https://github.com/cturvey/stm32extldr/blob/main/h5_mx25lm51245g/MX25LM51245G_STM32H5-ARI.stldr

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

I just tested it and unfortunately it's not working. I'm trying to make the external load by porting the github project from U5 to H5 and using the memory driver that I found in the STM32Cube_FW_H5_V1.1.1. 

Posted the unpacked version (fixer.stldr), and the assembler patch file in case I did something monumentally wrong. Double check the pins and alternate function settings.

https://github.com/cturvey/stm32extldr/tree/main/h5_mx25lm51245g

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

Ok, looks like my H5 boards will come in on Monday

@Aziz BRIGUI is there some rational behind H5 external loaders building at 0x20003004 ?

========================================================================

** ELF Header Information

    File Name: MX25LM51245G_STM32H573I-DK.stldr

    Machine class: ELFCLASS32 (32-bit)
    Data encoding: ELFDATA2LSB (Little endian)
    Header version: EV_CURRENT (Current version)
    Operating System ABI: none
    ABI Version: 0
    File Type: ET_EXEC (Executable) (2)
    Machine: EM_ARM (ARM)

    Image Entry point: 0x20003005
    Flags: None (0x05000000)

    ARM ELF revision: 5 (ABI version 2)

    Conforms to Base float procedure-call standard

    Header size: 52 bytes (0x34)
    Program header entry size: 32 bytes (0x20)
    Section header entry size: 40 bytes (0x28)

    Program header entries: 2
    Section header entries: 20

    Program header offset: 159376 (0x00026e90)
    Section header offset: 159440 (0x00026ed0)

    Section header string table index: 1

========================================================================

** Program header #0 (PT_LOAD) [PF_R]
    Size : 200 bytes
    Virtual address: 0x00000000 (Alignment 4)


====================================

** Program header #1 (PT_LOAD) [PF_X + PF_W + PF_R]
    Size : 16205 bytes
    Virtual address: 0x20003004 (Alignment 4)


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

Hi @AMend.7 

The HAL library moved from HAL OSPI to HAL XSPI to consider the support of Extended-SPI mode up to 16-bits (Hexa-SPI). Hardware configurations are different between products on this Hexa-SPI capability.

Regards

Patrice 

ABasi.2
Associate III

hi!

did you succeed to make the external loader?

I'm trying my best, I have a functional driver for a quad quad spi memory but when I make the external loader it doesn't work (read data failed)

I'm using the NUCLEO-H563ZI with a MX25L512 

I think I have problem with the linker file

if you have succeeded can you share your project?

best regards