Skip to content

Commit 2f06545

Browse files
committed
targets: support portenta_h7
USB (and net_mgmt) are known to crash the system
1 parent dc1b248 commit 2f06545

File tree

5 files changed

+246
-1
lines changed

5 files changed

+246
-1
lines changed

boards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ portentah7.upload.native_usb=true
319319
portentah7.upload.maximum_size=1966080
320320
portentah7.upload.maximum_data_size=523624
321321

322-
portentah7.upload.address=0x08100000
322+
portentah7.upload.address=0x080E0000
323323

324324
portentah7.upload.maximum_size=786432
325325
portentah7.upload.maximum_data_size=523624
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
CONFIG_USB_DEVICE_STACK=y
2+
CONFIG_USB_DEVICE_PRODUCT="Arduino Portenta H7"
3+
CONFIG_USB_DEVICE_MANUFACTURER="Arduino"
4+
CONFIG_USB_DEVICE_VID=0x2341
5+
CONFIG_USB_DEVICE_PID=0x005b
6+
7+
CONFIG_USB_CDC_ACM=y
8+
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=512
9+
CONFIG_UART_LINE_CTRL=y
10+
CONFIG_CDC_ACM_DTE_RATE_CALLBACK_SUPPORT=y
11+
12+
CONFIG_LLEXT_STORAGE_WRITABLE=n
13+
14+
CONFIG_FPU=y
15+
CONFIG_ICACHE=y
16+
CONFIG_DCACHE=y
17+
CONFIG_CACHE_MANAGEMENT=y
18+
19+
CONFIG_USERSPACE=y
20+
CONFIG_ARM_MPU=y
21+
CONFIG_MAX_THREAD_BYTES=4
22+
23+
CONFIG_SHELL_STACK_SIZE=32768
24+
CONFIG_LLEXT_HEAP_SIZE=128
25+
26+
#CONFIG_ADC=y
27+
#CONFIG_PWM=y
28+
29+
CONFIG_NETWORKING=y
30+
CONFIG_NET_IPV6=n
31+
CONFIG_NET_IPV4=y
32+
CONFIG_NET_ARP=y
33+
CONFIG_NET_UDP=y
34+
CONFIG_NET_DHCPV4=y
35+
CONFIG_NET_DHCPV4_OPTION_CALLBACKS=y
36+
CONFIG_DNS_RESOLVER=y
37+
CONFIG_DNS_SERVER_IP_ADDRESSES=y
38+
CONFIG_DNS_SERVER1="8.8.8.8"
39+
40+
CONFIG_INIT_STACKS=y
41+
42+
CONFIG_NET_MGMT=y
43+
CONFIG_NET_MGMT_EVENT=y
44+
45+
CONFIG_TINYCRYPT=y
46+
CONFIG_TINYCRYPT_AES=y
47+
CONFIG_TINYCRYPT_SHA256=y
48+
CONFIG_TINYCRYPT_SHA256_HMAC=y
49+
CONFIG_TINYCRYPT_AES_CCM=y
50+
CONFIG_TINYCRYPT_AES_CTR=y
51+
CONFIG_TINYCRYPT_AES_CBC=y
52+
CONFIG_TINYCRYPT_AES_CMAC=y
53+
CONFIG_TINYCRYPT_CTR_PRNG=y
54+
CONFIG_ENTROPY_GENERATOR=y
55+
CONFIG_TEST_RANDOM_GENERATOR=y
56+
57+
CONFIG_NET_TX_STACK_SIZE=8192
58+
CONFIG_NET_RX_STACK_SIZE=8192
59+
CONFIG_NET_TCP_WORKQ_STACK_SIZE=8192
60+
CONFIG_NET_MGMT_EVENT_STACK_SIZE=8192
61+
CONFIG_NET_TCP=y
62+
CONFIG_NET_SOCKETS=y
63+
CONFIG_POSIX_API=y
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
&zephyr_udc0 {
2+
cdc_acm_uart0: cdc_acm_uart0 {
3+
compatible = "zephyr,cdc-acm-uart";
4+
status = "okay";
5+
};
6+
};
7+
8+
&usart1 {
9+
status = "okay";
10+
};
11+
12+
&uart4 {
13+
status = "okay";
14+
};
15+
16+
&usart6 {
17+
status = "okay";
18+
};
19+
20+
&cdc_acm_uart0 {
21+
status = "okay";
22+
};
23+
24+
&i2c4 {
25+
status = "okay";
26+
};
27+
28+
&rng {
29+
status = "okay";
30+
};
31+
32+
/ {
33+
chosen {
34+
zephyr,console = &usart6;
35+
zephyr,shell-uart = &usart6;
36+
zephyr,cdc-acm-uart0 = &usart6;
37+
};
38+
};
39+
40+
/ {
41+
soc {
42+
flash-controller@52002000 {
43+
flash0: flash@8000000 {
44+
compatible = "st,stm32-nv-flash", "soc-nv-flash";
45+
write-block-size = <32>;
46+
erase-block-size = <DT_SIZE_K(128)>;
47+
/* maximum erase time for a 128K sector */
48+
max-erase-time = <4000>;
49+
50+
reg = <0x08000000 DT_SIZE_K(1024)>;
51+
status = "okay";
52+
53+
partitions {
54+
compatible = "fixed-partitions";
55+
#address-cells = <1>;
56+
#size-cells = <1>;
57+
58+
user_sketch: partition@0 {
59+
reg = <0x0E0000 0x20000>;
60+
};
61+
};
62+
};
63+
};
64+
};
65+
};
66+
67+
/ {
68+
zephyr,user {
69+
digital-pin-gpios = <&gpioh 15 GPIO_ACTIVE_LOW>,
70+
<&gpiok 1 GPIO_ACTIVE_LOW>,
71+
<&gpioj 11 GPIO_ACTIVE_LOW>,
72+
<&gpiog 7 GPIO_ACTIVE_LOW>,
73+
<&gpioc 7 GPIO_ACTIVE_LOW>,
74+
<&gpioc 6 GPIO_ACTIVE_LOW>,
75+
<&gpioa 8 GPIO_ACTIVE_LOW>,
76+
<&gpioi 0 GPIO_ACTIVE_LOW>,
77+
<&gpioc 3 GPIO_ACTIVE_LOW>,
78+
<&gpioi 1 GPIO_ACTIVE_LOW>,
79+
<&gpioc 2 GPIO_ACTIVE_LOW>,
80+
<&gpioh 8 GPIO_ACTIVE_LOW>,
81+
<&gpioh 7 GPIO_ACTIVE_LOW>,
82+
<&gpioa 10 GPIO_ACTIVE_LOW>,
83+
<&gpioa 9 GPIO_ACTIVE_LOW>,
84+
<&gpiok 5 GPIO_ACTIVE_LOW>; // LEDR
85+
86+
builtin-led-gpios = <&gpiok 5 GPIO_ACTIVE_LOW>,
87+
<&gpiok 6 GPIO_ACTIVE_LOW>,
88+
<&gpiok 7 GPIO_ACTIVE_LOW>;
89+
90+
serials = <&cdc_acm_uart0>,<&usart6>, <&usart1>, <&uart4>;
91+
cdc-acm = <&cdc_acm_uart0>;
92+
i2cs = <&i2c4>;
93+
};
94+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FORCE_COMMON_ALLOCATION
2+
3+
SECTIONS {
4+
5+
/DISCARD/ : {
6+
*(.ARM.attributes)
7+
*(.ARM.attributes.*)
8+
*(.ARM.exidx)
9+
*(.ARM.exidx.*)
10+
*(.ARM.extidx)
11+
*(.ARM.extidx.*)
12+
*(.ARM.extab)
13+
*(.ARM.extab.*)
14+
*(.comment)
15+
*(.comment.*)
16+
*(.llvmbc)
17+
*(.llvmcmd)
18+
}
19+
20+
.text 0x00000000 : ALIGN(4) {
21+
*(.text)
22+
*(.stub)
23+
*(.text*)
24+
*(.text.*)
25+
*(.text._*)
26+
27+
KEEP (*(.init))
28+
KEEP (*(.ctors))
29+
KEEP (*(.dtors))
30+
KEEP (*(.fini))
31+
}
32+
33+
.rodata : {
34+
*(.rodata)
35+
*(.rodata1)
36+
*(.rodata.*)
37+
}
38+
39+
.data : {
40+
*(.data .data.*)
41+
}
42+
43+
.bss : {
44+
*(.bss .bss.* COMMON)
45+
}
46+
47+
.exported_sym : {
48+
KEEP(*(.exported_sym))
49+
KEEP(*(.exported_sym.*))
50+
}
51+
52+
.init_array : {
53+
KEEP(*(.init_array))
54+
}
55+
56+
.symtab : {
57+
KEEP(*(.symtab))
58+
}
59+
60+
.strtab : {
61+
KEEP(*(.strtab))
62+
}
63+
64+
.shstrtab : {
65+
KEEP(*(.shstrtab))
66+
}
67+
68+
.rel : {
69+
KEEP(*(.rel .rel.*))
70+
}
71+
72+
.got : {
73+
KEEP(*(.got .got.* .got.plt .got.plt*))
74+
}
75+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2022 Dhruva Gole
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// TODO: correctly handle these legacy defines
8+
#define MOSI 0
9+
#define MISO 0
10+
#define SCK 0
11+
#define SS 0
12+
#define SDA 0
13+
#define SCL 0

0 commit comments

Comments
 (0)