cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Breakpoints in external FLASH

charlesherrera
Associate II
Posted on January 15, 2009 at 00:00

Hardware Breakpoints in external FLASH

17 REPLIES 17
charlesherrera
Associate II
Posted on May 17, 2011 at 12:56

Hello,

I was able to write code to run out of the external FLASH on the STM3210E-EVAL board. The problem is that I have been unable to set a hardware breakpoint to debug code in external flash. The error that I get is:

Tue Dec 02 13:19:36 2008: Failed to set breakpoint at 0x64000242 (This area does not support hardware breakpoints)

Tue Dec 02 13:19:36 2008: Failed to set breakpoint: Driver error.

I have spoken to the manufacturer of the tool chain and they have suggested that it may be a bug in the STM32 part and said that all of the tool chains fail in the same fashion. I have looked at the errata and found nothing mentioning this. Has anyone been successful at setting a breakpoint in external flash memory?

Thanks,

Charles

joseph239955
Associate II
Posted on May 17, 2011 at 12:56

Hi Charles,

The hardware breakpoint unit can set breakpoint in the address range 0x0 to 0x1FFFFFFF only. For higher address, the ''Watchpoint on PC match'' feature in DWT can be used instead. However, watchpoint is slight different then breakpoint in the sense that the halting of processor might happen after the instruction is executed (imprecise).

I don't know if the tool you are using support this feature or not.

Which tool chain are you using?

regards,

Joseph

jilisegiar
Associate II
Posted on May 17, 2011 at 12:57

Hi Josepf,

can you please let us know the reference of this info:

The hardware breakpoint unit can set breakpoint in the address range 0x0 to 0x1FFFFFFF only

Rgds

16-32micros
Associate III
Posted on May 17, 2011 at 12:57

Hi,

This mechanism is ensured thanks to ''Flash Patch and Breakpoint'' (FPB) unit to implement breakpoints and code patches & ''Data Watchpoint and Trace'' (DWT) unit to implement watchpoints, trigger resources, and system profiling.

However , I believe that is feasible only while patching Code space to the ''SRAM memory region'' which starts from 0x2000_0000 to 0x3FFF_FFFF.

Hi Charles,

Could you please provide the name of your tool manufacturer, so I can investigate with our partner regarding this statement : ''may be a bug in the STM32 part and said that all of the tool chains fail in the same fashion'' ? which seems strange :(

Cheers,

STOne-32.

joseph239955
Associate II
Posted on May 17, 2011 at 12:57

Hi Jilisegiar,

If you look at Cortex-M3 Technical Reference Manual (TRM) on ARM web site, under FPB section (in System Debug), you can find the FPB registers details. The address comparison is done be comparing the address value to FPB Comparator Registers, which has compare address values of bit 28 to 2. Since the upper 3 bits are not address (bit 31 to bit 29), you cannot compare an address outside the CODE memory region.

regards,

Joseph

charlesherrera
Associate II
Posted on May 17, 2011 at 12:57

Hello All,

Thanks for the replies, I am using the IAR tool chain along with a J-Link jtag device. With the info from your replies, I attempted to use some kind of watchpoint feature with this tool chain but have been unsuccessful.

It does not appear to have anything related to watchpoints in the breakpoint menus, it has a J-Link Watchpoint menu, but it appears greyed out, also there is nothing in the watch menu that will stop execution. I will report any progress.

Regards,

Charles Herrera

charlesherrera
Associate II
Posted on May 17, 2011 at 12:57

Hi JJ,

Thanks for the suggestion. The code running in external flash will be significantly larger than the internal Flash space. I would like to be able to debug the system with the code located in the memory it will normally run out of, keeping the same memory fetch, read, and write timings.

Regards,

Charles

jj
Associate II
Posted on May 17, 2011 at 12:57

@Charles-

suggestion - as STOne-32 & Joseph Yiu indicate that you may ''not'' be able to debug in external flash I offer this...

Temporarily move your code to ''normal'' on-chip flash & debug from there. After you've verified operation - on
charlesherrera
Associate II
Posted on May 17, 2011 at 12:57

Hi Joseph,

Thanks for the info. Do you know of any debuggers that uses the ''Watchpoint on PC match'' feature in the DWT?

Regards,

Charles Herrera