Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.242

Program RH850/U2x Hardware Property Area

In this topic:

Requirements

Programming CSA

Area Switching

Python script and winIDEA workspace examples

Optional Python script examples

 

 

Introduction

The RH850 user manual details a multi-step procedure for modifying Hardware Property areas such as CSA, SSA, and BPAx. To simplify this process, you can use a Python script designed to automate these steps for you.

 

Hardware Property Area on U2x devices consists of seven areas, but the focus here is on the following four:

Configuration Setting Area (CSA)

Security Setting Area (SSA)

Block protection area 0 (BPA0)

Block protection area 1 (BPA1 is not available on smaller devices)

 

Each of these areas are further divided to 2 areas (Area 0 and Area 1) that can be mapped to front or back side address range:

Front side - Contains valid area which cannot be updated (programmed).

Back side - Contains invalid area which can be programmed with new settings.

 

For details please refer to the device User Manual, Chapter 51.3.3 Mapping of Hardware Property Area in Data Flash Memory.

 

The RH850 requires that the entire area intended to be switched (CSA, SSA, BPA, etc.) is fully programmed. When a part of the area is programmed, the associated flag at the beginning of the area is set. If not all flags are set, the area cannot be switched.

When performing a download to the hardware property area, winIDEA erases the back sector and then programs it with the downloaded file. No values are preserved.

 

If the switch operation doesn't succeed, it could be possible that the desired area is not entirely programmed. To check this, refer to the RH850's reference manual and confirm that all flags are set. Another option is to run the enclosed script <area>_compare_front_back.py and check the differences between the front and back sides. If any more differences than desired changes are detected, they could be flags that are not set.

 

 

Requirements

winIDEA 9.21.35 or newer

BlueBox iC5700, iC5000

RH850 Debug Adapter

 

 

Programming CSA

i-icon

The following is an example for programming CSA. For programming BPA follow the same procedure. For SSA please refer to a separate technical note, available on request.

 

To program new settings in Hardware Property Area follow the steps below:

1. Enable Hardware Property Area programming in Hardware  / Options / Programming.

2. Prepare the Program File.

3. Area Switching.

 

Enabling Hardware Property Area programming

To limit the chance of accidental area changes, the Hardware Property Area programming is not enabled in the Hardware menu by default. Open the Hardware / Options and check the Renesas RH850/U2x Hardware Property option to enable programming.

 

Hardware menu

Hardware menu / Options

u2a-hardware-menu
u2a-hardware-menu2

 

Preparing the Program File

Warning_orange

The sample workspace is based on the Renesas Getting Started package. You should familiarize yourself first with this package. Carefully check and double-check with your team that the settings match your requirements.

 

number1

Save the sample winIDEA workspace to a local drive, then open it and edit the OPBT settings if required.

 

number2

Make sure that One-Time Programmable settings - OTPs are not activated. That they are all 0xFFFFFFFF.

 

Warning_orange

If OTPs need to be activated, then they should be prepared in a completely separate HEX file and should be programmed in a separate step after programming the Option Bytes. OTP settings are applied immediately. Therefore, make sure that you program them last! Otherwise, you won’t be able to program the OPBTs.

 

Do not define both OPBT and OTP HEX files in the same Program Files dialog of the workspace. We recommend having a separate workspace for the OTPs for added safety. It does not suffice to have OTPs at the end of the area Program File, or as a separate download file in a block of files, because winIDEA forms a complete download image from all selected files upfront, before programming.

 

A note from the "UM Chapter 47.5.2 OTP (One Time Programmable) Function": OTP can be individually set for each block of the user area and the user boot area of code flash memory. When the OTP setting is made for an area, programming by serial programming and by self programming is prohibited. Once set, the OTP setting cannot be released.

 

number3

Hit Compile and then check the HEX Program File.

 

Number4

If it's OK, perform a regular Download.

 

Number5

The programmed OPBTs should be visible in the Back area together with validation flags.

All flags must be set for the next step - Area Switching - to succeed.

 

 

Area Switching

Front side and Back side will be switched, and new settings will be applied. Changes in settings become effective after TAG Update and release from the reset state. OTP Setting of Configuration Setting Area becomes effective without reset. Valid / Invalid area switching for read access also becomes effective without reset.

 

u2a-check-switch

 

number1

Save the script HWPropertyAreaSwitch.py

 

number2

Open the script. Edit the parameters to only enable CSA switch:

 

inParams['CheckCSA'] = 'true'

inParams['CheckSSA'] = 'false'

inParams['CheckBPA0'] = 'false'

inParams['CheckBPA1'] = 'false'

 

number3

Save it in the same folder as winIDEA workspace.

 

Number4

Select your Python script in Tools  / External Scripts.

 

Number5

Refresh the Watches Window (shortcut F8), check FSWASTAT_0 for the changes, and if all is as expected reset the device to apply the changes.

 

number6

To return back to the previous OPBTs, simply call the script again.

This way it is easy to toggle between the two sets of OPBTs. By performing the switch again, previous settings will be restored.

 

 

Python script and winIDEA workspace examples

Download and unzip the scripts and workspace examples via the link: RH850_U2x_programming.7z

 

In the zipped directory you can find:

HWPropertyAreaSwitch.py

winiDEA workspace Configuration Setting Area (Option Bytes) U2A_OPTBT_REE_GHS

Optional Python script examples listed below

 

Optional Python script examples

Scripts can be used to minimize the chance that something wrong gets programmed to the area.

 

Warning_orange

Use the scripts at your own discretion.

 

Scripts copy the Front side to the Back side:

CSA_copy_front_to_back.py

SSA_copy_front_to_back.py

BPA0_copy_front_to_back.py

BPA1_copy_front_to_back.py

 

Scripts compare the Front side with the Back side and show differences:

CSA_compare_front_back.py

SSA_compare_front_back.py

BPA0_compare_front_back.py

BPA1_compare_front_back.py

 

Copyright © 2024 TASKING Germany GmbH