gerbl board seems to be broken RS-CNC32

geostein8888
Messages : 68
Enregistré le : 03 déc. 2020 11:42

Re: gerbl board seems to be broken RS-CNC32

Message par geostein8888 »

Hello,
same result, nothing happens on the terminal window. i tried 2 different stm32, i even tried with changed rx/tx crossing.
is it possible that my stm32 is not correct programmed? i used the documentaion from this site (one time with the st-link utility, and one time while recompiling the hex file to be sure ist with 115200 baud)
do i have to make special settings in the st-link utility?

here the log file form st-link:

Code : Tout sélectionner

10:46:31 : [stm32grbl11.hex] opened successfully.
                  Address Ranges [0x08000000 0x0800010C] [0x08000110 0x0800C710] 
10:46:31 : [stm32grbl11.hex] checksum : 0x0054A370 
10:46:51 : ST-LINK SN : 2930040011145157544D4E00
10:46:51 : V2J31S7
10:46:51 : Connected via SWD.
10:46:51 : SWD Frequency = 4,0 MHz.
10:46:51 : Connection mode : Normal.
10:46:51 : Debug in Low Power mode enabled.
10:46:51 : Device ID:0x410 
10:46:51 : Device flash Size : 64KBytes
10:46:51 : Device family :STM32F10xx Medium-density
10:47:33 : Flash memory erased.
10:47:46 : Flash memory is blank.
10:50:05 : ST-LINK SN : 2930040011145157544D4E00
10:50:05 : V2J31S7
10:50:05 : Connected via SWD.
10:50:05 : SWD Frequency = 4,0 MHz.
10:50:05 : Connection mode : Normal.
10:50:05 : Debug in Low Power mode enabled.
10:50:05 : Device ID:0x410 
10:50:05 : Device flash Size : 64KBytes
10:50:05 : Device family :STM32F10xx Medium-density
10:50:19 : [stm32grbl11.hex] opened successfully.
                  Address Ranges [0x08000000 0x0800010C] [0x08000110 0x0800C710] 
10:50:19 : [stm32grbl11.hex] checksum : 0x0054A370 
10:50:44 : Memory programmed in 4s and 219ms.
10:50:44 : Verification...OK
10:51:05 : ST-LINK SN : 2930040011145157544D4E00
10:51:05 : V2J31S7
10:51:05 : Connected via SWD.
10:51:05 : SWD Frequency = 4,0 MHz.
10:51:05 : Connection mode : Normal.
10:51:05 : Debug in Low Power mode enabled.
10:51:05 : Device ID:0x410 
10:51:05 : Device flash Size : 64KBytes
10:51:05 : Device family :STM32F10xx Medium-density

Georg
mstrens
Messages : 2611
Enregistré le : 27 févr. 2018 12:58

Re: gerbl board seems to be broken RS-CNC32

Message par mstrens »

You can try to load a very basic program (blinking a led) into the stm32 to check if it works and if it can communicate via TX and RX.

Here a link that explain how to do it
https://how2electronics.com/getting-sta ... ng-of-led/

The link proposes to use the arduino IDE and the FTDI to upload the program. This is a good solution because if it works it means that it can communicate via TX and RX pins.

Can you test it.

Take care to always keep Tx connected to RX (so crossing) otherwise, the stm32 could be damaged.
geostein8888
Messages : 68
Enregistré le : 03 déc. 2020 11:42

Re: gerbl board seems to be broken RS-CNC32

Message par geostein8888 »

Hello,
i tried this with all3 modules. i always get the error
Couldn't find the DFU device: [1EAF:0003]
when i will upload the blinking led code

Georg
mstrens
Messages : 2611
Enregistré le : 27 févr. 2018 12:58

Re: gerbl board seems to be broken RS-CNC32

Message par mstrens »

I expect that you got this message because the stm32 does not have a "bootloader" preloaded.
In fact there are several ways to upload a program in a stm32 and the link I provided is not consistent (sorry I just understood it now).
The link contains as well some text and a video.
The description in the text is not good.

Please look at the video.
You will see that to have to:
- select "Serial" as uploading type
- change a jumper on the STM32 board
- press the reset button when uploading would start to force the STM32 to enter in programming mode.

I hope this help.
geostein8888
Messages : 68
Enregistré le : 03 déc. 2020 11:42

Re: gerbl board seems to be broken RS-CNC32

Message par geostein8888 »

i tried this also now (jumper boot0 set to 1 and reset):

Code : Tout sélectionner

Error probing interface "serial_w32"
stm32flash 0.4
Cannot handle device "COM6"

Failed to open port: COM6
http://stm32flash.googlecode.com/

Using Parser : Raw BINARY
i guess here is more damaged than the stm32. to be sure i ordered now another ftdi and stm from other companies

Georg
mstrens
Messages : 2611
Enregistré le : 27 févr. 2018 12:58

Re: gerbl board seems to be broken RS-CNC32

Message par mstrens »

If you can't upload a program using FTDI, you can try to load it using stlink.

Here is a link that explain how to do it.
https://idyl.io/arduino/how-to/program- ... 2f103c8t6/

If uploading the blink example is OK (this does not require the FTDI at all), you should have a led blinking.
If this is ok, it mean the STM32 is still running.

Then you could upload (still using the STLink) another skecth that will let you check the serial communication using the FTDI.
Let me now if you can have the "blink" sketch running and I will then search for a communication sketch.
geostein8888
Messages : 68
Enregistré le : 03 déc. 2020 11:42

Re: gerbl board seems to be broken RS-CNC32

Message par geostein8888 »

Hello,
this worked, with the st-link interface. The green led is now blinking

Georg
mstrens
Messages : 2611
Enregistré le : 27 févr. 2018 12:58

Re: gerbl board seems to be broken RS-CNC32

Message par mstrens »

Can you try following code (e.g replace blink sketch by this one)
I ask the program to send "Hello" by 2 ways because I am not sure which way uses the UART ( I think it is Serial1)

After uploading this code, connect the FTDI.
In arduino serial terminal (CTRL+SHIFT+M) set the baudrate on 115200.
I expect that you should get:
- a blinking led on the stm32
- a message "hello from ???" on the pc.

If not let me know, it could be that part of the code has to be removed if blocking (I have no stm32 free to test myself)

Code : Tout sélectionner


void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  Serial1.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  Serial.print("Hello from Serial");
  Serial1.print("Hello from Serial1");
  delay(1000);
}


geostein8888
Messages : 68
Enregistré le : 03 déc. 2020 11:42

Re: gerbl board seems to be broken RS-CNC32

Message par geostein8888 »

Hello,
this works, i get Hello from serial and serial1 in the terminal window

Georg
mstrens
Messages : 2611
Enregistré le : 27 févr. 2018 12:58

Re: gerbl board seems to be broken RS-CNC32

Message par mstrens »

Fine,
So your stm32 can send message.

Let see now if it can receive messages.

You could change the program with the code below
This should still blink the Led
It should send to the PC a dot once every 2 sec
Furthermore, if you enter some characters in the arduino serial terminal (in a frame in the upper part) and if you press Enter, the characters should be sent to the STM32. The STM32 should read them and send them back to the PC where there should be displayed.
If this works, then STM32 can communicate and is OK.


Code : Tout sélectionner

void setup() {
  //Initialize serial and wait for port to open:
  Serial1.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  Serial1.print(".");
  delay(1000);
  while (Serial1.available()) {      // If anything comes in Serial (USB),
    Serial1.write(Serial1.read());   // read it and send it out Serial1 (pins 0 & 1)
  }

}


Répondre