We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
C_FLAGS := -c -ggdb -mcpu=cortex-m3 -mthumb
MEMORY { FLASH : ORIGIN = 0x08000000, LENGTH = 256K RAM : ORIGIN = 0x20000000, LENGTH = 48K } SECTIONS { .text : { KEEP(*(.interrupt_vector)) *(.text) } > FLASH .data : { _data_begin_ = .; *(.data) _data_end_ = .; } > FLASH .bss : { _bss_begin_ = .; *(.bss) _bss_end_ = .; } > RAM _stack_size_ = 1024; _stack_end_ = ORIGIN(RAM) + LENGTH(RAM); _stack_begin_ = _stack_end_ - _stack_size_; ._stack : { . = . + _stack_size_; } > RAM } ENTRY(handler_reset)
extern unsigned long _stack_end_; typedef void (*interrupt_routine)( void );void handler_reset( void );void handler_default( void ); // vector interrupt table__attribute__ ( ( section( ".interrupt_vector" ) ) )interrupt_routine routines[] ={ (void*) &_stack_end_, handler_reset, handler_default, // ... itd...}; void handler_reset( void ){ main();} void handler_default( void ){ while ( 1 ) { }}
int main( void ){ int a = 3; int b = 2; int c = 3 + 2; a = c; while( 1 ) { // infinite loop } return 0;}
void aa(){} int main( void ){ int a = 3; int b = 2; int c = 3 + 2; a = c; aa(); while( 1 ) { // infinite loop } return 0;}
Setting breakpoint @ address 0x08000034, Size = 2, BPHandle = 0x0023Starting target CPU... WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1. ...Target halted (PC = 0xF04FAF00)Reading all registersRemoving breakpoint @ address 0x08000034, Size = 2
arm and thumb needs to be addressed while setting the bkpt. If bkpt is set in arm mode and if code executes in thumb mode it might not work.