Skip to content

Commit

Permalink
Merge pull request tock#3800 from twilfredo/wilfred/boron-upkeep
Browse files Browse the repository at this point in the history
boards: particle_boron: collection of updates/drop pconsole
  • Loading branch information
bradjc authored Jan 23, 2024
2 parents d930dc6 + 4c577ce commit a1257d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
5 changes: 2 additions & 3 deletions boards/particle_boron/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ include ../Makefile.common

TOCKLOADER=tockloader

# Where in the nrf52 flash to load the kernel with `tockloader`
# Where in the nrf52840 flash to load the kernel with `tockloader`
KERNEL_ADDRESS=0x00000

# Can be flashed with nrf52dk config
## TODO: Update board to particle_boron when tockloader supports
TOCKLOADER_JTAG_FLAGS = --jlink --board nrf52dk
TOCKLOADER_JTAG_FLAGS = --jlink --board particle_boron

# Default target for installing the kernel.
.PHONY: install
Expand Down
31 changes: 6 additions & 25 deletions boards/particle_boron/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ pub struct Platform {
>,
ieee802154_radio: &'static capsules_extra::ieee802154::RadioDriver<'static>,
button: &'static capsules_core::button::Button<'static, nrf52840::gpio::GPIOPin<'static>>,
pconsole: &'static capsules_core::process_console::ProcessConsole<
'static,
{ capsules_core::process_console::DEFAULT_COMMAND_HISTORY_LEN },
VirtualMuxAlarm<'static, nrf52840::rtc::Rtc<'static>>,
components::process_console::Capability,
>,
console: &'static capsules_core::console::Console<'static>,
gpio: &'static capsules_core::gpio::GPIO<'static, nrf52840::gpio::GPIOPin<'static>>,
led: &'static capsules_core::led::LedDriver<
Expand Down Expand Up @@ -386,26 +380,15 @@ pub unsafe fn start_particle_boron() -> (

// Create a shared UART channel for the console and for kernel debug.
let uart_mux = components::console::UartMuxComponent::new(uart_channel, 115200)
.finalize(components::uart_mux_component_static!());

let pconsole = components::process_console::ProcessConsoleComponent::new(
board_kernel,
uart_mux,
mux_alarm,
process_printer,
Some(cortexm4::support::reset),
)
.finalize(components::process_console_component_static!(
nrf52840::rtc::Rtc<'static>
));
.finalize(components::uart_mux_component_static!(132));

// Setup the console.
let console = components::console::ConsoleComponent::new(
board_kernel,
capsules_core::console::DRIVER_NUM,
uart_mux,
)
.finalize(components::console_component_static!());
.finalize(components::console_component_static!(132, 132));
// Create the debugger object that handles calls to `debug!()`.
components::debug_writer::DebugWriterComponent::new(uart_mux)
.finalize(components::debug_writer_component_static!());
Expand Down Expand Up @@ -524,9 +507,9 @@ pub unsafe fn start_particle_boron() -> (
// I2C Master/Slave
//--------------------------------------------------------------------------

let i2c_master_buffer = static_init!([u8; 32], [0; 32]);
let i2c_slave_buffer1 = static_init!([u8; 32], [0; 32]);
let i2c_slave_buffer2 = static_init!([u8; 32], [0; 32]);
let i2c_master_buffer = static_init!([u8; 128], [0; 128]);
let i2c_slave_buffer1 = static_init!([u8; 128], [0; 128]);
let i2c_slave_buffer2 = static_init!([u8; 128], [0; 128]);

let i2c_master_slave = static_init!(
I2CMasterSlaveDriver<nrf52840::i2c::TWI<'static>>,
Expand All @@ -549,7 +532,7 @@ pub unsafe fn start_particle_boron() -> (
base_peripherals.twi1.set_slave_client(i2c_master_slave);
// Note: strongly suggested to use external pull-ups for higher speeds
// to maintain signal integrity.
base_peripherals.twi1.set_speed(nrf52840::i2c::Speed::K100);
base_peripherals.twi1.set_speed(nrf52840::i2c::Speed::K400);

// I2C pin cfg for target
nrf52840_peripherals.gpio_port[I2C_SDA_PIN].set_i2c_pin_cfg();
Expand All @@ -571,7 +554,6 @@ pub unsafe fn start_particle_boron() -> (
button,
ble_radio,
ieee802154_radio,
pconsole,
console,
led,
gpio,
Expand All @@ -596,7 +578,6 @@ pub unsafe fn start_particle_boron() -> (
CHIP = Some(chip);

debug!("Particle Boron: Initialization complete. Entering main loop\r");
let _ = platform.pconsole.start();

//--------------------------------------------------------------------------
// PROCESSES AND MAIN LOOP
Expand Down

0 comments on commit a1257d0

Please sign in to comment.