mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-19 15:40:41 +00:00
update fsp to version 4.5, correct RA BSP. Fix ETM Trace with 6m5 by lowering PLL to 128Mhz.
This commit is contained in:
parent
bb0e688b8e
commit
071c30f381
@ -227,6 +227,10 @@ function(family_add_tinyusb TARGET OPT_MCU RTOS)
|
|||||||
|
|
||||||
if (DEFINED LOG)
|
if (DEFINED LOG)
|
||||||
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE CFG_TUSB_DEBUG=${LOG})
|
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE CFG_TUSB_DEBUG=${LOG})
|
||||||
|
if (LOG STREQUAL "3")
|
||||||
|
# no inline for debug level 3
|
||||||
|
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE TU_ATTR_ALWAYS_INLINE=)
|
||||||
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (RTOS STREQUAL "freertos")
|
if (RTOS STREQUAL "freertos")
|
||||||
|
@ -31,12 +31,6 @@
|
|||||||
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
|
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
|
||||||
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
|
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
|
||||||
|
|
||||||
#define BSP_FEATURE_BSP_HAS_SCISPI_CLOCK 0
|
|
||||||
|
|
||||||
#define BSP_FEATURE_TFU_SUPPORTED 0
|
|
||||||
#define BSP_TZ_SECURE_BUILD (0)
|
|
||||||
#define BSP_TZ_NONSECURE_BUILD (0)
|
|
||||||
|
|
||||||
// for SystemInit()
|
// for SystemInit()
|
||||||
void bsp_init(void * p_args);
|
void bsp_init(void * p_args);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
||||||
#define BSP_CFG_HOCO_FREQUENCY (0) /* HOCO 24MHz */
|
#define BSP_CFG_HOCO_FREQUENCY (0) /* HOCO 24MHz */
|
||||||
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_2) /* PLL Div /2 */
|
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_2) /* PLL Div /2 */
|
||||||
#define BSP_CFG_PLL_MUL (BSP_CLOCKS_PLL_MUL_8_0) /* PLL Mul x8 */
|
#define BSP_CFG_PLL_MUL (BSP_CLOCKS_PLL_MUL(8u,0u)) /* PLL Mul x8 */
|
||||||
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
||||||
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* ICLK Div /1 */
|
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* ICLK Div /1 */
|
||||||
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKA Div /1 */
|
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKA Div /1 */
|
||||||
|
@ -38,12 +38,10 @@ extern "C" {
|
|||||||
#define BUTTON_STATE_ACTIVE 0
|
#define BUTTON_STATE_ACTIVE 0
|
||||||
|
|
||||||
static const ioport_pin_cfg_t board_pin_cfg[] = {
|
static const ioport_pin_cfg_t board_pin_cfg[] = {
|
||||||
{.pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT},
|
{ .pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT },
|
||||||
{.pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT},
|
{ .pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT },
|
||||||
// USB FS D+, D-, VBus
|
// USB FS
|
||||||
{.pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
|
{ .pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS },
|
||||||
{.pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
|
|
||||||
{.pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -60,13 +60,6 @@ extern "C" {
|
|||||||
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
|
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BSP_FEATURE_BSP_HAS_SCISPI_CLOCK 0
|
|
||||||
#define BSP_FEATURE_TFU_SUPPORTED 0
|
|
||||||
#define BSP_TZ_SECURE_BUILD (0)
|
|
||||||
#define BSP_TZ_NONSECURE_BUILD (0)
|
|
||||||
|
|
||||||
#define BSP_CFG_USE_LOW_VOLTAGE_MODE 0
|
|
||||||
|
|
||||||
// for SystemInit()
|
// for SystemInit()
|
||||||
void bsp_init(void * p_args);
|
void bsp_init(void * p_args);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
||||||
#define BSP_CFG_HOCO_FREQUENCY (2) /* HOCO 20MHz */
|
#define BSP_CFG_HOCO_FREQUENCY (2) /* HOCO 20MHz */
|
||||||
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_1) /* PLL Div /1 */
|
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_1) /* PLL Div /1 */
|
||||||
#define BSP_CFG_PLL_MUL BSP_CLOCKS_PLL_MUL_20_0 /* PLL Mul x20.0 */
|
#define BSP_CFG_PLL_MUL BSP_CLOCKS_PLL_MUL(20U,0U) /* PLL Mul x20.0 */
|
||||||
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
||||||
#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 */
|
||||||
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKA Div /2 */
|
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKA Div /2 */
|
||||||
|
@ -41,22 +41,24 @@ static const ioport_pin_cfg_t board_pin_cfg[] = {
|
|||||||
{ .pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT | IOPORT_CFG_PORT_OUTPUT_LOW },
|
{ .pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT | IOPORT_CFG_PORT_OUTPUT_LOW },
|
||||||
{ .pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT },
|
{ .pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT },
|
||||||
|
|
||||||
// USB FS D+, D-, VBus
|
// USB FS
|
||||||
{ .pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH },
|
{ .pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH },
|
||||||
{ .pin = BSP_IO_PORT_05_PIN_00, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH},
|
{ .pin = BSP_IO_PORT_05_PIN_00, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH},
|
||||||
{ .pin = BSP_IO_PORT_05_PIN_01, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH},
|
{ .pin = BSP_IO_PORT_05_PIN_01, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS | IOPORT_CFG_DRIVE_HIGH},
|
||||||
|
|
||||||
// USB HS D+, D-, VBus
|
// USB HS
|
||||||
{ .pin = BSP_IO_PORT_07_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS },
|
{ .pin = BSP_IO_PORT_07_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS },
|
||||||
{ .pin = BSP_IO_PORT_11_PIN_00, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS | IOPORT_CFG_DRIVE_HIGH},
|
{ .pin = BSP_IO_PORT_11_PIN_00, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS | IOPORT_CFG_DRIVE_HIGH},
|
||||||
{ .pin = BSP_IO_PORT_11_PIN_01, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS | IOPORT_CFG_DRIVE_HIGH},
|
{ .pin = BSP_IO_PORT_11_PIN_01, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_HS | IOPORT_CFG_DRIVE_HIGH},
|
||||||
|
|
||||||
// ETM Trace
|
// ETM Trace
|
||||||
{ .pin = BSP_IO_PORT_02_PIN_08, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE },
|
#ifdef TRACE_ETM
|
||||||
{ .pin = BSP_IO_PORT_02_PIN_09, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE },
|
{ .pin = BSP_IO_PORT_02_PIN_08, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE | IOPORT_CFG_DRIVE_HS_HIGH },
|
||||||
{ .pin = BSP_IO_PORT_02_PIN_10, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE },
|
{ .pin = BSP_IO_PORT_02_PIN_09, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE | IOPORT_CFG_DRIVE_HS_HIGH },
|
||||||
{ .pin = BSP_IO_PORT_02_PIN_11, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE },
|
{ .pin = BSP_IO_PORT_02_PIN_10, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE | IOPORT_CFG_DRIVE_HS_HIGH },
|
||||||
{ .pin = BSP_IO_PORT_02_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE },
|
{ .pin = BSP_IO_PORT_02_PIN_11, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE | IOPORT_CFG_DRIVE_HS_HIGH },
|
||||||
|
{ .pin = BSP_IO_PORT_02_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_TRACE | IOPORT_CFG_DRIVE_HS_HIGH },
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,35 +1,45 @@
|
|||||||
/* generated configuration header file - do not edit */
|
/* generated configuration header file - do not edit */
|
||||||
#ifndef BSP_CLOCK_CFG_H_
|
#ifndef BSP_CLOCK_CFG_H_
|
||||||
#define BSP_CLOCK_CFG_H_
|
#define BSP_CLOCK_CFG_H_
|
||||||
#define BSP_CFG_CLOCKS_SECURE (0)
|
|
||||||
|
#define BSP_CFG_CLOCKS_SECURE (0)
|
||||||
#define BSP_CFG_CLOCKS_OVERRIDE (0)
|
#define BSP_CFG_CLOCKS_OVERRIDE (0)
|
||||||
#define BSP_CFG_XTAL_HZ (24000000) /* XTAL 24000000Hz */
|
#define BSP_CFG_XTAL_HZ (24000000) /* XTAL 24000000Hz */
|
||||||
#define BSP_CFG_HOCO_FREQUENCY (2) /* HOCO 20MHz */
|
#define BSP_CFG_HOCO_FREQUENCY (2) /* HOCO 20MHz */
|
||||||
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
|
||||||
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_3) /* PLL Div /3 */
|
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_3) /* PLL Div /3 */
|
||||||
#define BSP_CFG_PLL_MUL BSP_CLOCKS_PLL_MUL_25_0 /* PLL Mul x25.0 */
|
|
||||||
#define BSP_CFG_PLL2_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL2 Src: XTAL */
|
#ifdef TRACE_ETM
|
||||||
#define BSP_CFG_PLL2_DIV (BSP_CLOCKS_PLL_DIV_2) /* PLL2 Div /2 */
|
// Due to ozone fixed trace clock div = 1, PLL is limited around 100Mhz. This use 128 Mhz
|
||||||
#define BSP_CFG_PLL2_MUL BSP_CLOCKS_PLL_MUL_20_0 /* PLL2 Mul x20.0 */
|
#define BSP_CFG_PLL_MUL (BSP_CLOCKS_PLL_MUL(16U,0U)) /* PLL Mul x16.0 */
|
||||||
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
#else
|
||||||
#define BSP_CFG_CLKOUT_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CLKOUT Disabled */
|
#define BSP_CFG_PLL_MUL (BSP_CLOCKS_PLL_MUL(25U,0U)) /* PLL Mul x25.0 */
|
||||||
#define BSP_CFG_UCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL2) /* UCLK Src: PLL2 */
|
#endif
|
||||||
#define BSP_CFG_U60CK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* U60CK Disabled */
|
|
||||||
#define BSP_CFG_OCTA_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* OCTASPICLK Disabled */
|
#define BSP_CFG_PLL2_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL2 Src: XTAL */
|
||||||
#define BSP_CFG_CANFDCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CANFDCLK Disabled */
|
#define BSP_CFG_PLL2_DIV (BSP_CLOCKS_PLL_DIV_2) /* PLL2 Div /2 */
|
||||||
#define BSP_CFG_CECCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CECCLK Disabled */
|
#define BSP_CFG_PLL2_MUL (BSP_CLOCKS_PLL_MUL(20U,0U)) /* PLL2 Mul x20.0 */
|
||||||
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* ICLK Div /1 */
|
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
|
||||||
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKA Div /2 */
|
#define BSP_CFG_CLKOUT_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CLKOUT Disabled */
|
||||||
#define BSP_CFG_PCLKB_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKB Div /4 */
|
#define BSP_CFG_UCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL2) /* UCLK Src: PLL2 */
|
||||||
#define BSP_CFG_PCLKC_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKC Div /4 */
|
#define BSP_CFG_U60CK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL2) /* U60CK Src: PLL2 */
|
||||||
#define BSP_CFG_PCLKD_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKD Div /2 */
|
#define BSP_CFG_OCTA_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* OCTASPICLK Disabled */
|
||||||
#define BSP_CFG_BCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* BCLK Div /2 */
|
#define BSP_CFG_CANFDCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CANFDCLK Disabled */
|
||||||
#define BSP_CFG_BCLK_OUTPUT (2) /* EBCLK Div /2 */
|
#define BSP_CFG_CECCLK_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CECCLK Disabled */
|
||||||
#define BSP_CFG_FCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* FCLK Div /4 */
|
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* ICLK Div /1 */
|
||||||
#define BSP_CFG_CLKOUT_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CLKOUT Div /1 */
|
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKA Div /2 */
|
||||||
#define BSP_CFG_UCK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* UCLK Div /5 */
|
#define BSP_CFG_PCLKB_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKB Div /4 */
|
||||||
#define BSP_CFG_U60CK_DIV (BSP_CLOCKS_USB60_CLOCK_DIV_1) /* U60CK Div /1 */
|
#define BSP_CFG_PCLKC_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKC Div /4 */
|
||||||
#define BSP_CFG_OCTA_DIV (BSP_CLOCKS_OCTA_CLOCK_DIV_1) /* OCTASPICLK Div /1 */
|
#define BSP_CFG_PCLKD_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKD Div /2 */
|
||||||
#define BSP_CFG_CANFDCLK_DIV (BSP_CLOCKS_CANFD_CLOCK_DIV_1) /* CANFDCLK Div /1 */
|
#define BSP_CFG_BCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* BCLK Div /2 */
|
||||||
#define BSP_CFG_CECCLK_DIV (BSP_CLOCKS_CEC_CLOCK_DIV_1) /* CECCLK Div /1 */
|
#define BSP_CFG_BCLK_OUTPUT (2) /* EBCLK Div /2 */
|
||||||
|
#define BSP_CFG_FCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* FCLK Div /4 */
|
||||||
|
#define BSP_CFG_CLKOUT_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CLKOUT Div /1 */
|
||||||
|
#define BSP_CFG_UCK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* UCLK Div /5 */
|
||||||
|
#define BSP_CFG_U60CK_DIV (BSP_CLOCKS_USB60_CLOCK_DIV_4) /* U60CK Div /4 */
|
||||||
|
#define BSP_CFG_OCTA_DIV (BSP_CLOCKS_OCTA_CLOCK_DIV_1) /* OCTASPICLK Div /1 */
|
||||||
|
#define BSP_CFG_CANFDCLK_DIV (BSP_CLOCKS_CANFD_CLOCK_DIV_1) /* CANFDCLK Div /1 */
|
||||||
|
#define BSP_CFG_CECCLK_DIV (BSP_CLOCKS_CEC_CLOCK_DIV_1) /* CECCLK Div /1 */
|
||||||
|
|
||||||
|
|
||||||
#endif /* BSP_CLOCK_CFG_H_ */
|
#endif /* BSP_CLOCK_CFG_H_ */
|
||||||
|
@ -33,3 +33,73 @@ void BeforeTargetConnect (void) {
|
|||||||
// Trace pin init is done by J-Link script file as J-Link script files are IDE independent
|
// Trace pin init is done by J-Link script file as J-Link script files are IDE independent
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetReset
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine.
|
||||||
|
* - Sets the PC register to program reset value.
|
||||||
|
* - Sets the SP register to program reset value on Cortex-M.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void AfterTargetReset (void) {
|
||||||
|
unsigned int SP;
|
||||||
|
unsigned int PC;
|
||||||
|
unsigned int VectorTableAddr;
|
||||||
|
|
||||||
|
VectorTableAddr = Elf.GetBaseAddr();
|
||||||
|
|
||||||
|
if (VectorTableAddr != 0xFFFFFFFF) {
|
||||||
|
SP = Target.ReadU32(VectorTableAddr);
|
||||||
|
Target.SetReg("SP", SP);
|
||||||
|
} else {
|
||||||
|
Util.Log("Project file error: failed to get program base");
|
||||||
|
}
|
||||||
|
|
||||||
|
PC = Elf.GetEntryPointPC();
|
||||||
|
|
||||||
|
if (PC != 0xFFFFFFFF) {
|
||||||
|
Target.SetReg("PC", PC);
|
||||||
|
} else if (VectorTableAddr != 0xFFFFFFFF) {
|
||||||
|
PC = Target.ReadU32(VectorTableAddr + 4);
|
||||||
|
Target.SetReg("PC", PC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
*
|
||||||
|
* AfterTargetDownload
|
||||||
|
*
|
||||||
|
* Function description
|
||||||
|
* Event handler routine.
|
||||||
|
* - Sets the PC register to program reset value.
|
||||||
|
* - Sets the SP register to program reset value on Cortex-M.
|
||||||
|
*
|
||||||
|
**********************************************************************
|
||||||
|
*/
|
||||||
|
void AfterTargetDownload (void) {
|
||||||
|
unsigned int SP;
|
||||||
|
unsigned int PC;
|
||||||
|
unsigned int VectorTableAddr;
|
||||||
|
|
||||||
|
VectorTableAddr = Elf.GetBaseAddr();
|
||||||
|
|
||||||
|
if (VectorTableAddr != 0xFFFFFFFF) {
|
||||||
|
SP = Target.ReadU32(VectorTableAddr);
|
||||||
|
Target.SetReg("SP", SP);
|
||||||
|
} else {
|
||||||
|
Util.Log("Project file error: failed to get program base");
|
||||||
|
}
|
||||||
|
|
||||||
|
PC = Elf.GetEntryPointPC();
|
||||||
|
|
||||||
|
if (PC != 0xFFFFFFFF) {
|
||||||
|
Target.SetReg("PC", PC);
|
||||||
|
} else if (VectorTableAddr != 0xFFFFFFFF) {
|
||||||
|
PC = Target.ReadU32(VectorTableAddr + 4);
|
||||||
|
Target.SetReg("PC", PC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -36,15 +36,14 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "bsp_api.h"
|
#include "bsp_api.h"
|
||||||
|
#include "r_ioport.h"
|
||||||
|
#include "r_ioport_api.h"
|
||||||
|
#include "renesas.h"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "r_ioport.h"
|
|
||||||
#include "r_ioport_api.h"
|
|
||||||
#include "renesas.h"
|
|
||||||
|
|
||||||
#include "bsp/board.h"
|
#include "bsp/board.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
|
||||||
@ -86,15 +85,17 @@ void board_init(void)
|
|||||||
R_IOPORT_Open(&port_ctrl, &family_pin_cfg);
|
R_IOPORT_Open(&port_ctrl, &family_pin_cfg);
|
||||||
|
|
||||||
#ifdef TRACE_ETM
|
#ifdef TRACE_ETM
|
||||||
// Enable trace clock with div 1 (100 Mhz)
|
// Enable trace clock (max 100Mhz) = PLL / div
|
||||||
R_SYSTEM->TRCKCR = R_SYSTEM_TRCKCR_TRCKEN_Msk;
|
// Somehow ozone/jtrace always fixed trace div to 1 therefore for ETM tracing working reliably
|
||||||
|
// PLL is limited around 100Mhz
|
||||||
|
R_SYSTEM->TRCKCR = R_SYSTEM_TRCKCR_TRCKEN_Msk | 0x01;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Enable USB module
|
// Enable USB module
|
||||||
R_MSTP->MSTPCRB &= ~(1U << 11U); // FS
|
R_MSTP->MSTPCRB &= ~(1U << 11U); // FS
|
||||||
|
|
||||||
#ifdef R_USB_HS0_BASE
|
#ifdef R_USB_HS0_BASE
|
||||||
R_MSTP->MSTPCRB &= ~(1U << 12U); // HS
|
// R_MSTP->MSTPCRB &= ~(1U << 12U); // HS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUSB_OS == OPT_OS_FREERTOS
|
#if CFG_TUSB_OS == OPT_OS_FREERTOS
|
||||||
|
@ -37,14 +37,14 @@ function(add_board_target BOARD_TARGET)
|
|||||||
${FSP_RA}/src/bsp/mcu/all/bsp_security.c
|
${FSP_RA}/src/bsp/mcu/all/bsp_security.c
|
||||||
${FSP_RA}/src/r_ioport/r_ioport.c
|
${FSP_RA}/src/r_ioport/r_ioport.c
|
||||||
)
|
)
|
||||||
target_compile_definitions(${BOARD_TARGET} PUBLIC
|
# ETM Trace option
|
||||||
_RA_TZ_NONSECURE
|
if (TRACE_ETM STREQUAL "1")
|
||||||
)
|
target_compile_definitions(${BOARD_TARGET} PUBLIC TRACE_ETM)
|
||||||
|
endif ()
|
||||||
|
|
||||||
target_compile_options(${BOARD_TARGET} PUBLIC
|
target_compile_options(${BOARD_TARGET} PUBLIC
|
||||||
-ffreestanding
|
-ffreestanding
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
||||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
|
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
|
||||||
|
@ -57,7 +57,7 @@ deps_optional = {
|
|||||||
'58879cfa0eca5725d8db6443ec17f8896a321042',
|
'58879cfa0eca5725d8db6443ec17f8896a321042',
|
||||||
'rp2040'],
|
'rp2040'],
|
||||||
'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git',
|
'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git',
|
||||||
'9860fae1f180340a0e3c097dc6e91323cf83b926',
|
'd52e5a6a59b7c638da860c2bb309b6e78e752ff8',
|
||||||
'ra'],
|
'ra'],
|
||||||
'hw/mcu/renesas/rx': ['https://github.com/kkitayam/rx_device.git',
|
'hw/mcu/renesas/rx': ['https://github.com/kkitayam/rx_device.git',
|
||||||
'706b4e0cf485605c32351e2f90f5698267996023',
|
'706b4e0cf485605c32351e2f90f5698267996023',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user