Skip to content

Commit

Permalink
Merge pull request #10 from Technoculture/port_to_olimex
Browse files Browse the repository at this point in the history
feat: ported, example-sensor, blink app may have issues
  • Loading branch information
sutyum authored Aug 17, 2024
2 parents 46b9493 + 54f1ee8 commit 7399ce0
Show file tree
Hide file tree
Showing 22 changed files with 218 additions and 136 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ To build the application, run the following command:

```shell
cd panomic-workspace
export BOARD=panomic_board
west build -b $BOARD app
```

where `$BOARD` is the target board.

You can use the `custom_plank` board found in this
You can use the `panomic_board` board found in this
repository. Note that Zephyr sample boards may be used if an
appropriate overlay is provided (see `app/boards`).

Expand All @@ -93,9 +94,19 @@ west build -b $BOARD app -- -DOVERLAY_CONFIG=debug.conf
Once you have built the application, run the following command to flash it:

```shell
west flash
west flash -r jlink
```

In order to debug the program using gdb, run the following command:

```shell
west debug -r jlink
```

When accessing the shell or console, use USART3 on the Olimexe407 board
<br />
<img width="360" alt="uart" src="https://github.com/user-attachments/assets/81d9f513-b26d-4965-b07d-c114b8efe631">

### Testing

To execute Twister integration tests, run the following command:
Expand Down
3 changes: 1 addition & 2 deletions app/debug.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
CONFIG_DEBUG_OPTIMIZATIONS=y

# logging
CONFIG_LOG=y
CONFIG_APP_LOG_LEVEL_DBG=y
CONFIG_APP_LOG_LEVEL_DBG=y
4 changes: 4 additions & 0 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

CONFIG_SENSOR=y
CONFIG_BLINK=y

# logging
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART_AUTOSTART=y
2 changes: 1 addition & 1 deletion app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sample:
common:
build_only: true
integration_platforms:
- custom_plank
- panomic_board
- nucleo_f302r8
tests:
app.default: {}
Expand Down
1 change: 1 addition & 0 deletions app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int main(void)
struct sensor_value last_val = {0}, val;

printk("Firmware Template %s\n", APP_VERSION_STRING);
LOG_DBG("Logging works.");

sensor = DEVICE_DT_GET(DT_NODELABEL(example_sensor));
if (!device_is_ready(sensor))
Expand Down
8 changes: 8 additions & 0 deletions boards/technoculture/panomic_board/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

# config BOARD_ENABLE_DCDC
# bool "Enable DCDC mode"
# select SOC_DCDC_NRF52X
# default y
# depends on BOARD_CUSTOM_PLANK
6 changes: 6 additions & 0 deletions boards/technoculture/panomic_board/Kconfig.panomic_board
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2017, Erwin Rol <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config BOARD_PANOMIC_BOARD
bool "Use Olimex STM32 E407 Board"
select SOC_STM32F407XG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Custom Plank Board
# OlimexF407 Board

`custom_plank` board is used to demonstrate how to create custom boards. It is
`olimex f407` board is used to demonstrate how to create custom boards. It is
in fact a simplified version of the nRF52840-DK board, so the
`firmware-template` can be run on that development kit when using
`custom_plank`.
`olimex f407`.
6 changes: 6 additions & 0 deletions boards/technoculture/panomic_board/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=STM32F407ZG" "--speed=4000")

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

board:
name: custom_plank
vendor: vendor
name: panomic_board
vendor: technoculture
socs:
- name: nrf52840
- name: stm32f407xx
141 changes: 141 additions & 0 deletions boards/technoculture/panomic_board/panomic_board.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <st/f4/stm32f407Xg.dtsi>
#include <st/f4/stm32f407z(e-g)tx-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Panomic Board";
compatible = "technoculture,panomic_board";

chosen {
zephyr,console = &usart3;
zephyr,shell-uart = &usart3;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,ccm = &ccm0;
};

leds {
compatible = "gpio-leds";
green_led_1: led_1 {
gpios = <&gpioc 14 GPIO_ACTIVE_HIGH>; // is actually 13: TODO fix jugaad
label = "LED1";
};
};

blink_led: blink-led {
compatible = "blink-gpio-led";
led-gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
blink-period-ms = <1000>;
};

gpio_keys {
compatible = "gpio-keys";
user_button: button {
label = "Key";
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_0>;
};
};

example_sensor: example-sensor {
compatible = "zephyr,example-sensor";
input-gpios = <&gpiob 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

aliases {
led0 = &green_led_1;
sw0 = &user_button;
};

};

&clk_lsi {
status = "okay";
};

&clk_hse {
clock-frequency = <DT_FREQ_M(12)>;
status = "okay";
};

&pll {
div-m = <12>;
mul-n = <336>;
div-p = <2>;
div-q = <7>;
clocks = <&clk_hse>;
status = "okay";
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(168)>;
ahb-prescaler = <1>;
apb1-prescaler = <4>;
apb2-prescaler = <2>;
};

&usart1 {
pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};

&usart3 {
pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};

&usart6 {
pinctrl-0 = <&usart6_tx_pc6 &usart6_rx_pc7>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};

&rtc {
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
status = "okay";
};

&rng {
status = "okay";
};

/* Only one interface should be enabled at a time: usbotg_fs or usbotg_hs */
usb_otg1: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "disabled";
};

zephyr_udc0: &usbotg_hs {
pinctrl-0 = <&usb_otg_hs_dm_pb14 &usb_otg_hs_dp_pb15>;
pinctrl-names = "default";
status = "okay";
};

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_col_pa3
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pg14>;
pinctrl-names = "default";
};
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

identifier: custom_plank
name: Custom-Plank
vendor: vendor
identifier: panomic_board
name: Panomic-Board
vendor: technoculture
type: mcu
arch: arm
ram: 256
ram: 128
flash: 1024
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
- counter
- usb_device
- gpio
22 changes: 22 additions & 0 deletions boards/technoculture/panomic_board/panomic_board_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: Apache-2.0

# Enable MPU
CONFIG_ARM_MPU=y

# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y

CONFIG_SERIAL=y

# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# enable GPIO
CONFIG_GPIO=y

# Enable Clocks
CONFIG_CLOCK_CONTROL=y

# enable pin controller
CONFIG_PINCTRL=y
8 changes: 0 additions & 8 deletions boards/vendor/custom_plank/Kconfig

This file was deleted.

5 changes: 0 additions & 5 deletions boards/vendor/custom_plank/Kconfig.custom_plank

This file was deleted.

12 changes: 0 additions & 12 deletions boards/vendor/custom_plank/board.cmake

This file was deleted.

26 changes: 0 additions & 26 deletions boards/vendor/custom_plank/custom_plank-pinctrl.dtsi

This file was deleted.

Loading

0 comments on commit 7399ce0

Please sign in to comment.