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.

-- 
.-----------------.-------------------.----------------------.-----------------.
| Michal Lyszczek | Embedded C, Linux |   Company Address    |  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `----.--------------: Brzezinka Sredzka PL | /`'\      &     |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`----------------------^--------------^----------------------^-----------------'

Attachment: signature.asc
Description: PGP signature

Reply via email to