Renesas


Renesas Electronics Corporation (TSE: 6723), the world's number one supplier of microcontrollers, is a premier supplier of advanced semiconductor solutions including microcontrollers, SoC solutions and a broad range of analog and power devices.

Exporting to GCC ARM

Environment

/media/uploads/RyoheiHagimoto/make-cmsisdap-component.png

Generate elf file

Build GCC development environment

Install GCC ARM embedded

  1. Go to GCC ARM embedded.
  2. Download installer of version4.9 2015 q3 from the above page.
  3. Launch GCC ARM embedded install wizard.
  4. Select language.
    /media/uploads/RyoheiHagimoto/gccarm_inst_1.png
  5. Push "Next>".
    /media/uploads/RyoheiHagimoto/gccarm_inst_2.png
  6. Push "I accept the terms of the license agreement" and "Next>"
    /media/uploads/RyoheiHagimoto/gccarm_inst_3.png
  7. Push "Next>".
    /media/uploads/RyoheiHagimoto/gccarm_inst_4.png
  8. Push "Next>".
    /media/uploads/RyoheiHagimoto/gccarm_inst_5.png
  9. Check "Add path to environment variable", and push "Finish>".
    /media/uploads/RyoheiHagimoto/gccarm_inst_6.png

Install Cygwin

If your environment is windows, you need to install "make.exe" and add make.exe to path.
If your environment is not windows, skip this section.

  1. Go to cygwin.
  2. Click "Install Cygwin"
    /media/uploads/RyoheiHagimoto/cygwin_site.png
  3. Click setup.exe
    /media/uploads/RyoheiHagimoto/cygwin_site22.png
  4. Launch setup.exe
  5. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_1.png
  6. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_2.png
  7. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_3.png
  8. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_4.png
  9. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_5.png
  10. Select download site, and push "Next>"
    /media/uploads/RyoheiHagimoto/cygwin_inst_6.png
  11. Input "make" int the Search box, DO NOT input enter. Expand "Devel", and check "make: The GNU version of the 'make' utility.", Push "Next>"
    /media/uploads/RyoheiHagimoto/cygwin_inst_71.png
  12. Push "Next>".
    /media/uploads/RyoheiHagimoto/cygwin_inst_8.png
  13. Push "Finish >".
    /media/uploads/RyoheiHagimoto/cygwin_inst_9.png
  14. Add path below, refer here.
;C:\Cygein\bin

Exporting to GCC ARM

  1. Goto Mbed compiler.
  2. Right click at the program you want to export.
  3. Select "Export Program"
    /media/uploads/RyoheiHagimoto/export1.png
  4. Select "Renesas GR-PEACH" for Export Target
    Select "GCC (Arm Embedded)" for Export Toolchain
    Push "Export"
    /media/uploads/RyoheiHagimoto/export2.png
  5. Expand zip file.

Build Process

  1. Launch command prompt.
  2. Enter "make" command at the directory includes "Makefile".

Make

$ cd /my/program/directory/
$ ls
main.cpp  Makefile  mbed  mbed.lib
 
$ make
arm-none-eabi-g++ -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -DTARGET_LPC1768 -DTOOLCHAIN_GCC_CS -DNDEBUG -std=gnu++98 -I./mbed -I./mbed/LPC1768 -I./mbed/LPC1768/GCC_CS  -o main.o main.cpp
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Tmbed/LPC1768/GCC_CS/LPC1768.ld -L./mbed -L./mbed/LPC1768 -L./mbed/LPC1768/GCC_CS  -o my_program.elf main.o mbed/LPC1768/GCC_CS/startup_LPC17xx.o mbed/LPC1768/GCC_CS/sys.o mbed/LPC1768/GCC_CS/cmsis_nvic.o mbed/LPC1768/GCC_CS/core_cm3.o mbed/LPC1768/GCC_CS/system_LPC17xx.o -lmbed -lcapi -lstdc++ -lsupc++ -lm -lc -lgcc -lmbed -lcapi -lstdc++ -lsupc++ -lm -lc -lgcc
arm-none-eabi-objcopy -O binary my_program.elf my_program.bin
 
$ ls
main.cpp  main.o  Makefile  mbed  mbed.lib  my_program.bin  my_program.elf

Install Windows serial driver

Install latest Windows Serial Port Driver to setup CMSIS-DAP from the link below:
https://mbed.org/handbook/Windows-serial-configuration

Download DS-5 Starter Kit for Renesas RZ

  1. Download DS-5 v5.19, and install. (You need an Arm account for donwloading.)
    ・Windows 32bit
    ・Windows 64bit
    ・Linux 32bit
    ・Linux 64bit
  2. To get your activation code of DS-5, goto DS-5 for Renesas RZ and click "Get started with free activation code" under "DS-5 Starter Kit for Renesas RZ".
    /media/uploads/RyoheiHagimoto/activation.png
  3. Launch DS-5 and clink "Help" and select "Arm License Manager".
    /media/uploads/RyoheiHagimoto/arm_license_manager.png
  4. Arm License Manager is displayed, Click "Add license"
  5. Input your activation code, and click "Next"
    /media/uploads/RyoheiHagimoto/ds5-lic1.png
  6. Select Host ID, and click "Next"
    /media/uploads/RyoheiHagimoto/ds5-lic2.png
  7. Fill account boxes , and click "Finish"
    /media/uploads/RyoheiHagimoto/ds5-lic3.png

Build of DS-5 environment

Add DS-5 configuration for the target

Add Mbed RZ/A1H configuration into DS-5.
configdb_v519-20150327.zip

  1. Download above zip file and extract it
  2. Start DS-5
  3. From menu, select [Window] [Preference] and [DS-5] [Configuration Database] press [Add] button
    /media/uploads/RyoheiHagimoto/preferences.png
  4. Browse the configdb folder which you extracted and set configuration name e.g. mbed
    /media/uploads/RyoheiHagimoto/add_config.png
  5. Press [Rebuild database] button
  6. Press [OK] button to close the dialog

Create debug configuration

1. Connection tab

  • From menu in C/C++ perspective or DS-5 debug perspective , select [Run] [Debug Configurations...]
  • Create new configuration from [DS-5 Debugger]
  • Select target: Renesas - RZ/A1H R7S721001 - Bare Metal Debug - Debug Cortex-A9
    /media/uploads/RyoheiHagimoto/debug_configurations.png
  • Set Target Connection to Mbed CMSIS-DAP
  • Select CMSIS-DAP device from [Browse...] of the Connections
    /media/uploads/RyoheiHagimoto/cmsis-dap_e.png

2. File tab

  • Select .elf file of the test program in the Target Configuration
    /media/uploads/RyoheiHagimoto/file_2e.png

3. Debugger tab

  • Run Control : Debug from entry point
  • Check "Run target initialization debugger script (.ds / .py) " and select the mbedload.ds in the "configdb_v519-20150327.zip" file
  • Check "Execute debugger commands" and put following commands:

interrupt
info flash
flash load "C:\Users\toywat01\Documents\GitHub\mbed_private_renesas\build\test\RZ_A1H\ARM\MBED_BLINKY\blinky.elf"
delete breakpoints
reset

/media/uploads/RyoheiHagimoto/debug_setting_e2.png

4. Debug

  • Press [Apply] and [Debug] button to start debug session /media/uploads/RyoheiHagimoto/debug_e2.png

How to debug without downloading elf file

Following procedure above, you can debug with source code. But there might be issue that flash-programming takes long time.

Then following procedure fixes issue above.

  1. Copy bin file to Mbed drive.
  2. Unheck "Execute debugger commands" and put following commands:
    at "Debugger" tab in "Debugger configuration" dialog.

All wikipages