Comments (8)
USB or UART connection?
Was the last test run from a sender requesting real-time reports or from a simple terminal program like PuTTY?
In not from a simple terminal program can you rerun the test from one? Issue still visible? If not it is likely interrupt priority for either UART or USB comms has to be lowered.
from stm32f1xx.
I'm using G code sender with USB connection.
I either think that the root cause is in misconfig in interrupt priorities.. Looks like TIM3 interrupt delayed from time to time.
Ok, I will try putty
from stm32f1xx.
It looks much better when connecting with serial terminal.
Below is the waveform after running G0Z500 command. I still have longer pulses but the difference is much less than previously.
from stm32f1xx.
Try reducing the priority for the serial and USB interrupts:
Increasing the second parameter decreases priority, e.g:
HAL_NVIC_SetPriority(xxx_IRQn, 1, 0);
will let the step pulse off interrupt preempt these.
Priority for the systick timer should be reduced as well? IIRC I have done that for a few drivers.
I have fried my only F103 board so I cannot check myself...
from stm32f1xx.
Thanks Terje. I will test it and then update you.
from stm32f1xx.
Hi Terje.
So I lowered USB interrupt priority (USART1 and USART3 are turned off for me) and it's much better now.
diff --git a/USB_DEVICE/Target/usbd_conf.c b/USB_DEVICE/Target/usbd_conf.c
index f9587a6..1488723 100644
--- a/USB_DEVICE/Target/usbd_conf.c
+++ b/USB_DEVICE/Target/usbd_conf.c
@@ -78,7 +78,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
__HAL_RCC_USB_CLK_ENABLE();
/* Peripheral interrupt init */
- HAL_NVIC_SetPriority(USB_LP_CAN1_RX0_IRQn, 0, 0);
+ HAL_NVIC_SetPriority(USB_LP_CAN1_RX0_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn);
/* USER CODE BEGIN USB_MspInit 1 */
But sometimes when I run the G code program attached previously, I see ~16us pulses (instead of 10us).
from stm32f1xx.
Try reducing priority to 2, It should not matter but who knows...
I do not know how long it takes to preempt an USB interrupt, and neither if the USB driver code disables interrupts for critical sections of code. If minimal jitter is a must using a USB <> UART breakout is IMO likely a better choice. Or switch to a faster processor, the F1xx series is pretty slow and does not have a FPU.
from stm32f1xx.
By the way I tried the previous grblHAL version before you moved to a new home:
https://github.com/terjeio/grblHAL/tree/master/drivers/STM32F1xx
and all the step pulses are good there (with USB interrupt priority 1).
So probably there's some "heavy" code on a new version.
Anyway thanks for your help Terje. The issue fixed.
from stm32f1xx.
Related Issues (20)
- Usb not working on 103RC HOT 30
- Port restrictions for 5-axis? HOT 2
- STM32CubeIDE Build Project failed with 5 errors. HOT 2
- Creality 4.2.2 stm32f103ret6 support HOT 6
- safety door enabled but not stopping the program HOT 2
- machine suddenly stops while working HOT 2
- how to compiling stm32f103c8t6 HOT 2
- Questions about grblhal using timers for outputting pulses HOT 2
- Z probe wiring diagram for skr mini e3 v2 HOT 7
- Please, help check and suggest modifications CNC3040 map file. HOT 16
- no usb com port HOT 4
- USB is not working on stm32f103RCT6. HOT 4
- Motor Stepper buzzes using A4988 and drv 8825 HOT 4
- error:7 - A settings read failed. Auto-restoring affected settings to default values. HOT 7
- Build fails, not enough flash HOT 3
- MiniGerbil 2 board map HOT 1
- STM32F103RCT6 : bad linker file
- Y & Z TMC2209s not being properly init'ed on BTT SKR Mini E3 V2.0 HOT 5
- Can't use SWD on BTT SKR Mini E3 V2.0 HOT 4
- E-stop/alarm issue HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm32f1xx.