Skip to content
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
23 changes: 14 additions & 9 deletions ref_app/src/mcal/v850es_jg3/mcal_osc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include <mcal_cpu.h>
#include <mcal_osc.h>

#include <cstdint>

#define PLLCTL (*(volatile uint8_t*)0xFFFFF82Cul)
#define PLLLOCKR (*(volatile uint8_t*)0xFFFFF824ul)
#define PCC (*(volatile uint8_t*)0xFFFFF828ul)
#define PRCMD (*(volatile uint8_t*)0xFFFFF1FCul)

auto mcal::osc::init(const config_type*) -> void
{
constexpr std::uintptr_t PLLCTL { 0xFFFFF82CUL };
constexpr std::uintptr_t PLLLOCKR { 0xFFFFF824UL };
constexpr std::uintptr_t PCC { 0xFFFFF828UL };
constexpr std::uintptr_t PRCMD { 0xFFFFF1FCUL };

/* enable the PLL (20MHz) */
PRCMD = 0;
PCC = 0;
PLLCTL = 3;
while(PLLLOCKR);
*(volatile uint8_t*) PRCMD = 0;
*(volatile uint8_t*) PCC = 0;
*(volatile uint8_t*) PLLCTL = 3;

while(*(volatile uint8_t*) PLLLOCKR != std::uint8_t { UINT8_C(0) })
{
mcal::cpu::nop();
}
}

extern "C"
Expand Down
12 changes: 9 additions & 3 deletions ref_app/src/mcal/v850es_jg3/mcal_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@

auto mcal::port::init(const config_type*) -> void
{
/* set P36 as output low (LED ON) */
// P3L &= (uint8_t)~(1u << 6);
// PM3L &= (uint8_t)~(1u << 6);
}

extern "C"
auto port_init(void) -> void;

extern "C"
auto port_init(void) -> void
{
mcal::port::init(nullptr);
}
4 changes: 2 additions & 2 deletions ref_app/target/app/make/app_make.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ WARN_FLAGS = -Wall \

endif

GCCFLAGS = -g \
GCCFLAGS = -gdwarf-4 \
-ggdb \
$(WARN_FLAGS) \
-Wno-comment \
-gdwarf-4 \
-fno-exceptions \
-fdata-sections \
-ffunction-sections
Expand Down
32 changes: 16 additions & 16 deletions ref_app/target/build/test_app_benchmarks_v850.sh

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ref_app/target/micros/v850es_jg3/make/v850es_jg3.ld
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright Christopher Kormanyos 2007 - 2024.
Copyright Christopher Kormanyos 2007 - 2026.
Distributed under the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt
or copy at http://www.boost.org/LICENSE_1_0.txt)
*/

/* Originally from: */
/* Revision, originally from: */
/******************************************************************************************
Filename : V850ES.ld

Expand Down
2 changes: 1 addition & 1 deletion ref_app/target/micros/v850es_jg3/make/v850es_jg3_files.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright Christopher Kormanyos 2026.
# Copyright Christopher Kormanyos 2007 - 2026.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
13 changes: 7 additions & 6 deletions ref_app/target/micros/v850es_jg3/make/v850es_jg3_flags.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright Christopher Kormanyos 2014 - 2026.
# Copyright Christopher Kormanyos 2007 - 2026.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -15,13 +15,14 @@ GCC_PREFIX = v850-unknown-elf

TGT_SUFFIX = elf

TGT_ALLFLAGS = -Os \
-mv850e1 \
-mlong-calls \
-mgcc-abi \
TGT_ALLFLAGS = -O2 \
-mv850es \
-mtda=0 \
-mzda=0 \
-msda=0 \
-Wl,--defsym=__gp=0 \
-Wl,--defsym=__ep=0 \
-falign-functions=4 \
-fomit-frame-pointer \
-finline-functions \
-finline-limit=32

Expand Down
5 changes: 4 additions & 1 deletion ref_app/target/micros/v850es_jg3/startup/boot.s
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
.globl _start

_start:

# initialize I/O ports
jarl _port_init, lp

# enable the PLL (20MHz)
jarl _pll_init, lp

Expand All @@ -48,5 +52,4 @@ _start:
# call C/C++ runtime initialization
jr _Startup_Init


.size _start, .-_start
Loading