I found out the problem, with

CONFIG_NSH_DISABLE_EXIT=y

the exit(1) function in code correctly works otherwise the exit(1) call leads to:

_assert: Assertion failed panic: at file: armv7-m/arm_hardfault.c:175 task: 0x80002b9

In my opinion it should be the opposite behavior...

Bye

Roberto



On 10/3/24 6:16 PM, michal.lyszc...@bofc.pl wrote:
On 2024-10-03 17:02:09, Roberto Bucher 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...
Ok I see. So you expected exit() to work same as on, say, Linux. So that
app just exits back to the shell. According to function documentation
is should work like that

The exit() function causes normal process termination and the
least significant byte of status (i.e., status & 0xFF) is
returned to the parent (see wait(2)).
Don't know why it asserts, maybe you miss some config? Your best bet to
fix it is to put breakpoint at your exit() function, and step through the
code. Nuttx is exceptionally well documented in its C files, you will have
no problems following it.


Reply via email to