Skip to content

Commit 53f7f01

Browse files
committed
ports/renesas-ra/boards/VK-RA6M3: New Board.
ports/renesas-ra/boards: New processor RA6M3. ports/renesas-ra: Integration to the existing RA family. Signed-off-by: mbedNoobNinja <novoltage@gmail.com>
1 parent 4937174 commit 53f7f01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7706
-191
lines changed

ports/renesas-ra/Makefile

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,16 @@ endif
1616
# If the build directory is not given, make it reflect the board name.
1717
BUILD ?= build-$(BOARD)
1818

19-
ifeq ($(BOARD),RA4M1_CLICKER)
20-
BOARD_LOW = ra4m1_ek
21-
CMSIS_MCU_LOW = ra4m1
22-
CMSIS_MCU_CAP = RA4M1
23-
USE_FSP_LPM = 0
24-
endif
25-
26-
ifeq ($(BOARD),RA4M1_EK)
27-
BOARD_LOW = ra4m1_ek
28-
CMSIS_MCU_LOW = ra4m1
29-
CMSIS_MCU_CAP = RA4M1
30-
USE_FSP_LPM = 0
31-
endif
32-
33-
ifeq ($(BOARD),RA4W1_EK)
34-
BOARD_LOW = ra4w1_ek
35-
CMSIS_MCU_LOW = ra4w1
36-
CMSIS_MCU_CAP = RA4W1
37-
USE_FSP_LPM = 1
38-
endif
39-
40-
ifeq ($(BOARD),RA6M1_EK)
41-
BOARD_LOW = ra6m1_ek
42-
CMSIS_MCU_LOW = ra6m1
43-
CMSIS_MCU_CAP = RA6M1
44-
USE_FSP_LPM = 1
45-
endif
46-
47-
ifeq ($(BOARD),RA6M2_EK)
48-
BOARD_LOW = ra6m2_ek
49-
CMSIS_MCU_LOW = ra6m2
50-
CMSIS_MCU_CAP = RA6M2
51-
USE_FSP_LPM = 1
52-
endif
53-
5419
# select use wrapper function of FSP library
5520
USE_FSP_FLASH = 1
5621

5722
include ../../py/mkenv.mk
5823
-include mpconfigport.mk
5924
include $(BOARD_DIR)/mpconfigboard.mk
6025

26+
USE_FSP_LPM ?= 1
27+
FSP_BOARD_NAME ?= $(shell echo $(BOARD) | tr '[:upper:]' '[:lower:]')
28+
6129
# Files that are generated and needed before the QSTR build.
6230
#QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h
6331
QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h
@@ -99,7 +67,7 @@ INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/inc/api
9967
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/inc/instances
10068
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/bsp/cmsis/Device/RENESAS/Include
10169
#INC += -Ilwip_inc
102-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2))
70+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M3))
10371
INC += -Ira
10472
endif
10573
INC += -I$(BOARD_DIR)/ra_gen
@@ -126,6 +94,7 @@ CFLAGS_MCU_RA4M1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
12694
CFLAGS_MCU_RA4W1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
12795
CFLAGS_MCU_RA6M1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
12896
CFLAGS_MCU_RA6M2 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
97+
CFLAGS_MCU_RA6M3 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
12998

13099
CFLAGS += $(INC) -Wall -Wpointer-arith -Werror -Wdouble-promotion -Wfloat-conversion -std=gnu99 -nostdlib $(CFLAGS_EXTRA)
131100
#CFLAGS += -D$(CMSIS_MCU)
@@ -312,6 +281,7 @@ SRC_C += \
312281
gccollect.c \
313282
help.c \
314283
machine_adc.c \
284+
machine_dac.c \
315285
machine_i2c.c \
316286
machine_spi.c \
317287
machine_uart.c \
@@ -343,10 +313,13 @@ SRC_O += \
343313
SRC_O += \
344314
shared/runtime/gchelper_thumb2.o
345315

346-
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/board/$(BOARD_LOW)/,\
316+
FSP_BOARD_DIR = $(HAL_DIR)/ra/board/$(FSP_BOARD_NAME)
317+
ifneq ($(wildcard $(TOP)/$(FSP_BOARD_DIR)/.),)
318+
HAL_SRC_C += $(addprefix $(FSP_BOARD_DIR)/,\
347319
board_init.c \
348320
board_leds.c \
349321
)
322+
endif
350323

351324
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/fsp/src/bsp/mcu/all/,\
352325
bsp_clocks.c \
@@ -378,16 +351,17 @@ HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_flash_lp/r_flash_lp.c
378351
endif
379352
endif
380353

381-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M1 RA6M2))
354+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M1 RA6M2 RA6M3))
382355
ifeq ($(USE_FSP_FLASH), 1)
383356
CFLAGS += -DUSE_FSP_FLASH
384357
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_flash_hp/r_flash_hp.c
385358
endif
386359
endif
387360

388-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2))
361+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M3))
389362
HAL_SRC_C += $(addprefix ra/,\
390363
ra_adc.c \
364+
ra_dac.c \
391365
ra_flash.c \
392366
ra_gpio.c \
393367
ra_i2c.c \
@@ -398,6 +372,7 @@ HAL_SRC_C += $(addprefix ra/,\
398372
ra_sci.c \
399373
ra_spi.c \
400374
ra_timer.c \
375+
ra_gpt.c \
401376
ra_utils.c \
402377
)
403378

@@ -500,6 +475,9 @@ endif
500475
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M2))
501476
AF_FILE = boards/ra6m2_af.csv
502477
endif
478+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M3))
479+
AF_FILE = boards/ra6m3_af.csv
480+
endif
503481
GEN_PINS_SRC = $(BUILD)/pins_$(BOARD).c
504482
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
505483
GEN_PINS_QSTR = $(BUILD)/pins_qstr.h

ports/renesas-ra/RA4M1_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA4W1_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA6M1_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA6M2_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA6M3_hal.h

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Renesas Electronics Corporation
5+
* Copyright (c) 2023 Vekatech Ltd.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
26+
#ifndef PORTS_RA_RA6M3_HAL_H_
27+
#define PORTS_RA_RA6M3_HAL_H_
28+
29+
#include <stdio.h>
30+
#include <stdint.h>
31+
#include <stdbool.h>
32+
// #include "hal_data.h"
33+
#include "bsp_api.h"
34+
#include "common_data.h"
35+
36+
#define SCI_CH 9
37+
#define SCI_BAUD 115200
38+
#define UART_CH SCI_CH
39+
#define UART_TxStr sci_tx_str
40+
#define PCLK 120000000
41+
42+
#define RA_PRI_SYSTICK (0)
43+
#define RA_PRI_UART (1)
44+
#define RA_PRI_SDIO (4)
45+
#define RA_PRI_DMA (5)
46+
#define RA_PRI_FLASH (6)
47+
#define RA_PRI_OTG_FS (6)
48+
#define RA_PRI_OTG_HS (6)
49+
#define RA_PRI_TIM5 (6)
50+
#define RA_PRI_CAN (7)
51+
#define RA_PRI_SPI (8)
52+
#define RA_PRI_I2C (8)
53+
#define RA_PRI_TIMX (13)
54+
#define RA_PRI_EXTINT (14)
55+
#define RA_PRI_PENDSV (15)
56+
#define RA_PRI_RTC_WKUP (15)
57+
58+
#include "ra_config.h"
59+
#include "ra_adc.h"
60+
#include "ra_dac.h"
61+
#include "ra_flash.h"
62+
#include "ra_gpio.h"
63+
#include "ra_gpt.h"
64+
#include "ra_i2c.h"
65+
#include "ra_icu.h"
66+
#include "ra_init.h"
67+
#include "ra_int.h"
68+
#include "ra_rtc.h"
69+
#include "ra_sci.h"
70+
#include "ra_spi.h"
71+
#include "ra_timer.h"
72+
#include "ra_utils.h"
73+
74+
typedef enum {
75+
HAL_OK = 0x00,
76+
HAL_ERROR = 0x01,
77+
HAL_BUSY = 0x02,
78+
HAL_TIMEOUT = 0x03
79+
} HAL_StatusTypeDef;
80+
81+
#define __IO volatile
82+
83+
#if defined(USE_DBG_PRINT)
84+
#if !defined(DEBUG_CH)
85+
#define DEBUG_CH SCI_CH
86+
#endif
87+
#if (DEBUG_CH == 7)
88+
#define DEBUG_TX_PIN P613
89+
#define DEBUG_RX_PIN P614
90+
#endif
91+
#if (DEBUG_CH == 8)
92+
#define DEBUG_TX_PIN P105
93+
#define DEBUG_RX_PIN P104
94+
#endif
95+
#if (DEBUG_CH == 9)
96+
#define DEBUG_TX_PIN P109
97+
#define DEBUG_RX_PIN P110
98+
#endif
99+
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
100+
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
101+
#else
102+
#define DEBUG_TXSTR(s)
103+
#define DEBUG_TXCH(c)
104+
#endif
105+
106+
#endif /* PORTS_RA_RA6M3_HAL_H_ */

ports/renesas-ra/boards/RA4M1_CLICKER/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_CLICKER/ra4m1_clicker.ld
44

55
# MicroPython settings
66
MICROPY_VFS_FAT = 1
7+
USE_FSP_LPM = 0
78

89
# Don't include default frozen modules because MCU is tight on flash space
910
FROZEN_MANIFEST ?= boards/RA4M1_CLICKER/manifest.py

ports/renesas-ra/boards/RA4M1_EK/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_EK/ra4m1_ek.ld
44

55
# MicroPython settings
66
MICROPY_VFS_FAT = 1
7+
USE_FSP_LPM = 0
78

89
# Don't include default frozen modules because MCU is tight on flash space
910
FROZEN_MANIFEST ?= boards/RA4M1_EK/manifest.py

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy