cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303VB: How to debug Boot loader + Application?

Prasant J
Associate III
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
1 ACCEPTED SOLUTION

Accepted Solutions
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 Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

7 REPLIES 7
AVI-crak
Senior
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.
Imen.D
ST Employee
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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 04, 2017 at 16:58

Assume his own boot loader, not system loader

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
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

@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.

Look at the assorted IAP examples for the platform. The CM0 parts have some different considerations when you can't program the vector table.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..