Git Product home page Git Product logo

stm32-external-loader's Introduction

Introduction

This repository contains the Flashloaders source code of external memories embedded in STM32 HW boards.

  • The branch master provides the Flashloaders projects and source files as it's integrated in STM32CubeProgrammer tool.
  • The branch contrib helps you to integrate the external memory to your Embedded system driven by STM32.

External memories

External memories are available on many STM32 HW board like the evaluation and discovery boards. It can be a Flash or SRAM and it provides higher storage capabilities. The STM32 boards supports many types of external memories such us Micron, Winbond that are connected to the mcu through different interfaces like FMC, SPI..

Package structure

The flashloader project is built with EWARM or MDK-ARM IDE and comes with the corresponding source, header and linker files:

  • Library : source/headers files providing required drivers to manage read, write erase functionalities of the supported memory that are required to implement the initialization, erase and write functions needed by the flashloader.

  • Loader : source/headers files containing specific information related to the supported memory (name, size…) and functions required by the flashloader

  • Project : contains a preconfigured project with the associated linker file

How to adapt the flashloader project for a customized board

The required steps to build a customized loader for cube programmer are vailable at this link (Section 3.9).

Contribution

We propose and accept contribution from community for new loaders and drivers only on contrib branch. This branch, master, includes original external loaders for STM32 development boards.

stm32-external-loader's People

Contributors

ccastm avatar fbostm avatar majerle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32-external-loader's Issues

stm32h750b

Why are there no folders for STM32H750B-DK? (I am noob.)

MX25L6433F SPI Flash

The MX25L6433F SPI Flash is used on the X-NUCLEO-GFX01M1 board. The use of the TouchGFX libraries makes it necessary the external loader for this flash.
The TouchGFX designer provides two application templates that support this flash, but only for the NUCLEO-G071RB board.
By downloading the application template through the TouchGFX Designer 4.15.0 you can get the External Loader MX25L6433F_STM32G071B_NUCLEO.stldr.

The X-NUCLEO-GFX01M1 board supports many other NUCLEO boards: there is a need to have many external loaders if you want to use TouchGFX libraries!

Based on this repository I have implemented the MX25L6433F_STM32F446RE_NUCLEO.stldr for X-NUCLEO-GFX01M1 and NUCLEO-F446RE.
I would like to share the project.
It's possible ?
If so, how should I proceed to do this?

add flash loader for W25Qxx IC

hi everyone
The w25qxx IC is cheaper and more available than other flash ICs. Please add the driver for the w25q256FV IC.

Erasing sector in dual flash mode

I faced an issue while I worked through the erasing cycle on STM32H745I-DISCO with dual MT25QL512ABB8ESF-0SIT QSPI flash. When the QSPI is in dual flash mode, the CSP_QSPI_EraseSector() method will erase the next or the previous sector as well (based on the destination sector) i.e:

#define MEMORY_SECTOR_SIZE 0x10000

  • If you erase sector 0 then sector 1 will be erased too ( CSP_QSPI_EraseSector(0 * MEMORY_SECTOR_SIZE, (0 + 1) * MEMORY_SECTOR_SIZE - 1) )
  • If you erase sector 1 then sector 0 will be erased too! ( CSP_QSPI_EraseSector(1 * MEMORY_SECTOR_SIZE, (1 + 1) * MEMORY_SECTOR_SIZE - 1) )
  • If you erase sector 2 then sector 3 will be erased too ( CSP_QSPI_EraseSector(2 * MEMORY_SECTOR_SIZE, (2 + 1) * MEMORY_SECTOR_SIZE - 1) )
  • If you erase sector 3 then sector 2 will be erased too! ( CSP_QSPI_EraseSector(3 * MEMORY_SECTOR_SIZE, (3 + 1) * MEMORY_SECTOR_SIZE - 1) )

and so on.

I didn't find any workaround to fix this issue so right now for the demo code to work I had to erase the sectors first and then run writing loop:

	 for (var = 0; var < SECTORS_COUNT; var++)
	 {
		 if (CSP_QSPI_EraseSector(var * MEMORY_SECTOR_SIZE, (var + 1) * MEMORY_SECTOR_SIZE - 1) != HAL_OK)
		 {
			 while (1) {}
		 }
	 }

	 for (var = 0; var < SECTORS_COUNT; var++)
	 {
		 if (CSP_QSPI_WriteMemory(buffer_test, var * MEMORY_SECTOR_SIZE, MEMORY_SECTOR_SIZE) != HAL_OK)
		 {
			 while (1) {}
		 }
	 }

Issues with MT25QL512

Hello,
i followed this guide several times, i correctly set my MT25L128, now i want to set MT25QL512, however i does not work properly.
When i program the flash memory through the Programmer, the number are shifted by one byte, like in this picture.
I copied and pasted the entire driver but it doen't work. The only different parameters are the CubeMX settings. I used:

  1. prescaler = 2
  2. FIFO = 1
  3. No sample shifting
  4. Flash size = 25
  5. CS High Time = 2
  6. Clock Mode = LOW
  7. Flash ID = 1
  8. Dual Flash = Disabled

Can not erase

Hi,

I have tried this project with STM32H7B3I-DK which use MX25LM51245G_STM32H7B3I-DISCO.stldr external loader with STM32CubeProgrammer. If I build this project and replace MX25LM51245G_STM32H7B3I-DISCO.stldr into C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\ExternalLoader it does not work? Did you test on this board please?

Please see bellow log into STM32CubeProgrammer
10:19:26 : Memory Programming ...
10:19:26 : Opening and parsing file: extflash.bin
10:19:26 : File : extflash.bin
10:19:26 : Size : 5525216 Bytes
10:19:26 : Address : 0x90000000
10:19:26 : Erasing memory corresponding to segment 0:
10:19:26 : Erasing external memory sectors [0 84]
10:19:31 : Error: failed to erase memory
10:19:31 : Error: failed to erase memory
10:19:31 : RUNNING Program ...
10:19:31 : Address: : 0x90000000
10:19:31 : Application is running
10:19:31 : Start operation achieved successfully

By advanced, thanks for your help,

BR,

Grégory

MX25LM51245G_STM32L562E-DK Project not working as expected

I have compiled the "MX25LM51245G_STM32L562E-DK" project and generated a .stldr file. If I used generated file and tried to download the sample file using the STM32Cube programer it fails, If I tried with the default stm32 provided .stldr file then it works fine.

Is "MX25LM51245G_STM32L562E-DK" has been tested? Any configuration extra required, before building it?

Note: I am using the 9.10 version of the IAR workbench, during project open it shows "Project is in old formate, would you like to convert it for used this version?"

Bug reading the ID from the External Flash MX25LM51245G in STM32H735G-DK Eval kit board

Hi, I am taking the source code from trying to read the ID from the External Flash, but I am having some problems, note very sure if there is maybe with the clock config.

The initialization of the OCTOSPI device seems correct:
int32_t result=0;
uint8_t *ID;
memset(&ID,0,sizeof(ID));
Flash.InterfaceMode = BSP_OSPI_NOR_OPI_MODE;
Flash.TransferRate = BSP_OSPI_NOR_DTR_TRANSFER;
/Initialaize OSPI/
if(BSP_OSPI_NOR_Init(0,&Flash) !=0)
{
return 0;
}
/Configure the OSPI in memory-mapped mode/
//result = BSP_OSPI_NOR_EnableMemoryMappedMode(0);
result = BSP_OSPI_NOR_ReadID(0, &ID);

When I reached the line "result = BSP_OSPI_NOR_ReadID(0, &ID);" the returned ID is 0x85c2c2 and it must be 0x3a85c2, seems like there is a problem in one byte.

image

any help?

Thanks,
Aitor

Support CubeMX!

Could you provide linking scripts also for your IDE? It's very bad that you are njot supporting STM32CubeMX ide!
I'm trying all day to get it to work and I need to use cubemx but no luck as now!
The code wroks when programmed on the target flash memory but I cannot get it to be run from RAM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.