Hello from Croatia

nostromo_2000
Posts: 4
Joined: Sat Jul 15, 2017 3:38 pm

Hello from Croatia

Post by nostromo_2000 » Sat Jul 15, 2017 5:01 pm

Hello from Croatia

Finaly I found nice place to expand my hobby. First time user of Mini maple board. Some projects were successful and with some i spend lot ot time trying to get them work .
This time i was stuck with GRBL for STM32F103. Board is BTE14-07 with STM32duino-bootloader. I was followed instructions from usbcnc on You tube using files from github.com/usbcnc/grbl. After loading .hex or .bin to board, in control panel only Maple DFU appears without comm port. Can someone try to build, load hex to BTE14-07 and check for comm ports? Same thing with attached grbl_v1.1f.20170131.hex .

Thanks in advance
Damir

goran.mahovlic
Posts: 35
Joined: Fri May 26, 2017 9:01 pm

Re: Hello from Croatia

Post by goran.mahovlic » Sat Jul 15, 2017 7:29 pm

Usually ports are recognized after first arduino upload. You can try that...

Pozdrav,
Goran

nostromo_2000
Posts: 4
Joined: Sat Jul 15, 2017 3:38 pm

Re: Hello from Croatia

Post by nostromo_2000 » Sat Jul 15, 2017 10:15 pm

Thanks for fast reply.
I have tested ASCIITable.ino.bin, and immediately after reconnecting board comm port apears in control panel, this is not case with compiled grbl. I have loaded grbl hex at 0x8002000 not to disturb bootloader. Probably i am doing someting wrong in coocox configuration setings. I do not know do i have to change Read/Only Memory Area on-chip Start Size from 0x00020000 to 0x00010000 according "All devices up to 128kb have a 1k page size...". I am using Coocox CoIDE for first time.

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Croatia

Post by RogerClark » Sun Jul 16, 2017 1:36 am

You don't seem to be using the Arduino IDE or the STM32_duino core

If you want to use coo-cox, I'd recommend you get it working without the bootloader first

The bootloader is only installed to make it easy to flash the binary to the device without needing any external hardware (SWD programmer e.g. STLink or USB to Serial adaptor)

The bootloader only provides DFU to upload the binary to 0x8002000 or 0x8005000 depending on the options sent to the uploader

Your application code needs to provide whatever USB you require, it also needs to reset the USB bus so that whatever USB device your application code provides, gets detected by the host system (e.g. the PC)

nostromo_2000
Posts: 4
Joined: Sat Jul 15, 2017 3:38 pm

Re: Hello from Croatia

Post by nostromo_2000 » Sun Jul 16, 2017 10:31 am

Yes I am using Arduino IDE for all my projects, and it is a first time I am using CooCox. I have just folloved You tube video. In that moment it semms to be quickest sollution. I just need GRBL running on Maple mini, to try to achive 1/128 step with raps128 stepper driver. Still need help.
I have also tried without bootloader but still no comm port.
I read "Arduino STM32 – USB Serial and DFU"and I assume this is the way bootloader works, but after readnig your ansver I know for shure.
Thanks for sharing Your knolege.

Still learning :D .

User avatar
RogerClark
Posts: 7136
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hello from Croatia

Post by RogerClark » Sun Jul 16, 2017 9:39 pm

Try something simple to confirm your hardware is working, e.g. Something that prints to Serial every second, check this works and you have all the drivers loaded etc etc,

andrethomas
Posts: 6
Joined: Fri Jun 16, 2017 7:55 pm
Location: South Africa

Re: Hello from Croatia

Post by andrethomas » Mon Jul 17, 2017 6:24 pm

nostromo_2000 wrote:
Sun Jul 16, 2017 10:31 am
I just need GRBL running on Maple mini, to try to achive 1/128 step with raps128 stepper driver.
As RogerClark suggested, try something simple first. GRBL isnt going to compile straight out on the maple from what I can tell... you'll need to dig around in the code to change some stuff which was atmega specific and perhaps not relevant to the maple. Also, grbl uses eeprom to store the parameters/settings of your CNC requirements so you'll need to find a way to work around that also... either external eeprom or writing it to flash on the chip... i would recommend rather using external eeprom... dunno if your stm32 board has external eeprom on it or not.

That aside you may want to look at the code used by RADDS as they already have a lot of code which was written for the duo which may be easier to port to stm32 as it is the same architecture.

goran.mahovlic
Posts: 35
Joined: Fri May 26, 2017 9:01 pm

Re: Hello from Croatia

Post by goran.mahovlic » Mon Jul 17, 2017 7:21 pm

But I think he is using this code
https://github.com/jcarvalhogo/grbl_usb_stm32F103c8t6

So it is already ported
And probably need to fix just serial port (I see that USB serial is not on same pins)

And at first look at code it seams they are using EEPROM emulation

http://www.st.com/content/ccc/resource/ ... 165693.pdf

andrethomas
Posts: 6
Joined: Fri Jun 16, 2017 7:55 pm
Location: South Africa

Re: Hello from Croatia

Post by andrethomas » Tue Jul 18, 2017 6:21 am

goran.mahovlic wrote:
Mon Jul 17, 2017 7:21 pm
But I think he is using this code
https://github.com/jcarvalhogo/grbl_usb_stm32F103c8t6

So it is already ported
And probably need to fix just serial port (I see that USB serial is not on same pins)

And at first look at code it seams they are using EEPROM emulation

http://www.st.com/content/ccc/resource/ ... 165693.pdf
Nice find - I guess the eeprom emulation equates to using program memory / flash

nostromo_2000
Posts: 4
Joined: Sat Jul 15, 2017 3:38 pm

Re: Hello from Croatia

Post by nostromo_2000 » Tue Jul 18, 2017 10:19 am

Thanks a lot for help.

I usually test comm on Maple mini with ASCIITable.ino or monitor my GPS in Arduino serial monitor, and it works.
I misss serial port when grbl is compiled in CooCoxIDE or when precompiled hex is loaded.

But is it possible to compile Grbl in Arduino IDE? Now i have right IDE?
I have compiled grbl for Arduino Uno without problem, and it works. Simple load Grbl into the Arduino IDE as a Library, upload Grbl example, compile and upload to Uno.
Let s try same with maple and grbl -edge and arduino IDE.
Downloaded code from https://github.com/usbcnc/grbl.
Opened grbl-edge.zip file and found gbrl directory under main gbrl.
Copied the second grbl in C:\Users\XXX\Documents\Arduino\libraries
Opened Arduino IDE and search in examples for grbl. Found it in examples from custom libraries
Opened grblupload.ino, and try to compile for UNO just to check. few seconds after "Done compiling". Ok .

After selecting Maple mini and runing compiler, massage "fatal error: avr/io.h: No such file or directory #include <avr/io.h>" appeared. Hmmmm?
Lets try something different. This time i have copied grbl directory to C:\Users\XXX\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries.
Opened Arduino IDE and search in examples for grbl. Found it in examples for Maple mini
Opened grblupload.ino, and try to compile for Maple mini board. Same error massage appeared. Yes, it is normal it is for Arduino board (AVR IO definitions) .
Is ths gbrl writen for STM32? Time to look and seatch for evdence in code. Yes, found lots of #if defined (STM32F103C8)........#endif and also there is //#define NOEEPROMSUPPORT. So for #if defined, have to be propper #define, but i can not find #define STM32F103C8.
How to activate #if defined (STM32F103C8)?
Selecting proper board from menu - maple allredy selected, or I have to comment #if defined for oder boards or controllers?

Post Reply