Topic : STM32: How to create an application for UART IAP?

Forum : ARM

Original Post
Post Information Post
August 19, 2008 - 10:32am
Guest

Cross-posted on the ST forum: http://www.st.com/mcu/forums-cat-7227-23.html

Quote:
Ref: Application Note AN2557

Quote:
The PDF documents (and readme file) state the requirement that the "user" application must start at 0x0800_2000.

I assume that the example proajects supplied must do this, but there is no description of how it is done - which is not very helpful when it comes to creating my own application!

See: http://www.st.com/mcu/forums-cat-6742-23.html&start=7


The two requirements stated in the App Note are:
1. The Vector Table must be located at 0x0800_2000
2. The Application must be located at 0x0800_2000

1. Can be done with an NVIC_SetVectorTable() call from the FWLib.

For 2, I copied the Linker script from the provided example - but this didn't work.

After a lot of investigation, I found that the Hex file contained a load of spurious data located from 0x2000_0108 - if I manually delete this from the Hex file, it works!

Looking at the ELF file, this seems to correspond to a section called "DISCARD".

So, the questions are:
* What is this spurious data?
* Why is it there?
* What do I need to do to properly create an IAP-compatible application?

Replies
Post Information Post
+1
0
-1
August 19, 2008 - 12:31pm
Guest

There is a pre-configured example for RIDE which allows you to generate an application for IAP. see @:
IAP_AN/binary/template project/RIDE (AN2557)

+1
0
-1
August 19, 2008 - 12:57pm
Guest

Quote:
There is a pre-configured example for RIDE...

Yes, that's the problem - it is all pre-configured, and there's no explanation of how to configure your own application! :mad:

As I said, I took the Linker script from that example - and it doesn't work! :mad: :mad:

+1
0
-1
August 19, 2008 - 3:04pm
Guest

As I said you can start from this project. All needed steps are described in the readme file(IAP_AN/binary).
Regarding the linker file, you have to use stm32f10x_md_flash_offset.ld as linker with medium density devices and stm32f10x_hd_flash_offset.ld with high density devices.
What do you mean by it doesn't work!:can you give more details !

+1
0
-1
August 21, 2008 - 9:36am
Guest

Quote:
you have to use stm32f10x_md_flash_offset.ld ...

That actually seems to be the source of the problem - causing this extra, spurious data in the HEX file.

Quote:
What do you mean by it doesn't work!:can you give more details !

The IAP application runs, and transfers the file successfully but, when I try to run the downloaded application, it doesn't start.

In the debugger, it just seems to cause a hard fault exception.

If I manually remove the spurious section from the HEX file, it all works fine.

Hence the original questions:
[*] What is this spurious data?
[*] Why is it there?
[*] What do I need to do to properly create an IAP-compatible application?

I guess the last one could probably be re-phrased as, "what edits are required in stm32f10x_md_flash_offset.ld (or elsewhere?) to stop it generating this spurious section?"

+1
0
-1
August 21, 2008 - 2:42pm
Guest

Hi,

I had similar problem with IAP,
Maybe you use interrupts and do not relocate vector table please use:

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x2000);

besides in IAP example from ST there is also exemplary program. Search the forder, IAP program and examplary program with moved offset.

This exemplary program should work.

+1
0
-1
August 21, 2008 - 3:01pm
Guest

jaroslaw.oska wrote:
Maybe you use interrupts and do not relocate vector table please use:

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x2000);


Yes, I did that - see above

Quote:
This exemplary program should work.

It should - but it doesn't tell me how to configure my project so that my project will work!

That's the whole point: the App Note says what is required, but it does not say how to achieve that using RIDE! :mad:

+1
0
-1
August 21, 2008 - 3:30pm
Raisonance Support Team

Hi,

RIDE only generates linker scripts for 'simple' standard applications. That does not include IAP, bootloaders, etc.

You will find information for how to create more complex linker scripts in the LD GNU linker's documentation, in the 'Scripts' section.
(I suggest you start with a script generated by RIDE, or the one from ST's example, and then modify it)

You can see this doc in the 'documentation explorer' of RIDE, or in this folder:
\Doc\ARM\LD\...
Or you can download it directly from the GCC website.

I hope it helps.

Best Regards,

Vincent