cancel
Showing results for 
Search instead for 
Did you mean: 

Problem getting Application to run with DFU (STM32F4)

Christoph Eschenbach
Associate III
Posted on May 24, 2018 at 15:51

Hello there,

i have a Application based on FreeRTOS running on STM32F429ZI-Nucleo with LwIP. FreeRTOS Tick is based on TIM6. The Application runs well.

So i have tried now the demo for DFU and it works correctly. So i was trying to push my application instead of the demo application.

Before this i changed the linker configuration in IAR for my application:

Verctor table: -> .invec start: 0x08008000

Memory Regions: -> ROM Start: 0x08008000.

Downloading the code via dfu works fine.

But when my application starts it jumps at a specific location below the base address.

While debugging there come 2 different problems:

1. Debuging the USBD_DFU project in IAR.

It Jumps to application and then Hangs up in TIM6_DAC_IRQHandler (startup_stm32F429xx.s) [Disassembly 0x80031dc] which is somewhere in the dfu code.

2. Debugging my application:

Disassembly is suddenly located at 0x80031dc which is basically somewhere in the memory region of the dfu bootloader. Step by step i went through the code.

Point after the jump backwards happens int stm32f4xx_hal_timebase_TIM.c function HAL_InitTick() ->

if(HAL_TIM_Base_Init(&htim6) == HAL_OK)

  {

    /* Start the TIM time Base generation in interrupt mode */

    return HAL_TIM_Base_Start_IT(&htim6); //<----- happens while/after this

  }

I guess it has something to do with the interrupts.

So I had a look at the element htim6 and found out weird values :

htim6->hdma->[0]->parent     Value: 0x0800308B

->XferCpltCallback                 Value: 0x0800308D

and so on.

Since i have never had to deal with any bootloaders i have trouble to find a solution.

Did I made mistakes setting up the linker? Do I have to change source code for the init of my application code?

Did I miss any points i should have considered to set up the application to run on a different base address?

I dont know where to start ?

Please Help

#run-application #stm32f429 #usb #dfu #stm32f4
1 ACCEPTED SOLUTION

Accepted Solutions
Christoph Eschenbach
Associate III
Posted on May 28, 2018 at 14:13

Resolved:

So all i did was to add the correct Vector offset:

In system_stm32f4xx.c-file from the application #define VECT_TAB_OFFSET needed to be set to 0x8000.

Still after that FreeRTOS ran me right into a HardFault but now in the correct Hardfault_Handler.

There was somehow a messy priority for SVCall_IRQn. setting the priority to 0 solved the problem.

The Application runs now and can be downloaded via the dfsue-demo to the board.

I hope at least for someone this information will be helpfull.

View solution in original post

2 REPLIES 2
Christoph Eschenbach
Associate III
Posted on May 28, 2018 at 09:51

Update:

I managed to jump to application. All I did was to HAL_DeInit() before the JumpToApplication() - function.

Now my application starts from 0x08008000. But I still run into a HardFault();

But I still cant figure out exactly  how to resolve the hardfault cause.

Call Stack:

[vPortStartFirstTask + 0x17]

<Exception Frame>

HardFault_Handler()

SCB->HFSR = 0x4000 0000

SCB->CFSR = 0x0000 0000

SCB->BFSR = 0xe000 ed38

I am stucked here again to find the next point for the solution.

Christoph Eschenbach
Associate III
Posted on May 28, 2018 at 14:13

Resolved:

So all i did was to add the correct Vector offset:

In system_stm32f4xx.c-file from the application #define VECT_TAB_OFFSET needed to be set to 0x8000.

Still after that FreeRTOS ran me right into a HardFault but now in the correct Hardfault_Handler.

There was somehow a messy priority for SVCall_IRQn. setting the priority to 0 solved the problem.

The Application runs now and can be downloaded via the dfsue-demo to the board.

I hope at least for someone this information will be helpfull.