cancel
Showing results for 
Search instead for 
Did you mean: 

How to select Key I/O for In-application program(IAP) through UART for STM32F407VGT6TR?

JieShen_Jason
Associate

Hi,

I would like to in-live upgrade firmware of STM32F407 through USART1, that means  in-application program(IAP) . If I remember right, there need a trigger signal from key meanwhile NRST is low.

My question is that the Key signal could be connected to any GPIO I/O of STM32F407 except those dedicated pin, right?  Is there special point to care about selection of  Key I/O pin?

 

Thanks in advance!

Best regards!

Jason

7 REPLIES 7
Andrew Neil
Super User

@JieShen_Jason wrote:

If I remember right, there need a trigger signal from key meanwhile NRST is low.


That depends on what IAP method you're using.

If you're using the built-in ROM bootloader, that requires a reset & specific BOOT settings - see the datasheet for details.

See also Application note AN2606Introduction to system memory boot mode on STM32 MCUs

 

If you're using some other method (some other bootloader), its requirements will differ - see the documentation for whatever you're using.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Employee

Hello,

IAP is more related to the application note: AN4657 "STM32 in-application programming (IAP) using the USART" and the X Cube package: X-CUBE-IAP-USART.

So in the firmware check what was implemented for that "Key" and find how it could be changed.

mALLEm_0-1757414983906.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi,

Thank for your response in the time!

I checked AN4657, and want to know if push-button must be pressed all the time until user application have been download to flash memory, or just pressed then release which generate time-limited negative pulse?

JieShen_Jason_0-1757424704103.png

Thanks in advance!

Best regards!

Jason

It seems highly unlikely that the user would have to keep the button pressed for the entire time - that would be a nightmare UX!

But the source code is available - take a look!

Or build it and try it out.

You can modify it as required ...

 

PS:

Look at the flowchart @mƎALLEm shared:

AndrewNeil_0-1757427182129.png

The switch is only used to decide whether to 'Jump to user program' or to 'Initialise IAP'.

Once that decision has been made, the key can be released.

Again, the code presented is just an example - you can do whatever suits in your own implementation...

AndrewNeil_1-1757427383840.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I can't download the package for now to check but based on the organigram shared above from the AN4657, the button state is sampled at the beginning of the IAP application and then no matter its state. So I think no need to keep that button pressed during the application upload.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi,

Get it!

Thanks a lot!

 

Best regards!

Jason

 

 

 

you're welcome.

If your question is now answered, please mark the solution.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.