Skip to content

Commit 6f52c50

Browse files
authored
Merge pull request #627 from ckormanyos/syntax_and_typos
Handle some syntax and typos
2 parents f0b4435 + 6c50fef commit 6f52c50

6 files changed

Lines changed: 63 additions & 46 deletions

File tree

readme.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,12 @@ The multicore system first boots core0 which subsequently
406406
starts up core1 and also starts up the RISCV coprocessor core.
407407
Blinky runs in the standard `ref_app`
408408
on core0 toggling `port7` while an endless timer loop on core1
409-
toggles `port6`. The LED ports togle in near unison at $\frac{1}{2}~\text{Hz}$.
410-
Self-procured LEDs and resistors need to be fitted in order to observe
411-
blinky on this particular board. The RISCV coprocessor
412-
toggles `port17` at a randomly chosen, visible frequency.
409+
toggles `port6`. These LED ports togle in near unison
410+
at the normal blinky feequency of $\frac{1}{2}~\text{Hz}$.
411+
The RISCV coprocessor toggles `port17` at a randomly chosen
412+
frequency slightly higher than that of the regular blinky show.
413+
Self-procured LEDs and resistors need to be fitted externally
414+
on the port pins in order to observe blinking on this particular board.
413415

414416
The NXP(R) OM13093 LPC11C24 board ARM(R) Cortex(R)-M0+ configuration
415417
called `target lpc11c24` toggles the LED on `port0.8`.

ref_app/src/mcal/xtensa_esp32_s3_riscv_cop/mcal_port.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,4 @@
77

88
#include <mcal_port.h>
99

10-
auto mcal::port::init(const config_type*) -> void
11-
{
12-
// Set all GPIO out registers to low.
13-
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpio::rtc_gpio_out_reg, UINT32_C(0)>::reg_set();
14-
}
10+
auto mcal::port::init(const config_type*) -> void { }

ref_app/src/mcal/xtensa_esp32_s3_riscv_cop/mcal_port.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
public:
3030
static auto set_direction_output() -> void
3131
{
32-
//RTC_IO_RTC_PAD17_REG |= (1ul << 19);
33-
//RTC_GPIO_PIN17_REG = 0;
34-
//RTC_GPIO_ENABLE_REG |= (1ul << (10 + 17));
35-
3632
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, io_rtc_padxx_reg, UINT32_C(19)>::bit_set();
3733
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, gpio_pinxx_reg, UINT32_C(0)>::reg_set();
34+
35+
// Set the pin to output low.
36+
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpio::rtc_gpio_out_reg, std::uint32_t { UINT32_C(10) + bpos }>::bit_clr();
3837
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpio::rtc_gpio_enable_reg, std::uint32_t { UINT32_C(10) + bpos }>::bit_set();
3938
}
4039

@@ -49,7 +48,7 @@
4948

5049
static auto set_pin_low() -> void
5150
{
52-
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpio::rtc_gpio_out_reg, std::uint32_t { UINT32_C(10) + bpos }>::bit_set();
51+
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpio::rtc_gpio_out_reg, std::uint32_t { UINT32_C(10) + bpos }>::bit_clr();
5352
}
5453

5554
static auto read_input_value() -> bool

ref_app/target/micros/xtensa_esp32_s3/startup/coprocessor_binary.S

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.global coprocessor_bin
33
coprocessor_bin:
44
.byte 0x6F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
5-
.byte 0x17, 0x11, 0x00, 0x00, 0x13, 0x01, 0xC1, 0x43, 0x6F, 0x00, 0x80, 0x20, 0x41, 0x11, 0x06, 0xC6
5+
.byte 0x17, 0x11, 0x00, 0x00, 0x13, 0x01, 0xC1, 0x43, 0x6F, 0x00, 0x00, 0x22, 0x41, 0x11, 0x06, 0xC6
66
.byte 0x21, 0x22, 0xB2, 0x40, 0x41, 0x01, 0x82, 0x80, 0xB7, 0x16, 0x00, 0x50, 0x03, 0xA7, 0x86, 0x01
77
.byte 0xB7, 0x17, 0x00, 0x50, 0x93, 0x87, 0x07, 0x03, 0x3A, 0x95, 0x63, 0x74, 0xF5, 0x00, 0x23, 0xAC
88
.byte 0xA6, 0x00, 0x3A, 0x85, 0x82, 0x80, 0x00, 0x00, 0x82, 0x80, 0x00, 0x00, 0x82, 0x80, 0x00, 0x00
@@ -25,28 +25,28 @@ coprocessor_bin:
2525
.byte 0x23, 0xA0, 0xD7, 0x40, 0x93, 0x47, 0x17, 0x00, 0x23, 0x02, 0xF5, 0x00, 0x82, 0x80, 0x00, 0x00
2626
.byte 0xA1, 0x45, 0xED, 0xB5, 0xB7, 0x17, 0x00, 0x50, 0x03, 0xC7, 0x87, 0x03, 0x41, 0x11, 0x22, 0xC4
2727
.byte 0x06, 0xC6, 0x37, 0x14, 0x00, 0x50, 0x19, 0xC7, 0xB2, 0x40, 0x13, 0x05, 0x04, 0x04, 0x22, 0x44
28-
.byte 0x41, 0x01, 0x82, 0x80, 0xA9, 0x66, 0x03, 0xA6, 0x06, 0x40, 0x37, 0x17, 0x00, 0x50, 0x93, 0x05
29-
.byte 0x04, 0x04, 0x37, 0x08, 0x00, 0x08, 0x13, 0x07, 0x87, 0x00, 0x98, 0xC1, 0x33, 0x66, 0x06, 0x01
30-
.byte 0x23, 0xA0, 0xC6, 0x40, 0x03, 0xA6, 0x86, 0x4C, 0x37, 0x05, 0x08, 0x00, 0x36, 0x87, 0x49, 0x8E
31-
.byte 0x23, 0xA4, 0xC6, 0x4C, 0x23, 0xA6, 0x06, 0x46, 0x83, 0xA6, 0xC6, 0x40, 0x37, 0x05, 0x00, 0x50
32-
.byte 0x13, 0x05, 0xC5, 0x13, 0xB3, 0xE6, 0x06, 0x01, 0x23, 0x26, 0xD7, 0x40, 0x05, 0x47, 0x23, 0x82
33-
.byte 0x05, 0x00, 0x23, 0x8C, 0xE7, 0x02, 0x49, 0x35, 0xB2, 0x40, 0x13, 0x05, 0x04, 0x04, 0x22, 0x44
34-
.byte 0x41, 0x01, 0x82, 0x80, 0xA9, 0x67, 0x23, 0xA0, 0x07, 0x40, 0x82, 0x80, 0x00, 0x00, 0x00, 0x00
35-
.byte 0x41, 0x11, 0x01, 0x45, 0x06, 0xC6, 0x22, 0xC4, 0xF5, 0x37, 0x01, 0x45, 0x11, 0x3F, 0x37, 0x14
36-
.byte 0x00, 0x50, 0x8D, 0x37, 0x1C, 0x41, 0x9C, 0x47, 0x82, 0x97, 0x37, 0x07, 0x06, 0x00, 0x83, 0x27
37-
.byte 0x84, 0x04, 0x7D, 0x17, 0x85, 0x07, 0x23, 0x24, 0xF4, 0x04, 0x75, 0xFB, 0xDD, 0xB7, 0x00, 0x00
38-
.byte 0x41, 0x11, 0x06, 0xC6, 0x31, 0x20, 0xAD, 0x20, 0xE1, 0x37, 0x01, 0x00, 0x01, 0x00, 0xF5, 0xBF
39-
.byte 0xB7, 0x16, 0x00, 0x50, 0x37, 0x17, 0x00, 0x50, 0x93, 0x86, 0xC6, 0x01, 0x93, 0x05, 0x87, 0x01
40-
.byte 0xB7, 0x17, 0x00, 0x50, 0x33, 0x85, 0xB6, 0x40, 0x13, 0x86, 0x87, 0x01, 0x2A, 0x96, 0x63, 0x8D
41-
.byte 0xB6, 0x00, 0x13, 0x07, 0x87, 0x01, 0x93, 0x87, 0x87, 0x01, 0x94, 0x43, 0x91, 0x07, 0x11, 0x07
42-
.byte 0x23, 0x2E, 0xD7, 0xFE, 0xE3, 0x1B, 0xF6, 0xFE, 0xB7, 0x17, 0x00, 0x50, 0x37, 0x17, 0x00, 0x50
43-
.byte 0x93, 0x86, 0x07, 0x02, 0x13, 0x07, 0xC7, 0x04, 0x63, 0x89, 0xE6, 0x00, 0x93, 0x87, 0x07, 0x02
44-
.byte 0x23, 0xA0, 0x07, 0x00, 0x91, 0x07, 0xE3, 0x9D, 0xE7, 0xFE, 0x82, 0x80, 0x00, 0x00, 0x00, 0x00
45-
.byte 0x41, 0x11, 0x22, 0xC4, 0x26, 0xC2, 0x37, 0x14, 0x00, 0x50, 0xB7, 0x14, 0x00, 0x50, 0x06, 0xC6
46-
.byte 0x93, 0x07, 0x84, 0x01, 0x93, 0x84, 0x84, 0x01, 0x63, 0x8A, 0x97, 0x00, 0x13, 0x04, 0x84, 0x01
47-
.byte 0x83, 0x27, 0xC4, 0xFF, 0x71, 0x14, 0x82, 0x97, 0xE3, 0x1C, 0x94, 0xFE, 0xB2, 0x40, 0x22, 0x44
48-
.byte 0x92, 0x44, 0x41, 0x01, 0x82, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
49-
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
28+
.byte 0x41, 0x01, 0x82, 0x80, 0x29, 0x67, 0x83, 0x25, 0x07, 0x40, 0xB7, 0x16, 0x00, 0x50, 0x37, 0x06
29+
.byte 0x00, 0xF8, 0x13, 0x08, 0x04, 0x04, 0x93, 0x86, 0x86, 0x00, 0x7D, 0x16, 0x23, 0x20, 0xD8, 0x00
30+
.byte 0xF1, 0x8D, 0x23, 0x20, 0xB7, 0x40, 0x03, 0x25, 0x87, 0x4C, 0xB7, 0x08, 0x08, 0x00, 0xBA, 0x86
31+
.byte 0x33, 0x65, 0x15, 0x01, 0x23, 0x24, 0xA7, 0x4C, 0x23, 0x26, 0x07, 0x46, 0x83, 0x25, 0x07, 0x40
32+
.byte 0x37, 0x05, 0x00, 0x50, 0x13, 0x05, 0xC5, 0x13, 0x6D, 0x8E, 0x23, 0x20, 0xC7, 0x40, 0x03, 0x27
33+
.byte 0xC7, 0x40, 0x37, 0x06, 0x00, 0x08, 0x51, 0x8F, 0x23, 0xA6, 0xE6, 0x40, 0x05, 0x47, 0x23, 0x02
34+
.byte 0x08, 0x00, 0x23, 0x8C, 0xE7, 0x02, 0x8D, 0x3D, 0xB2, 0x40, 0x13, 0x05, 0x04, 0x04, 0x22, 0x44
35+
.byte 0x41, 0x01, 0x82, 0x80, 0x82, 0x80, 0x00, 0x00, 0x41, 0x11, 0x01, 0x45, 0x06, 0xC6, 0xDD, 0x3F
36+
.byte 0xB2, 0x40, 0x01, 0x45, 0x41, 0x01, 0x29, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x41, 0x11, 0x22, 0xC4
37+
.byte 0x06, 0xC6, 0x37, 0x14, 0x00, 0x50, 0xCD, 0x37, 0xB1, 0x37, 0x1C, 0x41, 0x9C, 0x47, 0x82, 0x97
38+
.byte 0x37, 0x07, 0x06, 0x00, 0x83, 0x27, 0x84, 0x04, 0x7D, 0x17, 0x85, 0x07, 0x23, 0x24, 0xF4, 0x04
39+
.byte 0x75, 0xFB, 0xDD, 0xB7, 0x00, 0x00, 0x00, 0x00, 0x41, 0x11, 0x06, 0xC6, 0x31, 0x20, 0xAD, 0x20
40+
.byte 0xF1, 0x37, 0x01, 0x00, 0x01, 0x00, 0xF5, 0xBF, 0xB7, 0x16, 0x00, 0x50, 0x37, 0x17, 0x00, 0x50
41+
.byte 0x93, 0x86, 0xC6, 0x01, 0x93, 0x05, 0x87, 0x01, 0xB7, 0x17, 0x00, 0x50, 0x33, 0x85, 0xB6, 0x40
42+
.byte 0x13, 0x86, 0x87, 0x01, 0x2A, 0x96, 0x63, 0x8D, 0xB6, 0x00, 0x13, 0x07, 0x87, 0x01, 0x93, 0x87
43+
.byte 0x87, 0x01, 0x94, 0x43, 0x91, 0x07, 0x11, 0x07, 0x23, 0x2E, 0xD7, 0xFE, 0xE3, 0x1B, 0xF6, 0xFE
44+
.byte 0xB7, 0x17, 0x00, 0x50, 0x37, 0x17, 0x00, 0x50, 0x93, 0x86, 0x07, 0x02, 0x13, 0x07, 0xC7, 0x04
45+
.byte 0x63, 0x89, 0xE6, 0x00, 0x93, 0x87, 0x07, 0x02, 0x23, 0xA0, 0x07, 0x00, 0x91, 0x07, 0xE3, 0x9D
46+
.byte 0xE7, 0xFE, 0x82, 0x80, 0x00, 0x00, 0x00, 0x00, 0x41, 0x11, 0x22, 0xC4, 0x26, 0xC2, 0x37, 0x14
47+
.byte 0x00, 0x50, 0xB7, 0x14, 0x00, 0x50, 0x06, 0xC6, 0x93, 0x07, 0x84, 0x01, 0x93, 0x84, 0x84, 0x01
48+
.byte 0x63, 0x8A, 0x97, 0x00, 0x13, 0x04, 0x84, 0x01, 0x83, 0x27, 0xC4, 0xFF, 0x71, 0x14, 0x82, 0x97
49+
.byte 0xE3, 0x1C, 0x94, 0xFE, 0xB2, 0x40, 0x22, 0x44, 0x92, 0x44, 0x41, 0x01, 0x82, 0x80, 0x00, 0x00
5050
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
5151
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
5252
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

ref_app/target/micros/xtensa_esp32_s3_riscv_cop/make/xtensa_esp32_s3_riscv_cop_flags.gmk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,8 @@ PYTHON := python
107107

108108
RULE_SPECIAL_MAKE_IMAGE_FILE_PART01 := $(OBJCOPY) $(APP).$(TGT_SUFFIX) -O binary $(APP).bin
109109
RULE_SPECIAL_MAKE_IMAGE_FILE_PART02 := $(PYTHON) $(PATH_TGT)/startup/from_no_sdk/Scripts/bin2asm.py -i $(APP).bin -o $(PATH_BIN)/coprocessor_binary.S -s ".coprocessor" -l 16 -g coprocessor_bin
110+
RULE_SPECIAL_MAKE_IMAGE_FILE_PART03 := $(PYTHON) $(PATH_TGT)/startup/from_no_sdk/Scripts/bin2asm.py -i $(APP).bin -o $(PATH_TGT)/../xtensa_esp32_s3/startup/coprocessor_binary.S -s ".coprocessor" -l 16 -g coprocessor_bin
110111

111-
RULE_SPECIAL_MAKE_IMAGE_FILE := $(RULE_SPECIAL_MAKE_IMAGE_FILE_PART01) && $(RULE_SPECIAL_MAKE_IMAGE_FILE_PART02)
112+
RULE_SPECIAL_MAKE_IMAGE_FILE := $(RULE_SPECIAL_MAKE_IMAGE_FILE_PART01) \
113+
&& $(RULE_SPECIAL_MAKE_IMAGE_FILE_PART02) \
114+
&& $(RULE_SPECIAL_MAKE_IMAGE_FILE_PART03)

ref_app/target/micros/xtensa_esp32_s3_riscv_cop/startup/from_no_sdk/Code/Appli/main.cpp

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,42 @@
2727
#include <mcal_led.h>
2828
#include <mcal_port.h>
2929

30+
extern "C" void main();
31+
32+
namespace mcal
33+
{
34+
auto init() -> void;
35+
36+
auto init() -> void
37+
{
38+
mcal::port::init(nullptr);
39+
mcal::gpt::init(nullptr);
40+
}
41+
}
42+
3043
namespace
3144
{
3245
volatile std::uint32_t main_counter { };
33-
}
3446

35-
extern "C" void main();
47+
auto delay() -> void
48+
{
49+
constexpr std::uint32_t loop_count{ UINT32_C(0x00060000) };
50+
51+
for (std::uint32_t loop{ UINT32_C(0) }; loop < loop_count; ++loop)
52+
{
53+
main_counter = std::uint32_t { main_counter + UINT8_C(1) };
54+
}
55+
}
56+
}
3657

3758
extern "C" void main()
3859
{
39-
mcal::port::init(nullptr);
40-
mcal::gpt::init(nullptr);
60+
mcal::init();
4161

4262
for(;;)
4363
{
4464
mcal::led::led0().toggle();
4565

46-
for(std::uint32_t loop { UINT32_C(0) }; loop < std::uint32_t { UINT32_C(0x00060000) }; ++loop)
47-
{
48-
main_counter = std::uint32_t { main_counter + UINT8_C(1) };
49-
}
66+
delay();
5067
}
5168
}

0 commit comments

Comments
 (0)