cancel
Showing results for 
Search instead for 
Did you mean: 

External loader for the SST26VF064B Flash Memory

MLair.1
Associate III

Hello Everyone,

I'm working on the Mikromedia 7 Capacitive board and I'd like to store my fonts and images in my external Flash Memory, the SST26VF064B. I searched in /bin/ExternalLoader and there is no example for this Flash.

So I decided to make my own, following this documentation with dev_inf and loader_src files : https://www.st.com/resource/en/user_manual/dm00403500-stm32cubeprogrammer-software-description-stmicroelectronics.pdf#page=25

0693W00000D2b3hQAB.png 

But, I don't manage to have my .stldr file working. It seems like this :

0693W00000D2b3wQAB.png 

Do you have already an example of an external loader for this SST26VF064B or would you have some advice to make my own. Thanks!

13 REPLIES 13

External loaders are a bit of a minefield. Here it looks like it fails to pulling the StorageInfo structure from the .ELF file. Perhaps an issue with the Linker Script

Most people are using Micron and Winbond parts, and to some lesser extent Macronix. I can usually fixture SOP16(W) / SOIC16 300mil parts

The ordering/size of the SST26VF064B seems significantly more awkward and complex than your table describes. I'd be half tempted to say they were all 4KB

4, 8192,

1, 32768,

126, 65536,

1, 32768,

4, 8192

STM32 Cube Programmer will throw you an address range, so expect that your Erase() function will need to unpack the boundaries too.

Generally I'd recommend building and testing your read, write, erase code and functionality outside of the loader first

I'd also suggest using the type SPI_FLASH, and providing a Read() function, as this avoids a lot of issues entering/exiting Memory Mapped mode continually.

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

Thanks Tesla, I've looked my .elf file in depth and it looks like my dev_inf et loader_src files are not considered in it. Probably an error of properties.

This is what I use for my GNU\GCC MAKE process

/*
*****************************************************************************
**
**  File        : ExternalLoader.ld
**
**  Abstract    : Linker script for STM32F7xx Device with
**                128KByte RAM
**
**  Copyright (c) 2020-2021 Clive One / sourcer32@gmail.com
**
*****************************************************************************
*/
 
/* Entry Point */
ENTRY(Init)
 
/* Specify the memory areas */
MEMORY
{
  RAM_INFO (r)   : ORIGIN = 0, LENGTH = 1K
  RAM_PROG (xrw) : ORIGIN = 0x20000004, LENGTH = 128K-4 /* 0x20000004 for Non-H7, 0x24000004 for H7 */
}
 
/* Define output sections */
SECTIONS
{
  .info :
  {
    KEEP (*(.rodata.StorageInfo))
  } >RAM_INFO
 
  /* The program code and other data goes into IMAGE */
  .prog :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)
 
    /* Ensure entry points are pulled in here */
    KEEP (*(.text.Init))
    KEEP (*(.text.DeInit))
    KEEP (*(.text.Write))
    KEEP (*(.text.Read))
    KEEP (*(.text.Verify))
    KEEP (*(.text.Checksum))
    KEEP (*(.text.SectorErase))
    KEEP (*(.text.MassErase))
 
    KEEP (*(.init))
    KEEP (*(.fini))
 
    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >RAM_PROG
 
  /* Constant data goes into IMAGE */
  .rodata :
  {
    . = ALIGN(4);
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    . = ALIGN(4);
  } >RAM_PROG
 
  .ARM.extab :
  {
     *(.ARM.extab* .gnu.linkonce.armextab.*)
  } >RAM_PROG
 
  .ARM :
  {
    __exidx_start = .;
    *(.ARM.exidx*)
    __exidx_end = .;
  } >RAM_PROG
 
  .preinit_array :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array*))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  } >RAM_PROG
 
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT(.init_array.*)))
    KEEP (*(.init_array*))
    PROVIDE_HIDDEN (__init_array_end = .);
  } >RAM_PROG
 
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT(.fini_array.*)))
    KEEP (*(.fini_array*))
    PROVIDE_HIDDEN (__fini_array_end = .);
  } >RAM_PROG
 
  /* Initialized data sections goes into RAM, load LMA copy after code */
  .data :
  {
    . = ALIGN(4);
    _sdata = .;        /* create a global symbol at data start */
    *(.data)           /* .data sections */
    *(.data*)          /* .data* sections */
 
    . = ALIGN(4);
    _edata = .;        /* define a global symbol at data end */
  } >RAM_PROG
 
  /* Uninitialized data section */
  . = ALIGN(4);
  .bss :
  {
    /* This is used by the startup in order to initialize the .bss secion */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)
 
    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM_PROG
 
  /* Remove information from the standard libraries */
  /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
 
  .ARM.attributes 0 : { *(.ARM.attributes) }
}

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

Yes I have a pretty similar loader. Now I can recognize my own external loader in STM32CubePrg, however I can't yet load it, where the error could be from ?

My Dev_Inf and Loader_Src files, the linker script or something else ?

0693W00000DpezhQAB.png 

As much for me, I've badly called my init() function.. I forgot the great I.

A quick scan of the MikroE schematic suggests this connects as SPI rather than QSPI

You'll need this to be an SPI_FLASH not a NOR_FLASH, and you'll want to implement the Read() function to recover content (historically the programmer has crashed when NOR_FLASH and Read() co-exist)

Microchip/SST indicate a 52 week lead on this part in the SOP/SOIC16(W) package

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

Thanks for the detail ! My Write, Read and SectorErase functions are working great outside the loader. I just have to focus on my external loader now.

Here is my two files : 0693W00000DpmMTQAZ.png0693W00000DpmMYQAZ.png 

Maybe my error could be from my .ld file which is not from my microcontroller specifically but I expect it to work fine.

DSucl.1
Associate II

Hi MLair.1

I'm currently using the same Mikromedia 7, i've noted you've used SPI1, in that board the flash is connected to the SPI2. Did you get it work? it has been a year since your last reply about this threat, hope you make it work... please let me know, i'm facing the same issue right now....

Thank you in advance, hope to have your reply soon.

my best regards

Hi MLair.1

I'm currently using the same Mikromedia 7, i've noted you've used SPI1, in that board the flash is connected to the SPI2. Did you get it work? it has been a year since your last reply about this threat, hope you make it work... please let me know, i'm facing the same issue right now....

Thank you in advance, hope to have your reply soon.

my best regards