1
\$\begingroup\$

I tried debugging my code in ram in order to increase the flash's life (only rated at 10k writes minimum)

Anyways, I have tied the boot0 and boot1 pins to 3.3v and set the compiler to debug from ram like so:

Compiler "debug in ram" settings

When I debug my code this way, my SysTick_Handler doesn't run. If I debug from flash everything works just fine.

I can't figure out what is going on, and how can I get my SysTick interrupt to work in ram debug mode ?

P.S: I tried asking this in the coocox forum, but haven't got any help there.

\$\endgroup\$
  • \$\begingroup\$ That's a ~$5 chip, but let's toss in the price of a hot air station to change it out. $105 / 10000 = about a penny per trial. Sure your time is worth a bit more than that? If you really want to investigate it though, start by figuring out if it runs with the interrupt from RAM and it's merely the debugger making it fail, or if that setup doesn't make it work from RAM on its own. \$\endgroup\$ – Chris Stratton Jul 29 '14 at 20:44
3
\$\begingroup\$

You need to relocate the vector table — right now, the processor is probably still using the copy of the vector table in FLASH, which will point into an old version of your code in FLASH. (Or, if you've erased FLASH since you started developing in SRAM, the vector table in use will be blank.)

If you're using the STM32 Standard Peripheral Library (SPL), you can define the VECT_TAB_SRAM macro to have it set the appropriate flags to use a vector table in SRAM. If you're going the bare-metal route, you need to set the TBLOFF field of VTOR to point to the base of SRAM (0x02000000 on STM32F1).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.