Skip to content

ports/renesas-ra/boards/VK-RA4W1: New board. #10595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 11 additions & 36 deletions ports/renesas-ra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,16 @@ endif
# If the build directory is not given, make it reflect the board name.
BUILD ?= build-$(BOARD)

ifeq ($(BOARD),RA4M1_CLICKER)
BOARD_LOW = ra4m1_ek
CMSIS_MCU_LOW = ra4m1
CMSIS_MCU_CAP = RA4M1
USE_FSP_LPM = 0
endif

ifeq ($(BOARD),RA4M1_EK)
BOARD_LOW = ra4m1_ek
CMSIS_MCU_LOW = ra4m1
CMSIS_MCU_CAP = RA4M1
USE_FSP_LPM = 0
endif

ifeq ($(BOARD),RA4W1_EK)
BOARD_LOW = ra4w1_ek
CMSIS_MCU_LOW = ra4w1
CMSIS_MCU_CAP = RA4W1
USE_FSP_LPM = 1
endif

ifeq ($(BOARD),RA6M1_EK)
BOARD_LOW = ra6m1_ek
CMSIS_MCU_LOW = ra6m1
CMSIS_MCU_CAP = RA6M1
USE_FSP_LPM = 1
endif

ifeq ($(BOARD),RA6M2_EK)
BOARD_LOW = ra6m2_ek
CMSIS_MCU_LOW = ra6m2
CMSIS_MCU_CAP = RA6M2
USE_FSP_LPM = 1
endif

# select use wrapper function of FSP library
USE_FSP_FLASH = 1

include ../../py/mkenv.mk
-include mpconfigport.mk
include $(BOARD_DIR)/mpconfigboard.mk

USE_FSP_LPM ?= 1
FSP_BOARD_NAME ?= $(shell echo $(BOARD) | tr '[:upper:]' '[:lower:]')

# Files that are generated and needed before the QSTR build.
#QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h
QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h
Expand Down Expand Up @@ -109,6 +77,7 @@ INC += -Idebug

CFLAGS += -D$(CMSIS_MCU)
CFLAGS += -DRA_HAL_H='<$(CMSIS_MCU)_hal.h>'
CFLAGS += -DRA_CFG_H='<$(FSP_BOARD_NAME)_conf.h>'

# Basic Cortex-M flags
CFLAGS_CORTEX_M = -mthumb
Expand Down Expand Up @@ -312,6 +281,7 @@ SRC_C += \
gccollect.c \
help.c \
machine_adc.c \
machine_dac.c \
machine_i2c.c \
machine_spi.c \
machine_uart.c \
Expand Down Expand Up @@ -343,10 +313,13 @@ SRC_O += \
SRC_O += \
shared/runtime/gchelper_thumb2.o

HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/board/$(BOARD_LOW)/,\
FSP_BOARD_DIR = $(HAL_DIR)/ra/board/$(FSP_BOARD_NAME)
ifneq ($(wildcard $(TOP)/$(FSP_BOARD_DIR)/.),)
HAL_SRC_C += $(addprefix $(FSP_BOARD_DIR)/,\
board_init.c \
board_leds.c \
)
endif

HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/fsp/src/bsp/mcu/all/,\
bsp_clocks.c \
Expand Down Expand Up @@ -388,6 +361,7 @@ endif
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2))
HAL_SRC_C += $(addprefix ra/,\
ra_adc.c \
ra_dac.c \
ra_flash.c \
ra_gpio.c \
ra_i2c.c \
Expand All @@ -398,6 +372,7 @@ HAL_SRC_C += $(addprefix ra/,\
ra_sci.c \
ra_spi.c \
ra_timer.c \
ra_gpt.c \
ra_utils.c \
)

Expand Down
2 changes: 2 additions & 0 deletions ports/renesas-ra/RA4M1_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@

#include "ra_config.h"
#include "ra_adc.h"
#include "ra_dac.h"
#include "ra_flash.h"
#include "ra_gpio.h"
#include "ra_gpt.h"
#include "ra_i2c.h"
#include "ra_icu.h"
#include "ra_init.h"
Expand Down
18 changes: 12 additions & 6 deletions ports/renesas-ra/RA4W1_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* The MIT License (MIT)
*
* Copyright (c) 2021 Renesas Electronics Corporation
* Copyright (c) 2023 Vekatech Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -31,6 +32,9 @@
// #include "hal_data.h"
#include "bsp_api.h"
#include "common_data.h"
#if defined(USE_DBG_PRINT)
#include RA_CFG_H
#endif

#define SCI_CH 0
#define SCI_BAUD 115200
Expand All @@ -56,8 +60,10 @@

#include "ra_config.h"
#include "ra_adc.h"
#include "ra_dac.h"
#include "ra_flash.h"
#include "ra_gpio.h"
#include "ra_gpt.h"
#include "ra_i2c.h"
#include "ra_icu.h"
#include "ra_init.h"
Expand All @@ -82,16 +88,16 @@ typedef enum {
#define DEBUG_CH SCI_CH
#endif
#if (DEBUG_CH == 0)
#define DEBUG_TX_PIN P411
#define DEBUG_RX_PIN P410
#define DEBUG_TX_PIN DBG_TX0
#define DEBUG_RX_PIN DBG_RX0
#endif
#if (DEBUG_CH == 1)
#define DEBUG_TX_PIN P401
#define DEBUG_RX_PIN P402
#define DEBUG_TX_PIN DBG_TX1
#define DEBUG_RX_PIN DBG_RX1
#endif
#if (DEBUG_CH == 9)
#define DEBUG_TX_PIN P203
#define DEBUG_RX_PIN P202
#define DEBUG_TX_PIN DBG_TX9
#define DEBUG_RX_PIN DBG_RX9
#endif
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
Expand Down
2 changes: 2 additions & 0 deletions ports/renesas-ra/RA6M1_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@

#include "ra_config.h"
#include "ra_adc.h"
#include "ra_dac.h"
#include "ra_flash.h"
#include "ra_gpio.h"
#include "ra_gpt.h"
#include "ra_i2c.h"
#include "ra_icu.h"
#include "ra_init.h"
Expand Down
2 changes: 2 additions & 0 deletions ports/renesas-ra/RA6M2_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@

#include "ra_config.h"
#include "ra_adc.h"
#include "ra_dac.h"
#include "ra_flash.h"
#include "ra_gpio.h"
#include "ra_gpt.h"
#include "ra_i2c.h"
#include "ra_icu.h"
#include "ra_init.h"
Expand Down
1 change: 1 addition & 0 deletions ports/renesas-ra/boards/RA4M1_CLICKER/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_CLICKER/ra4m1_clicker.ld

# MicroPython settings
MICROPY_VFS_FAT = 1
USE_FSP_LPM = 0

# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MANIFEST ?= boards/RA4M1_CLICKER/manifest.py
1 change: 1 addition & 0 deletions ports/renesas-ra/boards/RA4M1_EK/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_EK/ra4m1_ek.ld

# MicroPython settings
MICROPY_VFS_FAT = 1
USE_FSP_LPM = 0

# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MANIFEST ?= boards/RA4M1_EK/manifest.py
9 changes: 9 additions & 0 deletions ports/renesas-ra/boards/RA4W1_EK/ra4w1_ek_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@

#define DEBUG_CH 0

#define DBG_TX0 P411
#define DBG_RX0 P410

#define DBG_TX1 P401
#define DBG_RX1 P402

#define DBG_TX9 P203
#define DBG_RX9 P202

#endif /* RA4M1_EK_CONF_H */
Loading