eLooM for STM32 application  v3.3.0
Loading...
Searching...
No Matches
Typedefs | Functions
IBoot.h File Reference

The Boot interface integrates support for the bootloader into the framework. More...

#include "services/eloom_sysbase.h"
+ Include dependency graph for IBoot.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct _IBoot IBoot
 

Functions

static sys_error_code_t IBootInit (IBoot *_this)
 
static boolean_t IBootCheckDFUTrigger (IBoot *_this)
 
static uint32_t IBootGetAppAdderss (IBoot *_this)
 
static sys_error_code_t IBootOnJampToApp (IBoot *_this, uint32_t nAppDress)
 

Detailed Description

The Boot interface integrates support for the bootloader into the framework.

Author
STMicroelectronics - ST-Korea - MCD Team
Version
3.0.0
Date
Nov 21, 2017

This interface is implemented by applications that need to jump to another application during the startup sequence. The typical example is a bootloader. The IBoot interface is used by the system during the startup before the scheduler is running (this means that there is not INIT task yet). The algorithm is displayed in Fig. 16.

Fig.16 - Boot IF

The system reset all peripherals and it initializes the minimum set of resources (like the clock three). At this point if the SysInit() has been called with the parameter TRUE the system uses the SysGetBootIF() in order to obtain a pointer to an application object that implement the IBoot interface. Then the system initialize the Boot IF by calling the IBootInit() function. The the system check if the DFU trigger condition - IBootCheckDFUTrigger(). If it it is FALSE then the system prepare the jump to the application. First it retrieves the jump address by calling the IBootGetAppAdderss() function. Then it uses the IBootOnJampToApp() in order to perform some other tasks before the jump. Finally the system check if the application address is valid and make the jump.

In order to optimize the memory footprint of the framework the IBoot interface can be disabled by the linker with the following definition:

#define INIT_TASK_CFG_ENABLE_BOOT_IF  0

It can be added in the sysconfig.h file.

Attention

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Typedef Documentation

◆ IBoot

typedef struct _IBoot IBoot

Create type name for _IBoot.

Function Documentation

◆ IBootCheckDFUTrigger()

static boolean_t IBootCheckDFUTrigger ( IBoot _this)
inlinestatic

Check if the DFU condition occurs. If it is TRUE the bootloader enters the DFU mode,

Parameters
_this[IN] specifies a pointer to the object.
Returns
TRUE if the system must enter the DFU mode, FALSE otherwise.

◆ IBootGetAppAdderss()

static uint32_t IBootGetAppAdderss ( IBoot _this)
inlinestatic

Used by the system to retrieve the address of the application to start.

Parameters
_this[IN] specifies a pointer to the object.
Returns
the address where is located the application to start.

◆ IBootInit()

static sys_error_code_t IBootInit ( IBoot _this)
inlinestatic

Initialize the interface IBoot. It should be called after the object allocation and before using the object.

Parameters
_this[IN] specifies a pointer to the object.
Returns
SYS_NO_ERROR_CODE if success, an error code otherwise.

◆ IBootOnJampToApp()

static sys_error_code_t IBootOnJampToApp ( IBoot _this,
uint32_t  nAppDress 
)
inlinestatic

Called by the system before the jump to the other application. It can be used to perform some operations before the jump and also to stop the system from jump,.

Parameters
_this[IN] specifies a pointer to the object.
nAppDress[IN] specifies the address of the application to start.
Returns
SYS_NO_ERROR_CODE if the system can continue with the jump, an application specific error code otherwise.