cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with jumpingto user app. from bootloader

mikhailm
Associate II
Posted on December 01, 2008 at 15:25

Problem with jumpingto user app. from bootloader

7 REPLIES 7
mikhailm
Associate II
Posted on May 17, 2011 at 12:54

After much consideration I've decided to write my own USB bootloader. I know, I know DFU really works and everything, but frankly PC side of DFU code is a mess.

Besides IMHO if all I want is to dump .hex file into a chip the whole DFU architecture a bit excessive.

So..... Now when I offended everybody.... 🙂

Loader works.... Flash content seemed to be correct when compared against file....

Problem seems to be in either

__MSR_MSP(*(vu32*) 0x8003000);

or

Jump_To_Application();

I am using Rowley CW 1.7 toolchain.....

Anybody can gove me any pointers what can go wrong here?

16-32micros
Associate III
Posted on May 17, 2011 at 12:54

Hi,

You can refer to

http://www.st.com/stonline/products/support/micro/files/an2557.zip

&

http://www.st.com/stonline/products/literature/an/13588.pdf

a boot-loader implementation reference code with RS232. Could you please detail what is the problem when you use the debugger ? is it a stack overflow ? Wrong Program Counter ? etc..

Cheers,

STOne-32.

trevor1
Associate II
Posted on May 17, 2011 at 12:54

I also use CW 1.7. Have you done the following

1)

Set the vector table location to where your app starts (above the bootloader).E.g.

// Set the Vector Table base location after bootloader (0x08003000)

NVIC_SetVectorTable(NVIC_VectTab_FLASH, BOOTLOADER_LEN);

2)

Modify the memory map xml file. Mine is called ST_STM32F103VB_MemoryMap_Release.xml. I copied this from Rowley into my project before editing it. You need to change the address (and size) of the ''FLASH'' memory segment. Scroll to the end to find this section. I couldn't post it because the bb does not like XML in posts.

3)

The default stack size in CW is quite small so look to increase this using the project editor.

[ This message was edited by: trevor on 27-11-2008 15:46 ]

mikhailm
Associate II
Posted on May 17, 2011 at 12:54

Quote:

On 27-11-2008 at 11:30, Anonymous wrote:

I also use CW 1.7. Have you done the following

1)

Set the vector table location to where your app starts (above the bootloader).E.g.

// Set the Vector Table base location after bootloader (0x08003000)

NVIC_SetVectorTable(NVIC_VectTab_FLASH, BOOTLOADER_LEN);

2)

Modify the memory map xml file. Mine is called ST_STM32F103VB_MemoryMap_Release.xml. I copied this from Rowley into my project before editing it. You need to change the address (and size) of the ''FLASH'' memory segment. Scroll to the end to find this section. I couldn't post it because the bb does not like XML in posts.

3)

The default stack size in CW is quite small so look to increase this using the project editor.

[ This message was edited by: trevor on 27-11-2008 15:46 ]

1,2 is done and should be correct.... after all application loads and runs fine using DFU....

3. should be fine also because of (1,2) and it runs fine in stand alone mode.

trevor1
Associate II
Posted on May 17, 2011 at 12:54

Need more info then. Maybe you could post the code.

mikhailm
Associate II
Posted on May 17, 2011 at 12:54

Quote:

On 26-11-2008 at 20:48, Anonymous wrote:

Hi,

You can refer to

http://www.st.com/stonline/products/support/micro/files/an2557.zip

&

http://www.st.com/stonline/products/literature/an/13588.pdf

a boot-loader implementation reference code with RS232. Could you please detail what is the problem when you use the debugger ? is it a stack overflow ? Wrong Program Counter ? etc..

Cheers,

STOne-32.

That is what I basically done - I took your example and modified it for load with USB instead of RS232.

It seems that it should be pretty straight forward - bootloader size grew a bit ( probably due to USB implementation ), but it still easily fits into 0x3000 assign for DFU type loader.

The rest of the code is pretty much straight copy, so it has to be something really damn.... on my part.

I forget to mention that project loads and runs fine when loaded with DFU loader.... so it is probably NOT anything inside the project itself.

mikhailm
Associate II
Posted on May 17, 2011 at 12:54

Quote:

On 01-12-2008 at 19:33, Anonymous wrote:

Need more info then. Maybe you could post the code.

Here it is.....

Due to size issues didn't include library files and device maps.... Otherwise all there...