Skip to main content
Prasant J
Associate III
August 4, 2017
Solved

STM32F303VB: How to debug Boot loader + Application?

  • August 4, 2017
  • 3 replies
  • 2592 views
Posted on August 04, 2017 at 08:19

Hi,

I'm working on my custom hardware based on STM32F303VB

I'm trying to make a CAN based boot loader. 

I can jump from boot loader to application but the application just hangs some where.

How can I debug boot loader + application using AC6 System Work bench?

Is it even possible to debug 2 projects together?

Or is there a special method to debug?

Any inputs will be of help.

Thanks & regards, Pj

#stm32f303 #stm32f303vb #bootloader
This topic has been closed for replies.
Best answer by Tesla DeLorean
Posted on August 04, 2017 at 17:03

In Keil and IAR you can debug either the app or the loader with source, You can step across the transition, and follow the assembler code, if it gets hung up some place, a) see if you recognize the code/function, b) look at the .MAP file to determine what you're in, and how deep, ie 40% into SystemInit(), etc.

I'd expect any debugger worth a damn to be able to step into ANY code, might not show you 'source' but again this should not preclude a reasonable understanding of what's going on.

Have a proper Hard Fault handler so you catch gross failure. Make sure SystemInit() or whatever sets the correct Vector Table via (SCB->VTOR), especially important for an app not at the base of flash.

Instrument your code, or add check points, so you know what's going on, where the flow goes, where it gets stuck.

3 replies

AVI-crak
Senior
August 4, 2017
Posted on August 04, 2017 at 10:19

GCC does not allow you to debug two parts of the project at once. He needs to have solid ground under his feet while debugging the application.

During the debugging of the bootloader - the degree of availability of the application is not important, it's just a load.

I wanted to have such a magic button, but it does not exist.
Technical Moderator
August 4, 2017
Posted on August 04, 2017 at 16:21

Hello

J.Prasant

,

CAN bootloaderis not applicable for STM32F

I recommend that you have a look to the application note ''STM32 microcontroller system memory boot mode''

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD001675pdf/files/CD001675pdf/jcr:content/translations/en.CD001675pdf

and you find related information to the STM32F303 bootloader .

You can refer to this

http://www.st.com/content/ccc/resource/technical/document/application_note/56/94/0c/7d/63/f6/4d/96/CD00264pdf/files/CD00264pdf/jcr:content/translations/en.CD00264pdf

''CAN protocol used in the STM32 bootloader'' and checkApplicable products.

0690X00000607qdQAA.png

0690X00000607e4QAA.png

Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Tesla DeLorean
Guru
August 4, 2017
Posted on August 04, 2017 at 16:58

Assume his own boot loader, not system loader

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
August 4, 2017
Posted on August 04, 2017 at 17:03

In Keil and IAR you can debug either the app or the loader with source, You can step across the transition, and follow the assembler code, if it gets hung up some place, a) see if you recognize the code/function, b) look at the .MAP file to determine what you're in, and how deep, ie 40% into SystemInit(), etc.

I'd expect any debugger worth a damn to be able to step into ANY code, might not show you 'source' but again this should not preclude a reasonable understanding of what's going on.

Have a proper Hard Fault handler so you catch gross failure. Make sure SystemInit() or whatever sets the correct Vector Table via (SCB->VTOR), especially important for an app not at the base of flash.

Instrument your code, or add check points, so you know what's going on, where the flow goes, where it gets stuck.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Prasant J
Prasant JAuthor
Associate III
August 18, 2017
Posted on August 18, 2017 at 08:11

Hi guys,

I found the problem.. the jump was working fine but systick interrupts were not working.

I had missed using __enable_irq() at the beginning on the application firmware.

Thanks for valuable inputs!

Regards, Pj

mcdino.5338840562911753E12
Associate III
January 30, 2019

@Prasant J​  can you please share you code with me? I wish to write a can based bootlaoder for my STM32F042K6 but I have some difficulties. It will be very kind of yours if you could give me some help. Thanks in advance.