Hi.
what i mean:
- I use i2cMasterTransmitTimeout() - if communication with the device is lost, the system "freezes" (https://git.heaven.pp.ua/Heaven/Accum-T ... /INA3221.c, line 83),
- if there is not enough stack size for the thread - the system "freezes",
- trying to send an event - for some reason the system "freezes" (https://git.heaven.pp.ua/Heaven/Accum-T ... src/main.c, line 172).
how to find and correct the causes of such behavior?
thank you.
P.S.: forgot to add - if you set the optimization level to 3 (-O3), then sending the event works.
when my code works or doesn't work depending on the compiler or its settings - it's very annoying and disturbs my sleep.
how to handle operating system exceptions? Topic is solved
Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess
how to handle operating system exceptions?
Last edited by shilow on Thu Dec 29, 2022 8:31 pm, edited 1 time in total.
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: how to handle operating system exceptions?
Do I understand correctly that it is possible to determine the cause of SysHalt only using the hardware debugger?
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: how to handle operating system exceptions? Topic is solved
Correct, you need to examine the string pointed by the chSysHalt() parameter. It is possible to "hook" the function and print the string somewhere but the debugger is usually the easiest and safest way (after a crash your "print" function could fail as well).
giovanni
giovanni
Re: how to handle operating system exceptions?
Giovanni wrote:Correct, you need to examine the string pointed by the chSysHalt() parameter. It is possible to "hook" the function and print the string somewhere but the debugger is usually the easiest and safest way (after a crash your "print" function could fail as well).
how to force chSysHalt() to output the string to the serial port? any example?
I will be very grateful.
- Giovanni
- Site Admin
- Posts: 14461
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: how to handle operating system exceptions?
I don't have an example, usually using the debugger is the easier thing to do.
You may try to start a serial driver beforehand then create a "write" function in polled mode, this way it can be used with interrupts disabled.
Giovanni
You may try to start a serial driver beforehand then create a "write" function in polled mode, this way it can be used with interrupts disabled.
Giovanni
Who is online
Users browsing this forum: No registered users and 10 guests