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.
You are viewing an older revision! See the latest version
GR PEACH knowhow database
Information
Japanese version is available in lower part of this page.
このページの後半に日本語版が用意されています.
[other] How to run a program stored in the internal SRAM¶
Access performance to internal SRAM is faster than access performance to serial flash memory. By placing the program in the internal RAM, it is possible to improve the program execution performance of GR-PEACH. The way to run a program stored in the internal SRAM is below:
- Delete mbed library.Then Import mbed-src library.
- Select "mbed" library and delete it as shown below.
- Import mbed-src rev.C library.
Import librarymbed-src
mbed library sources
- Check "Update all libraries to the latest version".
- Get the source code by clicking "Import" button.
- Select "mbed" library and delete it as shown below.
- Overwite or add following files of mbed-src.
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\TOOLCHAIN_ARM_STD\startup_MBRZA1H.s (Overwrite)
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\TOOLCHAIN_ARM_STD\MBRZA1H.sct (Overwrite)
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\mmu_Renesas_RZ_A1.c (Overwrite)
- targets\hal\TARGET_RENESAS\TARGET_RZ_A1H\mbed_overrides.c (Add)
Note¶
Program code is stored in address below. Do not allocate variables to these address.
0x20020000 - 0x200FFFFF
How to change sct file in mbed online compiler¶
You can not edit scr file in mbed online compiler. Please import sct file by the way shown below.
- Click "import" button on mbed compiler.
- Click "Upload" tag.
- Click "browse" button, and select file to upload.
- Select file to import on mbed compiler.
- Click "Import!" button.
[USB]How to change the USB Speed¶
You can switch Hi-Speed or Full-speed by the procedure below.
(define 1:Hi-Speed, define 0:Full Speed)
USBHost
USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h
#define USB_HOST_HISPEED 1 ↓ #define USB_HOST_HISPEED 0
USBDevice
\USBDevice\USBDevice\TARGET_RENESAS\TARGET_RZ_A1H\usb_function_setting.h
#define USB_FUNCTION_HISPEED 1 ↓ #define USB_FUNCTION_HISPEED 0
[USB] How to use the USB1 function of GR-PEACH rev.C¶
You can use the USB1 connector by the procedure below.
(define 0:USB0、define 1:USB1)
USBHost
USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h
#define USB_HOST_CH 0 ↓ #define USB_HOST_CH 1
USBDevice
\USBDevice\USBDevice\TARGET_RENESAS\TARGET_RZ_A1H\usb_function_setting.h
#define USB_FUNCTION_CH 0 ↓ #define USB_FUNCTION_CH 1
Usable settings please refer to the following.
No | USB0 | USB1 | usable |
---|---|---|---|
1 | Host | Device | OK |
2 | Device | Host | OK |
3 | Host | Host | NG |
4 | Device | Device | NG |
If you use the USB0 as USB Host, please close JP3.
If you use the USB1 as USB Host, please supply 5V to USB1 VBUS.
[USB]USBHost Isochronous transfer¶
In board-dependent part of USBHost, GR-PEACH supports isochronous transfer.
USBHost library by mbed official does not support isochronous transfer.
If you use isochronous transfer, please import following library.
Import libraryUSBHost_AddIso
I added the Isochronous to USBHost library. The Isochronous code based on the following. http://developer.mbed.org/users/va009039/code/USBHostC270_example/
Two samples below are the sample of use of the library above.
- USB camera
- This program converts the camera image in JPEG image, and save it to a USB flash memory.
- Note: USBHostC270 is the C270 dedicated driver.
- Note: This porgram set the baud rate of serial to 921600bps.
Target device:C270
Import programUSBHostC270_example_GR-PEACH
supported GR-PEACH original: http://developer.mbed.org/users/va009039/code/USBHostC270_example/ The function of Isochronous has moved to USBHost_AddIso library.
- USB DAC sample
This program will play the file with the extension "abc" in the root directory of the USB flash memory.
(This program supports only file with RIFF format, 48kHz, 16bit, and 2ch.)
Target device:BSHSAU01BK
Import programUSBHostDac_example
This sample will play a ".wav" file of the USB root folder. Only RIFF format, 48kHz, 16bit, 2ch.
[other] 内蔵RAMに格納されたプログラムを実行する方法¶
プログラムを、GR-PEACH標準のシリアルフラッシュメモリよりもアクセス性能の良い内蔵RAMに配置することで、GR-PEACHのプログラム実行性能を向上させることができます。
- mbedライブラリを削除し、mbed-srcライブラリをimportしてください
- mbed-src内の、以下の各ファイルを上書きまたは追加してください
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\TOOLCHAIN_ARM_STD\startup_MBRZA1H.s (上書き)
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\TOOLCHAIN_ARM_STD\MBRZA1H.sct (上書き)
- targets\cmsis\TARGET_RENESAS\TARGET_RZ_A1H\mmu_Renesas_RZ_A1.c (上書き)
- targets\hal\TARGET_RENESAS\TARGET_RZ_A1H\mbed_overrides.c (追加)
注意:¶
RAM実行時、以下のRAM領域はコード領域となります。
変数などのデータは配置しないでください。
0x20020000 - 0x200FFFFF
sctファイルの変更方法¶
sctファイルはmbedコンパイラ上で編集することができません。以下の手法でインポートしてください。
- mbed compiler 上で 「import」をクリックします
- 「Upload」タグをクリックします
- 「参照」をクリックし、アップロードするファイルを選択します
- mbed compiler上でインポートするファイルを選択します
- 「Import!」ボタンをクリックします
[USB]USB Speedの切り替え¶
以下の手順でHi-SpeedとFull Speedの切り替えができます。
(define 1:Hi-Speed、define 0:Full Speed)
USBHost
USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h
#define USB_HOST_HISPEED 1 ↓ #define USB_HOST_HISPEED 0
USBDevice
\USBDevice\USBDevice\TARGET_RENESAS\TARGET_RZ_A1H\usb_function_setting.h
#define USB_FUNCTION_HISPEED 1 ↓ #define USB_FUNCTION_HISPEED 0
[USB]rev.Cボード USB 2ポート設定方法¶
以下の手順で使用するUSBのポートを指定できます。
(define 0:USB0、define 1:USB1)
注意:rev.Cボードのみの機能です。rev.B以前のボードではUSBポートの変更はできません。
USBHost
USBHost\USBHost\TARGET_RENESAS\TARGET_RZ_A1H\usb_host_setting.h
#define USB_HOST_CH 0 ↓ #define USB_HOST_CH 1
USBDevice
\USBDevice\USBDevice\TARGET_RENESAS\TARGET_RZ_A1H\usb_function_setting.h
#define USB_FUNCTION_CH 0 ↓ #define USB_FUNCTION_CH 1
Host、Deviceの組み合わせは下記を参照ください。
No | USB0 | USB1 | 設定可否 |
---|---|---|---|
1 | Host | Device | 可(OK) |
2 | Device | Host | 可(OK) |
3 | Host | Host | 不可(NG) |
4 | Device | Device | 不可(NG) |
USB0をUSB Hostとして使用する場合はJP3をcloseしてください。
USB1をUSB Hostとして使用する場合はUSB1 VBUSに5Vを供給してください。
[USB]USBHost アイソクロナス転送¶
USBHostのボード依存部において、アイソクロナス転送に対応しています。
mbedオフィシャルのUSBHostではアイソクロナス転送のインターフェースが存在しないため、以下のライブラリをご用意しました。
Import libraryUSBHost_AddIso
I added the Isochronous to USBHost library. The Isochronous code based on the following. http://developer.mbed.org/users/va009039/code/USBHostC270_example/
また、上記ライブラリの使用例として、USBカメラとUSB Dacのサンプルを公開しました。
- USBカメラサンプル
カメラの画像をjpegに変換し、USBメモリに保存します。
注意:USBHostC270はc270専用ドライバです。
注意:printfを表示させるためには、PCとのシリアルポート ボー・レートを921600に変更する必要があります。
動作確認デバイス:c270
Import programUSBHostC270_example_GR-PEACH
supported GR-PEACH original: http://developer.mbed.org/users/va009039/code/USBHostC270_example/ The function of Isochronous has moved to USBHost_AddIso library.
- USB Dacサンプル
USBルートフォルダにある拡張子".wav"のファイルを再生します。(RIFF形式、48kHZ、16bit、2chのみ対応)
動作確認デバイス:BSHSAU01BK
Import programUSBHostDac_example
This sample will play a ".wav" file of the USB root folder. Only RIFF format, 48kHz, 16bit, 2ch.