Skip to main content
Visitor II
August 20, 2020
Question

Compiling application to run not from the start of the flash

  • August 20, 2020
  • 3 replies
  • 1514 views

Hello

I have an steval-stwinkt1 board, that i am trying to enable support for DFU mode.

I flashed costume boot loader firmware on to the the start of the flash (0x8000000) that lets you load into another firmware that was uploaded by the DFU mode or to stay in the current program to flash new firmware throw the USB.

i used this st tutorial- https://www.youtube.com/watch?v=n_LDXOQHerU

I tried the .dfu package that comes with the STM32Cube and i saw that the program ran successfully so i assume that the bootloader works.

but when i try to make my own DFU package from my software the software never loads and i get hard fault. i moved the software according to the ST totorial & some research i done to 0x800C000 by changin the following lines:

in the FLASH.ld file:

FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K

to:

FLASH (rx) : ORIGIN = 0x800C000, LENGTH = 2048K

and in the stm32l4r9xx.h changed FLASH_BASE to:

#define FLASH_BASE (0x0800C000UL)

to make the dfu package i use dfu-tool (i use linux) and use this command:

dfu-tool convert dfuse software.bin software.dfu

what do i need to change to make my software works when i load the dfu package?

thanks

itay

    This topic has been closed for replies.

    3 replies

    IFInc.1Author
    Visitor II
    August 23, 2020

    does some one know what did i miss?

    Graduate II
    August 23, 2020

    > in the stm32l4r9xx.h changed FLASH_BASE

    That is hardware definition file. Don't change anything there!

    IFInc.1Author
    Visitor II
    August 23, 2020

    so where do i change the code to make the application run from 0x0800C000, both the main code and the vector table?

    IFInc.1Author
    Visitor II
    August 25, 2020

    up