cancel
Showing results for 
Search instead for 
Did you mean: 

IAP for STM32F4 Discovery

pradeepa
Associate II
Posted on September 11, 2013 at 09:34

Hello,

Is it possible to use the IAP example which is referred in

an3965 

directly in the STM32F4 Discovery board? 

Thank you.

#stm32f4 #discovery #iap #iap #wait-for-you--clive1-!-!-!
9 REPLIES 9
Posted on September 11, 2013 at 10:30

The techniques are generally applicable to all F2 and F4 board designs. You'll need to port specifically to your own board choice and adapt the USART, Button, and pin configurations to match.

The STM32F4-Discovery can't use USART1 PA9/PA10 without modification, USART6 PC6/PC7 would be usable with the STM32F4-DIS-BB base board, for example.

Ethernet IAP examples would need pin and PHY specific adaptations.

The internal System Loader (ISP - In System Programming) should be demonstrable using USB DfuSe, or USART3

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pradeepa
Associate II
Posted on September 11, 2013 at 10:56

Thank you. I will try to port the example.

munger
Associate II
Posted on March 11, 2014 at 17:02

Hi,

I am trying to do the same thing. How did you make out? I've started working on the porting process starting with the IAP example for the STM324xG-EVAL board and modifying it. I'd appreciate any tips you might have, thanks.

Mike

Posted on March 14, 2014 at 04:51

I'll follow up here as there don't seem to have been any other responses.

Did you make any progress? The main work would be with the USART, attaching my files for the STM32F4-DIS-BB breakout board

________________

Attachments :

stm32f4_discovery.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzpu&d=%2Fa%2F0X0000000bRm%2FAv.osJ52ayVFTj9LMSkr.dEeuA.aDqW0dnqk67odrzs&asPdf=false

stm32f4_discovery.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzzF&d=%2Fa%2F0X0000000bRl%2F6RC7_RuO6W1IlQklNQTQjaFfBLee_MCyZWCrndeIewk&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
munger
Associate II
Posted on March 20, 2014 at 19:17

Thanks for your response clive1, I didn't think anyone was paying attention.

Anyway, I've made progress with this and I'm still working on it.

Here are the changes I've made:

1) Change target device to STM32F401VC

2) Changed clock to 84 MHz.

3) Remove stm324xg_eval.c from project and add in STM32F401_discovery.c, .h files too of course. I think they are the same as the files you've enclosed.

4) Change BUTTON_KEY to BUTTON_USER

5) Removed EVAL_COM1 declarations from stm32f401_discovery.c and instead populated USART_InitStructure and then called USART_Init.

6) Removed STM_EVAL_COMInit from stm32f401_discovery.c as I am using USART_init directly

7) Added COM_Typedef to stm32f401_discovery.h

😎 Copied definition of COM port1 from stm324xg_eval.h to stm32f401_discovery.h. Had to change USART3 to USART6 and change pin numbers and stuff.

Why is it that bits in ports are called pins in STM nomenclature? Very confusing.

Look okay so far? I'm still getting used to MDK IDE, have not used it before. I've been using IAR for 10 years. At least it compiles and downloads and I can start to step through it. I added some of the LED blinking stuff from the discovery board demo and that is working. I still need to add menu.c and all that.

Thanks.

Mike

dingzeze0610
Associate II
Posted on October 04, 2015 at 03:51

Hello, 

I am using stm32f4 discovery board

I have tried the sample code for IAP. I want to ask is it possible to load two bin files two different flash memory sectors and let the user to choose which one to run? And how to do it?

Posted on October 04, 2015 at 13:15

Each binary would need to be built for the specific address being used, or you could use a relocatable object and fix it at flash writing time.

Do you have some method to accept user input? The boot loader could output to a serial port, and query the user about which to run, or it could probe the state of a GPIO input, or inputs, and use them to select what gets run at boot time.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dingzeze0610
Associate II
Posted on October 04, 2015 at 17:10

Hi clivel,

Thanks for your prompt reply and it helps us a lot.

We have tried to load different binary files(images) given by the example to different memory locations. And it is found that only when the image in the default starting application address(0x08008000) is able to run. For images in other locations, if it is the same as the one in the default starting address, it can also run properly. And it shows what exactly you mentioned.

However, we are still confused by two problems:

1. How can we configure the binary file so that it can be loaded to different memory address and run properly. 

2. If the specific address can only be included when the binary file is generated. How do we generate a binary file for a specific memory address?

Posted on October 05, 2015 at 01:40

It's going to depend on your tool-chain, you need to modify the build address either via the GUI, or in a linker script or scatter file. You need to move up the Flash address (IROM1 in Keil) to 0x08008000, or whatever, and shrink the available size.

You'd likely want to come up with some naming convention that you can apply to the IAP side, so that it can infer what address the file should be loaded. If you use .HEX files the addresses are inferred in the data records it contains.

You can use HEX2BIN, SRECORD, or whatever tool your chain provides for doing such. The .HEX format isn't that complex.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..