Skip to content

Commit c5d958d

Browse files
committed
add ra6m1 board
1 parent 50381f7 commit c5d958d

File tree

11 files changed

+285
-5
lines changed

11 files changed

+285
-5
lines changed

hw/bsp/ra/boards/ra4m1_ek/fsp_cfg/bsp/bsp_cfg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
3232
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
3333

34+
#define BSP_FEATURE_BSP_HAS_SCISPI_CLOCK 0
35+
3436
#define BSP_FEATURE_TFU_SUPPORTED 0
37+
#define BSP_TZ_SECURE_BUILD (0)
38+
#define BSP_TZ_NONSECURE_BUILD (0)
3539

3640
// for SystemInit()
3741
void bsp_init(void * p_args);

hw/bsp/ra/boards/ra4m1_ek/fsp_cfg/bsp/bsp_mcu_family_cfg.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
#define BSP_CORTEX_VECTOR_TABLE_ENTRIES (16U)
2626
#define BSP_VECTOR_TABLE_MAX_ENTRIES (48U)
2727

28-
#define BSP_TZ_SECURE_BUILD (0)
29-
#define BSP_TZ_NONSECURE_BUILD (0)
30-
31-
#define BSP_FEATURE_BSP_HAS_SCISPI_CLOCK 0
32-
3328
#define OFS_SEQ1 0xA001A001 | (1 << 1) | (3 << 2)
3429
#define OFS_SEQ2 (15 << 4) | (3 << 8) | (3 << 10)
3530
#define OFS_SEQ3 (1 << 12) | (1 << 14) | (1 << 17)

hw/bsp/ra/boards/ra6m1_ek/board.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2023 Ha Thach (tinyusb.org)
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*
24+
* This file is part of the TinyUSB stack.
25+
*/
26+
27+
#ifndef _BOARD_H_
28+
#define _BOARD_H_
29+
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
34+
#define LED1 BSP_IO_PORT_01_PIN_12
35+
#define LED_STATE_ON 1
36+
37+
#define SW1 BSP_IO_PORT_04_PIN_15
38+
#define BUTTON_STATE_ACTIVE 0
39+
40+
const ioport_pin_cfg_t board_pin_cfg[] = {
41+
{.pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT},
42+
{.pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT},
43+
// USB D+, D-, VBus
44+
{.pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
45+
{.pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
46+
{.pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
47+
};
48+
49+
#ifdef __cplusplus
50+
}
51+
#endif
52+
53+
#endif
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_CFG_H_
3+
#define BSP_CFG_H_
4+
5+
#ifdef __cplusplus
6+
extern "C" {
7+
#endif
8+
9+
#include "bsp_clock_cfg.h"
10+
#include "bsp_mcu_family_cfg.h"
11+
12+
#define RA_NOT_DEFINED 0
13+
#ifndef BSP_CFG_RTOS
14+
#if (RA_NOT_DEFINED) != (2)
15+
#define BSP_CFG_RTOS (2)
16+
#elif (RA_NOT_DEFINED) != (RA_NOT_DEFINED)
17+
#define BSP_CFG_RTOS (1)
18+
#else
19+
#define BSP_CFG_RTOS (0)
20+
#endif
21+
#endif
22+
23+
#ifndef BSP_CFG_RTC_USED
24+
#define BSP_CFG_RTC_USED (RA_NOT_DEFINED)
25+
#endif
26+
27+
#undef RA_NOT_DEFINED
28+
#if defined(_RA_BOOT_IMAGE)
29+
#define BSP_CFG_BOOT_IMAGE (1)
30+
#endif
31+
32+
#define BSP_CFG_MCU_VCC_MV (3300)
33+
#define BSP_CFG_STACK_MAIN_BYTES (0x400)
34+
#define BSP_CFG_HEAP_BYTES (0x1000)
35+
#define BSP_CFG_PARAM_CHECKING_ENABLE (1)
36+
#define BSP_CFG_ASSERT (0)
37+
#define BSP_CFG_ERROR_LOG (0)
38+
39+
#define BSP_CFG_PFS_PROTECT ((1))
40+
41+
#define BSP_CFG_C_RUNTIME_INIT ((1))
42+
#define BSP_CFG_EARLY_INIT ((0))
43+
44+
#define BSP_CFG_STARTUP_CLOCK_REG_NOT_RESET ((0))
45+
46+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_POPULATED
47+
#define BSP_CLOCK_CFG_MAIN_OSC_POPULATED (1)
48+
#endif
49+
50+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE
51+
#define BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE (0)
52+
#endif
53+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_DRIVE
54+
#define BSP_CLOCK_CFG_SUBCLOCK_DRIVE (0)
55+
#endif
56+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_POPULATED
57+
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
58+
#endif
59+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS
60+
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
61+
#endif
62+
63+
#define BSP_FEATURE_BSP_HAS_SCISPI_CLOCK 0
64+
#define BSP_FEATURE_TFU_SUPPORTED 0
65+
#define BSP_TZ_SECURE_BUILD (0)
66+
#define BSP_TZ_NONSECURE_BUILD (0)
67+
68+
#define BSP_CFG_USE_LOW_VOLTAGE_MODE 0
69+
70+
// for SystemInit()
71+
void bsp_init(void * p_args);
72+
73+
#ifdef __cplusplus
74+
}
75+
#endif
76+
77+
#endif /* BSP_CFG_H_ */
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_CLOCK_CFG_H_
3+
#define BSP_CLOCK_CFG_H_
4+
#define BSP_CFG_CLOCKS_SECURE (0)
5+
#define BSP_CFG_CLOCKS_OVERRIDE (0)
6+
#define BSP_CFG_XTAL_HZ (12000000) /* XTAL 12000000Hz */
7+
#define BSP_CFG_PLL_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_MAIN_OSC) /* PLL Src: XTAL */
8+
#define BSP_CFG_HOCO_FREQUENCY (2) /* HOCO 20MHz */
9+
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_1) /* PLL Div /1 */
10+
#define BSP_CFG_PLL_MUL BSP_CLOCKS_PLL_MUL_20_0 /* PLL Mul x20.0 */
11+
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* Clock Src: PLL */
12+
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* ICLK Div /2 */
13+
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKA Div /2 */
14+
#define BSP_CFG_PCLKB_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKB Div /4 */
15+
#define BSP_CFG_PCLKC_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* PCLKC Div /4 */
16+
#define BSP_CFG_PCLKD_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKD Div /2 */
17+
#define BSP_CFG_BCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* BCLK Div /2 */
18+
#define BSP_CFG_BCLK_OUTPUT (2) /* EBCLK Div /2 */
19+
#define BSP_CFG_UCK_DIV (BSP_CLOCKS_USB_CLOCK_DIV_5) /* UCLK Div /5 */
20+
#define BSP_CFG_FCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_4) /* FCLK Div /4 */
21+
#define BSP_CFG_CLKOUT_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CLKOUT Disabled */
22+
#define BSP_CFG_CLKOUT_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CLKOUT Div /1 */
23+
#endif /* BSP_CLOCK_CFG_H_ */
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_MCU_DEVICE_CFG_H_
3+
#define BSP_MCU_DEVICE_CFG_H_
4+
#define BSP_CFG_MCU_PART_SERIES (6)
5+
#endif /* BSP_MCU_DEVICE_CFG_H_ */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_MCU_DEVICE_PN_CFG_H_
3+
#define BSP_MCU_DEVICE_PN_CFG_H_
4+
#define BSP_MCU_R7FA6M1AD3CFP
5+
#define BSP_MCU_FEATURE_SET ('A')
6+
#define BSP_ROM_SIZE_BYTES (524288)
7+
#define BSP_RAM_SIZE_BYTES (262144)
8+
#define BSP_DATA_FLASH_SIZE_BYTES (8192)
9+
#define BSP_PACKAGE_LQFP
10+
#define BSP_PACKAGE_PINS (100)
11+
#endif /* BSP_MCU_DEVICE_PN_CFG_H_ */
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_MCU_FAMILY_CFG_H_
3+
#define BSP_MCU_FAMILY_CFG_H_
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
8+
#include "bsp_mcu_device_pn_cfg.h"
9+
#include "bsp_mcu_device_cfg.h"
10+
#include "../../../ra/fsp/src/bsp/mcu/ra6m1/bsp_mcu_info.h"
11+
#include "bsp_clock_cfg.h"
12+
13+
#define BSP_MCU_GROUP_RA6M1 (1)
14+
#define BSP_LOCO_HZ (32768)
15+
#define BSP_MOCO_HZ (8000000)
16+
#define BSP_SUB_CLOCK_HZ (32768)
17+
#if BSP_CFG_HOCO_FREQUENCY == 0
18+
#define BSP_HOCO_HZ (16000000)
19+
#elif BSP_CFG_HOCO_FREQUENCY == 1
20+
#define BSP_HOCO_HZ (18000000)
21+
#elif BSP_CFG_HOCO_FREQUENCY == 2
22+
#define BSP_HOCO_HZ (20000000)
23+
#else
24+
#error "Invalid HOCO frequency chosen (BSP_CFG_HOCO_FREQUENCY) in bsp_clock_cfg.h"
25+
#endif
26+
27+
#define BSP_CFG_FLL_ENABLE (0)
28+
29+
#define BSP_CORTEX_VECTOR_TABLE_ENTRIES (16U)
30+
#define BSP_VECTOR_TABLE_MAX_ENTRIES (112U)
31+
32+
#define OFS_SEQ1 0xA001A001 | (1 << 1) | (3 << 2)
33+
#define OFS_SEQ2 (15 << 4) | (3 << 8) | (3 << 10)
34+
#define OFS_SEQ3 (1 << 12) | (1 << 14) | (1 << 17)
35+
#define OFS_SEQ4 (3 << 18) |(15 << 20) | (3 << 24) | (3 << 26)
36+
#define OFS_SEQ5 (1 << 28) | (1 << 30)
37+
#define BSP_CFG_ROM_REG_OFS0 (OFS_SEQ1 | OFS_SEQ2 | OFS_SEQ3 | OFS_SEQ4 | OFS_SEQ5)
38+
#define BSP_CFG_ROM_REG_OFS1 (0xFFFFFEF8 | (1 << 2) | (3) | (1 << 8))
39+
#define BSP_CFG_ROM_REG_MPU_PC0_ENABLE (1)
40+
#define BSP_CFG_ROM_REG_MPU_PC0_START (0xFFFFFFFC)
41+
#define BSP_CFG_ROM_REG_MPU_PC0_END (0xFFFFFFFF)
42+
#define BSP_CFG_ROM_REG_MPU_PC1_ENABLE (1)
43+
#define BSP_CFG_ROM_REG_MPU_PC1_START (0xFFFFFFFC)
44+
#define BSP_CFG_ROM_REG_MPU_PC1_END (0xFFFFFFFF)
45+
#define BSP_CFG_ROM_REG_MPU_REGION0_ENABLE (1)
46+
#define BSP_CFG_ROM_REG_MPU_REGION0_START (0x00FFFFFC)
47+
#define BSP_CFG_ROM_REG_MPU_REGION0_END (0x00FFFFFF)
48+
#define BSP_CFG_ROM_REG_MPU_REGION1_ENABLE (1)
49+
#define BSP_CFG_ROM_REG_MPU_REGION1_START (0x200FFFFC)
50+
#define BSP_CFG_ROM_REG_MPU_REGION1_END (0x200FFFFF)
51+
#define BSP_CFG_ROM_REG_MPU_REGION2_ENABLE (1)
52+
#define BSP_CFG_ROM_REG_MPU_REGION2_START (0x407FFFFC)
53+
#define BSP_CFG_ROM_REG_MPU_REGION2_END (0x407FFFFF)
54+
#define BSP_CFG_ROM_REG_MPU_REGION3_ENABLE (1)
55+
#define BSP_CFG_ROM_REG_MPU_REGION3_START (0x400DFFFC)
56+
#define BSP_CFG_ROM_REG_MPU_REGION3_END (0x400DFFFF)
57+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_WAIT
58+
#define BSP_CLOCK_CFG_MAIN_OSC_WAIT (9)
59+
#endif
60+
/* Used to create IELS values for the interrupt initialization table g_interrupt_event_link_select. */
61+
#define BSP_PRV_IELS_ENUM(vector) (ELC_ ## vector)
62+
63+
/*
64+
ID Code
65+
Note: To permanently lock and disable the debug interface define the BSP_ID_CODE_PERMANENTLY_LOCKED in the compiler settings.
66+
WARNING: This will disable debug access to the part and cannot be reversed by a debug probe.
67+
*/
68+
#if defined(BSP_ID_CODE_PERMANENTLY_LOCKED)
69+
#define BSP_CFG_ID_CODE_LONG_1 (0x00000000)
70+
#define BSP_CFG_ID_CODE_LONG_2 (0x00000000)
71+
#define BSP_CFG_ID_CODE_LONG_3 (0x00000000)
72+
#define BSP_CFG_ID_CODE_LONG_4 (0x00000000)
73+
#else
74+
/* ID CODE: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF */
75+
#define BSP_CFG_ID_CODE_LONG_1 (0xFFFFFFFF)
76+
#define BSP_CFG_ID_CODE_LONG_2 (0xFFFFFFFF)
77+
#define BSP_CFG_ID_CODE_LONG_3 (0xFFFFFFFF)
78+
#define BSP_CFG_ID_CODE_LONG_4 (0xffFFFFFF)
79+
#endif
80+
81+
#ifdef __cplusplus
82+
}
83+
#endif
84+
#endif /* BSP_MCU_FAMILY_CFG_H_ */
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_PIN_CFG_H_
3+
#define BSP_PIN_CFG_H_
4+
#include "r_ioport.h"
5+
6+
/* Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */
7+
FSP_HEADER
8+
9+
extern const ioport_cfg_t g_bsp_pin_cfg; /* RA6M1-EK.pincfg */
10+
11+
void BSP_PinConfigSecurityInit();
12+
13+
/* Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
14+
FSP_FOOTER
15+
16+
#endif /* BSP_PIN_CFG_H_ */
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef R_IOPORT_CFG_H_
3+
#define R_IOPORT_CFG_H_
4+
5+
#define IOPORT_CFG_PARAM_CHECKING_ENABLE (BSP_CFG_PARAM_CHECKING_ENABLE)
6+
7+
#endif /* R_IOPORT_CFG_H_ */

0 commit comments

Comments
 (0)