Skip to content

Commit 99e75e6

Browse files
committed
rework ra build
1 parent 48738df commit 99e75e6

File tree

17 files changed

+299
-275
lines changed

17 files changed

+299
-275
lines changed

.github/workflows/cmake_arm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- 'lpc18'
3939
- 'lpc55'
4040
- 'mcx'
41+
- 'ra'
4142
- 'rp2040'
4243
- 'stm32f0'
4344
- 'stm32f1'

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(CMAKE_SYSTEM_PROCESSOR cortex-m4 CACHE INTERNAL "System Processor")
2+
set(MCU_VARIANT ra4m1)
3+
4+
set(JLINK_DEVICE R7FA4M1AB)
5+
6+
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/ra4m1_ek.ld)
7+
8+
function(update_board TARGET)
9+
target_compile_definitions(${TARGET} PUBLIC
10+
)
11+
target_sources(${TARGET} PRIVATE
12+
)
13+
target_include_directories(${BOARD_TARGET} PUBLIC
14+
)
15+
endfunction()

hw/bsp/ra/boards/ra4m1_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_06)
35+
#define LED_STATE_ON 1
36+
37+
#define SW1 (BSP_IO_PORT_01_PIN_05)
38+
#define BUTTON_STATE_ACTIVE 0
39+
40+
const ioport_pin_cfg_t board_pin_cfg[] = {
41+
{ .pin = LED1, .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_OUTPUT | (uint32_t) IOPORT_CFG_PORT_OUTPUT_LOW) },
42+
{ .pin = SW1 , .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_INPUT) },
43+
44+
{ .pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
45+
{ .pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
46+
{ .pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
47+
};
48+
49+
#ifdef __cplusplus
50+
}
51+
#endif
52+
53+
#endif

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ MCU_VARIANT = ra4m1
33

44
FSP_BOARD_DIR = hw/mcu/renesas/fsp/ra/board/ra4m1_ek
55

6-
SRC_C += \
7-
$(FSP_BOARD_DIR)/board_init.c \
8-
$(FSP_BOARD_DIR)/board_leds.c \
9-
10-
INC += \
11-
$(TOP)/$(FSP_BOARD_DIR)
12-
136
# All source paths should be relative to the top level.
147
LD_FILE = $(BOARD_PATH)/ra4m1_ek.ld
158

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#ifndef BSP_CFG_H_
33
#define BSP_CFG_H_
44

5-
#include "board.h"
65
#include "bsp_clock_cfg.h"
76
#include "bsp_mcu_family_cfg.h"
87

@@ -32,4 +31,9 @@
3231
#define BSP_CLOCK_CFG_SUBCLOCK_POPULATED (1)
3332
#define BSP_CLOCK_CFG_SUBCLOCK_STABILIZATION_MS 1000
3433

34+
#define BSP_FEATURE_TFU_SUPPORTED 0
35+
36+
// for SystemInit()
37+
void bsp_init(void * p_args);
38+
3539
#endif /* BSP_CFG_H_ */

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
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+
2833
#define OFS_SEQ1 0xA001A001 | (1 << 1) | (3 << 2)
2934
#define OFS_SEQ2 (15 << 4) | (3 << 8) | (3 << 10)
3035
#define OFS_SEQ3 (1 << 12) | (1 << 14) | (1 << 17)

hw/bsp/ra/boards/ra4m1_ek/ra4m1_ek.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ SECTIONS
553553
{
554554
. = ALIGN(8);
555555
__HeapBase = .;
556+
PROVIDE(end = .);
556557
/* Place the STD heap here. */
557558
KEEP(*(.heap))
558559
__HeapLimit = .;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(CMAKE_SYSTEM_PROCESSOR cortex-m33 CACHE INTERNAL "System Processor")
2+
set(MCU_VARIANT ra4m3)
3+
4+
set(JLINK_DEVICE R7FA4M3AF)
5+
6+
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/ra4m3_ek.ld)
7+
8+
function(update_board TARGET)
9+
target_compile_definitions(${TARGET} PUBLIC
10+
)
11+
target_sources(${TARGET} PRIVATE
12+
)
13+
target_include_directories(${BOARD_TARGET} PUBLIC
14+
)
15+
endfunction()

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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_15)
35+
#define LED_STATE_ON 1
36+
37+
#define SW1 (BSP_IO_PORT_00_PIN_05)
38+
#define BUTTON_STATE_ACTIVE 0
39+
40+
const ioport_pin_cfg_t board_pin_cfg[] = {
41+
{.pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS)},
42+
{.pin = BSP_IO_PORT_05_PIN_00, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS)},
43+
{.pin = BSP_IO_PORT_05_PIN_01, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS)},
44+
{.pin = LED1, .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_OUTPUT | (uint32_t) IOPORT_CFG_PORT_OUTPUT_LOW)},
45+
{.pin = SW1, .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_INPUT)},
46+
};
47+
48+
#ifdef __cplusplus
49+
}
50+
#endif
51+
52+
#endif

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ MCU_VARIANT = ra4m3
33

44
FSP_BOARD_DIR = hw/mcu/renesas/fsp/ra/board/ra4m3_ek
55

6-
SRC_C += \
7-
$(FSP_BOARD_DIR)/board_init.c \
8-
$(FSP_BOARD_DIR)/board_leds.c \
9-
10-
INC += \
11-
$(TOP)/$(FSP_BOARD_DIR)
12-
136
# All source paths should be relative to the top level.
147
LD_FILE = $(BOARD_PATH)/ra4m3_ek.ld
158

0 commit comments

Comments
 (0)