Giter Club home page Giter Club logo

Comments (10)

dlarue avatar dlarue commented on July 19, 2024

I noticed in my_machine.h there was "#define USB_SERIAL_CDC 1" and comment stating to comment it out for UART comm
but that made no difference. I also set USB_ENABLE = 0 in the symbols but tried with USB_ENABLE at 1 and still not grbl output on the UART.

from stm32f1xx.

terjeio avatar terjeio commented on July 19, 2024

The symbol USB_ENABLE is no longer used in grblHAL due to conflict with some other frameworks, use USB_SERIAL_CDC instead as you have discovered. When USB_SERIAL_CDC is not defined or set to 0 UART comms should be default. One way to check this is to see which part of the code gets compiled in driver.c:

image

Here you can see usbInit() is greyed out and serialInit() is active. Note that sometimes the greyed out parts might be wrong, right click on the project folder in the IDE and select Index > Rebuild to be sure it is correct.

Do you have a ST-Link and can set breakpoints? serialWriteS() in serial.c is the first place to check, is it ever called? If not has the board gone into a hardfault? Press the pause button to check if so.

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

I checked and it is flowing through stream_connect(serialInit()) and to be sure I removed USB_ENABLE and set USB_SERIAL_CDC 0 in my_machine.h and still nothing on the serial output.

I am using ST-Link to upload firmware but don't know yet how to use it to set breakpoints. That would be very handy to have working. Currently I'm only using the ST-Link via OpenOCD to upload code. I'll see if I can figure out how to get debugging happening.

from stm32f1xx.

terjeio avatar terjeio commented on July 19, 2024

I removed USB_ENABLE and set USB_SERIAL_CDC 0 in my_machine.h

I assume you removed OVERRIDE_MY_MACHINE from the IDE symbols then...

To set a breakpoint just double click to the left of the line number:

image

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

I was just covering my ars by making sure it was in both places. :-)

I have debugging working and it's breaking at line 103 in serialWriteS()

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

Seems to be wanting to print "error:7"

And wow, this was fairly easy to setup...

from stm32f1xx.

terjeio avatar terjeio commented on July 19, 2024

error 7 is failure to read settings, either from flash or EEPROM - I belive I saw that this board has an EEPROM mounted, but possibly interfaced via SPI? grblHAL supports I2C EEPROMs.

If you send a '?' do you get new output in serialWriteS?
You can also set breakpoints in the USART1_IRQHandler to see if RX and TX interrupts fires.

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

I'm testing this on a Bluepill board so no external EEPROM. I will connect up my FTDI board(3.3V) and minicom and see if there's any reaction.

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

ok so this is different. It's in debug mode and I connected the FTDI board and now I'm getting stuff!

?
error:7

Grbl 1.1f ['$' for help]
[MSG:'$H'|'$X' to unlock]
?<Alarm|MPos:0.000,0.000,0.000|Bf:35,512|FS:0,0|Pn:PXYZRHS|Ov:100,100,100>

and $$ gives me settings.
$$
$0=10.0
$1=25
$2=0
$3=0
$4=7
$5=0
$6=0
$9=1
$10=511
$11=0.010
$12=0.002
$13=0
$14=0
$15=0
$16=0
$17=0
$18=0
$19=0
$20=0
$21=0
$22=0
$23=0
$24=25.0
$25=500.0
$26=250
$27=1.000
$28=0.100
$29=0.0
$30=1000.000
$31=0.000
$32=0
$33=5000.0
$34=0.0
$35=0.0
$36=100.0
$37=0
$39=1
$40=0
$43=1
$44=4
$45=3
$46=0
$62=0
$63=2
$64=0
$65=0
$100=250.000
$101=250.000
$102=250.000
$110=500.000
$111=500.000
$112=500.000
$120=10.000
$121=10.000
$122=10.000
$130=200.000
$131=200.000
$132=200.000
$341=0
$342=30.0
$343=25.0
$344=200.0
$345=100.0
$384=0
ok

from stm32f1xx.

dlarue avatar dlarue commented on July 19, 2024

it will run through the debugger either single stepping or just running but it will not run when powered via USB.
I realized the firmware size was over 64K again( 111K ) and couldn't figure it out. Seems single stepping or running through debug literally loads the code as it runs. Well, I went to see if another programmer besides openocd was around and STM makes one and so I installed it and flashed 111K image and now the Bluepill runs from USB power and with the FTDI connected to a9 and a10.

That took a while but I now have in-circuit debugging working and have another programmer option.

Next step is now figuring out how to move the PWM/spindle to PB0.

from stm32f1xx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.