HOWTO: Program Serial RCON using S32 Debug Probe

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO: Program Serial RCON using S32 Debug Probe

HOWTO: Program Serial RCON using S32 Debug Probe

This document details the steps to program external EEPROM with the 32 reset configuration bits in support of the 'Boot from serial RCON' method detailed in the device reference manual. The Python scripts used for this task are designed and tested to work on the EVBs, where EEPROM hardware is connected via I2C.(Serial EEPROM is not implemented on all boards).

 

The RCON can be set by the following: 

 

  1. Fuses (internal to the device) 
  2. Parallel (GPIO pins/DIP Switches on EVB) 
  3. Serial (EEPROM connected via I2C) 

 

The Serial option can be programmed using a debug probe connected via JTAG. This enables the RCON to be controlled remotely, assuming the debug probe is setup to allow remote connections. 

The images shown throughout this document are of the S32G274A device implementation and are provided for illustration purposes.

             

Preparation 

 

  1. Install S32 Design Studio IDE 
  2. Use the S32DS Extensions and Updates menu to install the Development

Package for the device subject to debugging. This is important as the

Development Packages add the S32 Debugger support which provides access to the EEPROM programming capabilities via I2C of the S32 Debug Probe. 

  1. Connect the S32 Debug Probe to the EVB and the host PC containing S32 Design Studio installation. 
  2. Set BOOTMOD pins to boot from RCON 
    DanielBarbu_0-1727701984224.png

     

  3. Set BOOT_CFG[8]=1 on the EVB, for serial RCON mode
    DanielBarbu_1-1727702012683.png

     

Procedure 

 

Depending on the way the device used and how the {device name}_i2c_RCON.py is edited, user must use the old procedure on the new one. Both detailed below.

To choose between the Old procedure and the new procedure, you must check in the {device_name}_i2c_RCON.py if variables like

INTERACTIVE_MODE” and “RCON_DATA” exist.

The {device_name}_i2c_RCON.py can be found in:

{INSTALL_DIR}…S32DS/tools/S32Debugger/Debugger/scripts/{device_name}/ {device_name_part_name}_i2c_RCON.py

If the variables exist, please use the old procedure. If the variables were removed, please use the new procedure.

I.  Old procedure ( If “INTERACTIVE_MODE” variable still exists)

 

  1. Open cmd window to the S32 Debugger folder where the device-specific scripts are located. ../S32Debugger/Debugger/Scripts/{device_name/part_number}
  2. Set Python path so correct version is used (if not already set in env vars)

 

set
PYTHONPATH=C:\NXP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7;C:\N XP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages

 

  1. Edit the python script to adjust the value to be programmed to RCON, {device_name}_i2c_RCON.py.

Note: The listed examples show only the minimum values required to configure each of the external memory types. Additional settings may be required for your specific application.

 

  1. Adjust RCON_DATA for the configuration you wish to program.
  2. Do not adjust RCON_ADDR.
  3. Adjust S32DBG_IP for the IP address of your S32 Debug Probe.
  4. Adjust INTERACTIVE_MODE
  5. i. Set True, if desired to be prompted in the command window to enter RCON_DATA      ii. Set False, if desried to have script automatically enter RCON_DATA, based on the value set     within the file.
  6. Adjust _SOC_NAME as appropriate for the specific device you are using. The valid options are defined in {device_name}_context.py
  1. Enter the command to start GDB, passing in the RCON Python script:

 

Windows OS:

../ S32DS\tools\gdb-arm\arm32-eabi\bin/arm-none-eabi-gdb-py.exe -x

{device_name}_i2c_RCON.py

OR

../ S32DS\tools\gdb-arm\arm64-eabi\bin/arm-none-eabi-gdb-py.exe -x

{device_name}_i2c_RCON.py

Linux OS:

arm-none-eabi-gdb-py -x {device_name}_i2c_RCON.py

DanielBarbu_2-1727702132471.png

 

  1. If everything worked properly, then the value you programmed will be displated to the screen.
    DanielBarbu_3-1727702173392.png

     

  1. To exit GDB, enter ‘quit’.

II.  New Procedure ( If “INTERACTIVE_MODE” variable was deleted)

 

  1. Set Python path so correct version is used (if not already set in env vars) 

set
PYTHONPATH=C:\NXP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7;C:\N XP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages 

  1. Start GDB Server. (…\S32Debugger\Debugger\Server\gta\gta.exe)
    DanielBarbu_4-1727702233412.png

     

  2. Start Command Prompt and enter the command to start GDB with python:

Example:

 

C:\NXP\S32DS.3.5_230912_devpck\S32DS\tools\gdb-arm\arm32eabi\bin\arm-none-eabi-gdb-py.exe

Linux OS: arm-none-eabi-gdb-py  

DanielBarbu_5-1727702254435.png

 

  1. In s32rcon.py

( C:\NXP\S32DS.3.5_230912_devpck\S32DS\tools\S32Debugger\Deb ugger\scripts\gdb_extensions\rcon\s32rcon.py

  1. Edit connection parameters (Probe IP, GDB server port, JTAG speed, etc.)
  2. Edit _RCON_SCRIPT parameter with absolute path to the desired I2C RCON script for the desired board:

Example:

_RCON_SCRIPT = "

C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Deb ugger/scripts/s32g2xx/ s32g274a_i2c_RCON.py"

     c. Source s32rcon.py in GDB.

Example:

source

C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Deb ugger/scripts/gdb_extensions/rcon/s32rcon.py

    d. Run command py rcon() in GDB.

OBS:  Steps a, b can be done after c directly from GDB, using GDB py commands:

Examples: 

py _GDB_SERVER_PORT=45000  py

_RCON_SCRIPT="C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Debu gger/scripts/s32g2xx/ s32g274a_i2c_RCON.py"

DanielBarbu_6-1727702279041.png

 

  1. User can now use the available commands, like rcon_help, rcon_read, rcon_write to interact with the EEPROM.

 

  1. User can write [command] -h for more information and mandatory parameters of the command.
DanielBarbu_7-1727702298552.pngDanielBarbu_8-1727702312607.png

 

  1. User can write ‘quit’ to exit the S32 RCON services.
No ratings
Version history
Last update:
a week ago
Updated by: