Discussion Forum

example stm32 bootloader for uvision 4?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
David Merrill
Posted
9-Feb-2010 00:31 GMT
Toolset
ARM
New! example stm32 bootloader for uvision 4?

Hello,

I am looking for a how-to / walk-through for writing a custom bootloader for STM32. I need my device to bootload from attached SPI flash, so I can't use the built-in bootloader. So far I have been unable to find information about how to do this -- can anyone send a pointer to a how-to? (I am using uVision 4).

Thanks,
-David Merrill

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 01:07 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

Have you looked at the ST App Note on the subject...?

Read-Only
Author
David Merrill
Posted
9-Feb-2010 02:04 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

I have seen appnotes from ST for using the built-in bootloader, but not anything for writing my and uploading using uvision 4.. thoughts?
thanks,
-David

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 08:56 GMT
Toolset
ARM
New! RE: example stm32 bootloader

AN2557: STM32F10x in-application programming using the USART

"The purpose of this application note is to provide general guidelines for creating an IAP application... The STM32F10x microcontroller can run user-specific firmware to perform IAP of the microcontroller-embedded Flash memory. This feature allows the use of any type of communication protocol for the reprogramming process (such as CAN, USART, USB).
USART is the example used in this application note."

http://www.st.com/mcu/familiesdocs-110.html

Read-Only
Author
David Merrill
Posted
10-Feb-2010 20:57 GMT
Toolset
ARM
New! RE: example stm32 bootloader

Thanks Andy.

So, just to make sure I understand: I think the way that the example in AN2557 works is the following:

- IAP driver program gets loaded into the Flash memory at the base address of the Flash (0x0800 0000)

- User program gets loaded into the flash memory immediately after the IAP driver (0x0800 2000)

- when the STM32 starts, the IAP driver code checks the state of a button that may or may not be pressed

- if the button was pressed at startup, it runs the IAP driver, otherwise it jumps to 0x0800 2000 to execute the user program.

Is that correct? And if so, what do I need to do at compile/link/upload time to put the code in the right places?

After looking through the project, I have a couple questions: is there a difference between unlocking the flash and disabling write protection?

(from stm32f10x_flash.c)

void FLASH_Unlock(void)
{
  /* Authorize the FPEC Access */
  FLASH->KEYR = FLASH_KEY1;
  FLASH->KEYR = FLASH_KEY2;
}

Then in common.c, there is a call to:

FLASH_UserOptionByteConfig

It seems like FLASH_Unlock is always done when the IAP driver starts, and the function that calls FLASH_UserOptionByteConfig can be invoked interactively from the command line.

Also, it seems that this strategy for bootloading does not make use of the BOOT0 / BOOT1 pins at all -- the system is ALWAYS booting into the Flash (never to the System memory / built-in bootloader) -- is that correct?

thanks,
-David

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 08:57 GMT
Toolset
ARM
New! RE: example stm32 bootloader

AN2557: STM32F10x in-application programming using the USART

"The purpose of this application note is to provide general guidelines for creating an IAP application... The STM32F10x microcontroller can run user-specific firmware to perform IAP of the microcontroller-embedded Flash memory. This feature allows the use of any type of communication protocol for the reprogramming process (such as CAN, USART, USB).
USART is the example used in this application note."

http://www.st.com/mcu/familiesdocs-110.html

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 09:34 GMT
Toolset
ARM
New! RE: example stm32 bootloader

AN2557: STM32F10x in-application programming using the USART

"The purpose of this application note is to provide general guidelines for creating an IAP application... The STM32F10x microcontroller can run user-specific firmware to perform IAP of the microcontroller-embedded Flash memory. This feature allows the use of any type of communication protocol for the reprogramming process (such as CAN, USART, USB).
USART is the example used in this application note."

http://www.st.com/mcu/familiesdocs-110.html

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 23:28 GMT
Toolset
ARM
New! RE: example stm32 bootloader

AN2557: STM32F10x in-application programming using the USART

"The purpose of this application note is to provide general guidelines for creating an IAP application... The STM32F10x microcontroller can run user-specific firmware to perform IAP of the microcontroller-embedded Flash memory. This feature allows the use of any type of communication protocol for the reprogramming process (such as CAN, USART, USB).
USART is the example used in this application note."

http://www.st.com/mcu/familiesdocs-110.html

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 10:43 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

Is the forum working again yet?

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 11:20 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

?

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 12:40 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

?

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 14:21 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

?

Read-Only
Author
David Lively
Posted
9-Feb-2010 15:32 GMT
Toolset
ARM
New! RE: example stm32 bootloader for uvision 4?

Test message - please ignore.

This is an administrative test message posted for site validation purposes. It will be deleted shortly. Pay me no mind'...

Read-Only
Author
Andy Neil
Posted
9-Feb-2010 23:27 GMT
Toolset
None
New! RE: It will be deleted shortly

along with some others?

Next Thread | Thread List | Previous Thread Start a Thread | Settings