swd debug

Info and Discussion about the ESC32 hardware and software

swd debug

Postby almaz_1c » Tue May 05, 2015 6:33 pm

Hello, I try to debug esc32 using st-link debugger from stm32 discovery board.
I try to erase chip:
Code: Select all
./st-flash erase
2015-05-05T08:25:17 INFO src/stlink-common.c: Loading device parameters....
2015-05-05T08:25:17 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2015-05-05T08:25:17 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
Mass erasing.

It looks like all went successful, but in fact, after reset esc32 begin to work ( red led is blinking ). Why chip memory is not erased?
Connected pins are: SWCLK, SWDIO, VRef, NRST, GND.
Esc32 powered from pwm 5v supply.
Is it possible to debug firmware ( erase, re-flash and debug)?
almaz_1c
 
Posts: 7
Joined: Tue May 05, 2015 6:25 pm

Re: swd debug

Postby Max » Tue May 05, 2015 8:24 pm

almaz_1c wrote:Is it possible to debug firmware ( erase, re-flash and debug)?


Yes. I'm using the STM32F4 Discovery board for SWD interface, ST-LINK Utility from STM, and the free GDB server from STM (with Eclipse+CDT). It all works.

-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: swd debug

Postby almaz_1c » Tue May 05, 2015 9:24 pm

Thank you for answer, Max. I use exactly that scheme:stm32f4-discovery board and eclipse project. I have absolutely no idea what the reason. Honestly, I was going to chip desoldering. Now I am trying to debug firmware on the stm32f103 nucleo board. If not hard please describe your circuit connection to mirkokontrolleru: what legs are involved and how the power is used? What is the output of st-flash utility when performing erase/flash operations?
almaz_1c
 
Posts: 7
Joined: Tue May 05, 2015 6:25 pm

Re: swd debug

Postby Max » Tue May 05, 2015 10:46 pm

The firmware relies on the Rowley CrossWorks for ARM build chain (which is slightly modified GCC for ARM) and also on their proprietary libs (libc, libm, etc). It might be easier to get started using an eval copy of CrossWorks, and/or check the Makefile for details. If you build debug version with CW, you must debug with CW, and vice versa (build with Makefile if debugging with standard GDB).

BTW, welcome to the forums!

HTH,
-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: swd debug

Postby almaz_1c » Wed May 06, 2015 5:50 pm

Hello, Max! Perhaps therefore my firmware, compiled using the standard GCC exceeded 100K. But can another build chain be the reason that I can not erase the firmware of the chip?
almaz_1c
 
Posts: 7
Joined: Tue May 05, 2015 6:25 pm

Re: swd debug

Postby Max » Wed May 06, 2015 5:59 pm

almaz_1c wrote:But can another build chain be the reason that I can not erase the firmware of the chip?

Can't see how it could be! I've never had any issue erasing a chip via SWD... This is a genuine, stock ESC32? You could check the "Option Bytes" of the chip (in ST_LINK Utility) to see if perhaps something is locked...

-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: swd debug

Postby almaz_1c » Wed May 06, 2015 8:42 pm

There is the foto of my esc32 and option bits configuration . It seems like original esc32. From once of them I desolder the chip. I can perform only few successful connecting to esc32 via ST-LINK utility. After that esc32 chip goes to inaccessible state and i can't connect to chip via ST-Link utility.
Attachments
20150506_201814.jpg
almaz_1c
 
Posts: 7
Joined: Tue May 05, 2015 6:25 pm

Re: swd debug

Postby almaz_1c » Wed May 06, 2015 8:42 pm

Here is option bits.
Attachments
20150506_222713.jpg
almaz_1c
 
Posts: 7
Joined: Tue May 05, 2015 6:25 pm


Return to ESC32

Who is online

Users browsing this forum: No registered users and 3 guests

cron