ARM Cortex-M Microcontroller startup files

Timo Sintonen via Digitalmars-d digitalmars-d at puremagic.com
Fri May 1 00:30:02 PDT 2015


On Thursday, 30 April 2015 at 23:49:52 UTC, Jens Bauer wrote:
>
> Most asserts on microcontrollers I've seen are just implemented 
> as while(1){}
> -But one could probably also trigger the debugger (BKPT), 
> HardFault or RESET if necessary.
> Perhaps the default could be while(1){} and then 
> version(ASSERT_BKPT) could be used to add a breakpoint before 
> that while(1){}. Thus --version=ASSERT_BKPT could be specified 
> on the command-line.
> Would it be possible to 'extend' an existing assert; eg. the 
> user might want to be notified via the U(S)ART ?

In a desktop computer it is easy to return to the system. A 
flying aeroplane can not stop its engines and wait the pilot to 
reboot...

We do have the 'weak' attribute now. Just make a weak default 
handler that stops. Then the application designer can override it 
with whatever the application needs.


More information about the Digitalmars-d mailing list