Skip to content

Commit 11acf8c

Browse files
committed
Added boards capri and muxto
1 parent b5f7710 commit 11acf8c

18 files changed

+1174
-0
lines changed

hw/bsp/ra/boards/capri/board.cmake

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set(CMAKE_SYSTEM_PROCESSOR cortex-m23 CACHE INTERNAL "System Processor")
2+
set(MCU_VARIANT ra42a1)
3+
4+
set(JLINK_DEVICE R7FA2A1AF)
5+
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/${BOARD}.ld)
6+
7+
function(update_board TARGET)
8+
# target_compile_definitions(${TARGET} PUBLIC)
9+
# target_sources(${TARGET} PRIVATE)
10+
# target_include_directories(${BOARD_TARGET} PUBLIC)
11+
endfunction()

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

+53
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_04_PIN_00 // D13
35+
#define LED_STATE_ON 1
36+
37+
#define SW1 BSP_IO_PORT_03_PIN_01 // D12
38+
#define BUTTON_STATE_ACTIVE 0
39+
40+
static 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 FS D+, D-, VBus
44+
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

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

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CPU_CORE = cortex-m23
2+
MCU_VARIANT = ra2a1
3+
4+
LD_FILE = ${BOARD_PATH}/${BOARD}.ld
5+
6+
# For flash-jlink target
7+
JLINK_DEVICE = R7FA4M1AB
8+
9+
USB_FIRST_BULK_PIPE=4
10+
USB_NO_ISOCRONOUS_PIPE=1
11+
USB_NUMBER_OF_PIPES=8
12+
13+
14+
flash: flash-jlink
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* generated configuration header file - do not edit */
2+
#ifndef BSP_CFG_H_
3+
#define BSP_CFG_H_
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
8+
#include "bsp_clock_cfg.h"
9+
#include "bsp_mcu_family_cfg.h"
10+
#include "board_cfg.h"
11+
12+
#define RA_NOT_DEFINED 0
13+
#ifndef BSP_CFG_RTOS
14+
#if (RA_NOT_DEFINED) != (RA_NOT_DEFINED)
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+
#undef RA_NOT_DEFINED
23+
#if defined(_RA_BOOT_IMAGE)
24+
#define BSP_CFG_BOOT_IMAGE (1)
25+
#endif
26+
#define BSP_CFG_MCU_VCC_MV (5000)
27+
#define BSP_CFG_STACK_MAIN_BYTES (0x2000)
28+
#define BSP_CFG_HEAP_BYTES (0x4000)
29+
#define BSP_CFG_PARAM_CHECKING_ENABLE (0)
30+
#define BSP_CFG_ASSERT (0)
31+
#define BSP_CFG_ERROR_LOG (0)
32+
33+
#define BSP_CFG_PFS_PROTECT ((1))
34+
35+
#define BSP_CFG_C_RUNTIME_INIT ((1))
36+
#define BSP_CFG_EARLY_INIT ((0))
37+
38+
#define BSP_CFG_SOFT_RESET_SUPPORTED ((0)) // DEPRECATED, replace with BSP_CFG_STARTUP_CLOCK_REG_NOT_RESET
39+
#define BSP_CFG_STARTUP_CLOCK_REG_NOT_RESET ((0))
40+
41+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_POPULATED
42+
#define BSP_CLOCK_CFG_MAIN_OSC_POPULATED (1)
43+
#endif
44+
45+
#ifndef BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE
46+
#define BSP_CLOCK_CFG_MAIN_OSC_CLOCK_SOURCE (0)
47+
#endif
48+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_DRIVE
49+
#define BSP_CLOCK_CFG_SUBCLOCK_DRIVE (0)
50+
#endif
51+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_POPULATED
52+
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
53+
#endif
54+
#ifndef BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS
55+
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
56+
#endif
57+
58+
#ifdef __cplusplus
59+
}
60+
#endif
61+
#endif /* BSP_CFG_H_ */
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 (2)
5+
#endif /* BSP_MCU_DEVICE_CFG_H_ */
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_R7FA2A1AB3CNF
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_QFN
10+
#define BSP_PACKAGE_PINS (40)
11+
#endif /* BSP_MCU_DEVICE_PN_CFG_H_ */
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/ra2a1/bsp_mcu_info.h"
11+
#include "bsp_clock_cfg.h"
12+
#define BSP_MCU_GROUP_RA2A1 (1)
13+
#define BSP_LOCO_HZ (32768)
14+
#define BSP_MOCO_HZ (8000000)
15+
#define BSP_SUB_CLOCK_HZ (32768)
16+
#if BSP_CFG_HOCO_FREQUENCY == 0
17+
#define BSP_HOCO_HZ (24000000)
18+
#elif BSP_CFG_HOCO_FREQUENCY == 2
19+
#define BSP_HOCO_HZ (32000000)
20+
#elif BSP_CFG_HOCO_FREQUENCY == 4
21+
#define BSP_HOCO_HZ (48000000)
22+
#elif BSP_CFG_HOCO_FREQUENCY == 5
23+
#define BSP_HOCO_HZ (64000000)
24+
#else
25+
#error "Invalid HOCO frequency chosen (BSP_CFG_HOCO_FREQUENCY) in bsp_clock_cfg.h"
26+
#endif
27+
28+
#define BSP_CORTEX_VECTOR_TABLE_ENTRIES (16U)
29+
#define BSP_VECTOR_TABLE_MAX_ENTRIES (48U)
30+
31+
#define OFS_SEQ1 0xA001A001 | (1 << 1) | (3 << 2)
32+
#define OFS_SEQ2 (15 << 4) | (3 << 8) | (3 << 10)
33+
#define OFS_SEQ3 (1 << 12) | (1 << 14) | (1 << 17)
34+
#define OFS_SEQ4 (3 << 18) |(15 << 20) | (3 << 24) | (3 << 26)
35+
#define OFS_SEQ5 (1 << 28) | (1 << 30)
36+
#define BSP_CFG_USE_LOW_VOLTAGE_MODE ((0))
37+
#define BSP_CFG_ROM_REG_OFS0 (OFS_SEQ1 | OFS_SEQ2 | OFS_SEQ3 | OFS_SEQ4 | OFS_SEQ5)
38+
#define BSP_CFG_ROM_REG_OFS1 (0xFFFFFEC3 | (1 << 2) | (3 << 3) | (0 << 8))
39+
#define BSP_CFG_ROM_REG_MPU_PC0_ENABLE (1)
40+
#define BSP_CFG_ROM_REG_MPU_PC0_START (0x000FFFFC)
41+
#define BSP_CFG_ROM_REG_MPU_PC0_END (0x000FFFFF)
42+
#define BSP_CFG_ROM_REG_MPU_PC1_ENABLE (1)
43+
#define BSP_CFG_ROM_REG_MPU_PC1_START (0x000FFFFC)
44+
#define BSP_CFG_ROM_REG_MPU_PC1_END (0x000FFFFF)
45+
#define BSP_CFG_ROM_REG_MPU_REGION0_ENABLE (1)
46+
#define BSP_CFG_ROM_REG_MPU_REGION0_START (0x000FFFFC)
47+
#define BSP_CFG_ROM_REG_MPU_REGION0_END (0x000FFFFF)
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_ */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 (0) /* XTAL 0Hz */
7+
#define BSP_CFG_HOCO_FREQUENCY (4) /* HOCO 48MHz */
8+
#define BSP_CFG_CLOCK_SOURCE (BSP_CLOCKS_SOURCE_CLOCK_HOCO) /* Clock Src: HOCO */
9+
#define BSP_CFG_ICLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* ICLK Div /1 */
10+
#define BSP_CFG_PCLKB_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* PCLKB Div /2 */
11+
#define BSP_CFG_PCLKD_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* PCLKD Div /1 */
12+
#define BSP_CFG_FCLK_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_2) /* FCLK Div /2 */
13+
#define BSP_CFG_SDADC_CLOCK_SOURCE (0) /* SDADCCLK Src: HOCO */
14+
#define BSP_CFG_SDADCCLK_DIV (7) /* SDADCCLK Div /12 */
15+
#define BSP_CFG_CLKOUT_SOURCE (BSP_CLOCKS_CLOCK_DISABLED) /* CLKOUT Disabled */
16+
#define BSP_CFG_CLKOUT_DIV (BSP_CLOCKS_SYS_CLOCK_DIV_1) /* CLKOUT Div /1 */
17+
#endif /* BSP_CLOCK_CFG_H_ */

hw/bsp/ra/boards/muxto/board.cmake

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set(CMAKE_SYSTEM_PROCESSOR cortex-m23 CACHE INTERNAL "System Processor")
2+
set(MCU_VARIANT ra42a1)
3+
4+
set(JLINK_DEVICE R7FA2A1A)
5+
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/${BOARD}.ld)
6+
7+
function(update_board TARGET)
8+
# target_compile_definitions(${TARGET} PUBLIC)
9+
# target_sources(${TARGET} PRIVATE)
10+
# target_include_directories(${BOARD_TARGET} PUBLIC)
11+
endfunction()

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

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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_11 // D13
35+
#define LED_STATE_ON 1
36+
37+
#define SW1 BSP_IO_PORT_01_PIN_10 // D12
38+
#define BUTTON_STATE_ACTIVE 0
39+
40+
static const ioport_pin_cfg_t board_pin_cfg[] = {
41+
{.pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT},
42+
{.pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
43+
{.pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
44+
};
45+
46+
#ifdef __cplusplus
47+
}
48+
#endif
49+
50+
#endif

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

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CPU_CORE = cortex-m23
2+
MCU_VARIANT = ra2a1
3+
4+
LD_FILE = ${BOARD_PATH}/${BOARD}.ld
5+
6+
# For flash-jlink target
7+
JLINK_DEVICE = R7FA4M1AB
8+
9+
USB_FIRST_BULK_PIPE=4
10+
USB_NO_ISOCRONOUS_PIPE=1
11+
USB_NUMBER_OF_PIPES=8
12+
13+
flash: flash-jlink

0 commit comments

Comments
 (0)