mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
update build for ra8m1: usbfs work, but usbhs not working just yet. Probably missing configuration or clock setup
This commit is contained in:
parent
c79890c359
commit
0785daecc1
@ -2,22 +2,15 @@ set(CMAKE_SYSTEM_PROCESSOR cortex-m33 CACHE INTERNAL "System Processor")
|
|||||||
set(MCU_VARIANT ra6m5)
|
set(MCU_VARIANT ra6m5)
|
||||||
|
|
||||||
set(JLINK_DEVICE R7FA6M5BH)
|
set(JLINK_DEVICE R7FA6M5BH)
|
||||||
#set(JLINK_OPTION "-USB 000831915224")
|
set(JLINK_OPTION "-USB 000831915224")
|
||||||
|
|
||||||
# Device port default to PORT1 Highspeed
|
# device default to PORT 1 High Speed
|
||||||
if (NOT DEFINED PORT)
|
if (NOT DEFINED RHPORT_DEVICE)
|
||||||
set(PORT 1)
|
set(RHPORT_DEVICE 1)
|
||||||
|
endif()
|
||||||
|
if (NOT DEFINED RHPORT_HOST)
|
||||||
|
set(RHPORT_HOST 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Host port will be the other port
|
|
||||||
set(HOST_PORT $<NOT:${PORT}>)
|
|
||||||
|
|
||||||
function(update_board TARGET)
|
function(update_board TARGET)
|
||||||
target_compile_definitions(${TARGET} PUBLIC
|
|
||||||
BOARD_TUD_RHPORT=${PORT}
|
|
||||||
BOARD_TUH_RHPORT=${HOST_PORT}
|
|
||||||
# port 0 is fullspeed, port 1 is highspeed
|
|
||||||
BOARD_TUD_MAX_SPEED=$<IF:${PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
|
|
||||||
BOARD_TUH_MAX_SPEED=$<IF:${HOST_PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
|
|
||||||
)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -5,6 +5,7 @@ MCU_VARIANT = ra6m5
|
|||||||
JLINK_DEVICE = R7FA6M5BH
|
JLINK_DEVICE = R7FA6M5BH
|
||||||
|
|
||||||
# Port 1 is highspeed
|
# Port 1 is highspeed
|
||||||
PORT ?= 1
|
RHPORT_DEVICE ?= 1
|
||||||
|
RHPORT_HOST ?= 0
|
||||||
|
|
||||||
flash: flash-jlink
|
flash: flash-jlink
|
||||||
|
@ -20,9 +20,7 @@ void OnProjectLoad (void) {
|
|||||||
Project.SetTraceSource ("Trace Pins");
|
Project.SetTraceSource ("Trace Pins");
|
||||||
Project.SetTracePortWidth (4);
|
Project.SetTracePortWidth (4);
|
||||||
|
|
||||||
//File.Open ("../../../../../../examples/device/cdc_msc/cmake-build-ra6m5/cdc_msc.elf");
|
File.Open ("../../../../../../examples/cmake-build-ra6m5_ek/device/cdc_msc/cdc_msc.elf");
|
||||||
//File.Open ("../../../../../../examples/dual/cmake-build-ra6m5/host_hid_to_device_cdc/host_hid_to_device_cdc.elf");
|
|
||||||
File.Open ("../../../../../../examples/cmake-build-ra6m5/host/cdc_msc_hid/cdc_msc_hid.elf");
|
|
||||||
}
|
}
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -4,5 +4,13 @@ set(MCU_VARIANT ra8m1)
|
|||||||
set(JLINK_DEVICE R7FA8M1AH)
|
set(JLINK_DEVICE R7FA8M1AH)
|
||||||
#set(JLINK_OPTION "-USB 001083115236")
|
#set(JLINK_OPTION "-USB 001083115236")
|
||||||
|
|
||||||
|
# device default to PORT 1 High Speed
|
||||||
|
if (NOT DEFINED RHPORT_DEVICE)
|
||||||
|
set(RHPORT_DEVICE 1)
|
||||||
|
endif()
|
||||||
|
if (NOT DEFINED RHPORT_HOST)
|
||||||
|
set(RHPORT_HOST 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
function(update_board TARGET)
|
function(update_board TARGET)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
11
hw/bsp/ra/boards/ra8m1_ek/board.mk
Normal file
11
hw/bsp/ra/boards/ra8m1_ek/board.mk
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CPU_CORE = cortex-m85
|
||||||
|
MCU_VARIANT = ra8m1
|
||||||
|
|
||||||
|
# For flash-jlink target
|
||||||
|
JLINK_DEVICE = R7FA8M1AH
|
||||||
|
|
||||||
|
# Port 1 is highspeed
|
||||||
|
RHPORT_DEVICE ?= 1
|
||||||
|
RHPORT_HOST ?= 0
|
||||||
|
|
||||||
|
flash: flash-jlink
|
BIN
hw/bsp/ra/boards/ra8m1_ek/ozone/Renesas_RA8_TracePins.pex
Normal file
BIN
hw/bsp/ra/boards/ra8m1_ek/ozone/Renesas_RA8_TracePins.pex
Normal file
Binary file not shown.
231
hw/bsp/ra/boards/ra8m1_ek/ozone/ra8m1.jdebug
Normal file
231
hw/bsp/ra/boards/ra8m1_ek/ozone/ra8m1.jdebug
Normal file
@ -0,0 +1,231 @@
|
|||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* OnProjectLoad
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Project load routine. Required.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void OnProjectLoad (void) {
|
||||||
|
Project.SetTraceSource ("Trace Pins");
|
||||||
|
Project.SetDevice ("R7FA8M1AH");
|
||||||
|
Project.SetHostIF ("USB", "");
|
||||||
|
Project.SetTargetIF ("SWD");
|
||||||
|
Project.SetTIFSpeed ("50 MHz");
|
||||||
|
|
||||||
|
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M85F.svd");
|
||||||
|
Project.AddSvdFile ("../../../../../../../cmsis-svd-data/data/Renesas/R7FA6M5BH.svd");
|
||||||
|
|
||||||
|
File.Open ("../../../../../../examples/cmake-build-ra8m1_ek/device/cdc_msc/cdc_msc.elf");
|
||||||
|
}
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* BeforeTargetConnect
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void BeforeTargetConnect (void) {
|
||||||
|
// Trace pin init is done by J-Link script file as J-Link script files are IDE independent
|
||||||
|
//Project.SetJLinkScript("../../../debug.jlinkscript");
|
||||||
|
Project.SetJLinkScript ("$(ProjectDir)/Renesas_RA8_TracePins.pex");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetConnect
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void AfterTargetConnect (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* TargetDownload
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Replaces the default program download routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void TargetDownload (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* BeforeTargetDownload
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void BeforeTargetDownload (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetDownload
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
* The default implementation initializes SP and PC to reset values.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void AfterTargetDownload (void) {
|
||||||
|
_SetupTarget();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* BeforeTargetDisconnect
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void BeforeTargetDisconnect (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetDisconnect
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void AfterTargetDisconnect (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetHalt
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void AfterTargetHalt (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* BeforeTargetResume
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void BeforeTargetResume (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* OnSnapshotLoad
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Called upon loading a snapshot. Optional.
|
||||||
|
*
|
||||||
|
* Additional information
|
||||||
|
* This function is used to restore the target state in cases
|
||||||
|
* where values cannot simply be written to the target.
|
||||||
|
* Typical use: GPIO clock needs to be enabled, before
|
||||||
|
* GPIO is configured.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void OnSnapshotLoad (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* OnSnapshotSave
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Called upon saving a snapshot. Optional.
|
||||||
|
*
|
||||||
|
* Additional information
|
||||||
|
* This function is usually used to save values of the target
|
||||||
|
* state which can either not be trivially read,
|
||||||
|
* or need to be restored in a specific way or order.
|
||||||
|
* Typically use: Memory Mapped Registers,
|
||||||
|
* such as PLL and GPIO configuration.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void OnSnapshotSave (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* OnError
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Called when an error occurred. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void OnError (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterProjectLoad
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* After Project load routine. Optional.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
//void AfterProjectLoad (void) {
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* _SetupTarget
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Setup the target.
|
||||||
|
* Called by AfterTargetReset() and AfterTargetDownload().
|
||||||
|
*
|
||||||
|
* Auto-generated function. May be overridden by Ozone.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void _SetupTarget(void) {
|
||||||
|
unsigned int SP;
|
||||||
|
unsigned int PC;
|
||||||
|
unsigned int VectorTableAddr;
|
||||||
|
|
||||||
|
VectorTableAddr = Elf.GetBaseAddr();
|
||||||
|
//
|
||||||
|
// Set up initial stack pointer
|
||||||
|
//
|
||||||
|
SP = Target.ReadU32(VectorTableAddr);
|
||||||
|
if (SP != 0xFFFFFFFF) {
|
||||||
|
Target.SetReg("SP", SP);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Set up entry point PC
|
||||||
|
//
|
||||||
|
PC = Elf.GetEntryPointPC();
|
||||||
|
if (PC != 0xFFFFFFFF) {
|
||||||
|
Target.SetReg("PC", PC);
|
||||||
|
} else {
|
||||||
|
Util.Error("Project script error: failed to set up entry point PC", 1);
|
||||||
|
}
|
||||||
|
}
|
@ -11,8 +11,8 @@
|
|||||||
#define BSP_CFG_PLL_FREQUENCY_HZ (960000000) /* PLL 960000000Hz */
|
#define BSP_CFG_PLL_FREQUENCY_HZ (960000000) /* PLL 960000000Hz */
|
||||||
#define BSP_CFG_PLODIVP (BSP_CLOCKS_PLL_DIV_2) /* PLL1P Div /2 */
|
#define BSP_CFG_PLODIVP (BSP_CLOCKS_PLL_DIV_2) /* PLL1P Div /2 */
|
||||||
#define BSP_CFG_PLL1P_FREQUENCY_HZ (480000000) /* PLL1P 480000000Hz */
|
#define BSP_CFG_PLL1P_FREQUENCY_HZ (480000000) /* PLL1P 480000000Hz */
|
||||||
#define BSP_CFG_PLODIVQ (BSP_CLOCKS_PLL_DIV_2) /* PLL1Q Div /2 */
|
#define BSP_CFG_PLODIVQ (BSP_CLOCKS_PLL_DIV_4) /* PLL1Q Div /4 */
|
||||||
#define BSP_CFG_PLL1Q_FREQUENCY_HZ (480000000) /* PLL1Q 480000000Hz */
|
#define BSP_CFG_PLL1Q_FREQUENCY_HZ (240000000) /* PLL1Q 240000000Hz */
|
||||||
#define BSP_CFG_PLODIVR (BSP_CLOCKS_PLL_DIV_2) /* PLL1R Div /2 */
|
#define BSP_CFG_PLODIVR (BSP_CLOCKS_PLL_DIV_2) /* PLL1R Div /2 */
|
||||||
#define BSP_CFG_PLL1R_FREQUENCY_HZ (480000000) /* PLL1R 480000000Hz */
|
#define BSP_CFG_PLL1R_FREQUENCY_HZ (480000000) /* PLL1R 480000000Hz */
|
||||||
#define BSP_CFG_PLL2_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* PLL2 Disabled */
|
#define BSP_CFG_PLL2_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* PLL2 Disabled */
|
||||||
@ -31,8 +31,8 @@
|
|||||||
#define BSP_CFG_SPICLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* SPICLK Disabled */
|
#define BSP_CFG_SPICLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* SPICLK Disabled */
|
||||||
#define BSP_CFG_CANFDCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CANFDCLK Disabled */
|
#define BSP_CFG_CANFDCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CANFDCLK Disabled */
|
||||||
#define BSP_CFG_I3CCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* I3CCLK Disabled */
|
#define BSP_CFG_I3CCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* I3CCLK Disabled */
|
||||||
#define BSP_CFG_UCK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* UCK Disabled */
|
#define BSP_CFG_UCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL1Q) /* UCK Src: PLL1Q */
|
||||||
#define BSP_CFG_U60CK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* U60CK Disabled */
|
#define BSP_CFG_U60CK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL1P) /* U60CK Src: PLL1P */
|
||||||
#define BSP_CFG_OCTA_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* OCTASPICLK Disabled */
|
#define BSP_CFG_OCTA_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* OCTASPICLK Disabled */
|
||||||
#define BSP_CFG_CPUCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CPUCLK Div /1 */
|
#define BSP_CFG_CPUCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CPUCLK Div /1 */
|
||||||
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* ICLK Div /2 */
|
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* ICLK Div /2 */
|
||||||
@ -51,6 +51,6 @@
|
|||||||
#define BSP_CFG_CANFDCLK_DIV (BSP_CLOCKS_CANFD_CLOCK_DIV_8) /* CANFDCLK Div /8 */
|
#define BSP_CFG_CANFDCLK_DIV (BSP_CLOCKS_CANFD_CLOCK_DIV_8) /* CANFDCLK Div /8 */
|
||||||
#define BSP_CFG_I3CCLK_DIV (BSP_CLOCKS_I3C_CLOCK_DIV_3) /* I3CCLK Div /3 */
|
#define BSP_CFG_I3CCLK_DIV (BSP_CLOCKS_I3C_CLOCK_DIV_3) /* I3CCLK Div /3 */
|
||||||
#define BSP_CFG_UCK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* UCK Div /5 */
|
#define BSP_CFG_UCK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* UCK Div /5 */
|
||||||
#define BSP_CFG_U60CK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* U60CK Div /5 */
|
#define BSP_CFG_U60CK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_8) /* U60CK Div /8 */
|
||||||
#define BSP_CFG_OCTA_DIV (BSP_CLOCKS_OCTA_CLOCK_DIV_4) /* OCTASPICLK Div /4 */
|
#define BSP_CFG_OCTA_DIV (BSP_CLOCKS_OCTA_CLOCK_DIV_4) /* OCTASPICLK Div /4 */
|
||||||
#endif /* BSP_CLOCK_CFG_H_ */
|
#endif /* BSP_CLOCK_CFG_H_ */
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
<node id="board.clock.pll.display" option="board.clock.pll.display.value"/>
|
<node id="board.clock.pll.display" option="board.clock.pll.display.value"/>
|
||||||
<node id="board.clock.pll1p.div" option="board.clock.pll1p.div.2"/>
|
<node id="board.clock.pll1p.div" option="board.clock.pll1p.div.2"/>
|
||||||
<node id="board.clock.pll1p.display" option="board.clock.pll1p.display.value"/>
|
<node id="board.clock.pll1p.display" option="board.clock.pll1p.display.value"/>
|
||||||
<node id="board.clock.pll1q.div" option="board.clock.pll1q.div.2"/>
|
<node id="board.clock.pll1q.div" option="board.clock.pll1q.div.4"/>
|
||||||
<node id="board.clock.pll1q.display" option="board.clock.pll1q.display.value"/>
|
<node id="board.clock.pll1q.display" option="board.clock.pll1q.display.value"/>
|
||||||
<node id="board.clock.pll1r.div" option="board.clock.pll1r.div.2"/>
|
<node id="board.clock.pll1r.div" option="board.clock.pll1r.div.2"/>
|
||||||
<node id="board.clock.pll1r.display" option="board.clock.pll1r.display.value"/>
|
<node id="board.clock.pll1r.display" option="board.clock.pll1r.display.value"/>
|
||||||
@ -182,8 +182,8 @@
|
|||||||
<node id="board.clock.spiclk.source" option="board.clock.spiclk.source.disabled"/>
|
<node id="board.clock.spiclk.source" option="board.clock.spiclk.source.disabled"/>
|
||||||
<node id="board.clock.canfdclk.source" option="board.clock.canfdclk.source.disabled"/>
|
<node id="board.clock.canfdclk.source" option="board.clock.canfdclk.source.disabled"/>
|
||||||
<node id="board.clock.i3cclk.source" option="board.clock.i3cclk.source.disabled"/>
|
<node id="board.clock.i3cclk.source" option="board.clock.i3cclk.source.disabled"/>
|
||||||
<node id="board.clock.uck.source" option="board.clock.uck.source.disabled"/>
|
<node id="board.clock.uck.source" option="board.clock.uck.source.pll1q"/>
|
||||||
<node id="board.clock.u60ck.source" option="board.clock.u60ck.source.disabled"/>
|
<node id="board.clock.u60ck.source" option="board.clock.u60ck.source.pll1p"/>
|
||||||
<node id="board.clock.octaspiclk.source" option="board.clock.octaspiclk.source.disabled"/>
|
<node id="board.clock.octaspiclk.source" option="board.clock.octaspiclk.source.disabled"/>
|
||||||
<node id="board.clock.cpuclk.div" option="board.clock.cpuclk.div.1"/>
|
<node id="board.clock.cpuclk.div" option="board.clock.cpuclk.div.1"/>
|
||||||
<node id="board.clock.iclk.div" option="board.clock.iclk.div.2"/>
|
<node id="board.clock.iclk.div" option="board.clock.iclk.div.2"/>
|
||||||
@ -202,7 +202,7 @@
|
|||||||
<node id="board.clock.canfdclk.div" option="board.clock.canfdclk.div.8"/>
|
<node id="board.clock.canfdclk.div" option="board.clock.canfdclk.div.8"/>
|
||||||
<node id="board.clock.i3cclk.div" option="board.clock.i3cclk.div.3"/>
|
<node id="board.clock.i3cclk.div" option="board.clock.i3cclk.div.3"/>
|
||||||
<node id="board.clock.uck.div" option="board.clock.uck.div.5"/>
|
<node id="board.clock.uck.div" option="board.clock.uck.div.5"/>
|
||||||
<node id="board.clock.u60ck.div" option="board.clock.u60ck.div.5"/>
|
<node id="board.clock.u60ck.div" option="board.clock.u60ck.div.8"/>
|
||||||
<node id="board.clock.octaspiclk.div" option="board.clock.octaspiclk.div.4"/>
|
<node id="board.clock.octaspiclk.div" option="board.clock.octaspiclk.div.4"/>
|
||||||
<node id="board.clock.cpuclk.display" option="board.clock.cpuclk.display.value"/>
|
<node id="board.clock.cpuclk.display" option="board.clock.cpuclk.display.value"/>
|
||||||
<node id="board.clock.iclk.display" option="board.clock.iclk.display.value"/>
|
<node id="board.clock.iclk.display" option="board.clock.iclk.display.value"/>
|
||||||
@ -261,6 +261,14 @@
|
|||||||
<description>Board support package for RA8M1 - Events</description>
|
<description>Board support package for RA8M1 - Events</description>
|
||||||
<originalPack>Renesas.RA_mcu_ra8m1.5.6.0.pack</originalPack>
|
<originalPack>Renesas.RA_mcu_ra8m1.5.6.0.pack</originalPack>
|
||||||
</component>
|
</component>
|
||||||
|
<component apiversion="" class="HAL Drivers" condition="" group="all" subgroup="r_usb_basic" variant="" vendor="Renesas" version="5.6.0">
|
||||||
|
<description>USB Basic</description>
|
||||||
|
<originalPack>Renesas.RA.5.6.0.pack</originalPack>
|
||||||
|
</component>
|
||||||
|
<component apiversion="" class="HAL Drivers" condition="" group="all" subgroup="r_usb_pcdc" variant="" vendor="Renesas" version="5.6.0">
|
||||||
|
<description>USB Peripheral Communications Device Class</description>
|
||||||
|
<originalPack>Renesas.RA.5.6.0.pack</originalPack>
|
||||||
|
</component>
|
||||||
</raComponentSelection>
|
</raComponentSelection>
|
||||||
<raElcConfiguration/>
|
<raElcConfiguration/>
|
||||||
<raIcuConfiguration/>
|
<raIcuConfiguration/>
|
||||||
@ -273,9 +281,57 @@
|
|||||||
<property id="module.driver.ioport.elc_trigger_ioport4" value="_disabled"/>
|
<property id="module.driver.ioport.elc_trigger_ioport4" value="_disabled"/>
|
||||||
<property id="module.driver.ioport.pincfg" value="g_bsp_pin_cfg"/>
|
<property id="module.driver.ioport.pincfg" value="g_bsp_pin_cfg"/>
|
||||||
</module>
|
</module>
|
||||||
|
<module id="module.driver.pcdc_on_usb.216998869">
|
||||||
|
<property id="module.driver.pcdc.name" value="g_pcdc0"/>
|
||||||
|
</module>
|
||||||
|
<module id="module.driver.basic_on_usb.877233012">
|
||||||
|
<property id="module.driver.basic.name" value="g_basic1"/>
|
||||||
|
<property id="module.driver.usb_basic.usb_mode" value="module.driver.usb_basic.usb_mode.host"/>
|
||||||
|
<property id="module.driver.usb_basic.usb_speed" value="module.driver.usb_basic.usb_speed.hs"/>
|
||||||
|
<property id="module.driver.usb_basic.usb_modulenumber" value="module.driver.usb_basic.usb_modulenumber.1"/>
|
||||||
|
<property id="module.driver.usb_basic.usb_classtype" value="module.driver.usb_basic.usb_classtype.pcdc"/>
|
||||||
|
<property id="module.driver.usb_basic.p_usb_reg" value="g_usb_descriptor"/>
|
||||||
|
<property id="module.driver.usb_basic.complience_cb" value="NULL"/>
|
||||||
|
<property id="module.driver.usb_basic.ipl" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.ipl_r" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.ipl_d0" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.ipl_d1" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.hsipl" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.hsipl_d0" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.hsipl_d1" value="board.icu.common.irq.priority12"/>
|
||||||
|
<property id="module.driver.usb_basic.rtos_callback" value="NULL"/>
|
||||||
|
<property id="module.driver.usb_basic.other_context" value="NULL"/>
|
||||||
|
</module>
|
||||||
<context id="_hal.0">
|
<context id="_hal.0">
|
||||||
<stack module="module.driver.ioport_on_ioport.0"/>
|
<stack module="module.driver.ioport_on_ioport.0"/>
|
||||||
|
<stack module="module.driver.pcdc_on_usb.216998869">
|
||||||
|
<stack module="module.driver.basic_on_usb.877233012" requires="module.driver.basic_on_usb.requires.basic"/>
|
||||||
|
</stack>
|
||||||
</context>
|
</context>
|
||||||
|
<config id="config.driver.usb_basic">
|
||||||
|
<property id="config.driver.usb_basic.param_checking_enable" value="config.driver.usb_basic.param_checking_enable.bsp"/>
|
||||||
|
<property id="config.driver.usb_basic.pll_clock_frequency" value="config.driver.usb_basic.pll_clock_frequency.20mhz"/>
|
||||||
|
<property id="config.driver.usb_basic.buswait" value="config.driver.usb_basic.buswait.7"/>
|
||||||
|
<property id="config.driver.usb_basic.bc_function" value="config.driver.usb_basic.bc_function.enable"/>
|
||||||
|
<property id="config.driver.usb_basic.power_source" value="config.driver.usb_basic.power_source.high"/>
|
||||||
|
<property id="config.driver.usb_basic.dcp_function" value="config.driver.usb_basic.dcp_function.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.request" value="config.driver.usb_basic.request.enable"/>
|
||||||
|
<property id="config.driver.usb_basic.dblb" value="config.driver.usb_basic.dblb.enable"/>
|
||||||
|
<property id="config.driver.usb_basic.cntmd" value="config.driver.usb_basic.cntmd.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.ldo_regulator" value="config.driver.usb_basic.ldo_regulator.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.type_c" value="config.driver.usb_basic.type_c.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.dma" value="config.driver.usb_basic.dma.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.source_address" value="config.driver.usb_basic.source_address.none"/>
|
||||||
|
<property id="config.driver.usb_basic.dest_address" value="config.driver.usb_basic.dest_address.none"/>
|
||||||
|
<property id="config.driver.usb_basic.compliance_mode" value="config.driver.usb_basic.compliance_mode.disable"/>
|
||||||
|
<property id="config.driver.usb_basic.tpl_table" value="NULL"/>
|
||||||
|
</config>
|
||||||
|
<config id="config.driver.usb_pcdc">
|
||||||
|
<property id="config.driver.usb_pcdc.bulk_in" value="config.driver.usb_pcdc.bulk_in.pipe4"/>
|
||||||
|
<property id="config.driver.usb_pcdc.bulk_out" value="config.driver.usb_pcdc.bulk_out.pipe5"/>
|
||||||
|
<property id="config.driver.usb_pcdc.int_in" value="config.driver.usb_pcdc.int_in.pipe6"/>
|
||||||
|
</config>
|
||||||
|
<config id="config.driver.usb_pcdc_class"/>
|
||||||
<config id="config.driver.ioport">
|
<config id="config.driver.ioport">
|
||||||
<property id="config.driver.ioport.checking" value="config.driver.ioport.checking.system"/>
|
<property id="config.driver.ioport.checking" value="config.driver.ioport.checking.system"/>
|
||||||
</config>
|
</config>
|
||||||
|
@ -32,11 +32,7 @@
|
|||||||
#pragma GCC diagnostic ignored "-Wundef"
|
#pragma GCC diagnostic ignored "-Wundef"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include "bsp_api.h"
|
|
||||||
//#include "r_ioport.h"
|
|
||||||
#include "common_data.h"
|
#include "common_data.h"
|
||||||
|
|
||||||
#include "r_ioport_api.h"
|
|
||||||
#include "renesas.h"
|
#include "renesas.h"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
@ -204,7 +200,6 @@ void usbfs_d1fifo_handler(void) {
|
|||||||
|
|
||||||
//------------- USB1 HighSpeed -------------//
|
//------------- USB1 HighSpeed -------------//
|
||||||
#ifdef BOARD_HAS_USB_HIGHSPEED
|
#ifdef BOARD_HAS_USB_HIGHSPEED
|
||||||
|
|
||||||
void usbhs_interrupt_handler(void) {
|
void usbhs_interrupt_handler(void) {
|
||||||
IRQn_Type irq = R_FSP_CurrentIrqGet();
|
IRQn_Type irq = R_FSP_CurrentIrqGet();
|
||||||
R_BSP_IrqStatusClear(irq);
|
R_BSP_IrqStatusClear(irq);
|
||||||
@ -223,7 +218,6 @@ void usbhs_d1fifo_handler(void) {
|
|||||||
R_BSP_IrqStatusClear(irq);
|
R_BSP_IrqStatusClear(irq);
|
||||||
// TODO not used yet
|
// TODO not used yet
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
@ -15,6 +15,28 @@ set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/arm_${TOOL
|
|||||||
|
|
||||||
set(FAMILY_MCUS RAXXX ${MCU_VARIANT} CACHE INTERNAL "")
|
set(FAMILY_MCUS RAXXX ${MCU_VARIANT} CACHE INTERNAL "")
|
||||||
|
|
||||||
|
# ----------------------
|
||||||
|
# Port & Speed Selection
|
||||||
|
# ----------------------
|
||||||
|
if (NOT DEFINED RHPORT_DEVICE)
|
||||||
|
set(RHPORT_DEVICE 0)
|
||||||
|
endif ()
|
||||||
|
if (NOT DEFINED RHPORT_HOST)
|
||||||
|
set(RHPORT_HOST 0)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT DEFINED RHPORT_SPEED)
|
||||||
|
set(RHPORT_SPEED OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED)
|
||||||
|
endif ()
|
||||||
|
if (NOT DEFINED RHPORT_DEVICE_SPEED)
|
||||||
|
list(GET RHPORT_SPEED ${RHPORT_DEVICE} RHPORT_DEVICE_SPEED)
|
||||||
|
endif ()
|
||||||
|
if (NOT DEFINED RHPORT_HOST_SPEED)
|
||||||
|
list(GET RHPORT_SPEED ${RHPORT_HOST} RHPORT_HOST_SPEED)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
cmake_print_variables(RHPORT_DEVICE RHPORT_DEVICE_SPEED RHPORT_HOST RHPORT_HOST_SPEED)
|
||||||
|
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
# BOARD_TARGET
|
# BOARD_TARGET
|
||||||
#------------------------------------
|
#------------------------------------
|
||||||
@ -57,6 +79,12 @@ function(add_board_target BOARD_TARGET)
|
|||||||
${FSP_RA}/src/bsp/mcu/all
|
${FSP_RA}/src/bsp/mcu/all
|
||||||
${FSP_RA}/src/bsp/mcu/${MCU_VARIANT}
|
${FSP_RA}/src/bsp/mcu/${MCU_VARIANT}
|
||||||
)
|
)
|
||||||
|
target_compile_definitions(${BOARD_TARGET} PUBLIC
|
||||||
|
BOARD_TUD_RHPORT=${RHPORT_DEVICE}
|
||||||
|
BOARD_TUD_MAX_SPEED=${RHPORT_DEVICE_SPEED}
|
||||||
|
BOARD_TUH_RHPORT=${RHPORT_HOST}
|
||||||
|
BOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED}
|
||||||
|
)
|
||||||
|
|
||||||
update_board(${BOARD_TARGET})
|
update_board(${BOARD_TARGET})
|
||||||
|
|
||||||
|
@ -4,33 +4,58 @@ include $(TOP)/$(BOARD_PATH)/board.mk
|
|||||||
# Don't include options setting in .bin file since it create unnecessary large file due to padding
|
# Don't include options setting in .bin file since it create unnecessary large file due to padding
|
||||||
OBJCOPY_BIN_OPTION = --only-section .text --only-section .data --only-section .rodata --only-section .bss
|
OBJCOPY_BIN_OPTION = --only-section .text --only-section .data --only-section .rodata --only-section .bss
|
||||||
|
|
||||||
# Default to port 0 fullspeed, board with port 1 highspeed should override this in board.mk
|
# ----------------------
|
||||||
PORT ?= 0
|
# Port & Speed Selection
|
||||||
|
# ----------------------
|
||||||
|
RHPORT_SPEED ?= OPT_MODE_FULL_SPEED OPT_MODE_HIGH_SPEED
|
||||||
|
RHPORT_DEVICE ?= 0
|
||||||
|
RHPORT_HOST ?= 0
|
||||||
|
|
||||||
|
# Determine RHPORT_DEVICE_SPEED if not defined
|
||||||
|
ifndef RHPORT_DEVICE_SPEED
|
||||||
|
ifeq ($(RHPORT_DEVICE), 0)
|
||||||
|
RHPORT_DEVICE_SPEED = $(firstword $(RHPORT_SPEED))
|
||||||
|
else
|
||||||
|
RHPORT_DEVICE_SPEED = $(lastword $(RHPORT_SPEED))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Determine RHPORT_HOST_SPEED if not defined
|
||||||
|
ifndef RHPORT_HOST_SPEED
|
||||||
|
ifeq ($(RHPORT_HOST), 0)
|
||||||
|
RHPORT_HOST_SPEED = $(firstword $(RHPORT_SPEED))
|
||||||
|
else
|
||||||
|
RHPORT_HOST_SPEED = $(lastword $(RHPORT_SPEED))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# --------------
|
||||||
|
# Compiler Flags
|
||||||
|
# --------------
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-flto \
|
|
||||||
-DCFG_TUSB_MCU=OPT_MCU_RAXXX \
|
-DCFG_TUSB_MCU=OPT_MCU_RAXXX \
|
||||||
-DBOARD_TUD_RHPORT=$(PORT) \
|
-DBOARD_TUD_RHPORT=${RHPORT_DEVICE} \
|
||||||
|
-DBOARD_TUD_MAX_SPEED=${RHPORT_DEVICE_SPEED} \
|
||||||
|
-DBOARD_TUH_RHPORT=${RHPORT_HOST} \
|
||||||
|
-DBOARD_TUH_MAX_SPEED=${RHPORT_HOST_SPEED}
|
||||||
|
|
||||||
|
CFLAGS_GCC += \
|
||||||
|
-flto \
|
||||||
-Wno-error=undef \
|
-Wno-error=undef \
|
||||||
-Wno-error=strict-prototypes \
|
-Wno-error=strict-prototypes \
|
||||||
-Wno-error=cast-align \
|
-Wno-error=cast-align \
|
||||||
-Wno-error=cast-qual \
|
-Wno-error=cast-qual \
|
||||||
-Wno-error=unused-but-set-variable \
|
-Wno-error=unused-but-set-variable \
|
||||||
-Wno-error=unused-variable \
|
-Wno-error=unused-variable \
|
||||||
-nostdlib \
|
|
||||||
-nostartfiles \
|
|
||||||
-ffreestanding
|
-ffreestanding
|
||||||
|
|
||||||
ifeq ($(PORT), 1)
|
LDFLAGS_GCC += \
|
||||||
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
|
-nostartfiles -nostdlib \
|
||||||
$(info "Using PORT 1 HighSpeed")
|
-specs=nosys.specs -specs=nano.specs
|
||||||
else
|
|
||||||
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_FULL_SPEED
|
|
||||||
$(info "Using PORT 0 FullSpeed")
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# Sources & Include
|
||||||
|
# -----------------
|
||||||
SRC_C += \
|
SRC_C += \
|
||||||
src/portable/renesas/rusb2/dcd_rusb2.c \
|
src/portable/renesas/rusb2/dcd_rusb2.c \
|
||||||
src/portable/renesas/rusb2/hcd_rusb2.c \
|
src/portable/renesas/rusb2/hcd_rusb2.c \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user