You are here

Print statements - Firmware

5 posts / 0 new
Last post
vitormhenrique
Offline
Last seen: 2 months 1 week ago
VESC FreeVESC Original
Joined: 2019-08-29 17:28
Posts: 25
Print statements - Firmware

Hello everyone,

let's start with I'm a noob developing rtos systems and st micro controllers, I play around with arduinos, teensys, esp, but nothing close to VESC firmware.

I downloaded the source code, and made some changes, basically updating the ws2811 library. I complied it and flashed on the vesc (i'm using a 4.12 hardware to test) but it did not work.

Is there a way to print statements to terminal, to understand what is going on? 

I'm using an ST Link v2 to upload and flash the firmware. But I also get a segger mini.

Documentation says to use commands_printf, and there are a lot of printft statements on the code, but going to the terminal I dont see anything beeing printed.

TLDR: noob wants to print on serial and debug code

MTomoum
Offline
Last seen: 3 years 3 months ago
Joined: 2020-04-18 21:32
Posts: 1

Hey vitormhenrique​,

I would do a quick sanity check and confirm you have set the correct baud rate( which is 115200 I believe), bit rate, etc on your computer. Although, I suspect the root of the problem is that the io stream is not being directed correctly to the virtual com port on the st-link debugger. I had a similar problem with my previous project which I some guidance from this link https://www.carminenoviello.com/2015/03/02/how-to-use-stm32-nucleo-serial-port/

I am currently working on digging deep with this firmware specifically uart communication as i am trying to build a custom handheld controller so i will let you know if i have any ideas or suggestions for you. Good Luck!

Muhab Tomoum

Siverian
Siverian's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2020-02-12 23:06
Posts: 3

Hello everyone. I'm also interested in debug feature. As I understood it's not possible to debug with a normal debugger with 0 optimization ar with ChibiOS debug feature. So, if someone may share debug experience - it would be interesting. 

hexakopter
Offline
Last seen: 1 year 1 month ago
VESC Original
Joined: 2017-05-24 12:13
Posts: 94

In this thread https://vesc-project.com/node/1027 a link about debugging an STM32F4 on Benjamins website is mentioned: http://vedder.se/2012/12/debugging-the-stm32f4-using-openocd-gdb-and-eclipse/ Haven't looked at it yet, but maybe that helps a bit.

Siverian
Siverian's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2020-02-12 23:06
Posts: 3

Debugging with breakpoints is not straightforward in this case because for this project optimization is set to O2. And if you try to set a breakpoint the further code does not execute straightforward. It jumps somewhere in the program and for me, it's difficult to understand what is going on. But if I disable optimization, the system hangs. 

Therefore i'm also interested in "serial debugging" when you send some information to serial port.