Hi Alan
The function "exit(1)" in my code of the pysimCoder blocks will be
called only if we set "y" to the configuration
CONFIG_NSH_DISABLE_EXIT=y
This configs means, in my opinion, that if exit is disabled, the
function "exit" doesn't exist, but it seem that we have an opposite
behaviour.
I'll check where this configuration is used.
Bye
Roberto
On 10/3/24 8:52 PM, Alan C. Assis wrote:
Hi Robert,
Did you identify the commit that changed the way exit(1) behaves?
BR,
Alan
On Thu, Oct 3, 2024 at 1:01 PM Roberto Bucher <bubu.buc...@gmail.com> wrote:
I developed a python application called "pysimCoder" similar to XCos and
Simulink, which is able to generate control code for different targets
(Linux, Linux RT, Raspberry PI, NuttX and others). We have about 175
blocks for the different targets already defined for inputs, outputs,
functions, sensors, actuators etc.
The <utomatically generated code from a graphical block diagram is
divided into 3 functions, called from a main:
initialization, termination and interrupt service routine
The last one is called by a temporized thread.
If the initialization fails, the program must stop: till now (also in
NuttX), this is realized by simply call the "exit(1)" function in the
initialization procedure! Now (new?) in NuttX, when we call the
"exit(1)" function we get the "Assertion failed panic" message, and no
more the stop of the running control program, instead of return into the
nsh application.
Of course, it is possible to exit from the main thread Using return)
after controlling if the initialization function of a block is failed:
but to implement this we, have to change the code of all the 175 blocks...
Bye
Roberto
On 10/3/24 3:58 PM, michal.lyszc...@bofc.pl wrote:
On 2024-10-03 14:16:40, Roberto Bucher wrote:
_assert: Assertion failed panic: at file: armv7-m/arm_hardfault.c:175
task:
0x80002b9
and this is related to the call of the function
exit(1);
in my code, for example if a device is not defined. The call to this
exit(1)
function leads to this assertion error.
Basically, what I have to do is only to stop my (generated) application
and
I think that it was ok in the past...
Any idea how to solve this?
I don't understand? What do you wanna solve? Hardfault? Well, then
don't call exit() function? I mean, if program cannot continue just
add proper log before doing call to exit() so next person does not
have to think hard what is going on. Better yet - if it's possible
to do, use static_assert()/COMPILE_TIME_ASSERT() to issue error
during compilation time that something is not defined.