cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F777T6 BOOTLOADER EXAMPLE

Utkarash Patil
Associate III

Hi All,

I am using the STM32F777T6 board with Attollic studio along with STM32Cube MCU package version 1.9.7 (My set up in Linux base).

I need boot loader example for STM32F777T6 board.

Please share the example.

I have used other reference examples but not working with this board.

If any one worked with this board on boot loader part please share the example/ sample code. It will help me to understand.

Urgent

Thanks and Regards

Utkarash Patil

4 REPLIES 4

Everything you post is "Urgent", in technical forums this gets interpreted differently, it generally infers an inability to perform one's own job.

http://www.catb.org/~esr/faqs/smart-questions.html#urgent

The STM32F777T6 is a "chip" not a "board", what's on the board around the chip will determine its usability. If you are using a specific board cite a page covering its design, and for custom ones provide schematics, or pin usage details.

You should review ST's assorted "IAP" examples demonstrating In-App Programming using assorted interfaces. Review also FLASH programming examples.

Bootloaders are a classic embedded task, perhaps review them for other platforms, and books covering the topic space, and apply those ideas to the STM32 family of platforms. The STM32 family is wide, you can look outside the F7 for examples.

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

Here is one such example named IAP ("in-app programming")

https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32F769I_EVAL/Applications/IAP

Adapt it to your board.

IAP_Main is the bootloader, the other project is example of user application loaded by the bootloader.

-- pa

Piranha
Chief II

The internet is literally full of bootloader examples, especially for ARM Cortex-M!

Utkarash Patil
Associate III

Hello All,

Thank you For Your Response

Sorry For the late Reply

As i was working as per your suggestions

Everything you post is "Urgent", in technical forums this gets interpreted differently, it generally infers an inability to perform one's own job.

http://www.catb.org/~esr/faqs/smart-questions.html#urgent

The STM32F777T6 is a "chip" not a "board", what's on the board around the chip will determine its usability. If you are using a specific board cite a page covering its design, and for custom ones provide schematics, or pin usage details.

Sorry i was not able to explain you in detail my issue the last time, I should have elaborated in detail and by mistake i posted as "STM32F777T6 board" instead of "STM32F777IITx MCU chip".

Please accept my sincere apologizes

We have designed a custom board with STM32F777Tx MCU chip and we want to implement a USB based boot loader. Where we will update the firmware throug USB Flash Drive.

Before contacting forum i had found out an example from STM Cube MCU package v1.9.0 which is named as "Flash_JumpBootloader" and "MSC_standalone". Which i was refereeing to implement my bootloader code.

However I was not able to perform the bootloader Jump to application functionality.

Refereing to the Example "IAP_main" i made the required changes in my code. I have followed the example code algorithm yet sharing mycode algorithm below, If any case you can help if i am missing out on something.

  1. Check Flash mode i.e., is Dual Bank Mode enabled or single bank mode enabled
  2. I wanted to use single Bank mode so enabled single bank mode of flash.
  3. Check if Application Present,
  4. If yes, Jump to application,
  5. If no, Check For USB in while loop.
  6. If USB Attached, Check For application file and verify it.
  7. If verification successful, Check if Flash is protected,
  8. If Yes, then remove protection of the Flash,
  9. Load the application file from USB to Flash,
  10. If Loading successful, Jump to Application.

My boot loader code size is below 50KB

Address on which application is Stored => 0x08020000.

Now Here after step 10 i am not able to Jump to application my application doesn't executes. It seems like code is stuck.

For reference I have also added the Jump to application function below

void JumpToApplication(void)
{
    /* Jump to user application */
    JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
    Jump = (pFunction) JumpAddress;
 
    /* Initialize user application's Stack Pointer */
    __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
 
    Jump();
}

The internet is literally full of bootloader examples, especially for ARM Cortex-M!

After referring few more post as per suggestions by "Piranha" Just before Jumping to the Application i De-initialized HAL, RCC and all peripherals which where initialized

Also I added vector table address handling statement before Jumping to application,

After this it looked like my Board is getting reset but unable to jump to application, added the code snippet below.

void JumpToApplication(void)
{
			MX_FATFS_DeInit();
			MX_USB_HOST_DeInit();
			MX_UART3_UART_DeInit();
			MX_GPIO_DeInit();
 
    /* Jump to user application */
    JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
    Jump = (pFunction) JumpAddress;
 
    /*STM32L4 based Boot loader example code instructions*/
        HAL_RCC_DeInit();
        HAL_DeInit();
 
        SysTick->CTRL = 0;
        SysTick->LOAD = 0;
        SysTick->VAL  = 0;
 
        SCB->VTOR = APPLICATION_ADDRESS;
 
 
    /* Initialize user application's Stack Pointer */
    __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
 
    Jump();
}

Also As per a refrence document from True Studio named as " Working with bootloaders on Cortex-M devices" I also made changes in my application file and then rebuilt it and extracted binary image.

I changed the Flash memory address in stm32F7xx_flash.id file as mentioned below.

/* Highest address of the user mode stack */
_estack = 0x20080000;    /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400; /* required amount of stack */
 
/* Specify the memory areas */
MEMORY
{
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 512K
FLASH (rx)      : ORIGIN = 0x8020000, LENGTH = 2048K
}

After This also my issue remains the same.

I had one more doubt that does Dual mode mode of the Mcu has any effect on boot loader system if yes what should it be configured as.

Please help me at the earliest as i am stuck withthis point

Thanks and regards

Utkarsh