Skip to content

Commit e0b1de9

Browse files
committed
add ra4m1_ek board
1 parent 2a10d5c commit e0b1de9

File tree

13 files changed

+1172
-10
lines changed

13 files changed

+1172
-10
lines changed

docs/reference/supported.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,17 @@ LPC55
297297
- `LPCXpresso 55s69 EVK <https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK>`__
298298
- `MCU-Link <https://www.nxp.com/design/development-boards/lpcxpresso-boards/mcu-link-debug-probe:MCU-LINK>`__
299299

300-
Renesas RX
301-
----------
300+
Renesas
301+
-------
302+
303+
RA
304+
^^
305+
306+
- `Evaluation Kit for RA4M1 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m1-evaluation-kit-ra4m1-mcu-group>`__
307+
- `Evaluation Kit for RA4M3 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m3-evaluation-kit-ra4m3-mcu-group>`__
308+
309+
RX
310+
^^
302311

303312
- `GR-CITRUS <https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-citrus>`__
304313
- `Renesas RX65N Target Board <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rx-32-bit-performance-efficiency-mcus/rtk5rx65n0c00000br-target-board-rx65n>`__

hw/bsp/ra/boards/ra4m1_ek/board.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CFLAGS += \
2+
-mcpu=cortex-m4 \
3+
-mfloat-abi=hard \
4+
-mfpu=fpv4-sp-d16 \
5+
-DCFG_TUSB_MCU=OPT_MCU_RAXXX
6+
7+
FSP_MCU_DIR = hw/mcu/renesas/fsp/ra/fsp/src/bsp/mcu/ra4m1
8+
FSP_BOARD_DIR = hw/mcu/renesas/fsp/ra/board/ra4m1_ek
9+
10+
# All source paths should be relative to the top level.
11+
LD_FILE = $(BOARD_PATH)/ra4m1_ek.ld
12+
13+
# For flash-jlink target
14+
JLINK_DEVICE = R7FA4M1AB
15+
JLINK_IF = SWD
16+
17+
flash: flash-jlink
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_CFG_H_
3+
#define BSP_CFG_H_
4+
5+
#include "board.h"
6+
#include "bsp_clock_cfg.h"
7+
#include "bsp_mcu_family_cfg.h"
8+
9+
#undef RA_NOT_DEFINED
10+
#define BSP_CFG_RTOS (0)
11+
#if defined(_RA_BOOT_IMAGE)
12+
#define BSP_CFG_BOOT_IMAGE (1)
13+
#endif
14+
#define BSP_CFG_MCU_VCC_MV (3300)
15+
#define BSP_CFG_STACK_MAIN_BYTES (0x400)
16+
#define BSP_CFG_HEAP_BYTES (0x1000)
17+
#define BSP_CFG_PARAM_CHECKING_ENABLE (1)
18+
#define BSP_CFG_ASSERT (0)
19+
#define BSP_CFG_ERROR_LOG (0)
20+
21+
#define BSP_CFG_PFS_PROTECT ((1))
22+
23+
#define BSP_CFG_C_RUNTIME_INIT ((1))
24+
#define BSP_CFG_EARLY_INIT ((0))
25+
26+
#define BSP_CFG_STARTUP_CLOCK_REG_NOT_RESET ((0))
27+
28+
#define BSP_CLOCK_CFG_MAIN_OSC_POPULATED (1)
29+
30+
#define BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE (0)
31+
#define BSP_CLOCK_CFG_SUBCLOCK_DRIVE (0)
32+
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
33+
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
34+
35+
#endif /* BSP_CFG_H_ */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 (0) /* HOCO 24MHz */
9+
#define BSP_CFG_PLL_DIV (BSP_CLOCKS_PLL_DIV_2) /* PLL Div /2 */
10+
#define BSP_CFG_PLL_MUL (BSP_CLOCKS_PLL_MUL_8_0) /* PLL Mul x8 */
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_1) /* ICLK Div /1 */
13+
#define BSP_CFG_PCLKA_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKA Div /1 */
14+
#define BSP_CFG_PCLKB_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKB Div /2 */
15+
#define BSP_CFG_PCLKC_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKC Div /1 */
16+
#define BSP_CFG_PCLKD_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKD Div /1 */
17+
#define BSP_CFG_FCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* FCLK Div /2 */
18+
#define BSP_CFG_CLKOUT_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CLKOUT Disabled */
19+
#define BSP_CFG_CLKOUT_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CLKOUT Div /1 */
20+
#define BSP_CFG_UCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_PLL) /* UCLK Src: PLL */
21+
#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 (4)
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_R7FA4M1AB3CFP
5+
#define BSP_MCU_FEATURE_SET ('A')
6+
#define BSP_ROM_SIZE_BYTES (262144)
7+
#define BSP_RAM_SIZE_BYTES (32768)
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: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* generated configuration header file through renesas e2 studio */
2+
#ifndef BSP_MCU_FAMILY_CFG_H_
3+
#define BSP_MCU_FAMILY_CFG_H_
4+
5+
#include "bsp_mcu_device_pn_cfg.h"
6+
#include "bsp_mcu_device_cfg.h"
7+
#include "bsp_mcu_info.h"
8+
#include "bsp_clock_cfg.h"
9+
10+
#define BSP_MCU_GROUP_RA4M1 (1)
11+
#define BSP_LOCO_HZ (32768)
12+
#define BSP_MOCO_HZ (8000000)
13+
#define BSP_SUB_CLOCK_HZ (32768)
14+
#if BSP_CFG_HOCO_FREQUENCY == 0
15+
#define BSP_HOCO_HZ (24000000)
16+
#elif BSP_CFG_HOCO_FREQUENCY == 2
17+
#define BSP_HOCO_HZ (32000000)
18+
#elif BSP_CFG_HOCO_FREQUENCY == 4
19+
#define BSP_HOCO_HZ (48000000)
20+
#elif BSP_CFG_HOCO_FREQUENCY == 5
21+
#define BSP_HOCO_HZ (64000000)
22+
#else
23+
#error "Invalid HOCO frequency chosen (BSP_CFG_HOCO_FREQUENCY) in bsp_clock_cfg.h"
24+
#endif
25+
#define BSP_CORTEX_VECTOR_TABLE_ENTRIES (16U)
26+
#define BSP_VECTOR_TABLE_MAX_ENTRIES (48U)
27+
28+
#define OFS_SEQ1 0xA001A001 | (1 << 1) | (3 << 2)
29+
#define OFS_SEQ2 (15 << 4) | (3 << 8) | (3 << 10)
30+
#define OFS_SEQ3 (1 << 12) | (1 << 14) | (1 << 17)
31+
#define OFS_SEQ4 (3 << 18) |(15 << 20) | (3 << 24) | (3 << 26)
32+
#define OFS_SEQ5 (1 << 28) | (1 << 30)
33+
#define BSP_CFG_ROM_REG_OFS0 (OFS_SEQ1 | OFS_SEQ2 | OFS_SEQ3 | OFS_SEQ4 | OFS_SEQ5)
34+
#define BSP_CFG_ROM_REG_OFS1 (0xFFFFFEC3 | (1 << 2) | (3 << 3) | (0 << 8))
35+
#define BSP_CFG_USE_LOW_VOLTAGE_MODE ((0))
36+
#define BSP_CFG_ROM_REG_MPU_PC0_ENABLE (1)
37+
#define BSP_CFG_ROM_REG_MPU_PC0_START (0x00FFFFFC)
38+
#define BSP_CFG_ROM_REG_MPU_PC0_END (0x00FFFFFF)
39+
#define BSP_CFG_ROM_REG_MPU_PC1_ENABLE (1)
40+
#define BSP_CFG_ROM_REG_MPU_PC1_START (0x00FFFFFC)
41+
#define BSP_CFG_ROM_REG_MPU_PC1_END (0x00FFFFFF)
42+
#define BSP_CFG_ROM_REG_MPU_REGION0_ENABLE (1)
43+
#define BSP_CFG_ROM_REG_MPU_REGION0_START (0x00FFFFFC)
44+
#define BSP_CFG_ROM_REG_MPU_REGION0_END (0x00FFFFFF)
45+
#define BSP_CFG_ROM_REG_MPU_REGION1_ENABLE (1)
46+
#define BSP_CFG_ROM_REG_MPU_REGION1_START (0x200FFFFC)
47+
#define BSP_CFG_ROM_REG_MPU_REGION1_END (0x200FFFFF)
48+
#define BSP_CFG_ROM_REG_MPU_REGION2_ENABLE (1)
49+
#define BSP_CFG_ROM_REG_MPU_REGION2_START (0x407FFFFC)
50+
#define BSP_CFG_ROM_REG_MPU_REGION2_END (0x407FFFFF)
51+
#define BSP_CFG_ROM_REG_MPU_REGION3_ENABLE (1)
52+
#define BSP_CFG_ROM_REG_MPU_REGION3_START (0x400DFFFC)
53+
#define BSP_CFG_ROM_REG_MPU_REGION3_END (0x400DFFFF)
54+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_WAIT
55+
#define BSP_CLOCK_CFG_MAIN_OSC_WAIT (9)
56+
#endif
57+
/* Used to create IELS values for the interrupt initialization table g_interrupt_event_link_select. */
58+
#define BSP_PRV_IELS_ENUM(vector) (ELC_ ## vector)
59+
60+
/*
61+
ID Code
62+
Note: To permanently lock and disable the debug interface define the BSP_ID_CODE_PERMANENTLY_LOCKED in the compiler settings.
63+
WARNING: This will disable debug access to the part and cannot be reversed by a debug probe.
64+
*/
65+
#if defined(BSP_ID_CODE_PERMANENTLY_LOCKED)
66+
#define BSP_CFG_ID_CODE_LONG_1 (0x00000000)
67+
#define BSP_CFG_ID_CODE_LONG_2 (0x00000000)
68+
#define BSP_CFG_ID_CODE_LONG_3 (0x00000000)
69+
#define BSP_CFG_ID_CODE_LONG_4 (0x00000000)
70+
#else
71+
/* ID CODE: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF */
72+
#define BSP_CFG_ID_CODE_LONG_1 (0xFFFFFFFF)
73+
#define BSP_CFG_ID_CODE_LONG_2 (0xFFFFFFFF)
74+
#define BSP_CFG_ID_CODE_LONG_3 (0xFFFFFFFF)
75+
#define BSP_CFG_ID_CODE_LONG_4 (0xffFFFFFF)
76+
#endif
77+
78+
#endif /* BSP_MCU_FAMILY_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_ */
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* vector numbers are configurable/dynamic, hence this, it will be used inside the port */
2+
#define TU_IRQn 0
3+
#define USBFS_RESUME_IRQn 1
4+
#define USBFS_FIFO_0_IRQn 2
5+
#define USBFS_FIFO_1_IRQn 3

0 commit comments

Comments
 (0)