cancel
Showing results for 
Search instead for 
Did you mean: 

stm3220G-EVAL DFU image templet (TASKING)

frdrikjohnsson
Associate
Posted on September 04, 2013 at 10:39

Hi

 

I'm trying to create a dfu image in TASKING for stm3220G-EVAL. For bootloader I'm using ''STM322xG-EVAL_USBD-FS'' from the STM32_USB-Host-Device_Lib_V2.1.0 library.  

 

The binary templet example in STM32_USB-Host-Device_Lib_V2.1.0 works fine in IAR and EWARM, but for TASKING there is only a example for STM324xG-EVAL.

I can flash the DFU files I've created from the IAR and EWARM examples, and they work fine.

 

I have edited the STM324xG-EVAL projekt to fit my board and created a DFU file from it, even no issues in DfuSe when i flash the board with it.  

Only problem is when I RESET my board the new image doesn't load, I've checked that the dfu file flashes 0x0800C000 (if I look at the Device Memory in STM32-ST-LINK Utility after flashing the board).

 

 

In system_stm32f2xx.c

 

&sharpdefine VECT_TAB_OFFSET  0xC000

 

This by itself does not change what address it flashes.  

 

 

 

 &sharpifndef __VECTOR_TABLE_ROM_ADDR

♯  define __VECTOR_TABLE_ROM_ADDR       0x0800C000

&sharpendif

 

 

memory STM32F2xx_Flash

{

    mau = 8;

    type = rom;

    size = __FLASH_SIZE;

    map ( size = __FLASH_SIZE, dest_offset=0x0800C000, dest=bus:ARM:local_bus);

}

 

If I edit these (0x0800C000 instead of 0x08000000) in the stm32f2xx.lsl file it changes the flash memory.

 

This is from the app.c file. APP_DEFAULT_ADD is 0x0800C000.

 

  /* Check if the Key push-button on STM32-EVAL Board is pressed */

  if (STM_EVAL_PBGetState(Button_KEY) != 0x00)

  { /* Test if user code is programmed starting from address 0x800C000 */

    if (((*(__IO uint32_t*)APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000)

    { /* Jump to user application */

 

      JumpAddress = *(__IO uint32_t*) (APP_DEFAULT_ADD + 4);

      Jump_To_Application = (pFunction) JumpAddress;

      /* Initialize user application's Stack Pointer */

      __set_MSP(*(__IO uint32_t*) APP_DEFAULT_ADD);

      Jump_To_Application();

    }

  } /* Otherwise enters DFU mode to allow user to program his application */

 

''JumpAddress = *(__IO uint32_t*) (APP_DEFAULT_ADD + 4);''

Jump to reset handler (__START)?

I've changed this (APP_DEFAULT_ADD + 4) to fit my vector table, but no change.

 

 

I don't know if this problem is related to TASKING or ST, or me not seeing the obvious.

 

Any help would be much appreciated, will ofcourse provide any debugging information that is needed. thanks!

 

#!stm3220g-eval-!dfu-!tasking
2 REPLIES 2
Posted on September 04, 2013 at 17:30

Can't give you any TASKING specific advice, but the placement of code is generally driven by linker scripts or scatter files, or GUI version thereof.

To confirm code placement one might want to review .MAP, .HEX or disassembly listings.

You could also review other project examples, and observe how they partition memory between boot loader and application code.

STM32F2xx_AN3374_FW_V1.0.0\Project\STM32F2xx_IAP\binary_template\TASKING\STM322xG-EVAL
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
frdrikjohnsson
Associate
Posted on September 05, 2013 at 15:16

Thank you for the help!

I can now jump to my code, but it crashes instantly :(

If I debug my project in TASKING I get ''TASKING Debugger - Component framework has stopped working''

Problem signature:

  Problem Event Name:    APPCRASH

  Application Name:    taskingdebugger.exe

  Application Version:    1.34.0.0

  Application Timestamp:    517692a6

  Fault Module Name:    distlink.dll

  Fault Module Version:    1.21.0.0

  Fault Module Timestamp:    51755fdc

  Exception Code:    c0000005

  Exception Offset:    0001e972

  OS Version:    6.1.7601.2.1.0.256.48

  Locale ID:    2057

  Additional Information 1:    0a9e

  Additional Information 2:    0a9e372d3b4ad19135b953a78882e789

  Additional Information 3:    0a9e

  Additional Information 4:    0a9e372d3b4ad19135b953a78882e789

Changes I made:

I took the stm32f2xx_flash_offset.lsl file from STM32F2xx_AN3374_FW_V1.0.0\Project\STM32F2xx_IAP\binary_template\TASKING\STM322xG-EVAL

and changed the address from 0x08004000 to 0x0800C000 to fit the bootloader code.

also

memory STM32F2xx_Flash

{

    mau = 8;

    type = rom;

    size = 976k;

    map ( size = 976k, dest_offset=0x0800C000, dest=bus:ARM:local_bus);

}

map size is 976k since the first 3 sectores (48 KB) are reserved for DFU bootloader code.

Aslo did have a look at the .mapxml file and compered HEX file from working dfu image with mine, found no issues (that I can see).

Edit: Ok so this is really weird TASKING does not crash anymore when debugging and when using the bootloader it jumps to and runs my program with out issues. I have no clue why its working or why it did not work before.