cancel
Showing results for 
Search instead for 
Did you mean: 

Program execution gets to void _exit (int status). I am unable to prevent that or find what line causes this to happen.

Yyes
Associate

So somehow through my chain of execution I end up here

void _exit (int status)

{

   _kill(status, -1);

   while (1) {}      /* Make sure we hang here */

}

From disassembly it seems that the functions preceeding it are

ITM_SendChar()

and before that

HAL_CAN_RxFifo1MsgPendingCallback()

I do use HAL_CAN_RxFifo1MsgPendingCallback(), but following in from there I do not know how it ends up in ITM_SendChar nor how does this lead to the _exit() function.

I've had errros before with HardFaultHandler(), but never ended up in _exit() and not sure how to proceed.

I am using TrueStudio, I started using it over Keil as it seemed to be better at dynamic printf and array display. It does show some issues as at 2,000,000 bps it drops bytes in between DMA transfers while the same code in Keil wouldn't.

Toolchain: Atollic ARM Tools

Probe: ST_Link

Optimisation: None (-O0)

Debugging: Maximum (-g3)

MCU: STM32F407

2 REPLIES 2

What tool-chain?

Malloc? _sbrk?

Disassemble the complete object code, and cross-reference where _exit is being called. As I recall FromELF and/or objcopy contain dissemblers.

Break-point _exit() look at the value of LR, or stacked version thereof, to work back up the call-stack.

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

I use malloc for circular buffers, they are used constantly and are not freed.

Not sure about _sbrk, I didn't touch it in any way.

"Disassemble the complete object code, and cross-reference where _exit is being called" how to do thate exactly?