Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
8358f3ea
Unverified
Commit
8358f3ea
authored
4 years ago
by
Victor
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Chitu V5 with extra GPIO init (#18299)
Co-authored-by:
Scott Lahteine
<
github@thinkyhead.com
>
parent
636813a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Marlin/src/pins/pins.h
+1
-1
1 addition, 1 deletion
Marlin/src/pins/pins.h
buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp
+32
-27
32 additions, 27 deletions
...re/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp
platformio.ini
+9
-0
9 additions, 0 deletions
platformio.ini
with
42 additions
and
28 deletions
Marlin/src/pins/pins.h
+
1
−
1
View file @
8358f3ea
...
...
@@ -541,7 +541,7 @@
#elif MB(CCROBOT_MEEB_3DP)
#include
"stm32f1/pins_CCROBOT_MEEB_3DP.h"
// STM32F1 env:STM32F103RC_meeb
#elif MB(CHITU3D_V5)
#include
"stm32f1/pins_CHITU3D_V5.h"
// STM32F1 env:chitu_f103
#include
"stm32f1/pins_CHITU3D_V5.h"
// STM32F1 env:chitu_f103
env:chitu_v5_gpio_init
#elif MB(CHITU3D_V6)
#include
"stm32f1/pins_CHITU3D_V6.h"
// STM32F1 env:chitu_f103
...
...
This diff is collapsed.
Click to expand it.
buildroot/share/PlatformIO/variants/CHITU_F103/wirish/boards_setup.cpp
+
32
−
27
View file @
8358f3ea
...
...
@@ -49,17 +49,17 @@
// currently officially supports).
#ifndef BOARD_RCC_PLLMUL
#if !USE_HSI_CLOCK
#if F_CPU==128000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_16
#elif F_CPU==72000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_9
#elif F_CPU==48000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_6
#elif F_CPU==16000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_2
#endif
#if F_CPU==128000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_16
#elif F_CPU==72000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_9
#elif F_CPU==48000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_6
#elif F_CPU==16000000
#define BOARD_RCC_PLLMUL RCC_PLLMUL_2
#endif
#else
#define BOARD_RCC_PLLMUL RCC_PLLMUL_16
#define BOARD_RCC_PLLMUL RCC_PLLMUL_16
#endif
#endif
...
...
@@ -83,33 +83,39 @@ namespace wirish {
rcc_set_prescaler
(
RCC_PRESCALER_AHB
,
RCC_AHB_SYSCLK_DIV_1
);
rcc_set_prescaler
(
RCC_PRESCALER_APB1
,
RCC_APB1_HCLK_DIV_2
);
rcc_set_prescaler
(
RCC_PRESCALER_APB2
,
RCC_APB2_HCLK_DIV_1
);
rcc_clk_disable
(
RCC_USB
);
#if F_CPU == 72000000
rcc_set_prescaler
(
RCC_PRESCALER_USB
,
RCC_USB_SYSCLK_DIV_1_5
);
#elif F_CPU == 48000000
rcc_set_prescaler
(
RCC_PRESCALER_USB
,
RCC_USB_SYSCLK_DIV_1
);
#endif
rcc_clk_disable
(
RCC_USB
);
#if F_CPU == 72000000
rcc_set_prescaler
(
RCC_PRESCALER_USB
,
RCC_USB_SYSCLK_DIV_1_5
);
#elif F_CPU == 48000000
rcc_set_prescaler
(
RCC_PRESCALER_USB
,
RCC_USB_SYSCLK_DIV_1
);
#endif
}
__weak
void
board_setup_gpio
(
void
)
{
/**
* PA14 is a pull up pin. But, some V5 boards it start with LOW state! And just behave properly when the Z- PROBE is actived at least once.
* So, if the sensor isnt actived, the PA14 pin will be forever in LOW state, telling Marlin the probe IS ALWAYS ACTIVE, that isnt the case!
* Chitu original firmware seems to start with every pullup PIN with HIGH to workaround this.
* So we are doing the same here.
* This hack only works if applied *before* the GPIO Init, it's the reason I did it here.
*/
#ifdef CHITU_V5_Z_MIN_BUGFIX
GPIOA
->
regs
->
BSRR
=
(
1U
<<
PA14
);
#endif
gpio_init_all
();
}
__weak
void
board_setup_usb
(
void
)
{
#ifdef SERIAL_USB
#ifdef GENERIC_BOOTLOADER
//Reset the USB interface on generic boards - developed by Victor PV
gpio_set_mode
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
GPIO_OUTPUT_PP
);
gpio_write_bit
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
0
);
//
Reset the USB interface on generic boards - developed by Victor PV
gpio_set_mode
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
GPIO_OUTPUT_PP
);
gpio_write_bit
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
0
);
for
(
volatile
unsigned
int
i
=
0
;
i
<
512
;
i
++
);
// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
gpio_set_mode
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
GPIO_INPUT_FLOATING
);
for
(
volatile
unsigned
int
i
=
0
;
i
<
512
;
i
++
);
// Only small delay seems to be needed, and USB pins will get configured in Serial.begin
gpio_set_mode
(
PIN_MAP
[
PA12
].
gpio_device
,
PIN_MAP
[
PA12
].
gpio_bit
,
GPIO_INPUT_FLOATING
);
#endif
Serial
.
begin
();
// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
Serial
.
begin
();
// Roger Clark. Changed SerialUSB to Serial for Arduino sketch compatibility
#endif
}
...
...
@@ -118,6 +124,5 @@ namespace wirish {
// interrupts work out of the box.
afio_init
();
}
}
}
This diff is collapsed.
Click to expand it.
platformio.ini
+
9
−
0
View file @
8358f3ea
...
...
@@ -664,6 +664,15 @@ build_flags = ${common_stm32f1.build_flags}
build_unflags = ${common_stm32f1.build_unflags}
-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
#
# Some Chitu V5 boards have a problem with GPIO init.
# Use this target if G28 or G29 are always failing.
#
[env:chitu_v5_gpio_init]
platform = ${common_stm32f1.platform}
extends = env:chitu_f103
build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX
#
# STM32F401VE
# 'STEVAL-3DP001V1' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment