Skip to content

Initial: add Opta target #95

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

Merged
merged 1 commit into from
Apr 23, 2025
Merged
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
65 changes: 65 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,68 @@ portentac33.bootloader.file=zephyr-{build.variant}.bin
portentac33.bootloader.interface=0
portentac33.bootloader.address=0x10000
portentac33.bootloader.dfuse=-Q

##########################################################################################

opta.name=Arduino Opta
opta.build.core=arduino
opta.build.crossprefix=arm-zephyr-eabi-
opta.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/

opta.menu.debug.false=Standard
opta.menu.debug.true=Debug

opta.menu.debug.false.postbuild_debug=
opta.menu.debug.true.postbuild_debug=-debug

opta.build.variant=arduino_opta_stm32h747xx_m7
opta.build.mcu=cortex-m7
opta.build.fpu=-mfpu=fpv5-d16
opta.build.architecture=cortex-m7
opta.compiler.zephyr.arch.define=-DCORE_CM7

opta.build.float-abi=-mfloat-abi=softfp
opta.build.extra_flags=
opta.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
opta.build.architecture=cortex-m7
opta.build.board=ARDUINO_OPTA
opta.compiler.zephyr=
opta.vid.0=0x2341
opta.pid.0=0x0064
opta.upload_port.0.vid=0x2341
opta.upload_port.0.pid=0x0364

opta.upload.tool=dfu-util
opta.upload.tool.default=dfu-util
opta.upload.protocol=
opta.upload.transport=
opta.upload.vid=0x2341
opta.upload.pid=0x0364
opta.upload.interface=0
opta.upload.use_1200bps_touch=true
opta.upload.wait_for_upload_port=true
opta.upload.native_usb=true
opta.upload.maximum_size=1966080
opta.upload.maximum_data_size=523624

opta.upload.address=0x080E0000

opta.upload.maximum_size=786432
opta.upload.maximum_data_size=523624

opta.bootloader.tool=dfu-util
opta.bootloader.tool.default=dfu-util
opta.bootloader.vid=0x2341
opta.bootloader.pid=0x0364
opta.bootloader.interface=0
opta.bootloader.file=zephyr-{build.variant}.bin
opta.bootloader.address=0x08040000

opta.debug.tool=gdb
opta.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
opta.debug.server.openocd.scripts.1={programmer.transport_script}
opta.debug.server.openocd.scripts.2=target/stm32h7x_dual_bank.cfg
opta.debug.cortex-debug.custom.request=attach
opta.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM7.svd

##############################################################################################################
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Arduino Opta"
CONFIG_USB_DEVICE_MANUFACTURER="Arduino"
CONFIG_USB_DEVICE_VID=0x2341
CONFIG_USB_DEVICE_PID=0x0064

CONFIG_USB_CDC_ACM=y
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=512
CONFIG_UART_LINE_CTRL=y
CONFIG_CDC_ACM_DTE_RATE_CALLBACK_SUPPORT=y

CONFIG_LLEXT_STORAGE_WRITABLE=n

CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_SHELL_STACK_SIZE=32768
CONFIG_MAIN_STACK_SIZE=32768
CONFIG_LLEXT_HEAP_SIZE=128

CONFIG_FPU=y

CONFIG_ADC=y
CONFIG_DAC=n
CONFIG_PWM=n

CONFIG_ICACHE=y
CONFIG_DCACHE=y
CONFIG_CACHE_MANAGEMENT=y

CONFIG_DMA=y
CONFIG_MEMC=y
CONFIG_SPI_ASYNC=y
CONFIG_SPI_STM32_INTERRUPT=y

CONFIG_FPU=y
CONFIG_ICACHE=y
CONFIG_DCACHE=y
CONFIG_CACHE_MANAGEMENT=y

CONFIG_USERSPACE=n
CONFIG_ARM_MPU=y
CONFIG_MAX_THREAD_BYTES=4

CONFIG_NETWORKING=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_ARP=y
CONFIG_NET_UDP=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_DHCPV4_OPTION_CALLBACKS=y
CONFIG_DNS_RESOLVER=y
CONFIG_DNS_SERVER_IP_ADDRESSES=y
CONFIG_DNS_SERVER1="8.8.8.8"

CONFIG_INIT_STACKS=y

CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_NET_MGMT=y
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_L2_ETHERNET_MGMT=y

CONFIG_TINYCRYPT=y
CONFIG_TINYCRYPT_AES=y
CONFIG_TINYCRYPT_SHA256=y
CONFIG_TINYCRYPT_SHA256_HMAC=y
CONFIG_TINYCRYPT_AES_CCM=y
CONFIG_TINYCRYPT_AES_CTR=y
CONFIG_TINYCRYPT_AES_CBC=y
CONFIG_TINYCRYPT_AES_CMAC=y
CONFIG_TINYCRYPT_CTR_PRNG=y
CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_NET_TX_STACK_SIZE=8192
CONFIG_NET_RX_STACK_SIZE=8192
CONFIG_NET_TCP_WORKQ_STACK_SIZE=8192
CONFIG_NET_MGMT_EVENT_STACK_SIZE=8192
CONFIG_NET_TCP=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=60000
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=7168
CONFIG_MBEDTLS_HASH_ALL_ENABLED=y
CONFIG_MBEDTLS_CMAC=y

CONFIG_LLEXT_LOG_LEVEL_INF=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
&usart6 {
status = "okay";
pinctrl-0 = <&usart6_tx_pg14 &usart6_rx_pg9>;
pinctrl-names = "default";
current-speed = <115200>;
};

&usart3 {
status = "okay";
};

&adc1 {
status = "okay";
};

&adc2 {
status = "okay";
};

&adc3 {
status = "okay";
};

&i2c1 {
status = "okay";
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST>;
};

&i2c3 {
status = "okay";
pinctrl-0 = <&i2c3_scl_ph7 &i2c3_sda_ph8>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST>;
};

/{
chosen {
zephyr,console = &usart6;
zephyr,shell-uart = &usart6;
zephyr,uart-mcumgr = &usart6;
};

/* used to overcome problems with _C analog pins */
gpioz: gpio@deadbeef {
compatible = "vnd,gpio";
gpio-controller;
reg = <0xdeadbeef 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
};
};

&flash0 {
partitions {
user_sketch: partition@e0000 {
reg = <0x0E0000 0x20000>;
};
};
};

/ {
zephyr,user {
digital-pin-gpios = <&gpioi 6 0>, /* Outputs */
<&gpioi 5 0>,
<&gpioi 7 0>,
<&gpioi 4 0>,
<&gpioi 0 0>, /* LEDs */
<&gpioi 1 0>,
<&gpioi 3 0>,
<&gpioh 15 0>,
<&gpioh 12 0>,
<&gpioh 11 0>,
<&gpioe 5 0>,
<&gpioe 4 0>, /* User button */
<&gpioz 0 0>, /* Inputs */
<&gpioz 1 0>,
<&gpiof 12 0>,
<&gpiob 0 0>,
<&gpiof 10 0>,
<&gpiof 8 0>,
<&gpiof 6 0>,
<&gpiof 4 0>,
<&gpiog 8 0>, /* bus detect */
<&gpiob 14 0>, /* Modbus DE */
<&gpiob 13 0>; /* Modbus RE */

builtin-led-gpios = <&gpioe 5 0>,
<&gpioh 12 0>,
<&gpioh 11 0>;

adc-pin-gpios = <&gpioz 0 0>,
<&gpioz 1 0>,
<&gpiof 12 0>,
<&gpiob 0 0>,
<&gpiof 10 0>,
<&gpiof 8 0>,
<&gpiof 6 0>,
<&gpiof 4 0>;

serials = <&board_cdc_acm_uart>, <&usart3>, <&usart6>;
cdc-acm = <&board_cdc_acm_uart>;
i2cs = <&i2c1>, <&i2c3>;

io-channels = <&adc1 0>,
<&adc3 0>,
<&adc1 6>,
<&adc2 9>,
<&adc3 6>,
<&adc3 7>,
<&adc3 8>,
<&adc3 9>;
};
};
8 changes: 8 additions & 0 deletions variants/arduino_opta_stm32h747xx_m7/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <zephyr/kernel.h>

void _on_1200_bps() {
uint32_t tmp = (uint32_t) & (RTC->BKP0R);
tmp += (RTC_BKP_DR0 * 4U);
*(__IO uint32_t *)tmp = (uint32_t)0xDF59;
NVIC_SystemReset();
}
Empty file.