Commit 1bac208a authored by hu's avatar hu

关于D1M1A操作DATA FLASH的驱动更改为FDL

parent 411f87f0
......@@ -34,4 +34,21 @@
.\CD4051\CD4051.c
.\BU98R10\BU98R10.c
.\Buzzer\Buzzer.c
.\FDL\r_fdl.h
.\FDL\fdl_descriptor.c
.\FDL\fdl_user.c
.\FDL\fdlapp_control.c
.\FDL\fdlapp_main.c
.\FDL\app.h
.\FDL\fdl_cfg.h
.\FDL\fdl_descriptor.h
.\FDL\fdl_user.h
.\FDL\r_fdl_mem_map.h
.\FDL\r_fdl_types.h
.\FDL\target.h
.\FDL\lib\r_fdl_env.h
.\FDL\lib\r_fdl_global.h
.\FDL\lib\r_fdl_hw_access.c
.\FDL\lib\r_fdl_user_if.c
.\FDL\lib\r_fdl_user_if_init.c
No preview for this file type
......@@ -57,6 +57,7 @@ primaryTarget=v800_standalone.tgt
-I..\source\Driver\Timer
-I..\source\Driver\IS31FL3236
-I..\source\Driver\Buzzer
-I..\source\Driver\FDL
-I..\source\Graphic\cdi\lib
-I..\source\Graphic\cdi\src
-I..\source\Graphic\device\d1mx\lib
......
This diff is collapsed.
project .intvect 1536
project .text 325980
project .rodata 411127
project .text 327836
project .rodata 412319
project .secinfo 120
project .syscall 6
project .romdata 8805
project .ROM.ramfunc 208
project .ramfunc 208
project .R_FDL_Text 5796
......@@ -74,6 +74,7 @@ void Popups_Polling(void)
Popup_Clear(POPUP1_BRAKE_SPACING_R);
Popup_Clear(POPUP1_BRAKE_SPACING_COLLISION);
Popup_Clear(POPUP1_BRAKE_SPACING_Y);
Popup_Clear(POPUT1_ASR_OPERATE);
return ;
}
else
......@@ -90,6 +91,7 @@ void Popups_Polling(void)
Popup_Clear(POPUP1_BRAKE_SPACING_R);
Popup_Clear(POPUP1_BRAKE_SPACING_COLLISION);
Popup_Clear(POPUP1_BRAKE_SPACING_Y);
Popup_Clear(POPUT1_ASR_OPERATE);
return ;
}
else
......@@ -106,6 +108,7 @@ void Popups_Polling(void)
Popup_Request(POPUP1_BRAKE_SPACING_R);
Popup_Clear(POPUP1_BRAKE_SPACING_COLLISION);
Popup_Clear(POPUP1_BRAKE_SPACING_Y);
Popup_Clear(POPUT1_ASR_OPERATE);
return ;
}
else
......@@ -120,6 +123,7 @@ void Popups_Polling(void)
{
Popup_Request(POPUP1_BRAKE_SPACING_COLLISION);
Popup_Clear(POPUP1_BRAKE_SPACING_Y);
Popup_Clear(POPUT1_ASR_OPERATE);
return ;
}
else
......@@ -134,6 +138,7 @@ void Popups_Polling(void)
if ((variable_1 == 0x05u) || (variable_2 == 0x05u))
{
Popup_Request(POPUP1_BRAKE_SPACING_Y);
Popup_Clear(POPUT1_ASR_OPERATE);
return ;
}
else
......
/*********************************************************************************************************************
* File Name : $Source: app.h $
* Mod. Revision : $Revision: 1.7 $
* Mod. Date : $Date: 2016/05/31 16:15:23JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : Sample application header file
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2014-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifndef SAMPLEAPP_H
#define SAMPLEAPP_H
/*********************************************************************************************************************
* Global compiler definition
*********************************************************************************************************************/
#define APP_COMP_GHS 1
#define APP_COMP_IAR 2
#define APP_COMP_REC 3
#if defined (__IAR_SYSTEMS_ASM__)
#define APP_COMPILER APP_COMP_IAR
#elif defined (__IAR_SYSTEMS_ICC__)
#define APP_COMPILER APP_COMP_IAR
#elif defined(__v850e3v5__)
#define APP_COMPILER APP_COMP_REC
#else /*GHS */
#define APP_COMPILER APP_COMP_GHS
#endif
/*********************************************************************************************************************/
#endif /* #ifndef SAMPLEAPP_H */
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_OFF 0292
#endif
/*********************************************************************************************************************
* File Name : $Source: fdl_cfg.h $
* Mod. Revision : $Revision: 1.5 $
* Mod. Date : $Date: 2016/06/01 10:39:51JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : FDL pre-compile definitions
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_ON 0292
#endif
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 3.1 (QAC message 0292)
* Reason: To support automatic insertion of revision, module name etc. by the source revision control system
* it is necessary to violate the rule, because the system uses non basic characters as placeholders.
* Verification: The placeholders are used in commentars only. Therefore rule violation cannot influency code
* compilation.
*********************************************************************************************************************/
#ifndef FDL_CFG_H
#define FDL_CFG_H
/*********************************************************************************************************************
* device specific define
*********************************************************************************************************************/
/******************************************************************************************************************
* Callback defines to disable interrupts during execution of critical code sections in the
* function R_FDL_Init.
* All possibly occurring exceptions must be disabled because during execution of the critical
* sections the Flash is not accessible
******************************************************************************************************************/
void FDL_User_CriticalSetionBegin (void);
void FDL_User_CriticalSetionEnd (void);
#define FDL_CRITICAL_SECTION_BEGIN FDL_User_CriticalSetionBegin (); /* PRQA S 3412 */
#define FDL_CRITICAL_SECTION_END FDL_User_CriticalSetionEnd (); /* PRQA S 3412 */
/******************************************************************************************************************
* Optional configuration
******************************************************************************************************************/
/*********************************************************************************************************************/
#endif /* #ifndef FDL_CFG_H */
/*********************************************************************************************************************
* File Name : $Source: fdl_descriptor.c $
* Mod. Revision : $Revision: 1.11 $
* Mod. Date : $Date: 2016/05/31 16:15:26JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : Descriptor variable definition
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
/*********************************************************************************************************************
* FDL header files include
*********************************************************************************************************************/
#include "r_typedefs.h"
#include "r_fdl.h"
#include "fdl_descriptor.h"
/*********************************************************************************************************************
* FDL descriptor variable definition
*********************************************************************************************************************/
/**< FDL descriptor structure */
const r_fdl_descriptor_t sampleApp_fdlConfig_enu =
{
CPU_FREQUENCY_MHZ, /**< CPU frequency in MHz */
FDL_POOL_SIZE, /**< Number of Data Flash blocks, accessible by the FDL.
Typically no. of available Data Flash blocks */
EEL_POOL_START, /**< 1st block of the EEL pool */
EEL_POOL_SIZE /**< Number of blocks in the EEL pool */
};
/*********************************************************************************************************************
* File Name : $Source: fdl_descriptor.h $
* Mod. Revision : $Revision: 1.4 $
* Mod. Date : $Date: 2016/06/01 10:39:59JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : FDL run-time configuration descriptor variable related defines.
* To be configured according to the application needs
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifndef FDL_DESCRIPTOR_H
#define FDL_DESCRIPTOR_H
#include "r_fdl_types.h"
/*********************************************************************************************************************
User changeable defines
*********************************************************************************************************************/
/*****************************************************************************************************************
* Important definitions for run-time configuration of the FDL:
* - Frequency -
*****************************************************************************************************************/
/* The Flash programming hardware is provided with a clock, derived from the CPU subsystem frequency. Check that
the frequency is correct as this has an impact on the programming quality and performance! */
#define CPU_FREQUENCY_MHZ (240) // (240) /**< CPU frequency in MHz */
/*****************************************************************************************************************
* Important definitions for run-time configuration of the FDL:
* - EEL/FDL Pool -
*****************************************************************************************************************/
/* The physical erase unit of the Data Flash is 64Byte.
The Renesas EEL works with a ring buffer consisting of ring buffer (virtual) blocks that merge a certain number
of physical blocks.
E.g. virtual block size of 2kB equals 32 physical blocks of 64Bytes --> EEL_VIRTUALBLOCKSIZE = 32
virtual block size of 4kB equals 64 physical blocks of 64Bytes --> EEL_VIRTUALBLOCKSIZE = 64
Note: If the Renesas EEL is not used, an alignment is not necessary "EEL_VIRTUALBLOCKSIZE" need not be defined
and the pools start and size definitions can be set free to the application needs */
#define EEL_VIRTUALBLOCKSIZE (64u)
#define FDL_POOL_SIZE (16u * EEL_VIRTUALBLOCKSIZE) /**< Number of Data Flash blocks, accessible by
the FDL. Typically it is the complete
no. of available Data Flash blocks */
#define EEL_POOL_START (0u * EEL_VIRTUALBLOCKSIZE) /**< 1st block of the EEL pool */
#define EEL_POOL_SIZE (0u * EEL_VIRTUALBLOCKSIZE) /**< no. of blocks for the EEL pool */
/*********************************************************************************************************************
* Even if possible, this section should not be changed by the user
*********************************************************************************************************************/
/*****************************************************************************************************************
* Descriptor variable declaration
*****************************************************************************************************************/
extern const r_fdl_descriptor_t sampleApp_fdlConfig_enu; /**< FDL descriptor variable */
/*********************************************************************************************************************/
#endif /* #ifndef FDL_DESCRIPTOR_H */
/*********************************************************************************************************************
* File Name : $Source: fdl_user.c $
* Mod. Revision : $Revision: 1.17 $
* Mod. Date : $Date: 2016/05/31 16:15:27JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : library related functions, which may be edited by the user
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
/*********************************************************************************************************************
* FDL header files include
*********************************************************************************************************************/
#include "r_typedefs.h"
#include "app.h"
#include "target.h"
/*********************************************************************************************************************
* Compiler specific defines
*********************************************************************************************************************/
#if APP_COMPILER == APP_COMP_GHS
#elif APP_COMPILER == APP_COMP_IAR
#define asm __asm
#elif APP_COMPILER == APP_COMP_REC
#endif
/*********************************************************************************************************************
* module global variable
*********************************************************************************************************************/
uint32_t PSWSafe; /* Variable to backup the PSW value before disabling ID/NP */
/*********************************************************************************************************************
* Function name: FDL_User_CriticalSetionBegin
*********************************************************************************************************************/
/**
* Function to disable Maskable / non maskable exceptions and NMI when critical code shall be
* executed that allows no access to the code Flash or might have problems with synchronization
*
* @param ---
* @return ---
*/
/*********************************************************************************************************************/
#if APP_COMPILER == APP_COMP_GHS
void FDL_User_CriticalSetionBegin (void)
{
asm( "ldsr r0, 31" ); /* select system register bank 0
(contains PSW)*/
asm( "stsr 0x05, r7" ); /* load PSW (register 5) */
asm( "mov _PSWSafe, r6" ); /* backup PSW */
asm( "st.w r7, 0[r6]" ); /* " */
asm( "movea 0x00A0, r0, r6" ); /* NMI Flag=1, ID=1 */
asm( "or r7, r6 "); /* " */
asm( "ldsr r6, 5" ); /* write PSW */
}
#elif APP_COMPILER == APP_COMP_REC
#pragma inline_asm FDL_User_CriticalSetionBegin
void FDL_User_CriticalSetionBegin (void)
{
ldsr r0, 31 /* select system register bank 0 */
/* (contains PSW) */
stsr 0x05, r7 /* load PSW (register 5) */
mov #_PSWSafe, r6 /* backup PSW */
st.w r7, 0[r6] /* " */
movea 0x00A0, r0, r6 /* NMI Flag=1, ID=1 */
or r7, r6 /* " */
ldsr r6, 5 /* write PSW */
}
#else
/* IAR */
void FDL_User_CriticalSetionBegin (void)
{
__asm(" ldsr r0, 31 \n"
" stsr 0x05, r7 \n"
" mov _PSWSafe, r6 \n"
" st.w r7, 0[r6] \n"
" movea 0x00A0, r0, r6 \n"
" or r7, r6 \n"
" ldsr r6, 5 \n"
);
}
#endif
/*********************************************************************************************************************
* Function name: FDL_User_CriticalSetionEnd
*********************************************************************************************************************/
/**
* Function to enable Maskable / non maskable exceptions and NMI after critical code has been
* executed
*
* @param ---
* @return ---
*/
/*********************************************************************************************************************/
#if APP_COMPILER == APP_COMP_GHS
void FDL_User_CriticalSetionEnd (void)
{
asm( "ldsr r0, 31" ); /* select system register bank 0
(contains PSW)*/
asm( "mov _PSWSafe, r6" ); /* Restore PSW value */
asm( "ld.w 0[r6], r7" ); /* " */
asm( "ldsr r7, 5" ); /* write PSW */
}
#elif APP_COMPILER == APP_COMP_REC
#pragma inline_asm FDL_User_CriticalSetionEnd
void FDL_User_CriticalSetionEnd (void)
{
ldsr r0, 31 /* select system register bank 0
(contains PSW) */
mov #_PSWSafe, r6 /* Restore PSW value */
ld.w 0[r6], r7 /* " */
ldsr r7, 5 /* write PSW */
}
#else
/* IAR */
void FDL_User_CriticalSetionEnd (void)
{
__asm(" ldsr r0, 31 \n"
" mov _PSWSafe, r6 \n"
" ld.w 0[r6], r7 \n"
" ldsr r7, 5 \n"
);
}
#endif
/*********************************************************************************************************************
* Function name: FDL_Open
*********************************************************************************************************************/
/**
* Function to open the FDL operation.
* The user modifiable function e.g. Initializes/Configures the Data Flash access
*
* @param ---
* @return ---
*/
/*********************************************************************************************************************/
void FDL_Open (void)
{
//INIT_FLASHACCESS //keith
}
/*********************************************************************************************************************
* Function name: FDL_Close
*********************************************************************************************************************/
/**
* Function to close the FDL operation.
* The user modifyable function might disable Flash access, ... currently, it is empty
*
* @param ---
* @return ---
*/
/*********************************************************************************************************************/
void FDL_Close (void)
{
// DISABLE_FLASHACCESS //keith
}
/*********************************************************************************************************************
* File Name : $Source: fdl_user.h $
* Mod. Revision : $Revision: 1.7 $
* Mod. Date : $Date: 2016/05/31 16:15:23JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : header for library related functions, which may be edited by the user
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifndef FDL_USER_H
#define FDL_USER_H
/*********************************************************************************************************************
* Global function prototypes
*********************************************************************************************************************/
void FDL_User_CriticalSetionBegin (void);
void FDL_User_CriticalSetionEnd (void);
void FDL_Open (void);
void FDL_Close (void);
/*********************************************************************************************************************/
#endif /* #ifndef FDL_USER_H */
This diff is collapsed.
/*********************************************************************************************************************
* File Name : $Source: fdlapp_main.c $
* Mod. Revision : $Revision: 1.7 $
* Mod. Date : $Date: 2014/09/10 16:24:34MESZ $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : Application sample main module
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
/*********************************************************************************************************************
* FDL header files include
*********************************************************************************************************************/
#define EEELIB_INTDEF
#include "r_typedefs.h"
#include "target.h"
#include "fdl_user.h"
/*********************************************************************************************************************
* External Function headers
*********************************************************************************************************************/
void SampleApp_FDL_Control ( void );
/*********************************************************************************************************************
* Function name: main
*********************************************************************************************************************/
/**
* main function
*
* @param ---
* @return ---
*/
/*********************************************************************************************************************/
void dataflash_test(void)
{
/*****************************************************************************************************************
* CPU initialization
*****************************************************************************************************************/
/* Initialize the CPU and Peripheral clock system */
// INIT_CPU_AND_FPERIPHERAL_CLK
#if (defined R_FDL_DEVICE_SPECIFIC_INIT)
/* Some older devices like F1L WS2.0 need Flash authentication prior to switch mode */
R_FDL_DEVICE_SPECIFIC_INIT;
#endif
/*****************************************************************************************************************
* Open the FDL / Data Flash access
*****************************************************************************************************************/
/* Initialize the data FLash is required to be able to access the data Flash. As this is considered to be a user
function, it is not part of the libraries, but part of the application sample */
FDL_Open ();
/*****************************************************************************************************************
* Call sample functions
*****************************************************************************************************************/
/* Sample of FDL handling */
SampleApp_FDL_Control ();
/*****************************************************************************************************************
* Close the FDL / Data Flash access
*****************************************************************************************************************/
FDL_Close ();
/*****************************************************************************************************************
* Wait forever
*****************************************************************************************************************/
/* Not reachable */
}
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_OFF 0292
#endif
/*********************************************************************************************************************
* Library : Data Flash Access Library for Renesas RH850 devices
*
* File Name : $Source: r_fdl_user_if_init.c $
* Lib. Version : $RH850_FDL_LIB_VERSION_T01: V2.11 $
* Mod. Revision : $Revision: 1.7 $
* Mod. Date : $Date: 2016/06/01 12:39:22JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : Source code for FDL initialization
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_ON 0292
#endif
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 3.1 (QAC message 0292)
* Reason: To support automatic insertion of revision, module name etc. by the source revision control system
* it is necessary to violate the rule, because the system uses non basic characters as placeholders.
* Verification: The placeholders are used in commentaries only. Therefore rule violation cannot influence code
* compilation.
*********************************************************************************************************************/
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 19.1 (QAC message 5087)
* Reason: The section mapping concept (Mapping code, constants and data to specific linker sections) bases on
* a central include file containing all section mapping defines and pragmas. This need to be included
* multiple times within the code. The file itself only contains those defines and pragmas.
* Verification: This is the standard concept defined for AUTOSAR implementations
*********************************************************************************************************************/
/*********************************************************************************************************************
* FDL header files include
*********************************************************************************************************************/
#include "r_typedefs.h"
#include "r_fdl.h"
/*********************************************************************************************************************
* Global function prototypes
*********************************************************************************************************************/
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 8.8 (QAC message 3447)
* Reason: Library is delivered as source code and as a precompiled object.
* The file r_fdl_user_if_init.c is not included on generation of the precompiled object.
* It is delivered as a separate file and cannot include any other header files, except the
* defined interface header files. The function is a library internal function and its declaration
* is not part of the interface header files.
* Verification: -
*********************************************************************************************************************/
extern r_fdl_status_t R_FDL_InitVariables (const r_fdl_descriptor_t * descriptor_pstr); /* PRQA S 3447 */
/*********************************************************************************************************************
* FDL internal section mapping definitions
*********************************************************************************************************************/
#define R_FDL_START_SEC_PUBLIC_CODE
#include "r_fdl_mem_map.h" /* PRQA S 5087 */
/*********************************************************************************************************************
* Function name: R_FDL_Init
*********************************************************************************************************************/
/**
* User interface function:
* This function initializes the FDL. It must be called before any execution of a FDL function.
* Sequence:
* - Call the function to initialize the library RAM and do parameter checks
* If compatibility mode is used then:
* - Call the function to initialize the FCU RAM
* - Call the function to set the frequency information with frequency check
* - Frequency is within reasonable range between R_FCU_FMIN and R_FCU_FMAX
*
* In error case the library is set to not initialized (R_FDL_ISTAT_NOINIT)
*
* @param[in] descriptor_pstr - Pointer to the FDL descriptor structure
* @return Initialization status when returned from function call:
* - R_FDL_OK - Initialization was successful
* - R_FDL_ERR_CONFIGURATION - FDL configuration parameter error
* If compatibility mode is used then following error codes may be returned:
* - R_FDL_ERR_PROTECTION - Programming hardware reset was prohibited
* - R_FDL_ERR_INTERNAL - Internal (HW) error during HW initialization
*/
/*********************************************************************************************************************/
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 14.1 (QAC message 1503)
* Reason: This function is not used within the library, it is only used by the user
* application.
* Verification: This function is part of the library API and therefore essential on the one hand.
* On the other hand the QAC warning is correct, because this function is never
* called within the library. To solve this dilemma it is necessary and suitable
* to disable the message.
*********************************************************************************************************************/
#ifdef R_FDL_LIB_V1_COMPATIBILITY
r_fdl_status_t R_FDL_Init (const r_fdl_descriptor_t * descriptor_pstr) /* PRQA S 1503 */
{
r_fdl_status_t ret;
r_fdl_request_t request;
ret = R_FDL_InitVariables (descriptor_pstr);
/* Init_Variables already does some configuration checks */
if (R_FDL_OK == ret)
{
request.command_enu = R_FDL_CMD_PREPARE_ENV;
R_FDL_Execute (&request);
while (R_FDL_BUSY == request.status_enu)
{
R_FDL_Handler ();
}
ret = request.status_enu;
}
return (ret);
} /* R_FDL_Init */
#else
r_fdl_status_t R_FDL_Init (const r_fdl_descriptor_t * descriptor_pstr) /* PRQA S 1503 */
{
r_fdl_status_t ret;
ret = R_FDL_InitVariables (descriptor_pstr);
return (ret);
} /* R_FDL_Init */
#endif /* ifdef R_FDL_LIB_V1_COMPATIBILITY */
/*********************************************************************************************************************/
#define R_FDL_STOP_SEC_PUBLIC_CODE
#include "r_fdl_mem_map.h" /* PRQA S 5087 */
/*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_OFF 0292
#endif
/*********************************************************************************************************************
* Library : Data Flash Access Library for Renesas RH850 devices
*
* File Name : $Source: r_fdl.h $
* Lib. Version : $RH850_FDL_LIB_VERSION_T01: V2.11 $
* Mod. Revision : $Revision: 1.12 $
* Mod. Date : $Date: 2016/06/01 12:39:16JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : User interface function prototypes
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_ON 0292
#endif
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 3.1 (QAC message 0292)
* Reason: To support automatic insertion of revision, module name etc. by the source revision control system
* it is necessary to violate the rule, because the system uses non basic characters as placeholders.
* Verification: The placeholders are used in commentaries only. Therefore rule violation cannot influence code
* compilation.
*********************************************************************************************************************/
#ifndef R_FDL_H
#define R_FDL_H
/*********************************************************************************************************************
* Global compiler definitions
*********************************************************************************************************************/
#define R_FDL_COMP_GHS 1
#define R_FDL_COMP_IAR 2
#define R_FDL_COMP_REC 3
#if defined (__IAR_SYSTEMS_ASM__)
#define R_FDL_COMPILER R_FDL_COMP_IAR
#elif defined (__IAR_SYSTEMS_ICC__)
#define R_FDL_COMPILER R_FDL_COMP_IAR
#elif defined (__v850e3v5__)
#define R_FDL_COMPILER R_FDL_COMP_REC
#else /*GHS */
#define R_FDL_COMPILER R_FDL_COMP_GHS
#endif
/*********************************************************************************************************************
* Include list
*********************************************************************************************************************/
#include "fdl_cfg.h"
#include "r_fdl_types.h"
#ifdef R_FDL_USERIF_C
#define R_FDL_EXTERN
#else
#define R_FDL_EXTERN extern
#endif
/*********************************************************************************************************************
* Global function prototypes
*********************************************************************************************************************/
/* FDL initialization function */
R_FDL_EXTERN r_fdl_status_t R_FDL_Init (const r_fdl_descriptor_t * descriptor_pstr);
/* Flash operation initiation */
R_FDL_EXTERN void R_FDL_Execute (r_fdl_request_t * request_pstr);
/* Flash operation forwarding and status check */
R_FDL_EXTERN void R_FDL_Handler (void);
/* Flash operation suspend request */
R_FDL_EXTERN r_fdl_status_t R_FDL_SuspendRequest (void);
/* Flash operation resume request after suspend */
R_FDL_EXTERN r_fdl_status_t R_FDL_ResumeRequest (void);
/* Asynchronous function to prepare FDL for device power save modes */
R_FDL_EXTERN r_fdl_status_t R_FDL_StandBy (void);
/* Asynchronous function to resume FDL after leaving device power save modes */
R_FDL_EXTERN r_fdl_status_t R_FDL_WakeUp (void);
/* Flash operation cancel request */
R_FDL_EXTERN r_fdl_status_t R_FDL_CancelRequest (void);
/* Return of FDL library version string */
R_FDL_EXTERN const uint8_t * R_FDL_GetVersionString (void);
/*********************************************************************************************************************/
#endif /* ifndef R_FDL_H */
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_OFF 0292
#endif
/*********************************************************************************************************************
* Library : Data Flash Access Library for Renesas RH850 devices
*
* File Name : $Source: r_fdl_mem_map.h $
* Lib. Version : $RH850_FDL_LIB_VERSION_T01: V2.11 $
* Mod. Revision : $Revision: 1.11 $
* Mod. Date : $Date: 2016/06/01 12:39:18JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : FDL section mapping definitions
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_ON 0292
#endif
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 3.1 (QAC message 0292)
* Reason: To support automatic insertion of revision, module name etc. by the source revision control system
* it is necessary to violate the rule, because the system uses non basic characters as placeholders.
* Verification: The placeholders are used in commentars only. Therefore rule violation cannot influency code
* compilation.
*********************************************************************************************************************/
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 19.6 (QAC message 0841), 19.15 (QAC message 0883)
* Reason: The section mapping concept (Mapping code, constants and data to specific linker sections) bases on
* a central include file containing all section mapping defines and pragmas. This need to be included
* multiple times within the code. The file itself only contains those defines, pragmas and checks
* including #undef to ensure correct file usage
* Verification: This is the standard concept defined for AUTOSAR implementations
*********************************************************************************************************************/
/*********************************************************************************************************************
* Global compiler definitions
*********************************************************************************************************************/
#ifdef AUTOSAR_IMPLEMENTATION
#if defined R_FDL_START_SEC_PUBLIC_CODE
#define FDL_START_SEC_PUBLIC_CODE /* PRQA S 0883 */
#elif defined R_FDL_STOP_SEC_PUBLIC_CODE
#define FDL_STOP_SEC_PUBLIC_CODE
#elif defined R_FDL_START_SEC_CONST
#define FDL_START_SEC_CONST_UNSPECIFIED
#elif defined R_FDL_STOP_SEC_CONST
#define FDL_STOP_SEC_CONST_UNSPECIFIED
#elif defined R_FDL_START_SEC_VAR
#define FDL_START_SEC_VAR_UNSPECIFIED
#elif defined R_FDL_STOP_SEC_VAR
#define FDL_STOP_SEC_VAR_UNSPECIFIED
#else
#error "r_fdl_mem_map.h: No valid section define found"
#endif
#include "MemMap.h"
#else
#if defined R_FDL_START_SEC_PUBLIC_CODE
#undef R_FDL_START_SEC_PUBLIC_CODE /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs section text=".R_FDL_Text"
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma location = "R_FDL_Text"
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section text "R_FDL_Text"
#endif
#elif defined R_FDL_STOP_SEC_PUBLIC_CODE
#undef R_FDL_STOP_SEC_PUBLIC_CODE /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs section text=default
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
/* location only for one function, so no default required */
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section default
#endif
#elif defined R_FDL_START_SEC_CONST
#undef R_FDL_START_SEC_CONST /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs startdata
#pragma ghs section rodata=".R_FDL_Const"
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma constseg = "R_FDL_Const"
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section const "R_FDL_Const"
#endif
#elif defined R_FDL_STOP_SEC_CONST
#undef R_FDL_STOP_SEC_CONST /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs section rodata=default
#pragma ghs enddata
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma constseg = default
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section default
#endif
#elif defined R_FDL_START_SEC_VAR
#undef R_FDL_START_SEC_VAR /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs startdata
#pragma ghs section bss = ".R_FDL_Data"
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma dataseg = R_FDL_Data
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section r0_disp32 "R_FDL_Data"
#endif
#elif defined R_FDL_STOP_SEC_VAR
#undef R_FDL_STOP_SEC_VAR /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs section bss = default
#pragma ghs enddata
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma dataseg = default
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section default
#endif
#elif defined R_FDL_START_SEC_CODERAM
#undef R_FDL_START_SEC_CODERAM /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs startdata
#pragma ghs section bss = ".R_FDL_CodeRam"
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma dataseg = R_FDL_CodeRam
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section r0_disp32 "R_FDL_CodeRam"
#endif
#elif defined R_FDL_STOP_SEC_CODERAM
#undef R_FDL_STOP_SEC_CODERAM /* PRQA S 0841 */
#if R_FDL_COMPILER == R_FDL_COMP_GHS
#pragma ghs section bss = default
#pragma ghs enddata
#elif R_FDL_COMPILER == R_FDL_COMP_IAR
#pragma dataseg = default
#elif R_FDL_COMPILER == R_FDL_COMP_REC
#pragma section default
#endif
#else
#error "r_fdl_mem_map.h: No valid section define found"
#endif /* if defined R_FDL_START_SEC_PUBLIC_CODE */
#endif /* ifdef AUTOSAR_IMPLEMENTATION */
/*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_OFF 0292
#endif
/*********************************************************************************************************************
* Library : Data Flash Access Library for Renesas RH850 devices
*
* File Name : $Source: r_fdl_types.h $
* Lib. Version : $RH850_FDL_LIB_VERSION_T01: V2.11 $
* Mod. Revision : $Revision: 1.18 $
* Mod. Date : $Date: 2016/06/01 12:39:19JST $
* Device(s) : RV40 Flash based RH850 microcontroller
* Description : User interface type definitions
*********************************************************************************************************************/
/*********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS
* AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
* REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2015-2016 Renesas Electronics Corporation. All rights reserved.
*********************************************************************************************************************/
#ifdef ENABLE_QAC_TEST
#pragma PRQA_MESSAGES_ON 0292
#endif
/*********************************************************************************************************************
* MISRA Rule: MISRA-C 2004 rule 3.1 (QAC message 0292)
* Reason: To support automatic insertion of revision, module name etc. by the source revision control system
* it is necessary to violate the rule, because the system uses non basic characters as placeholders.
* Verification: The placeholders are used in commentaries only. Therefore rule violation cannot influence code
* compilation.
*********************************************************************************************************************/
#ifndef R_FDL_TYPES_H
#define R_FDL_TYPES_H
/*********************************************************************************************************************
* Global type definitions
*********************************************************************************************************************/
/* ---------------- Configuration ------------------------------------------ */
/**
\struct r_fdl_descriptor_t
FDL descriptor variable definition.
*/
typedef struct R_FDL_DESCRIPTOR_T
{
uint16_t cpuFrequencyMHz_u16; /**< Flash hardware frequency in MHz */
uint16_t fdlPoolSize_u16; /**< FDL pool size in no. of blocks */
uint16_t eelPoolStart_u16; /**< 1st block of the EEL pool */
uint16_t eelPoolSize_u16; /**< Last block of the EEL pool */
} r_fdl_descriptor_t;
/* ---------------- Operation ---------------------------------------------- */
/**
\enum r_fdl_status_t
FDL status return values
*/
typedef enum R_FDL_STATUS_T
{
R_FDL_OK = 0, /**< Operation terminated successfully */
R_FDL_BUSY = 1, /**< Operation is still ongoing */
R_FDL_SUSPENDED = 2, /**< Flash operation is suspended */
R_FDL_ERR_CONFIGURATION = 3, /**< The FDL configuration (descriptor) was wrong */
R_FDL_ERR_PARAMETER = 4, /**< A parameter of the FDL function call was wrong */
R_FDL_ERR_PROTECTION = 5, /**< Operation blocked due to wrong parameters */
R_FDL_ERR_REJECTED = 6, /**< Flow error, e.g. another operation is still busy */
R_FDL_ERR_WRITE = 7, /**< Flash write error */
R_FDL_ERR_ERASE = 8, /**< Flash erase error */
R_FDL_ERR_BLANKCHECK = 9, /**< Flash blank check error */
R_FDL_ERR_COMMAND = 10, /**< Unknown command */
R_FDL_ERR_ECC_SED = 11, /**< Single bit error detected by ECC */
R_FDL_ERR_ECC_DED = 12, /**< Double bit error detected by ECC */
R_FDL_ERR_INTERNAL = 13, /**< Library internal error */
R_FDL_CANCELLED = 14 /**< Flash operation is cancelled */
} r_fdl_status_t;
/**
\enum r_fdl_accessType_t
FDL operations originator defines.
Set by the user when starting an FDL operation.
Reset to ..._NONE by the library on operation end.
*/
typedef enum R_FDL_ACCESS_TYPE_T
{
R_FDL_ACCESS_NONE = 0, /**< FDL internal value. Not used by the application */
R_FDL_ACCESS_USER = 1, /**< User application wants to execute an FDL operation */
R_FDL_ACCESS_EEL = 2 /**< The EEL wants to execute an FDL operation */
} r_fdl_accessType_t;
/**
\enum r_fdl_command_t
FDL operation commands
*/
typedef enum R_FDL_COMMAND_T
{
R_FDL_CMD_ERASE = 0, /**< Flash block erase (Multiple blocks) */
R_FDL_CMD_WRITE = 1, /**< Flash write (Multiple words) */
R_FDL_CMD_BLANKCHECK = 2, /**< Flash blank check command (Multiple words) */
R_FDL_CMD_READ = 3, /**< Flash read with ECC error polling (Multiple words) */
#if (defined ENABLE_CMD_WRITE16B)
R_FDL_CMD_WRITE16B = 4, /**< Flash write (Multiple of 16 bytes unit)
This command is supported only by the particular products.
If the product is not allowed to use this command explicitly,
then this command must not be used */
#endif
R_FDL_CMD_PREPARE_ENV = 5 /**< Prepare Flash environment */
} r_fdl_command_t;
/**
\struct r_fdl_request_t
FDL operations request structure, required for R_FDL_Execute
*/
typedef volatile struct R_FDL_REQUEST_T
{
r_fdl_command_t command_enu; /**< FDL operation, e.g. R_FDL_CMD_ERASE */
uint32_t bufAddr_u32; /**< Write operation: Source data address */
uint32_t idx_u32; /**< Write, blank check, read operation: byte index (address)\n
Erase operation: block number of the first block to erase */
uint16_t cnt_u16; /**< Write operation: Number of words to write \n
Erase operation: Number of blocks to erase \n
Blank Check operation: Number of words to check \n
Read operation: Number of words to read */
r_fdl_accessType_t accessType_enu; /**< Data Flash access originator: \n
R_FDL_ACCESS_USER: User code \n
R_FDL_ACCESS_EEL: EEL library */
r_fdl_status_t status_enu; /**< status return value of the FDL */
} r_fdl_request_t;
extern uint32_t TYW_FDL_Blank_Check(uint32_t u32StartAddr, uint32_t u32EndAddr);
extern r_fdl_status_t TYW_FDL_Flash_Read(uint32_t u32Addr, uint32_t u32Data[], uint32_t u32Len);
extern r_fdl_status_t TYW_FDL_Write(uint32_t u32Addr, uint32_t u32Data[], uint32_t u32Len);
extern r_fdl_status_t TYW_FDL_Erase(uint32_t u32StartAddr, uint32_t u32EndAddr);
extern r_fdl_status_t TYW_FDL_Init(void);
/*********************************************************************************************************************/
#endif /* ifndef R_FDL_TYPES_H */
This diff is collapsed.
......@@ -4,7 +4,7 @@ static const HanSansCNFontPos_t Hansans00002ce20[] =
{
//{charid, xpos, ypos, width, height, xoffset, yoffset, xadvance}
{ 0 , 3995 , 552 , 4 , 22 , 0 , 0 , 4 },
#if 0
#if 1
{ 1 , 3995 , 23 , 4 , 22 , 0 , 0 , 4 },
{ 2 , 3995 , 805 , 4 , 22 , 0 , 0 , 4 },
{ 3 , 3995 , 759 , 4 , 22 , 0 , 0 , 4 },
......@@ -2,6 +2,7 @@
#include "Internal_Flash.h"
#include "Emulated_EEPROM.h"
#include "Emulated_EEPROM_Access.h"
#include "r_fdl_types.h"
/****************************************************************************
* !!! The following code should be generated by configuration tool !!! *
......@@ -39,7 +40,7 @@ uint32_t g_u32EEPROMBlock9Buffer[EEPROM_BLOCK9_BUFFER_SIZE / 4U];
#define EEPROM_BLOCK10_BUFFER_SIZE (EEPROM_BLOCK_CTRL_BYTE_SIZE + EEPROM_BLOCK_EOL_K_LINE_SIZE)
uint32_t g_u32EEPROMBlock10Buffer[EEPROM_BLOCK10_BUFFER_SIZE / 4U];
static const EEPROM_Block_st_t g_stEEPROMBlockTable[] =
static const EEPROM_Block_st_t g_stEEPROMBlockTable[] =
{
/* u32StartAddr u32EndAddr u32DataSize pu32DataBuffer */
{0xFF200000UL, 0xFF20007FUL, EEPROM_BLOCK0_BUFFER_SIZE, g_u32EEPROMBlock0Buffer,},
......@@ -64,14 +65,16 @@ EEPROM_Block_Access_st_t g_stEEPROMBlockAccess[EEPROM_TOTAL_BLOCK_NUM];
void EEPROM_Init(void)
{
EEPROM_Media_Access_st_t stFlashAccessFunc;
stFlashAccessFunc.pfnMemErase = Int_Data_Flash_Erase;
stFlashAccessFunc.pfnMemBlankChk = Int_Data_Flash_Blank_Check;
stFlashAccessFunc.pfnMemRead = Int_Data_Flash_Read;
stFlashAccessFunc.pfnMemWrite = Int_Data_Flash_Write;
TYW_FDL_Init();
stFlashAccessFunc.pfnMemErase = TYW_FDL_Erase;//Int_Data_Flash_Erase;
stFlashAccessFunc.pfnMemBlankChk = TYW_FDL_Blank_Check;//Int_Data_Flash_Blank_Check;
stFlashAccessFunc.pfnMemRead = TYW_FDL_Flash_Read;//Int_Data_Flash_Read;
stFlashAccessFunc.pfnMemWrite = TYW_FDL_Write;//Int_Data_Flash_Write;
Int_Data_Flash_Register_P_E_Complete_Cb(EEPROM_Mem_Access_Complete_Callback);
EEPROM_Access_Init( g_stEEPROMBlockTable,
g_stEEPROMBlockAccess,
&stFlashAccessFunc,
......@@ -81,8 +84,8 @@ void EEPROM_Init(void)
EEPROM_Status_en_t EEPROM_Get_Status(void)
{
EEPROM_Status_en_t enStatus;
if(EEPROM_Access_Busy())
if (EEPROM_Access_Busy())
{
enStatus = EEPROM_STAT_BUSY;
}
......@@ -90,7 +93,7 @@ EEPROM_Status_en_t EEPROM_Get_Status(void)
{
enStatus = EEPROM_STAT_IDLE;
}
return enStatus;
}
......@@ -98,7 +101,7 @@ EEPROM_Block_Status_en_t EEPROM_Get_Block_Status(uint16_t u16BlockID)
{
uint8_t u8BlockStatus;
EEPROM_Block_Status_en_t enStatus;
u8BlockStatus = EEPROM_Block_Access_Status(u16BlockID);
if (u8BlockStatus == EEPROM_BLOCK_BLANK)
{
......@@ -112,7 +115,7 @@ EEPROM_Block_Status_en_t EEPROM_Get_Block_Status(uint16_t u16BlockID)
{
enStatus = EEPROM_STAT_ERROR;
}
return enStatus;
}
......@@ -120,7 +123,7 @@ EEPROM_RW_Result_en_t EEPROM_Read_Data(uint16_t u16BlockID, uint32_t u32Data[],
{
uint8_t u8Error;
EEPROM_RW_Result_en_t enResult;
u8Error = EEPROM_Read_Block_Data(u16BlockID, u32Data, u16Len);
if (u8Error)
{
......@@ -130,7 +133,7 @@ EEPROM_RW_Result_en_t EEPROM_Read_Data(uint16_t u16BlockID, uint32_t u32Data[],
{
enResult = EEPROM_RW_PASS;
}
return enResult;
}
......@@ -138,7 +141,7 @@ EEPROM_RW_Result_en_t EEPROM_Write_Data(uint16_t u16BlockID, uint32_t u32Data[],
{
uint8_t u8Error;
EEPROM_RW_Result_en_t enResult;
u8Error = EEPROM_Write_Block_Data(u16BlockID, u32Data, u16Len);
if (u8Error)
{
......@@ -148,7 +151,7 @@ EEPROM_RW_Result_en_t EEPROM_Write_Data(uint16_t u16BlockID, uint32_t u32Data[],
{
enResult = EEPROM_RW_PASS;
}
return enResult;
}
......@@ -87,7 +87,11 @@ SECTIONS
.romsdata ROM(.sdata) :>. /* constant data to initialize variables in SDA area (copied to RAM at startup)*/
.romtdata ROM(.tdata) :>. /* constant data to initialize variables in TDA area (copied to RAM at startup)*/
.ROM.ramfunc ROM(.ramfunc) :>. /* program code to be copied to RAM (copied to RAM at startup) */
/* Renesas FDL Program code sections */
.R_FDL_Text align(4) :>. /* FDL code in ROM */
.R_FDL_Const align(4) :>. /* FDL constants in ROM */
/* Start of internal RAM area (iRAM) */
.data :>iRAM_0 /* initialized data */
......@@ -104,7 +108,9 @@ SECTIONS
.tdata align(4) MAX_SIZE(0x0100) :>. /* initialized and zero-initialized data in TDA area */
.ramfunc align(4) :>. /* program code in RAM area */
.stack align(4) pad(0x4000) :>. /* definition of stack size */
/* Renesas FDL data sections */
.R_FDL_Data :>. /* FDL data */
.heapbase align(4) :>.
.heap align(4)
pad(MEMENDADDR(iRAM_0)-addr(.heapbase))
......
......@@ -46,6 +46,8 @@
#include "RTE_ADC.h"
#include "COM_CAN.h"
#include "UDS_Common.h"
#include "r_fdl_types.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
......@@ -89,6 +91,11 @@ extern uint32_t TestBackupRam;
void Sys_Startup_Init(void)
{
uint8_t u8ResetFlag = 0;
uint32_t u32FDLDataFlag[4] = {0, 0, 0, 0};
uint32_t u32FDLBlank = 0;
Clock_Init();
/* Enable interrupts globally */
enable_interrupt();
......@@ -111,20 +118,37 @@ void Sys_Startup_Init(void)
Int_Flash_Init();
EEPROM_Init();
BU98R10_Init();
/*EOL诊断 配置数据读取 DFLASH*/
ReadAllDFlashData();
/*读取K-LINE*/
ReadDTCEOLValue_Meter_K_LINE();
d_printf("Init complete!\n");
InitSeriFlashExternReadMode();
//APP_Startup_Init(Clock_Get_Startup_Mode());
u8ResetFlag = Clock_Get_Startup_Mode();
if (u8ResetFlag == CLOCK_STARTUP_PWR_ON)
{
TYW_FDL_Init();
TYW_FDL_Flash_Read(0xFF20FF00 , u32FDLDataFlag, 4 );
if ((u32FDLDataFlag[0] == 0x66666666) && (u32FDLDataFlag[1] == 0x55555555) && (u32FDLDataFlag[2] == 0xA555A55A) && (u32FDLDataFlag[3] == 0X12345678))
{
}
else
{
u32FDLDataFlag[0] = 0x66666666;
u32FDLDataFlag[1] = 0x55555555;
u32FDLDataFlag[2] = 0xA555A55A;
u32FDLDataFlag[3] = 0X12345678;
TYW_FDL_Erase(0XFF200000, 0XFF20FFFF);
TYW_FDL_Write(0xFF20FF00 , u32FDLDataFlag, 4);
}
}
EEPROM_Init();
if (u32ResetFlag != 0xA55AA55AUL)
{
u8ResetFlag = 0;
......@@ -138,6 +162,12 @@ void Sys_Startup_Init(void)
}
}
/*EOL诊断 配置数据读取 DFLASH*/
ReadAllDFlashData();
/*读取K-LINE*/
ReadDTCEOLValue_Meter_K_LINE();
/*30电初始化*/
APP_Startup_Init(u8ResetFlag);
APP_Startup_Init(u8ResetFlag);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment