This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom bootloader and app relocation problem

Hi,

i am trying to make a custom ethernet bootloader for an STM32F207 based board (full ref STM32F207IG eval), so this is going to happen in 3 steps.

1/ relocate the main program at address 0x08008000
2/ have a bootloader jump there
3/ add the ethernet support (lwip)

I am using eclipse / gcc toolchain; i have built the main app, that works fine, and i flash it using the command "ST_link_CLI.exe -C JTAG -Q -P myapp.bin 0x08000000"

But now i have to add the bootloader. Every time i try to relocate the app to 0x8008000 i cant make it work. As a test, the first thing i do after board init in the main program is setting a led on, and it never lits.

I tried every combination of these:

change the command "ST_link_CLI.exe -C JTAG -Q -P myapp.bin 0x08008000"

change from
GL_NVIC_SetVectorTable(GL_NVIC_VectTab_FLASH, 0x00)
to GL_NVIC_SetVectorTable(GL_NVIC_VectTab_FLASH, 0x08000).
or to GL_NVIC_SetVectorTable(GL_NVIC_VectTab_FLASH, 0x08008000).

changing

#define NVIC_VectTab_FLASH           ((uint32_t)0x08000000)
to #define NVIC_VectTab_FLASH           ((uint32_t)0x08008000)


and in stm32_ld.S file, MEMORY :

FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1024K
to
FLASH (rx)      : ORIGIN = 0x08008000, LENGTH = 1016K

Whatever i do, that led does not lit.

Here is the code used to jump, with APPLICATIONADDRESS being 0x08008000 :

      /* Jump to user application */
      JumpAddress = *(__IO uint32_t*) (APPLICATIONADDRESS + 4);
      Jump_To_Application = (pFunction) JumpAddress;
      /* Initialize user application's Stack Pointer */
      __set_MSP(*(__IO uint32_t*) APPLICATIONADDRESS);
      Jump_To_Application();
   }
  while (1)
  {}

I also saw that someone named Marco Accame posted on this bbs, long time ago though, and mentionned he did an ethernet bootloader. I would really like his advice on this and the next step if he is still around.

thanks a lot everyone !

0