Skip to content

Commit 59d161e

Browse files
ellenspimp67
authored andcommitted
✨ BTT Octopus with STM32-F407 (MarlinFirmware#25031)
1 parent 247bd35 commit 59d161e

File tree

9 files changed

+1242
-1
lines changed

9 files changed

+1242
-1
lines changed

Marlin/src/pins/pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@
658658
#elif MB(BTT_OCTOPUS_V1_0)
659659
#include "stm32f4/pins_BTT_OCTOPUS_V1_0.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB
660660
#elif MB(BTT_OCTOPUS_V1_1)
661-
#include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB
661+
#include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB env:BIGTREE_OCTOPUS_V1_F407 env:BIGTREE_OCTOPUS_V1_F407_USB
662662
#elif MB(BTT_OCTOPUS_PRO_V1_0)
663663
#include "stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB env:BIGTREE_OCTOPUS_PRO_V1_F429 env:BIGTREE_OCTOPUS_PRO_V1_F429_USB
664664
#elif MB(LERDGE_K)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m4",
4+
"extra_flags": "-DSTM32F4 -DSTM32F407xx",
5+
"f_cpu": "168000000L",
6+
"mcu": "stm32f407zgt6",
7+
"product_line": "STM32F407xx",
8+
"variant": "MARLIN_F407ZE"
9+
},
10+
"connectivity": [
11+
"can"
12+
],
13+
"debug": {
14+
"default_tools": [
15+
"stlink"
16+
],
17+
"jlink_device": "STM32F407ZE",
18+
"onboard_tools": [
19+
"stlink"
20+
],
21+
"openocd_board": "stm32f407",
22+
"openocd_target": "stm32f4x",
23+
"svd_path": "STM32F407x.svd"
24+
},
25+
"frameworks": [
26+
"arduino",
27+
"cmsis",
28+
"mbed",
29+
"stm32cube",
30+
"libopencm3",
31+
"zephyr"
32+
],
33+
"name": "STM32F407ZE (128k RAM, 64k CCM RAM, 512k Flash",
34+
"upload": {
35+
"disable_flushing": false,
36+
"maximum_ram_size": 131072,
37+
"maximum_size": 524288,
38+
"protocol": "stlink",
39+
"protocols": [
40+
"stlink",
41+
"dfu",
42+
"jlink"
43+
],
44+
"require_upload_port": true,
45+
"use_1200bps_touch": false,
46+
"wait_for_upload_port": false
47+
},
48+
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html",
49+
"vendor": "ST"
50+
}

buildroot/share/PlatformIO/variants/MARLIN_F407ZE/PeripheralPins.c

+433
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0, /* SYS_WKUP0 */
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = NC,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = NC,
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = NC,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = NC,
16+
#endif
17+
#ifdef PWR_WAKEUP_PIN6
18+
SYS_WKUP6 = NC,
19+
#endif
20+
#ifdef PWR_WAKEUP_PIN7
21+
SYS_WKUP7 = NC,
22+
#endif
23+
#ifdef PWR_WAKEUP_PIN8
24+
SYS_WKUP8 = NC,
25+
#endif
26+
/* USB */
27+
#ifdef USBCON
28+
USB_OTG_FS_DM = PA_11,
29+
USB_OTG_FS_DP = PA_12,
30+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#pragma once
2+
3+
#define HAL_MODULE_ENABLED
4+
#define HAL_ADC_MODULE_ENABLED
5+
#define HAL_CRC_MODULE_ENABLED
6+
#define HAL_DMA_MODULE_ENABLED
7+
#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
8+
#define HAL_GPIO_MODULE_ENABLED
9+
#define HAL_I2C_MODULE_ENABLED
10+
#define HAL_PWR_MODULE_ENABLED
11+
#define HAL_RCC_MODULE_ENABLED
12+
//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
13+
#define HAL_SPI_MODULE_ENABLED
14+
#define HAL_TIM_MODULE_ENABLED
15+
#define HAL_USART_MODULE_ENABLED
16+
#define HAL_CORTEX_MODULE_ENABLED
17+
//#define HAL_UART_MODULE_ENABLED // by default
18+
//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
19+
#define HAL_SD_MODULE_ENABLED
20+
21+
//#undef HAL_SD_MODULE_ENABLED
22+
#undef HAL_DAC_MODULE_ENABLED
23+
#undef HAL_FLASH_MODULE_ENABLED
24+
#undef HAL_CAN_MODULE_ENABLED
25+
#undef HAL_CAN_LEGACY_MODULE_ENABLED
26+
#undef HAL_CEC_MODULE_ENABLED
27+
#undef HAL_CRYP_MODULE_ENABLED
28+
#undef HAL_DCMI_MODULE_ENABLED
29+
#undef HAL_DMA2D_MODULE_ENABLED
30+
#undef HAL_ETH_MODULE_ENABLED
31+
#undef HAL_NAND_MODULE_ENABLED
32+
#undef HAL_NOR_MODULE_ENABLED
33+
#undef HAL_PCCARD_MODULE_ENABLED
34+
#undef HAL_SRAM_MODULE_ENABLED
35+
#undef HAL_SDRAM_MODULE_ENABLED
36+
#undef HAL_HASH_MODULE_ENABLED
37+
#undef HAL_SMBUS_MODULE_ENABLED
38+
#undef HAL_I2S_MODULE_ENABLED
39+
#undef HAL_IWDG_MODULE_ENABLED
40+
#undef HAL_LTDC_MODULE_ENABLED
41+
#undef HAL_DSI_MODULE_ENABLED
42+
#undef HAL_QSPI_MODULE_ENABLED
43+
#undef HAL_RNG_MODULE_ENABLED
44+
#undef HAL_SAI_MODULE_ENABLED
45+
#undef HAL_IRDA_MODULE_ENABLED
46+
#undef HAL_SMARTCARD_MODULE_ENABLED
47+
#undef HAL_WWDG_MODULE_ENABLED
48+
//#undef HAL_HCD_MODULE_ENABLED
49+
#undef HAL_FMPI2C_MODULE_ENABLED
50+
#undef HAL_SPDIFRX_MODULE_ENABLED
51+
#undef HAL_DFSDM_MODULE_ENABLED
52+
#undef HAL_LPTIM_MODULE_ENABLED
53+
#undef HAL_MMC_MODULE_ENABLED
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
** Abstract : Linker script for STM32F407ZETx Device with
8+
** 512KByte FLASH, 64KByte RAM
9+
**
10+
** Set heap size, stack size and stack location according
11+
** to application requirements.
12+
**
13+
** Set memory bank area and size if external memory is used.
14+
**
15+
** Target : STMicroelectronics STM32
16+
**
17+
**
18+
** Distribution: The file is distributed as is, without any warranty
19+
** of any kind.
20+
**
21+
*****************************************************************************
22+
** @attention
23+
**
24+
** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
25+
**
26+
** Redistribution and use in source and binary forms, with or without modification,
27+
** are permitted provided that the following conditions are met:
28+
** 1. Redistributions of source code must retain the above copyright notice,
29+
** this list of conditions and the following disclaimer.
30+
** 2. Redistributions in binary form must reproduce the above copyright notice,
31+
** this list of conditions and the following disclaimer in the documentation
32+
** and/or other materials provided with the distribution.
33+
** 3. Neither the name of Ac6 nor the names of its contributors
34+
** may be used to endorse or promote products derived from this software
35+
** without specific prior written permission.
36+
**
37+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47+
**
48+
*****************************************************************************
49+
*/
50+
51+
/* Entry Point */
52+
ENTRY(Reset_Handler)
53+
54+
/* Highest address of the user mode stack */
55+
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */
56+
/* Generate a link error if heap and stack don't fit into RAM */
57+
_Min_Heap_Size = 0x200; /* required amount of heap */
58+
_Min_Stack_Size = 0x400; /* required amount of stack */
59+
60+
/* Specify the memory areas */
61+
MEMORY
62+
{
63+
FLASH (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
64+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
65+
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
66+
MEMORY_ARRAY (rw) : ORIGIN = 0x10000000, LENGTH = 0x144
67+
}
68+
69+
/* Define output sections */
70+
SECTIONS
71+
{
72+
/* The startup code goes first into FLASH */
73+
.isr_vector :
74+
{
75+
. = ALIGN(4);
76+
KEEP(*(.isr_vector)) /* Startup code */
77+
. = ALIGN(4);
78+
} >FLASH
79+
80+
/* The program code and other data goes into FLASH */
81+
.text ALIGN(4):
82+
{
83+
. = ALIGN(4);
84+
*(.text) /* .text sections (code) */
85+
*(.text*) /* .text* sections (code) */
86+
*(.glue_7) /* glue arm to thumb code */
87+
*(.glue_7t) /* glue thumb to arm code */
88+
*(.eh_frame)
89+
90+
KEEP (*(.init))
91+
KEEP (*(.fini))
92+
93+
. = ALIGN(4);
94+
_etext = .; /* define a global symbols at end of code */
95+
} >FLASH
96+
97+
/* Constant data goes into FLASH */
98+
.rodata ALIGN(4) :
99+
{
100+
. = ALIGN(4);
101+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
102+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
103+
. = ALIGN(4);
104+
} >FLASH
105+
106+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
107+
.ARM : {
108+
__exidx_start = .;
109+
*(.ARM.exidx*)
110+
__exidx_end = .;
111+
} >FLASH
112+
113+
.preinit_array :
114+
{
115+
PROVIDE_HIDDEN (__preinit_array_start = .);
116+
KEEP (*(.preinit_array*))
117+
PROVIDE_HIDDEN (__preinit_array_end = .);
118+
} >FLASH
119+
.init_array :
120+
{
121+
PROVIDE_HIDDEN (__init_array_start = .);
122+
KEEP (*(SORT(.init_array.*)))
123+
KEEP (*(.init_array*))
124+
PROVIDE_HIDDEN (__init_array_end = .);
125+
} >FLASH
126+
.fini_array :
127+
{
128+
PROVIDE_HIDDEN (__fini_array_start = .);
129+
KEEP (*(SORT(.fini_array.*)))
130+
KEEP (*(.fini_array*))
131+
PROVIDE_HIDDEN (__fini_array_end = .);
132+
} >FLASH
133+
134+
/* used by the startup to initialize data */
135+
_sidata = LOADADDR(.data);
136+
137+
/* Initialized data sections goes into RAM, load LMA copy after code */
138+
.data :
139+
{
140+
. = ALIGN(4);
141+
_sdata = .; /* create a global symbol at data start */
142+
*(.data) /* .data sections */
143+
*(.data*) /* .data* sections */
144+
145+
. = ALIGN(4);
146+
_edata = .; /* define a global symbol at data end */
147+
} >RAM AT> FLASH
148+
149+
150+
_siccmram = LOADADDR(.ccmram);
151+
152+
/* CCM-RAM section
153+
*
154+
* IMPORTANT NOTE!
155+
* If initialized variables will be placed in this section,
156+
* the startup code needs to be modified to copy the init-values.
157+
*/
158+
.ccmram :
159+
{
160+
. = ALIGN(4);
161+
_sccmram = .; /* create a global symbol at ccmram start */
162+
*(.ccmram)
163+
*(.ccmram*)
164+
165+
. = ALIGN(4);
166+
_eccmram = .; /* create a global symbol at ccmram end */
167+
} >CCMRAM AT> FLASH
168+
169+
170+
/* Uninitialized data section */
171+
. = ALIGN(4);
172+
.bss :
173+
{
174+
/* This is used by the startup in order to initialize the .bss secion */
175+
_sbss = .; /* define a global symbol at bss start */
176+
__bss_start__ = _sbss;
177+
*(.bss)
178+
*(.bss*)
179+
*(COMMON)
180+
181+
. = ALIGN(4);
182+
_ebss = .; /* define a global symbol at bss end */
183+
__bss_end__ = _ebss;
184+
} >RAM
185+
186+
/* User_heap_stack section, used to check that there is enough RAM left */
187+
._user_heap_stack :
188+
{
189+
. = ALIGN(8);
190+
PROVIDE ( end = . );
191+
PROVIDE ( _end = . );
192+
. = . + _Min_Heap_Size;
193+
. = . + _Min_Stack_Size;
194+
. = ALIGN(8);
195+
} >RAM
196+
197+
198+
199+
/* Remove information from the standard libraries */
200+
/DISCARD/ :
201+
{
202+
libc.a ( * )
203+
libm.a ( * )
204+
libgcc.a ( * )
205+
}
206+
207+
.ARM.attributes 0 : { *(.ARM.attributes) }
208+
ExtRAMData : {*(.ExtRAMData)} >MEMORY_ARRAY
209+
}

0 commit comments

Comments
 (0)