Home

RH850 Family Data Flash Library Type01 User`s Manual

image

Contents

1. PEO AAA Start of 1st Command R FDL BUSY operation Execution of R_FDL_Handler R_FDL_BUSY See State check during DF operation i End of 1st Command Execution of R_FDL_Handler San B FDL auer Erase control NG Start of 2 Command operation y Execution of R_FDL_Handler R_FDL_BUSY lt SE State check during DF operation Erase control Start of nth Command operation DF operation End ES nth Command ES REDE BUSY State check during y n21 2 3 Command execution period Note Only a state check is made because Data Flash operation is underwav R01US0063EJ0101 Rev 1 01 Page 18 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 7 Suspend and Resume Suspend The suspend feature enables you to stop ongoing erase or write operation The state of the FDL inactivated by this feature is called FDL suspended state Note that you can newly write data to memory while the FDL is in suspended state The suspend feature is available only to stop erase or write operation If you attempt to use this ote feature to stop other operations status_enu of the request structure Na temporarily becomes R FDL SUSPENDED Note For details of the request structure see section 6 2 Request Structure Settings Resume The resume feature returns the FDL from
2. Any runtime settings excluding ID authentication or the argument pointer is incorrect Set correct values for runtime settings or the argument pointer R FDL ERR PROTECTION Meaning Execution of this R FDL Init function was rejected Cause 1 The ID authentication value in runtime settings is incorrect We 2 An access to the data flash was rejected due to a hardware fault Action to be taken Stop further Flash operation and investigate the cause of the problem R_FDL_ERR_ INTERNAL Meaning Execution of this R FDL Init function failed An unexpected error that cannot be identified by the FDL 1 The RAM used by the FDL may have been destroyed by the user program 2 The FDL may have been destroyed Action to be taken Stop further Flash operation and investigate the cause of the problem Note Be sure to set a correct ID also for devices that do not require ID authentication for the data flash RO1US0063EJ0101 Sep 30 2013 2ENESAS Page 32 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Commands Reference Settings None Others Disabling interrupts during execution of the R_FDL_Init function Interrupts should be disabled in certain periods during execution of the R FDL Init function Be sure to use the NP and ID of the PSW register to disable interrupts The FDL Type 01 provides an interface for callback functions to be ca
3. 2ENESAS RH850 Family Chapter 4 FDL Architecture Type 01 Data Flash Library Chapter 4 FDL Architecture This chapter describes the FDL architecture required for the user to rewrite Data Flash by using the FDL 4 1 System Structure The FDL offers interface for accessing the data flash area FDL pool defined by the user The FDL is controlled via the hardware that operates the data flash The arrows shown in the figure below indicate the flow of processing Figure 4 1 System Structure Code Flash User application Response Instruction Response Instruction Hardware Response Operation Data Flash FDL pool 4 1 1 FDL Pool The FDL pool is a user defined Data Flash area that is accessible by the FDL The user program can access the Data Flash only by using this FDL pool in the Data Flash via the FDL The FDL pool size must be specified with the number of blocks in the Data Flash of the target device For the procedure to specify the number of blocks see section 6 1 Runtime Settings Note Data can be directly read from the Data Flash via the user program without using the FDL R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 11 of 54 RH850 Family Chapter 4 FDL Architecture Type 01 Data Flash Library 4 2 Notes on FDL Architecture Below are notes on the FDL architecture Table 4 1 Notes on FDL Architecture 1 The Data Flash is manipulated via the FDL f
4. n 1 2 3 in figure 5 4 Example of Command Operation Sequence Deleted unnecessary words Divided table 5 3 Notes on FDL Function Modified words and added supplementary information RO1US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 54 of 54 RH850 Family User s Manual Type 01 Data Flash Library Publication Date Sep 30 2013 Rev 1 01 Published by Renesas Electronics Corporation ENESAS SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http www renesas com for the latest and detailed information Renesas Electronics America Inc 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 01 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 651 700 Fax 44 1628 651 804 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 49 211 65030 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Tel 86 21 5
5. Added explanation in section 6 2 2 User Read Access 28 Added 3 and 4 in table 6 2 Notes on Request Structure Settings Deleted unnecessary words in the R FDL Init function Added 31 32 pre conditions Added category and description in Return value Modified figure 6 4 Changed function names and file names Added supplementary information Added status enu used by the R FDL Handler function in Reference 34 36 Added category and description Added status enu used when R FDL SuspendRequest or HR FDL ResumeRequest is executed 40 Added notes on post conditions in R FDL Handler in table 6 2 R0OTUS0063EJ0101 Rev 1 01 Page 53 of 54 Sep 30 2013 ENESAS RH850 Family Appendix A Revision History Type 01 Data Flash Library Revisions Description 2013 06 27 Added write to the target of R_FDL_SuspendRequest Added category and description in Return value and Reference Shifted R_FDL_SUSPENDED to the page of R_FDL_Execute Added other information Added category and description in Return value and Reference of R_FDL_ResumeRequest Shifted R_FDL_BUSY to the page of R_FDL_Execute Added explanation of R_FDL_StandBy Added category and description in Return value and Reference Added category and description in Return value and Reference of R_FDL_WakeUp Added chapter 7 FDL Processing Time 2013 07 31 Added target products and versions in the table Added
6. None Others Flowchart of this function is described in combination with the R_FDL_ResumeRequest function See Flowchart of the R_FDL_ResumeRequest function RO1US0063EJ0101 Rev 1 01 Page 43 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_ResumeRequest Description This function requests the FDL to return from suspended state C language format r fdl status t R FDL ResumeRequest void Pre conditions The R_FDL_Init function should execute and return R FDL Ok status enu of the request structure should beR FDL SUSPENDED Post conditions The execution of the R FDL Handler function should be repeated until status enu of the request structure is changed from R FDL SUSPENDED to a different value Parameters None Return values This function can return the values below Macro name Category Description A request for return from the FDL suspended state was Meaning successfully accepted R FDL OK Cause Normal operation Action to be taken None Meaning Execution of this R FDL ResumeRequest function was rejected R_FDL_ERR_ Cause The FDL has not been initialized or is an invalid state REJECTED Stop further Flash operation and investigate the cause of the Action to be taken problem Commands None Reference This function can assign the value below to statsu_enu of the request structure Whe
7. The definitions in the figure below are called request structure The request structure is described in the file r_fdl_types h Figure 6 1 Definition of the request structure typedef volatile struct R FDL REQUEST T uint32_t command_enu uint32_t bufAddr_u32 uint32_t idx_u32 uint16 t cnt_u16 uint32_t accessType_enu uint32_t status_enu r_fdl_request_t Commands are executed by a single function Commands and data sizes are then passed to the FDL via the request structure The FDL state and error information are obtained via the request structure In subsequent sections write access to the request structure from the user is called user write access and read access to it from the user is called user read access A command_enu bufAddr_u32 idx_u32 cnt_u16 accessType_enu Figure 6 2 Request Structure Note status enu User write access gt User read access Note bufAddr u32 and accessType enu may be written from the FDL User read access is also possible For more information about how to do this see the description of the R FDL Execute function in section 6 5 FDL Functions The request structure should not be changed by the user except for adding dummy For details see table 6 2 Notes on Request Structure Settings Figure 6 3 Alignment of Variables of the Request Structure uint32 t status enu R0O1US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 27 of 54
8. invalid state R_FDL_ERR_REJECTED Action to Stop further Flash operation and investigate the cause of the be taken problem Commands None RO1US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 46 of 54 RH850 Family Type 01 Data Flash Library Chapter 6 User Interface Reference This function can assign the value below to status enu of the request structure status_enu R_FDL_BUSY Settings None Others Category Meaning Description During command execution Cause Normal operation Action to be taken Continue operation Flowchart of this function is described in combination with the R_FDL_WakeUp function See Flowchart of the R FDL WakeUp function RO1US0063EJ0101 Sep 30 2013 Rev 1 01 2ENESAS Page 47 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_WakeUp Description This function returns the FDL from standby state C language format r fdl status t R FDL WakeUp void Pre conditions The R_FDL_Init function should execute and return R FDL OK The return value of the R FDL StandBy function should have changed from R FDL BUSY to R FDL OK indicating the FDL is in standby state status enu of the request structure should be R FDL BUSY Post conditions None Parameters None Return values This function can return the values below Macro name Category Description A
9. name R_FDL_CMD_ERASE Amount of memory to be erased Expressed in units of blocks R_FDL_CMD_WRITE Amount of data to be written Expressed in 4 byte units R_FDL_CMD_BLANKCHECK Amount of data which should be subjected to a blank check Expressed in 4 byte units R_FDL_CMD_READ Amount of data to be read Expressed in 4 byte units R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 28 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 5 accessType_enu Right to access Data Flash Set R FDL ACCESS USER Macro name Description FDL_ACCESS_USER Enables access to the user pool from the FDL Remarks FDL_ACCESS_NONE Should not be set by the user FDL ACCESS EEL Setting reserved for the system Should not be set by the user 6 2 2 User Read Access status enu FDL state and error information For details see section 6 5 FDL Functions status enu is also referenced when the R FDL SuspendRequest or R FDL ResumeRequest function is executed as in the case of R_FDL_Execute or R FDL Handler 6 2 3 Note on Request Structure Settings Table 6 2 lists a note on the request structure settings Table 6 2 Note on Request Structure Settings Do not change the position of each variable of the request structure Variables must be aligned as shown in figure 6 3 Alignment of Variables of the Request Structure Otherwise the interface becomes incompatible with the FDL Example When the
10. operation has started normally or the command Meaning is being executed R_FDL_BUSY Cause Normal operation Action to Continue operation be taken Meaning Execution of this command was rejected Cause An invalid parameter was specified R_FDL_ERR_PARAMETER Action to Stop further Flash operation and investigate the cause of be taken the problem Parameters in the FDL or parameters that have been set R PDL ERRE PROTECTION Cause in the data flash control hardware via the FDL were illegally modified during command execution Action to Stop further Flash operation and investigate the cause of be taken the problem Meaning The command to be executed was rejected Cause Another command or FDL function is being executed R_FDL_ERR_REJECTED Action to Re execute the command after the hardware operation is be taken completed Meaning The command to be executed was rejected Cause An invalid command was specified R_FDL_ERR_COMMAND Action to Stop further Flash operation and investigate the cause of Meaning The command to be executed was rejected be taken the problem Meaning Execution of this command failed An unexpected error that cannot be identified by the FDL 1 The RAM used by the FDL may have been destroyed R_FDL_ERR_INTERNAL by the user program The FDL may have been destroyed Action to Stop further
11. user s manual for the target device 1 Table 2 2 Notes on Hardware Environment Ifthe CPU frequency has digits below the decimal point round it up to the nearest whole number and set this number Example When there is no decimal point Specify a CPU frequency 32 MHz as 32 Example When there is a decimal point Specify a CPU frequency of 25 3 MHz as 26 2 When read and write operations on data flash are performed with the FDL the addresses required for these operations are those relative to the start address 0 of block O in the data flash Note that they are not absolute addresses 3 The FDL does not perform compare check with the CPU operating frequency set by the user The CPU frequency is a parameter depending on the user system and so the FDL cannot check this parameter ES Le Check the specifications of the target device and be sure to configure the correct CPU frequency If checking of the CPU frequency is required configure the user application to perform the checking The FDL checks the CPU operating frequency only within the frequency range specific to each RH850 product For hardware information of the Data Flash in the target device such as a block size and unit of reading refer to the specifications and notes described in the user s manual for the target device The FDL is only usable in supervisor mode CPU operating mode and cannot be used in user mode RO1US0063EJ0101 Rev 1 01 Page 9 of 5
12. 2ENESAS Page 33 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_Execute Description This function performs erase write blank check operations for Data Flash Commands which are treated as parameters are specified in the request structure r_fdl_requst_t for execution C language format void R_FDL Execute r_fdl request t request pstr Pre conditions The R FDL Init function should execute and return R FDL Ok Post conditions After the R FDL Execute function normally ends status enu of the request structure is R FDL BUSY Execute the R FDL Handler function repeatedly while status enu is R FDL BUSY Parameters r Wl request t request pstr Request structure pointer Return values None Commands This function can use command enu below of the request structure Macro name Description R FDL CMD ERASE Erase R FDL CMD WRITE Write R FDL CMD BLANKCHECK Blank check R FDL CMD READ R01US0063EJ0101 Rev 1 01 Page 34 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Reference The following table lists status_enu values of the request structure that are supported for all commands of R_FDL_Execute and R_FDL_Handler that follows Values common to all commands Macro name Value Category Description Processing normally ended Cause Normal operation R_FDL_OK Action to None be taken Command
13. 4 Sep 30 2013 2ENESAS RH850 Family Chapter 3 Software Environment Type 01 Data Flash Library Chapter 3 Software Environment This chapter describes the software environment required for the user to rewrite Data Flash by using the FDL 3 1 FDL Sections The functions constants and variables used in the FDL are allocated to the specified sections The table below lists the sections defined for the FDL Table 3 1 Sections Available for the FDL R_FDL Text Code section for the FDL Contains the FDL programs R FDL Const Constant data section for the FDL Contains the constant data used inside the FDL R_FDL Data Variable data section for the FDL Contains the variable data used inside the FDL 3 2 FDL Resources The table below lists the resources available for the FDL lt R gt Table 3 2 Resources Available for the FDL Target GHS Version FDL V1 00 R_FDL Text section 3978 R_FDL_Const section R_FDL_Data section Maximum FOL stack size Note Please contact our distributors or sales representatives 3 3 Notes on Software Environment Below are notes on the software environment Table 3 3 Notes on Software Environment Reserve one stack area for the user and another stack area of the size specified in table 3 2 Resources Available for the FDL Do not destroy the FDL resources listed in table 3 2 Resources Available for the FDL RO1US0063EJ0101 Rev 1 01 Page 10 of 54 Sep 30 2013
14. 877 1818 Fax 86 21 6887 7858 7898 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 3F No 363 Fu Shing North Road Taipei Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 80 Bendemeer Road Unit 06 02 Hyflux Innovation Centre Singapore 339949 Tel 65 6213 0200 Fax 65 6213 0300 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 Jin Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 60 3 7955 9510 Renesas Electronics Korea Co Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2013 Renesas Electronics Corporation and Renesas Solutions Corp Colophon 1 3 RH850 Family ENESAS Renesas Electronics Corporation RO1US0063EJ0101
15. DL Functions Note1 See table 5 3 Notes on the Functional Specifications of the FDL 2 Erase First execute the R_FDL_Execute function using the R_FDL_CMD_ERASE command Then execute the R_FDL_Handler function By repeating its execution continue the erase operation and finally confirm the termination 3 Write First execute the R_FDL_Execute function using the R FDL CMD WRITE command Then execute the R_FDL_Handler function By repeating its execution continue the write operation and finally confirm the termination 4 Read Execute the R_FDL_Execute function the R_FDL_CMD_READ commana Execution of the R_FDL_CMD_READ command does not need execution of the R_FDL_Handler function Note 2 See table 4 1 Notes on FDL Architecture R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 14 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 4 Flowchart for Command Operations The figure below shows the basic procedure to perform erase and write operations for Data Flash by using the FDL Figure 5 2 Basic Flowchart for Command Operations 1 R_FDL_Execute function 2 Busy state 3 R_FDL_Handler check function Not busy 4 End state Abnormal end check Normal end Normal end Perform operations for Command 1 R_FDL_Execute function 2 Busy state check Check status enu of the request structure N other than R FDL BUSY is returned Repeat th
16. E R FDL Handler Standby and Wakeup R_FDL_Handler R_FDL_BUSY Busy state check R_FDL_StandBy R_FDL_BUSY Busy state check R_FDL_OK Device operation in power save mode R_FDL_WakeUp Put device into power save mode Get device out of power save mode End R01US0063EJ0101 Sep 30 2013 Rev 1 01 Note Error processing is omitted in this figure ENESAS Page 49 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_GetVersionString Description This function obtains the pointer to FDL version information C language format const uint8 t R FDL GetVersionString void Pre conditions None Post conditions None Parameters None Return values This function returns the following value type definition const uint8 t7 Value Macro name Address valu Format for FDL version information DH850T01xxxxxYZabcD XXXXX Compiler information Y System reserved area Z E Engineer version V Release version abc Library version D Library version only in the case of an engineer version Commands Reference Settings None Flowchart Figure 6 7 Flow of R_FDL_GetVersionString Function Exec
17. E d D A 0 lt 5 y O N ENESAS RH850 Family Type 01 Data Flash Library Japanese Release ZIP file name JP_R_FDL_RH850_T01_Vx xx_x_E 32 Bit Single Chip Microcontroller Supported Devices RH850 F1L All information contained in these materials including products and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corporation without notice Please review the latest information published by Renesas Electronics Corporation through various means including the Renesas Electronics Corporation website http www renesas com Renesas Electronics www renesas com Rev 1 01 Sep 2013 10 11 12 Notice Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred b
18. Family Chapter 7 FDL Processing Time Type 01 Data Flash Library Table 7 1 shows typical response time of each FDL function lt R gt Table 7 1 FDL Function Response Time Target GHS Version FDL V1 00 FDL Function Response Time us R FDL Init 51680 fxx R FDL Execute When R FDL CMD ERASE is executed 480 fxx When R_FDL_CMD_WRITE is executed 640 fxx When R_FDL_CMD_BLANKCHECK is executed 480 fxx When R_FDL_CMD_READ is executed 320 fxx x word R_FDL_Handler R_FDL_Execute When R_FDL_CMD_ERASE is executed 640 fxx When R_FDL_CMD_WRITE is executed 800 fxx When R_FDL_CMD_BLANKCHECK is executed 720 fxx Note fxx CPU operating frequency MHz word Set number of pieces of data in units of 4 bytes Example When the R_FDL_CMD_ERASE command of R_FDL_Execute fxx 80 MHz is executed 480 80 6 gt the response time 6 us For FDL execution time that is not described here please contact our distributors or sales representatives R01US0063EJ0101 Rev 1 01 Page 52 of 54 Sep 30 2013 2ENESAS RH850 Family Type 01 Data Flash Library Appendix A Revision History Appendix A Revision History Revisions Description 0 01 2013 03 11 First edition issued 1 00 2013 06 27 Throughout Unified terms e g request structure command operation the document Modified the style e g correction of figure tab
19. Flash operation and investigate the cause of be taken the problem Note In the case ofR FDL CMD READ command execution this error does not occur RO1US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 35 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Value forR FDL CMD READ command only R FDL ERR ECC SED Ox0B Mesa Data Flash operation was executed and the corrected data eaning was read Cause An ECC error 1 bit error was detected Actionto Stop further Flash operation and investigate the cause of the be taken problem R FDL ERR ECC DED 0x0C Data Flash operation was executed and the data which Meaning failed to be corrected was read Cause An ECC error 2 bit error was detected Action to Stop further Flash operation and investigate the cause of the be taken problem Note For details of ECC refer to the user s manual of the target device Value for R_FDL_CMD_ERASE command only Category R_FDL_ERR_ERASE Meaning Erase failed due to a hardware problem Cause Data Flash might be faulty Action to Stop further Flash operation and investigate the cause of the be taken problem Value forR FDL CMD WRITE command only Category R_FDL_ERR_WRITE 0x07 Meaning Write failed due to a hardware problem The area to write data to might not be erased Cause Data Flash might be faulty Ifthe area to write dat
20. ICES 1 VOLTAGE APPLICATION WAVEFORM AT INPUT PIN Waveform distortion due to input noise or a reflected wave may cause malfunction If the input of the CMOS device stays in the area between VIL MAX and VIH MIN due to noise etc the device may malfunction Take care to prevent chattering noise from entering the device when the input level is fixed and also in the transition period when the input level passes through the area between VIL MAX and VIH MIN 2 HANDLING OF UNUSED INPUT PINS Unconnected CMOS device inputs can be cause of malfunction If an input pin is unconnected it is possible that an internal input level may be generated due to noise etc causing malfunction CMOS devices behave differently than Bipolar or NMOS devices Input levels of CMOS devices must be fixed high or low by using pull up or pull down circuitry Each unused pin should be connected to VDD or GND via a resistor if there is a possibility that it will be an output pin All handling related to unused pins must be judged separately for each device and according to related specifications governing the device 3 PRECAUTION AGAINST ESD A strong electric field when exposed to a MOS device can cause destruction of the gate oxide and ultimately degrade the device operation Steps must be taken to stop generation of static electricity as much as possible and quickly dissipate it when it has occurred Environmental control must be adequate When it is dry a humidi
21. If a device supporting this FDL performs read operation for a blank block containing no data an undefined value is read out Perform the blank check before reading to check whether the block contains data or not This prevents an unwritten block from being treated as a data written block Use this command as necessary R FDL CMD READ Command Read RO1US0063EJ0101 Sep 30 2013 Rev 1 01 This command reads the specified amount of data from the area starting with the specified address and stores the data in the specified RAM area Before reading be sure to check that the area contains data Page 13 of 54 ENESAS RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 3 Basic Flowchart The figure below shows the basic procedure to perform erase write and other operations for Data Flash by using the FDL Figure 5 1 FDL Basic Flowchart Y 1 FDL initialization 8 2 Erase 1 FDL initialization Execute the R_FDL_Init function to initialize the FDL execution environment The R FDL Init function must be executed only once to initialize the FDL when the user system is started up Interrupt should be disabled in certain periods during execution of the R_FDL_Init function Be sure to use the NP and ID of the PSW register to disable interrupts For details about interrupt control during execution of the R FDL Init function see the description of the R_FDL_Init function in section 6 5 F
22. ND Busy state check Busy state check R_FDL_BUSY Note Error processing is omitted in this figure R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 45 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_StandBy Description This function sets the FDL to standby state while it is running The Data Flash operation is stopped While the FDL is in standby state it does not permit any Data Flash operations C language format r_fdl status t R FDL StandBy void Pre conditions The R_FDL_Init function should execute and return R_FDL_OK status enu of the request structure should have been set toR FDL BUSY by a write or erase operation The FDL should not be in the standby state Post conditions Execute the R_FDL_StandBy function repeatedly while the return value of the R_FDL_StandBy function is R_FDL_BUSY Onlythe R_FDL_WakeUp function is executable after the FDL standby Parameters None Return values This function can return the values below Macro name Category Description Meaning FDL standby started Cause Normal operation R_FDL_OK Action to None be taken Meaning The FDL standby request was successfully accepted Cause Normal operation R_FDL_BUSY Action to Continue operation be taken Meaning Execution of this R_FDL_StandBy function was rejected Cause The FDL has not been initialized or is an
23. RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 6 2 1 User Write Access The following outlines settings for each member of the request structure at user write access 1 command enu Commands to be set in the common executable function Command name macro name Description R_FDL_CMD_ERASE Erase R_FDL_CMD_WRITE Write R_FDL_CMD_BLANKCHECK Blank check R_FDL_CMD_READ Read 2 bufAddr_u32 Specify the start address of the data buffer used for R_FDL_CMD_WRITE R_FDL_CMD_READ command execution Associated command macro name R_FDL_CMD_WRITE Start address of the data butter R_FDL_CMD_READ Start address of the data buffer Note 1 Buffer which contains data written by the user Note 2 Buffer which stores data read from the Data Flash 3 idx_u32 Specify the index used for each command For more information about how to do this see the description of the R_FDL_Execute function in section 6 5 FDL Functions Associated command name macro name R_FDL_CMD_ERASE Block number for initiating erase R_FDL_CMD_WRITE Start address for performing write R_FDL_CMD_BLANKCHECK Start address for performing a blank check R_FDL_CMD_READ Start address for performing read 4 cnt_u32 Specify the number used for each command For more information about how to do this see the description of the R_FDL_Execute function in section 6 5 FDL Functions Associated command name macro
24. a to is not erased erase it and Action to then re execute the write be taken If the area to write data to is already erased use a bit check to investigate the cause of the problem Value for R_FDL_CMD_BLANKCHECK command only Category R_FDL_ERR_BLANKCHECK Meaning The specified area is not blank Cause Data is already written 1 If a blank check ensures the area is not blank Action to erase the area because it contains data be taken Ifa blank check ensures the area is blank perform the write operation RO1US0063EJ0101_ Rev 1 01 Sep 30 2013 ENESAS Page 36 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Value for R_FDL_SuspendRequest function R_FDL_ResumeRequest function only status_enu Category Description The FDL is being suspended Cause Normal operation R_FDL_SUSPENDED Action to None be taken This function can assign the values below to bufAddr_u32 and FDL_accessType_t of the request structure Member Description bufAddr_u32 The address where the blank check resulted in error is obtained upon occurrence of R_FDL_ERR_BLANKCHECK accessType t FDL ACCESS NONE which indicates no access right is set at reset time Settings This function uses the request structure settings below 1 Settings for R FDL CMD ERASE Command Execution Member Description command enu SetR FDL CMD ERASE Not used bufA
25. afety equipment etc Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury artificial life support devices or systems surgical implantations etc or may cause serious property damages nuclear reactor control systems military equipment etc You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application for which it is not intended Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions u
26. and gt FDL suspended state gt R FDL CMD WRITE command Only the following sequence is enabled lt lt Enabled sequence gt gt R_FDL_CMD_ERASE command gt FDL suspended state gt R_FDL_CMD_WRITE command However the R_FDL_CMD_WRITE command is enabled only for blocks other than the block that is being erased 12 While the FDL is in standby state it cannot be used Interrupts are disabled during the execution of the R FDL Init function For details about interrupt control during this execution see the description of the R FDL Init function in section 6 5 FDL Functions R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 24 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Chapter 6 User Interface This chapter describes the user interface offered by the FDL 6 1 Runtime Settings The fdl_descriptor h file contains the runtime settings required for using the FDL Some of the settings below might vary depending on the user So check the settings below before configuring them The other settings are reserved for the system and thus cannot be changed 1 define FDL CPU FREQUENCY MHZ 80 Set the CPU frequency The frequency used inside the FDL is calculated from the set CPU frequency Note See notes table 2 2 Notes on Hardware Environment 2 define AUTHENTICATION ID OxFFFFFFFF Y OxFFFFFFFF Y OxFFFFFFFF OxFFFFFFFF Set the value of an authentication ID F
27. and degradation of internal elements due to the passage of an abnormal current The correct power on off sequence must be judged separately for each device and according to related specifications governing the device INPUT OF SIGNAL DURING POWER OFF STATE Do not input signals or an I O pull up power supply while the device is not powered The current injection that results from input of such a signal or I O pull up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal elements Input of signals during the power off state must be judged separately for each device and according to related specifications governing the device How to Use This Manual Target Readers This manual is intended for users who wish to understand the features of the Type 01 Data Flash Library for RH850 Family and to use the library in designing and developing application systems Purpose This manual is intended to give users an understanding of the correct use of the Type 01 Data Flash Library that is used for programming the data flash in RH850 Family Organization This manual includes the following sections e Overview e Hardware environment e Software environment e FDL architecture e FDL functional specifications e User interface e FDL Processing Time How to Read This Manual Itis assumed that the readers of this manual have general knowledge of electricity logic circuits and mic
28. ause the address is not aligned with a 4 byte boundary Setting 0x0000 0003 4 byte units cnt u16 Example Eight bytes Setting 2 accessType enu The access right is always R FDL ACCESS USER Note Buffer which contains data to be written by the user R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 38 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 3 Settings for R_FDL_CMD_BLANKCHECK Command Execution Member Description command_enu SetR_FDL_CMD_BLANKCHECK The address where the blank check resulted in error is obtained upon occurrence of R_FDL_ERR_BLANKCHECK bufAddr_u32 Since this member is used only when R FDL ERR BLANKCHECK occurs any settings are invalid However for safety design treat invalid values as OxFFFF FFFF As the start address of the blank check specify a relative address from the first address 0x0000 0000 of block O in the Data Flash Only 4 byte aligned addresses whose lowest bytes are OH 4H 8H or CH are specifiable with the first address of block O in the Data Flash set to 0x0000_0000 Example 1 Performing a blank check on the beginning of Data Flash block O Setting 0x0000_0000 idx_u32 Example 2 Performing a blank check on the first 4 bytes of Data Flash block 1 Setting Ox0000 0044 Example 3 When the address shown below the third address from the top of block 0 in the Data Flash is specified before command execution status_enu of the requ
29. below Table 1 1 Definition of Terms BEE Type is an identification name representing an FDL type Use the type corresponding to your device An abbreviation of the data flash library used to control Data Flash Memory for storing data The RH850 Data Flash Library Type 01 is hereafter referred to as FDL FCL An abbreviation of the code flash library used to control Code Flash Memory for storing data FDL function A generic term for the functions offered by the FDL Block number A number which identifies a block of Flash memory R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 7 of 54 RH850 Family Type 01 Data Flash Library Chapter 2 Hardware Environment Chapter 2 Hardware Environment This chapter describes the hardware environment required for the user to rewrite Data Flash by using the FDL 2 1 Data Flash The RH850 family s on chip Data Flash has a block structure That is it is divided into several blocks A block is the smallest unit of erase operation on on chip Data Flash for the FDL Flash is always erased in units of blocks Write and blank check operations are performed by specifying the start address and execution size When read and write operations on data flash are performed using the FDL the addresses required for these operations are those relative to the start address 0 of block O in that memory Table 2 1 gives an example of Data Flash addresses when the FDL is r
30. cribed in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction When exporting the Renesas Electronics products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations It is the responsibility of the buyer or distributor of Renesas Electronics products who distributes disposes of or otherwise places the product with a third party to notify such third party in advance of the contents and conditions set forth in this document Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics 2012 4 NOTES FOR CMOS DEV
31. cription of R_FDL_StandBy and R_FDL_WakeUp in section 6 5 FDL Functions RO1US0063EJ0101 Rev 1 01 Page 21 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library Figure 5 6 Example of FDL Standby Operation Sequence User application Device hardware Execution ofR FDL Execute I l EE EE Start of 1st block erasure status enu R FDL BUSY lt Status check only Execution of R FDL StandBy return R_FDL_BUSY EE Acceptance of status_enu R_FDL_BUSY standby Execution of R_FDL StandBy Ira Lok d Execution of status_enu R_FDL_BUSY standby Execution of R FDL WakeUp return R_FDL_OK ee status_enu R_FDL_BUSY Execution of wakeup and resume of erasure Execution of R_FDL_Handler Status check only z End of 1st block erasure Standby period status_enu R_FDL_BUSY R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 22 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library lt R gt 5 9 Notes on the Functional Specifications of the FDL Below are notes on the functional specifications of the FDL Table 5 3 Notes on the Functional Specifications of the FDL 1 2 Timeout processing is not performed in the FDL When timeout processing of an FDL function is required use the watchdog timer or the like in the use
32. d While the FDL is in suspended state it permits further write operation C language format r_fdl_status_t R FDL SuspendRequest void Pre conditions TheR FDL Init function should execute and return R_FDL_OK status enu of the request structure should be R FDL BUSY for write or erase The FDL should not be in the suspended state Post conditions The execution of the R_FDL_Handler function should be repeated until status_enu of the request structure is changed to R_FDL_SUSPENDED Parameters None Return values This function can return the values below Macro name Category Description Meaning The FDL suspend request was successfully accepted Cause Normal operation R_FDL_OK Action to None be taken Execution of this R_FDL_SuspendRequest function was Meaning rejected R_FDL_ERR_REJECTED Cause The FDL has not been initialized or is an invalid state Action to Stop further Flash operation and investigate the cause of the be taken problem Commands None Reference This function can assign the value below to status_enu of the request structure status_enu Category Description Meaning During command execution Cause Normal operation R_FDL_BUSY Action to Continue operation be taken R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 42 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Settings
33. ddr u32 Any settings are invalid However for safety design treat invalid values as OXFFFF FFFF Set the start block number Example 1 Block 0 Setting O Example 1 Block 1 Setting 1 Set the number of blocks to be erased cnt u16 Example 1 Erasing three blocks Setting 3 accessType enu The access right is always R FDL ACCESS USER R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 37 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 2 Settings for R_FDL_CMD_WRITE Command Execution Member Description command_enu SetR FDL CMD WRITE Note Start address of the data buffer bufAddr u32 Example Array for the data buffer with the name data bufAddr u32 8data 0 As the start address of the location to write data specify a relative address Set the first address of block 0 in the Data Flash to 0x0000 0000 Only 4 byte aligned addresses whose lowest bytes are OH 4H 8H or CH are specifiable with the first address of block 0 in the Data Flash set to 0x0000_0000 Example 1 Writing data to the beginning of Data Flash block O Setting Ox0000 0000 idx_u32 Example 2 Writing data to the first four bytes of Data Flash block 1 Setting 0x0000_0044 Example 3 When the address shown below the third address from the top of block 0 in the Data Flash is specified before command execution status_enu of the request structure becomes R_FDL_ERR_PARAMETER bec
34. e execution of the R_FDL_Handler function until a value Note For details of the request structure see section 6 2 Request Structure Settings 3 R_FDL_Handler function Control the FDL while it is running By repeating the execution of the R_FDL_Handler function continue the Command operation 4 End state check If status_enu is R_FDL_OK the operation should terminate normally Otherwise it should terminate with an error 5 4 1 During Command Execution During Busy The time period from the execution of the 1 R_FDL_Execute function busy until the device leaves the busy state after the 3 R_FDL_Handler function is executed is called during command execution or during busy in this user s manual See the time period of command execution shown in figure 5 4 Example of Command Operation Sequence R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 15 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 5 FDL Incorporation into the User System Figure 5 3 shows an example of the procedure for incorporating the FDL into the user system After executing the R_FDL_Init function once at the time of initialization execute the R_FDL_Execute function and the R_FDL_Handler function according to the desired timing in the main part of the user program Note For the use of the R FDL CMD ERASE R FDL CMD WRITE or R_FDL_CMD_BLANKCHECK 1 User system Figure 5 3 FDL Incorporation
35. e user application This allows the user application to run during the Data Flash operation This function is called BGO Back Ground Operation In some cases the device hardware operation might be divided into multiple operations each performed on a separate occasion The first operation is conducted by calling the R_FDL_Execute function The second and subsequent operations are triggered by calling the R_FDL_Handler function Thus there is a need to call the R FDL Handler function multiple times Processing is suspended from the time each separate operation is completed until the next one is triggered Therefore as the time interval between R_FDL_Handler function calls increases so too does the overall processing time To determine whether or not the operation requested from the R_FDL_Execute function has normally ended you should call the R_FDL_Handler function from the user application and check the device hardware operation R01US0063EJ0101 Rev 1 01 Page 17 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library The figure below gives an example of the hardware operation sequence No more operations take place after the nth operation A similar sequence is implemented with a command other than the R FDL CMD WRITE command lt R gt Figure 5 4 Example of the Command Operation Sequence User application Device hardware Execution of R_FDL_Execute
36. eenseeeeeenseeeeenseeeeens 29 6 3 FDL Function Calls BAKA BRA Aires 30 6 4 Data Types aa lalala aida 30 6 5 o RU Te e TE 31 ASEO IME as 32 IS Cute La NAG AA AA NANA KAKANAN NANA NLNG 34 R FDL Handler AA AA AA 41 R FDL SuspendRequest eoooccccccccnncconcccnenennnnnnnnncnnnnnnnnnnnnn ANEK EKAKAN ANAN AN ANNSAKAKAN annen nnmnnn nennen NANANA 42 R_FDL_ResumeRequest u s ARNAN AABANG KABAN 44 ROTUSOOS3EJO101 Sein RENESAS Pasos Sep 30 2013 RH850 Family Type 01 Data Flash Library R FDL St and ebe EE 46 R FDL GetVersionString ccccccmncnonoccceneninnnnnnnncnncnnnnnnnnnnnnnnnenernnnn nene nn enn rra anne nnmnnn nennen EEN 50 Chapter 7 FDL Processing Time coocuosonmansasasassinnon ns 51 App ndix A Revision Pistons AGA 53 R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 6 of 54 RH850 Family Chapter 1 Introduction Type 01 Data Flash Library Chapter 1 Introduction 1 1 Overview The Data Flash library is free software to rewrite data flash through user programs This software offers interface for device operations on data flash such as Erase Write Read Blank check Use this manual along with the release notes included in the package of the Data Flash library and the user s manual for the target device 1 2 Target Devices For the latest device information please contact our distributors or sales representatives 1 3 Definition of Terms The terms used in this user s manual are defined
37. est structure becomes R_FDL_ERR_PARAMETER because the address is not aligned with a 4 byte boundary Setting 0x0000 0003 4 byte units cnt u16 Example Eight bytes Setting 2 accessType enu The access right is always R FDL ACCESS USER R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 39 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 4 Settings for R_FDL_CMD_READ Command Execution Member Description command_enu SetR FDL CMD READ Note Start address of the data buffer Example Array for the data buffer with the name data bufAddr u32 8data 0 bufAddr u32 Address where an error was detected when R FDL ERR ECC SED R FDL ERR ECC DED occurred As the start address of read operation specify a relative address from the first address 0x0000 0000 of block 0 in the Data Flash Only 4 byte aligned addresses whose lowest bytes are OH 4H 8H or CH are specifiable with the first address of block 0 in the Data Flash set to 0x0000_0000 Example 1 Reading data to the beginning of Data Flash block O Setting Ox0000 0000 idx_u32 Example 2 Reading data to the first 4 bytes of Data Flash block 1 Setting Ox0000 0044 Example 3 When the address shown below the third address from the top of block O in the Data Flash is specified before command execution status enu of the request structure becomes R FDL ERR PARAMETER because the address is not aligned wi
38. eturn R_FDL_OK Acceptance of status_enu R_FDL_SUSPENDED resume command 5 Resume control Resume of erase operation Execution of R_FDL_Handler Status check only status_enu R_FDL_BUSY End of ist block erasure Suspend period RO1US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 20 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 8 Standby and Wakeup Standby The standby feature enables you to stop ongoing erase and write operations The state of the FDL inactivated by this feature is called FDL standby state The FDL can be used while it is in FDL suspended state But it cannot be used while it is in FDL standby state Wakeup The wakeup feature returns the FDL from FDL standby state making it possible to resume the suspended erase or write operation Timing After the R_FDL_StandBy function is executed the timing feature forcibly aborts the ongoing hardware operation without waiting for the end of that operation the device s operation is divided into several hardware operations Example of Use The standby and wakeup features are available to set the device to power save mode immediately during Data Flash operation Note that you cannot set the device to power safe mode during Data Flash operation Note Enabled in the HALT mode only See table 4 1 Notes on FDL Architecture Flowcharts See the des
39. fier should be used It is recommended to avoid using insulators that easily build up static electricity Semiconductor devices must be stored and transported in an anti static container static shielding bag or conductive material All test and measurement tools including work benches and floors should be grounded The operator should be grounded using a wrist strap Semiconductor devices must not be touched with bare hands Similar precautions need to be taken for PW boards with mounted semiconductor devices 4 STATUS BEFORE INITIALIZATION Power on does not necessarily define the initial status of a MOS device Immediately after the power source is turned ON devices with reset functions have not yet been initialized Hence power on does not guarantee output pin levels I O settings or contents of registers A device is not initialized until the reset signal is received A reset operation must be executed immediately after power on for devices with reset functions POWER ON OFF SEQUENCE In the case of a device that uses different power supplies for the internal operation and external interface as a rule switch on the external power supply after switching on the internal power supply When switching the power supply off as a rule switch off the external power supply and then the internal power supply Use of the reverse power on off sequences may result in the application of an overvoltage to the internal elements of the device causing malfunction
40. ings Member Value Macro name Settings information such as the request structure Others Additional descriptions such as flowcharts R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 31 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_Init Description This function initializes the FDL execution environment More specifically it initializes the following Flash hardware initialization Confirmation of runtime settings CPU operating frequency ID authentication FDL pool size etc FDL internal variables Interrupts are disabled during the execution of the R FDL Init For details see Others on the following page C language format r_fdl status t R FDL Init const r_fdl descriptor t descriptor pstr Pre conditions When the user program is started the R FDL Init function must be executed only once Note to initialize the FDL and perform ID authentication Note See table 5 3 Notes on the Functional Specifications of the FDL Post conditions None Parameters const r_fdl_descriptor_t descriptor_pstr Runtime settings pointer Return Values This function can return the values below Macro name R FDL OK Category Meaning Description Processing normally ended Cause Action to be taken Normal operation None R FDL ERR CONFIGURATION Meaning Execution of this R FDL Init function was rejected Cause Action to be taken
41. initialization 4 R FDL Execute d function 2 R_FDL_Init function 5 Busy state 6 R_FDL_Handler F check 3 Main user function system processing 1 User system initialization Startup routine for user system initialization 2 R FDL Init function Initialize the FDL execution environment Execute the R FDL Init function only once when starting the user system Note See table 5 3 Notes on the Functional Specifications of the FDL 3 Main user system processing Main processing by the user system 4 R_FDL_Execute function Execute Command operations 5 Busy state check Check status enu of the request structure Tri R FDL BUSY is changed to a different value Repeat the execution of the R FDL Handler function until Note For details of the request structure see section 6 2 Request Structure Settings 6 R FDL Handler function Control the FDL while it is running By repeating the execution of the R FDL Handler function continue the Data Flash operation R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 16 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library 5 6 Back Ground Operation BGO The R_FDL_Execute function is used for erase write blank check operations for Data Flash This function requests the device hardware to perform required operation and then immediately returns control to th
42. le numbers Deleted contents of figures and tables 7 Changed section 1 3 Terms to a table 9 Changed the order in table 2 2 and added explanation and notes in section 2 3 Notes on Hardware Environment 10 Added sizes in section 3 2 FDL Resources 44 Added words in section 4 1 System Structure Added figure 4 1 System Structure 42 Added explanation in table 4 1 Notes on FDL Architecture Deleted unnecessary words in No 1 13 Divided command descriptions in section 5 1 List of FDL Functions 13 Created a table in section 5 2 List of Commands 15 Added explanation in section 5 4 Command Operation Flowchart 15 Added a new section 5 4 1 During Command Execution During Busy 16 Added explanation in section 5 5 FDL Incorporation into the User Program 18 Changed words in figure 5 4 Example of Command Operation Sequence and simplified this figure 19 Added write processing to suspend target and changed the figure in section 5 7 Suspend Resume 22 Added figure 5 6 Example of FDL Standby Operation Sequence 23 Added explanation in table 5 3 Notes on FDL Functions Integrated notes on multiple execution to one item Added explanation 24 Changed file names and macro names in section 6 1 Runtime Settings 25 Added explanation in table 6 1 Notes on Runtime Settings Changed file names and macro names 26 Exchanged positions of figure 6 1 and figure 6 2 in section 6 2 Request Structure Settings Added explanation and changed definition 28
43. lled before and after the interrupt disabled period in the R FDL Init function Be sure to use either a or b method below to disable interrupts a Disable interrupts before execution of the R FDL Init function and enable interrupts after execution of the R_FDL_Init function b Disable interrupts within the R_FDL_User_CriticalSetionBegin function and enable interrupts within the R_FDL_User_CriticalSetionEnd function Since the processing in the provided callback function is a sample program it needs to be tailored by the user Change the sample program as required and be sure to evaluate it adequately If callback functions are unnecessary delete the sample code of each callback function File name r_fdl_user c Callback function names R_FDL_User_CriticalSetionBegin R_FDL_User_CriticalSetionEnd Callback function execution timing The R_FDL_User_CriticalSetionBegin function is executed right before the interrupt disabled period during execution of the R FDL Init function and the R_FDL_User_CriticalSetionEnd function is executed right after the interrupt disabled period Figure 6 4 Execution Time of the Callback Functions StartR FDL Init function Interrupt enabled period S R_FDL_User_CriticalSetionBegin function ES Interrupt disabled period R_FDL_User_CriticalSetionEnd function Interrupt enabled period Terminate R FDL Init function R01US0063EJ0101 Rev 1 01 Sep 30 2013
44. n the FDL returns from suspended status status_enu of the request structure is changed back to the value which existed before the FDL went into suspended state status_enu Category Description Meaning The FDL is suspended Cause Normal operation R_FDL_SUSPENDED Action to None be taken R0O1US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 44 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Settings None Others Flowchart The figure below shows the basic flow of execution of the R_FDL_SuspendRequest and FDL_ResumeRequst functions used to perform an example write operation for emergency Error processing is omitted in this figure Busy state is checked using status_enu of the request structure Figure 6 5 FDL Suspend and FDL Resume Normal operation FDL Suspend and FDL Resume Write operation for emergency R_FDL_SuspendRequest R_FDL_Handler R_FDL_Execute FDL_CMD_WRITE R_FDL_ Handler R_FDL_Execute R_FDL_CMD_ERASE R_FDL_BUSY Busy state R_FDL_BUSY R FDL Handler check Busy state check R FDL SUSPEND Suspend Emergency write Resume SES R_FDL_Handler R_FDL_ResumeRequest y R_FDL_ Handler R_FDL_SUSPE
45. nder certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or systems manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations You should not use Renesas Electronics products or technology des
46. nnnnnnnnennnanannnnnnnnnnnennnananans 10 o ag A AA AA 10 3 2 FDL ROSOUICES cia AARAL 10 3 3 Notes on Software Environment cc ceecceceeeeeeeeeeeeeeeeeeeeeneeeaneeeeeeeesenenaneeseseeeseesseeneeeeeees 10 Chapter 4 FDL Architecture ion AA AA 11 AT System TC 11 AR AND SES ADA AA E dxedacides 11 4 2 Notes on FDL ArchiteCture n a AA GIIT ARRANGE 12 Chapter 5 FDL Function arnes 13 5 1 FDL Functions Commands of the R FDL Execute Functnon een 13 5 2 Listof ComMaNdSu na KNANG BANG ANG BKT NG KAGAD D ADA ma 13 5 3 ET le El dE 14 5 4 Flowchart for Command OperatiONS ooommomcocccccnncnnnnonncnccnnnnnnnnnnncncnncnnnnnnnnnnnn nen ennnnnnnnnnnnnennos 15 5 4 1 During Command Execution During BUSY a 15 5 5 FDL Incorporation into the User System ooooconoccccnnnocccccnnancnncnnnncnncnnnnnnrnnnnn nn rra cnn rra cnn 16 56 Back Ground Operation BGO AANI 17 5 7 Suspend and RESUME ccicinccnicnninion a a cin KAES A 19 5 8 Standby and Wake Upuan NAG AA a irc cias 21 5 9 Notes on the Functional Specifications of the FDL s ccceeeeeeeeeeeeneeeeeeeeseeeeeeneeeeeees 23 Chapter 6 User Interface on ci 25 6 1 Runtime Settings iii BINANATAN AA 25 6 1 1 Note on Runtime Settings nro cerraran 26 6 2 Request Structure d E 27 6 2 1 User Write ACCESS iii ad dan 28 6 2 2 User Read ACCESS cuina A 29 6 2 3 Note on Request Structure Settings cccccceseeeeessenneeeeeeeeeeeeeee
47. or details of ID authentication see the user s manual for the target device 3 8 define EEL VIRTUALBLOCKSIZE Ou This value is reserved for the system Because it should be fixed at Ou do not change it 4 define FDL POOL SIZE 512u Set the size of the FDL pool area Specify the number of blocks of Data Flash installed on the target device The FDL recognizes a Data Flash area by the set size Example When the size of Data Flash is 32 Kbytes FDL POOL SIZE is 512 5 define EEL POOL START Qu define EEL POOL SIZE Ou Set the values to Ou These settings are reserved for the system Be sure to set them to Ou RO1US0063EJ0101 Rev 1 01 Ee Sep 30 2013 ENESAS RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 6 1 1 Note on Runtime Settings Table 6 1 lists a note on the runtime settings Table 6 1 Note on Runtime Settings Be sure to check the values of the following definitions in the file fdl_descriptor h define CPU_FREQUENCY_MHZ define AUTHENTICATION_ID define EEL_VIRTUALBLOCKSIZE define FDL_POOL_SIZE define FDL_EEL_POOL_START define FDL_EEL_POOL_SIZE The EEL_POOL_START and EEL_POOL_SIZE definitions are reserved for the system Be sure to set Ou for them All initial values of ID authentication are OxFF RO1US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 26 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 6 2 Request Structure Settings
48. r program to perform the timeout processing If a reset or power down occurs during write or erase operation the operation is interrupted and the contents of the block being written or erased become undefined Before using the block whose contents became undefined perform the erase operation again The R_FDL_Init function must be executed only once to initialize the FDL when the user system is started up However in the following case the R FDL Init function can be executed again Re execution of the R_FDL_Init function In the write or erase operation if the FDL is in the R_FDL_BUSY state even after the timeout period has elapsed see chapter 7 FDL Processing Time execute the R FDL Init function to forcibly stop the ongoing write or erase operation To perform Data Flash operation after timeout follow the basic procedure again starting with the R FDL Init function see figure 5 1 FDL Basic Flowchart Thus Initialize the request structure by the user R_FDL_BUSY status_enu of the request structure When this FDL is used with a device the erased area of Data Flash in that target device contains an undefined value Thus you get an undefined value when reading from the erased area To prevent a read operation from being mistakenly conducted supervise write operations to determine the areas to which data has been written Note that you can detect blank state by using a blank check Thus perform a blank check as necessary Before w
49. rding to the function calling conventions for the C compiler package which is used as development environment by the user Then the function is called using a jarl instruction As a result the FDL function s parameters are passed to the FDL as arguments and the required processing is performed Remarks 1 To call the FDL functions offered by the FDL from a user program you should define the following standard header file and include it in that program r_fdl h Standard header file 2 If a FDL function other than the R FDL Init function is called before calling the R FDL Init function proper operation is not guaranteed 6 4 Data Types Below are the data types of the parameters to be specified for calling the FDL functions offered by the FDL Unsigned bitintegers unsigned char uint16_t Unsigned 16 bit integers unsigned short uint32 t Unsigned 32 bit integers unsigned long R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 30 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 6 5 FDL Functions The subsequent sections describe the FDL functions offered by the FDL These functions appear in the following format Description C language format Pre conditions Post conditions Parameters Return values Value Macro name Description Commands Value Macro name Description Reference Member Value Macro name Reference information such as the request structure Sett
50. request for return from the FDL standby state was successfully Meaning accepted R FDL OK Cause Normal operation Action to None be taken Meaning Execution of this R FDL WakeUp function was rejected Cause The FDL has not been initialized or is an invalid state R FDL ERR REJECTED Actionto Stop further Flash operation and investigate the cause of the be taken problem Commands None Reference This function can assign the value below to status enu of the request structure status enu Value Category Description Meaning During command execution Cause Normal operation R FDL BUSY 0x01 Action to Continue operation be taken R01US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 48 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library Settings None Others Flowchart The figure below shows the basic flow of the functions using the power save moder of a device as an example Busy state is checked using status_enu of the request structure Note 1 The HALT mode only See table 4 1 Notes on FDL Architecture Note 2 Busy state is checked after execution of the R_FDL_StandBy function see in figure 6 6 below using the return value of the function Figure 6 6 FDL Standby and FDL Wakeup Normal operation FDL Standby and FDL Wakeup Device operation in power save mode R_FDL_Execute FDL_CMD_WRIT
51. riting data to an area be sure to erase this area Ra You cannot operate the FDL suspend or FDL standby feature concurrently in multiple operations The FDL does not support multitask execution 1 Do not execute the FDL functions during interrupt processing 2 Do not execute the FDL functions from multiple tasks in the OS If you suspend an erase operation and then resume it the erase operation is performed again In this case however the number of erase operations does not increase If the suspend feature is not effective for a FDL function a suspend request is ignored while that function is being executed Once the FDL is set to suspended state it is terminated from suspended state after write operation Some commands such as blank check do not support the suspend feature Even when these commands are executed the library returns FDL suspended state Note For details of the request structure see section 6 2 Request Structure Settings RO1US0063EJ0101_ Rev 1 01 Sep 30 2013 ENESAS Page 23 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library Table 5 4 Notes on the Functional Specifications of the FDL 2 2 The suspend feature disables the following sequences lt lt Disabled sequences gt gt R_FDL_CMD_ERASE command gt FDL suspended state gt R_FDL_CMD_ERASE command R_FDL_CMD_WRITE command gt FDL suspended state gt R_FDL_CMD_ERASE command R_FDL_CMD_WRITE comm
52. rocontrollers e To gain a general understanding of features gt Read this manual in order of the table of contents e For details on the functions of the library gt Refer to section 5 User Interface of this user s manual The mark lt R gt shows major revised points Conventions Data significance Higher order digits to the left and lower order digits to the right Active low representations xxx overscore over pin and signal name Note Footnote for item marked with Note in the text Caution Information requiring particular attention Remark Supplementary information Numeral representation Binary xxxx or xxxxB Decimal xxxx Hexadecimal xxxxH or OxXXXX All trademarks and registered trademarks are the property of their respective owners EEPROM is a registered trademark of Renesas Electronics Corporation RH850 Family Type 01 Data Flash Library Contents Chapter 1 Introduction sucre AA 7 TA COVA iii ia 7 12 Target DEVICES iii E uEEE EE NANA AA 7 1 3 Definition ot Terms iii iia 7 Chapter 2 Hardware Environment cccccccccnnnnncnnnnnccnoncnnnnnannnnnnnnnnnnnnnnnannnnnnenrnnrnnnnananans 8 24 Data PASI AAA oe O cancer esesnecaeasenerresis 8 2 1 1 CPU Operating Frequency Configuration na 9 2 2 Notes on Hardware Environment 2 cccsceeeee cece ee eeeeeeeeee cece eeeeeeaeeneeseeeseeeeeaeeeseseeeseseeeeneesenees 9 Chapter 3 Software Environment cccccccccnnnnnncncncncnonennnanonnn
53. structure packing Xpack 1 of the CC RH compiler options is used accessType enu and status enu become out of alignment by 16 bits To avoid this problem insert dummy data as shown below typedef volatile struct R FDL REQUEST T omitted uint16 t cnt_u16 uint16 t dummy amp Add this r fdl accessType taccessType enu omitted 2 Every time before executing a command check the variables of the request structure and assign values The request structure is accessed by the FDL while command execution is in progress Do not destroy the request structure during command execution If the R_FDL_Handler function is executed again after an error has occurred in status_enu of the request structure the FDL initializes the status enu value to R_FDL_OK R01US0063EJ0101 Rev 1 01 Page 29 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 6 User Interface Type 01 Data Flash Library 6 3 FDL Function Calls This section describes how to call the FDL functions from a user program written in C or assembly language C language When a FDL function is called from a user program in C language in the same way as a normal C function is called the FDL function s parameters are passed to the FDL as arguments and the required processing is performed Assembly language Before a FDL function is called from a user program in assembly language processing such as parameter setup and return address setup is performed acco
54. suspended state making it possible to resume the suspended erase or write operation This return from the FDL suspended state is called FDL resume Timing After the R FDL SuspendRequest function is executed a wait occurs upon one hardware operation the device s operation is divided into several hardware operations That is after that function is executed a delay is introduced before a transition to FDL suspended state See the figure below Example of use lt R gt If data needs to be written for emergency the erase operation currently in progress can be suspended to write that data Flowcharts See the description of R_FDL_SuspendRequest and R FDL ResumeRequest in section 6 5 FDL Functions RO1US0063EJ0101 Rev 1 01 Page 19 of 54 Sep 30 2013 2ENESAS RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library Figure 5 5 Example of FDL Suspend Operation Sequence User application Device hardware Execution of R_FDL_Execute Ju Erase np a Start of 1st block erasure status enu R FDL BUSY Status check only Execution of R_FDL_SuspendRequest return R_FDL_OK status_enu R_FDL_BUSY Execution of R_FDL_Handler z gt gt Suspend control gt Preparation of nee suspend l SUSPEND Execution of suspend Execution of R_FDL_Handler a Execution of R FDL ResumeRequest en i r
55. th a 4 byte boundary Setting 0x0000 0003 4 byte units cnt u16 Example Eight bytes Setting 2 accessType enu The access right is always R FDL ACCESS USER Note Buffer which stores data read from the Data Flash R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 40 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_Handler Description This function continues command operations of the FDL and confirms their termination C language format void R_FDL Handler void Pre conditions The R_FDL_Init function should execute and return R FDL OK TheR FDL Execute function should execute and status_enu of the request structure should be R_FDL_BUSY Note Execution of the R FDL CMD READ command does not need execution of the R_FDL_Handler function Post conditions Repeat the execution of the R_FDL_Handler function until a value other than R_FDL_BUSY is returned Parameters Return values Commands None Reference Reference of this function is described in combination with the R_FDL_Execute function See Reference of the R_FDL_Execute function Settings None RO1US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 41 of 54 RH850 Family Chapter 6 User Interface Type 01 Data Flash Library R_FDL_SuspendRequest Description This function requests the FDL to be suspended while it is running The ongoing write and erase operations are stoppe
56. unctions and it cannot be manipulated by the user directly However data can be read directly by the user program without using the FDL functions The Data Flash cannot be read while a command of the R_FDL_Execute function is being executed Before reading from the Data Flash execute the R_FDL_Handler function to check that the command execution has been completed Confirm the completion of command execution by referring to status_enu of the request structure The FDL can manipulate only Data Flash It cannot rewrite Code Flash Do not stop the supply of input clock to the X1 pin for connection to the main clock oscillator during Data Flash operation Data Flash operation needs the input clock supplied to the X1 pin 4 The device is allowed to enter a power save mode only in the FDL standby state during Data Flash operation To enable a power save mode in the FDL standby state set the FDL standby state and then set the device to 5 the HALT mode The only power save mode that can be set in the FDL standby state is the HALT mode eN The FDL and FCL should not run at the same time Note For details of the request structure see section 6 2 Request Structure Settings R01US0063EJ0101 Rev 1 01 Sep 30 2013 2ENESAS Page 12 of 54 RH850 Family Chapter 5 FDL Function Type 01 Data Flash Library Chapter 5 FDL Function This chapter describes the functional specifications of the FDL required for the user to re
57. unning on a device supported by Type 01 For information about the block structure for the target device refer to the user s manual for the target device Table 2 1 Data Flash Addresses at the Time of FDL Operation Example RH850 F1L with 32 Kbyte Data Flash FDL control address Block size 64 bytes Block No Address RO1US0063EJ0101 Sep 30 2013 Rev 1 01 OxFF20_7FCO OxFF20_7F80 OxFF20_7F40 OxFF20_0140 OxFF20_0100 OxFF20 00CO OxFF20 0080 OxFF20 0040 OxFF20 0000 OxFF20_7FFF OxFF20_7FBF OxFF20 7F7F OxFF20 017F OxFF20 013F OxFF20_00FF OxFF20 00BF OxFF20 007F OxFF20 003F ENESAS 0x0000_7FCO 0x0000_7F80 0x0000_7F40 0x0000_0140 0x0000_0100 0x0000_00CO 0x0000_0080 0x0000_0040 0x0000_0000 0x0000_7FFF 0x0000_7FBF 0x0000_7F7F 0x0000_017F 0x0000_013F 0x0000_00FF 0x0000_00BF 0x0000_007F 0x0000_003F Page 8 of 54 RH850 Family Chapter 2 Hardware Environment Type 01 Data Flash Library 2 1 1 CPU Operating Frequency Configuration To rewrite data flash through the FDL requires configuring the CPU frequency This frequency is used for timing calculation inside the FDL For the procedure to configure the CPU operating frequency see section 6 1 Runtime Settings Also see table 2 2 Notes on Hardware Environment 2 2 Notes on Hardware Environment Below are notes on the hardware environment For details of notes other than No 1 and No 2 below be sure to see the
58. ution R_FDL_GetVersionString End RO1US0063EJ0101 Rev 1 01 Sep 30 2013 ENESAS Page 50 of 54 RH850 Family Chapter 7 FDL Processing Time Type 01 Data Flash Library Chapter 7 FDL Processing Time There are two types of FDL operation processing time 1 FDL function response time and 2 hardware Note execution time Figure 7 1 below shows the relationship between FDL function response time and hardware execution time For details of hardware execution time see the user s manual for the target device Note Hardware execution time is not necessary for FDL functions excluding R_FDL_StandBy that do not need execution of the R FDL Handler function The R_FDL_StandBy function is executed instead of the R FDL Handler function Figure 7 1 FDL Execution Sequence FDL s Processing Time User application Device hardware Execution of R_FDL_Execute l H Erase control Start of 1st Command R FDL BUSY operation l Execution of R_FDL_Handler State check during DF operation End of 1st Command operation sl nd of 1st Command operation 4 R_FDL_BUSY Erase control Start of 2nd Command operation Execution ofR FDL Handler End of 2nd Command Yy operation FDL function response time Hardware execution time RO1US0063EJ0101 Rev 1 01 TEA Sep 30 2013 ENESAS RH850
59. write Data Flash by using the FDL 5 1 FDL Functions Commands of the R_FDL_Execute Function The table below summarizes the FDL functions offered by the FDL Table 5 1 FDL Functions FDL function name Functional overview R FDL Init Initializes the FDL R FDL Execute Starts execution of each command Commands R FDL CMD ERASE R FDL CMD WRITE R FDL CMD BLANKCHECK R FDL CMD READ R FDL Handler Controls the FDL while it is running R FDL SuspendRequest Requests the FDL to suspend R FDL ResumeRequest Requests the FDL to return from suspended state R FDL StandBy Sets the FDL to standby state R FDL WakeUp Returns the FDL from standby state R FDL GetVersionString Obtains FDL version information 5 2 List of Commands With the R FDL Execute function the following commands can be executed Table 5 2 Command Command name Functional overview R FDL CMD WRITE Command Write R FDL CMD ERASE Command Erase R FDL CMD BLANKCHECK Command Blank Check This command reads data from the specified RAM area and writes the specified amount of data into the area starting with the specified address The write area must be erased by executing the R FDL CMD ERASE command in advance This command erases the content of the specified Data Flash blocks The blank check command of this FDL is used to check whether the target area is blank prior to read operation
60. y you resulting from errors in or omissions from the information included herein Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration modification copy or otherwise misappropriation of Renesas Electronics product Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems and s

Download Pdf Manuals

image

Related Search

Related Contents

(Impress\343o de foto de p\341gina inteira)  ASUS F200MA-KX071H  取扱説明書 - エー・アンド・デイ  Sistema para Controle de Obras Públicas  SENSIA® SEDR01, L SEDRL1 - Medtronic Manuals: Region  Descargar  

Copyright © All rights reserved.
Failed to retrieve file