rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
nvm.c File Reference

Functions

void NvmInit (void)
 Initializes the NVM driver.
 
void NvmReinit (void)
 Reinitializes the NVM driver. This function is called at the start of each firmware update as opposed to NvmInit, which is only called once during power on.
 
blt_bool NvmWrite (blt_addr addr, blt_int32u len, blt_int8u *data)
 Programs the non-volatile memory.
 
blt_bool NvmErase (blt_addr addr, blt_int32u len)
 Erases the non-volatile memory.
 
blt_bool NvmVerifyChecksum (void)
 Verifies the checksum, which indicates that a valid user program is present and can be started.
 
blt_addr NvmGetUserProgBaseAddress (void)
 Obtains the base address of the non-volatile memory available to the user program. This is typically that start of the vector table.
 
blt_bool NvmDone (void)
 Once all erase and programming operations are completed, this function is called, so at the end of the programming session and right before a software reset is performed. It is used to calculate a checksum and program this into flash. This checksum is later used to determine if a valid user program is present in flash.
 

Function Documentation

◆ NvmDone()

blt_bool NvmDone ( void  )

Once all erase and programming operations are completed, this function is called, so at the end of the programming session and right before a software reset is performed. It is used to calculate a checksum and program this into flash. This checksum is later used to determine if a valid user program is present in flash.

Returns
BLT_TRUE if successful, BLT_FALSE otherwise.

Definition at line 136 of file nvm.c.

137{
138 /* compute and write checksum, which is programmed by the internal driver. */
139 if (FlashWriteChecksum() == BLT_FALSE)
140 {
141 return BLT_FALSE;
142 }
143
144 /* finish up internal driver operations */
145 return FlashDone();
146} /*** end of NvmDone ***/
blt_bool FlashWriteChecksum(void)
blt_bool FlashDone(void)
Here is the call graph for this function:

◆ NvmErase()

blt_bool NvmErase ( blt_addr  addr,
blt_int32u  len 
)

Erases the non-volatile memory.

Parameters
addrStart address.
lenLength in bytes.
Returns
BLT_TRUE if successful, BLT_FALSE otherwise.

Definition at line 95 of file nvm.c.

96{
97 /* still here so the internal driver should try and perform the erase operation */
98 return FlashErase(addr, len);
99} /*** end of NvmErase ***/
constexpr uint8_t addr
Definition ads1015.cpp:14
blt_bool FlashErase(blt_addr addr, blt_int32u len)
Here is the call graph for this function:

◆ NvmGetUserProgBaseAddress()

blt_addr NvmGetUserProgBaseAddress ( void  )

Obtains the base address of the non-volatile memory available to the user program. This is typically that start of the vector table.

Returns
Base address.

Definition at line 121 of file nvm.c.

122{
124} /*** end of NvmGetUserProgBaseAddress ***/
blt_addr FlashGetUserProgBaseAddress(void)
Here is the call graph for this function:

◆ NvmInit()

void NvmInit ( void  )

Initializes the NVM driver.

Returns
none.

Definition at line 52 of file nvm.c.

53{
54 /* init the internal driver */
55 FlashInit();
56} /*** end of NvmInit ***/
void FlashInit(void)
Here is the call graph for this function:

◆ NvmReinit()

void NvmReinit ( void  )

Reinitializes the NVM driver. This function is called at the start of each firmware update as opposed to NvmInit, which is only called once during power on.

Returns
none.

Definition at line 66 of file nvm.c.

67{
68 /* reinitialize the internal driver */
70} /*** end of NvmReinit ***/
void FlashReinit(void)
Here is the call graph for this function:

◆ NvmVerifyChecksum()

blt_bool NvmVerifyChecksum ( void  )

Verifies the checksum, which indicates that a valid user program is present and can be started.

Returns
BLT_TRUE if successful, BLT_FALSE otherwise.

Definition at line 108 of file nvm.c.

109{
110 /* check checksum using the interally supported method. */
111 return FlashVerifyChecksum();
112} /*** end of NvmVerifyChecksum ***/
blt_bool FlashVerifyChecksum(void)

Referenced by CpuStartUserProgram(), and Rs232Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NvmWrite()

blt_bool NvmWrite ( blt_addr  addr,
blt_int32u  len,
blt_int8u data 
)

Programs the non-volatile memory.

Parameters
addrStart address.
lenLength in bytes.
dataPointer to the data buffer.
Returns
BLT_TRUE if successful, BLT_FALSE otherwise.

Definition at line 81 of file nvm.c.

82{
83 /* still here so the internal driver should try and perform the program operation */
84 return FlashWrite(addr, len, data);
85} /*** end of NvmWrite ***/
blt_bool FlashWrite(blt_addr addr, blt_int32u len, blt_int8u *data)
Here is the call graph for this function:

Go to the source code of this file.