Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Does FORTE run on systems without OS
Does FORTE run on systems without OS [message #1746839] Sat, 05 November 2016 14:11 Go to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I would like to use 4Diac in a project where I will be using a µC without operating system. Is it possible to install FORTE on systems without OS. If yes, how will it be done?
Re: Does FORTE run on systems without OS [message #1747035 is a reply to message #1746839] Tue, 08 November 2016 17:25 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi

the short answer is in principle yes.

The long answer is that in that case you need to implement interrupt code managing timers communication and other hardware interrupt and feed it into the execution of FORTE. In the start-up code for your µC you would need to create your device and then manage the execution of the CThread classes. For that you can applied different schemes. The simplest which we tried in a bachelor thesis was to use a cooperative scheduling approach. For a device with maybe one or two resources this should be pretty efficient. Unfortunately the resulting code was not nice enough to make it available.

But I'm happy to support you and and according means also to the public repository. I'm also available for a talk in skype or google hangouts if you like.

BR,
Alois





Re: Does FORTE run on systems without OS [message #1747331 is a reply to message #1747035] Sat, 12 November 2016 11:45 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Dear Alois,

thank you for your fast reply. I think a cooperative scheduling should be not too difficult to implement. Is there a manual or other hints where I could find the "hooks" for the timer interrupts, execution of CThread classes etc.?
Thank you also for offering a videoconference on this topic; which could be very helpful for me. But before that I would like to learn a bit more about the internals in order to make a possible videoconference more effective.
My plan is to implement this kind of PLC on one core of an AURIX Tri-Core µC. Each core has 300MHz and I think it should have enough resources for this kind of PLC, right?
If I succeed in this job I could contribute my code to your project - thus maybe it could be helpful for others also.

Kind reagrds

Lothar
Re: Does FORTE run on systems without OS [message #1747358 is a reply to message #1747331] Sun, 13 November 2016 17:04 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Dear Lothar,

unfortunately we curently have not much documentation available on this part of FORTE. I think I updated some parts when we reworked code for the last platforms we ported FORTE to. The best starting point would be the the rcX branch in our git repo. There we did several cleanups and improvemnts further reducing the porting effort. The code of interest for your endveors would be to look in one of the src/arch directories. I assume, rcx ThreadX or eCos would be better then Win32 or Posix.

In my "IEc 61499 Real-time Exeuction" book you can find in chapter 6 the description of the exeuction model and structure of FORTE. But I think if you have a first idea on the code structure the fasted would be a video session where I describe and show you the points for starting. Implemetnation and design decisions we can also discuss here in the forum.

I would be more then happy to have your contribution added to FORTE. Please note the Eclipse contribution guidlines [1].

Yes the CPU should have more then enough power to run FORTE. We did experiments with 32MHz arm7 and eCos as operating system and where able to perform real-time closed loop control.

Cheers,
Alois

[1] https://wiki.eclipse.org/Development_Resources/Contributing_via_Git
Re: Does FORTE run on systems without OS [message #1748165 is a reply to message #1747358] Sat, 19 November 2016 23:12 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I saw that 4Diac will be on the SPS/Drives fair in Nuernberg. I will also be there. Maybe/hopefully I find the time to stop by for some questions.

Best regards

Lothar
Re: Does FORTE run on systems without OS [message #1748181 is a reply to message #1748165] Sun, 20 November 2016 19:40 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

would be great to have a talk.
Re: Does FORTE run on systems without OS [message #1790405 is a reply to message #1748181] Sat, 09 June 2018 15:09 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
Is there any news regarding OS-less operation of FORTE?

best regards, Frank Radermacher
Re: Does FORTE run on systems without OS [message #1790486 is a reply to message #1790405] Mon, 11 June 2018 15:47 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Not really. We currently haven't had any device without operating system. Any specific device you have in mind? But as said above I would nearly always considering an OS noadays. Especially wehn it comes to more advanced networking features (e.g., OPC UA, MQTT).
Re: Does FORTE run on systems without OS [message #1790538 is a reply to message #1746839] Tue, 12 June 2018 14:03 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I also would like to come back to my intention to implement FORTE on a µC - either without OS or at least with FreeRTOS only.
Looking at the FORTE sourcecodes I see that the CMake build system is used. I am not familiar with CMake. Is it necessary to use CMake or may I compile the sourcefiles using Make with a standard makefile? Will it be cumbersome to switch to Make? Or is it easier to use CMake?
For CMake I think I need to configure the compiler settings somewhere. Wher this has to be done?
Do you have some hints for me how to start?
Re: Does FORTE run on systems without OS [message #1790543 is a reply to message #1790538] Tue, 12 June 2018 15:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

We have now a freeRTOS implementation for FORTE as well. We haven't jet had the time on polishing up such it is suitable for open sourcing but we plan to do that. Unfortunately given our current workload I can not tell when we'll achieve that.

CMake is now mandatory. We use CMake to generate some code during the build process. This makes FORTE faster and smaller. But CMake in the end just generates a makefile. Which you then run through make.

For cross compiling with CMake I can recommend the CMake-Gui. There in the very early stages you just select which compiler and where the root directory for you platform specific libs and includes are and thats mostly it. The best for starting I would say is to first compile a FORTE for Windows or Linux just to get you into the process. Then I would say for cross compiling have a look at the raspi docs. FreeRTOS would be pretty similar.
Re: Does FORTE run on systems without OS [message #1790555 is a reply to message #1746839] Tue, 12 June 2018 20:56 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Thank you for your fast answer. So, I will try to setup a build system on a Virtual Machine running Ubuntu. With this the first steps should be similar to the RasPi cross compiling build. Good to know that the final make is invoked with make, because my SW for the target µC also uses the make system - so, this should (hopefully) be not too difficult to combine.
When it comes to the FreeRTOS integration I might need your help again.
CU
Re: Does FORTE run on systems without OS [message #1790622 is a reply to message #1790555] Wed, 13 June 2018 16:04 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

You are welcome. We made good experiences in either compiling FORTE to a lib and linking it then to the rest of the embedded systems code (e.g., RCX operating system for the Hilscher netX Chips) or the other way rund linking the target code to FORTE for generating the final binary image (e.g., with eCos or freeRTOS).
Re: Does FORTE run on systems without OS [message #1790641 is a reply to message #1790622] Wed, 13 June 2018 19:29 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I have the cmake process finished. Here I encountered the difficulty that the compiler I am using needed some strange linker flags. But this seems to be solved now. Then, I am now trying to compile FORTE as a library as you are suggesting as one option. Here I encounter an error:
[ 50%] Building CXX object src/CMakeFiles/forte.dir/arch/posix/forte_thread.cpp.obj
In file included from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/posix/../threadbase.h:16:0,
                 from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/posix/forte_thread.h:15,
                 from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/posix/forte_thread.cpp:14:
/home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/posix/forte_sem.h:15:23: fatal error: semaphore.h: No such file or directory
compilation terminated.

I think that this is related to the fact that I am currently compiling for a Posix system - but my target system is not a Posix system but a plain µC whith no OS or at least with FreeRTOS. The fact that I am currently compiling for a Psoix system probably results from the fact that I used the raspberry documentation from the 4Diac installation documentation.
Now the question is: how can I compile FORTE as a library for a µC running FreeRTOS. Probably I need to setup my own /src/arch/freeRTOS directory with the appropriate sourcecode inside. But: how to do that?
Do you have some helpful hints for me?

Kind regards
Re: Does FORTE run on systems without OS [message #1790671 is a reply to message #1790641] Thu, 14 June 2018 08:21 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi,

Your cross-compiler is not finding the semaphore.h file wich should be available if your target system is a linux one. If you want to run forte on a new OS, like you said, you should have a src/arch/yourOS folder and implement some code there. But I'll spare you some coding issues, and tell you that a freeRTOS architecture is about to be released and will be available in the develop branch soon

Jose
Re: Does FORTE run on systems without OS [message #1790688 is a reply to message #1746839] Thu, 14 June 2018 14:20 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Do you have a rough estimate how long it will take until the FreeRTOS port is in the development branch? Depending on this durartion I would select a shorter or longer project to be inserted before continuing on this one. Currently I am not in a hurry on this.
Re: Does FORTE run on systems without OS [message #1790805 is a reply to message #1746839] Mon, 18 June 2018 08:47 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
@A. Zoitl: In you post on 13.Nov. 2016 in this thread you mentioned the book "IEc 61499 Real-time Exeuction". Is this still the right source of information to make FORTE running on a µC or is there now a more recent source of information available?
Kind regards
Re: Does FORTE run on systems without OS [message #1790806 is a reply to message #1790805] Mon, 18 June 2018 08:55 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi Franz,

the main code is I'd say ready in a beta version. we're still figuring out some small issues before making it public. But I'd stimate in the best of cases by middle of July
Re: Does FORTE run on systems without OS [message #1790819 is a reply to message #1790805] Mon, 18 June 2018 14:03 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

The IEC 61499 real-time execution book describes in Chapter 6 in detail how the base architecture of FORTE was developed, why? I'm not sure if you need it to port FORTE but it definitely explains the key principles on what we expect from a platform so that we can get certain real-time properties.
Re: Does FORTE run on systems without OS [message #1790823 is a reply to message #1790806] Mon, 18 June 2018 15:26 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Jose Maria Jesus Cabral Lassalle wrote on Mon, 18 June 2018 08:55
Hi Franz,

the main code is I'd say ready in a beta version. we're still figuring out some small issues before making it public. But I'd stimate in the best of cases by middle of July

Thank you for this information. So I can plan some other activities before contunuing on this one.
Re: Does FORTE run on systems without OS [message #1790825 is a reply to message #1790819] Mon, 18 June 2018 15:28 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Alois Zoitl wrote on Mon, 18 June 2018 14:03
The IEC 61499 real-time execution book describes in Chapter 6 in detail how the base architecture of FORTE was developed, why? I'm not sure if you need it to port FORTE but it definitely explains the key principles on what we expect from a platform so that we can get certain real-time properties.

So, I think I will order the book just to get some more background information.
Re: Does FORTE run on systems without OS [message #1790948 is a reply to message #1790806] Wed, 20 June 2018 13:32 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Jose Maria Jesus Cabral Lassalle wrote on Mon, 18 June 2018 08:55
Hi Franz,

the main code is I'd say ready in a beta version. we're still figuring out some small issues before making it public. But I'd stimate in the best of cases by middle of July


Dear Jose, will this new support of FORTE for FreeRTOS also include ethernet communication via lwip (just by chance) ?

Best regards
Re: Does FORTE run on systems without OS [message #1790976 is a reply to message #1790948] Wed, 20 June 2018 21:06 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

As Jose is traveling I try to answer. Yes lwip is also used. But we are using the BSD interface of lwip. Which may not be the best option.
Re: Does FORTE run on systems without OS [message #1793972 is a reply to message #1790976] Tue, 21 August 2018 12:00 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Is there any news on this topic?
Re: Does FORTE run on systems without OS [message #1794008 is a reply to message #1793972] Wed, 22 August 2018 09:52 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Yes, sorry for the delay. The cleaning of issues to make the freeRTOS public will continue at the beginning of September, when most people get back from holidays. If no problems are found, it should be public on the first weeks of september
Re: Does FORTE run on systems without OS [message #1794205 is a reply to message #1794008] Mon, 27 August 2018 13:39 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Thank you for the feedback. My intention was not to push you. So, please take your time.
Re: Does FORTE run on systems without OS [message #1795566 is a reply to message #1794205] Tue, 25 September 2018 11:05 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
The freeRTOS architecture was merged to the develop branch. It's in a beta state so any feedback of improvements, errors or inconvenience will be appreciate so the code could be improved
Re: Does FORTE run on systems without OS [message #1797148 is a reply to message #1795566] Fri, 26 October 2018 10:10 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
The RDA5981B can be run with freeRTOS or mbedOS5.1.

Is the chip capable to run Forte on freeRTOS?
Is it reasonable to run Forte on mbedOS on this or other platforms?

kind regards, Frank Radermacher
Re: Does FORTE run on systems without OS [message #1797172 is a reply to message #1797148] Fri, 26 October 2018 16:56 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I must confess I haven't looked into embedOS sofar. I had a quick look on the overview and it looks quite promising. Especially the update features seems to be something one should consider for new products and projects.

But coming back to your question. I think running 4diac FORTE with one of both should work. The advantage of freeRTOS is that there we already provide the basic porting with all architecture specific code you need. So you can focus on just getting it running on your device. For embOS you would need to do this first.

Typically 4diac FORTE should run on such devices. It depends a bit how much memory you have in addition to the internal. Especially when you start exploring the chip and according device I would recommend more. Having from the biging scarce memory resources can greatly slow done your development.
Re: Does FORTE run on systems without OS [message #1797180 is a reply to message #1797148] Sat, 27 October 2018 06:02 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Frank Radermacher wrote on Fri, 26 October 2018 10:10
The RDA5981B can be run with freeRTOS or mbedOS5.1.

Is the chip capable to run Forte on freeRTOS?
Is it reasonable to run Forte on mbedOS on this or other platforms?

kind regards, Frank Radermacher

Just for my curiosity: why you are considering the RDA5981 and not ESP32?
Re: Does FORTE run on systems without OS [message #1797369 is a reply to message #1797180] Tue, 30 October 2018 11:23 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
It´s a private project and I have more than 200 pots with plants to measure humidity with capacitive sensors. Urban jungle. The RDA is even cheaper than the ESP32.

have you running Forte on the ESP32?

kind regards, Frank
Re: Does FORTE run on systems without OS [message #1797390 is a reply to message #1797369] Tue, 30 October 2018 13:53 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Wow this sounds really interesting. Have you considered submitting it to the Eclipse IoT Challenge [1]?

[1] https://iot.eclipse.org/open-iot-challenge/
Re: Does FORTE run on systems without OS [message #1797398 is a reply to message #1746839] Tue, 30 October 2018 15:26 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
@Frank Radermacher: yes, this was my intention. I wanted to implement Forte on an ESP32 - but only as a proof of concept in our company (for showing that 4Diac/Forte can do useful things with/for our product). The final solution should run on another µC.
@Alois Zoitl: I don't know the Eclipse IoT challenge. I need to read about it. But since I have only very little time to work on this project I have some doubt that I can finish it on-time (whatever the time target is) ...

[Updated on: Tue, 30 October 2018 15:32]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1797399 is a reply to message #1797398] Tue, 30 October 2018 15:41 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
@ Franzl: "The final solution should run on another µC."

Which one?

Where are you based?
Re: Does FORTE run on systems without OS [message #1797410 is a reply to message #1797399] Tue, 30 October 2018 16:06 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
@ Alois Zoitl

Arm is owner of Mbed. Mbed has anounced Mbed Linux OS. The Mbed OS is for cortex M core based uC. The Mbed Linux is for cortex A core based systems. So ARM has a full offering for their own IP-cores that should not be neglected. :)

In the Düsseldorf FabLab we have a project to control our higher valued machines and tools with a 61499 based system. as by now we work with Orange pi zeros with Armbian. But ..... ESP? RDA? Mbed OS? freeRTOS? Mbed Linux? Who knows?

As you said, Pelion is something to keep in mind.

kind regards, Frank
Re: Does FORTE run on systems without OS [message #1797413 is a reply to message #1797410] Tue, 30 October 2018 16:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

@Franz Beckenbauer: the time schedule can definitely be an issue. If we can be of support let us know.

@Frank: Thanks for the background. This is definitely something to keep in mind. freeRTOS recently got quite some support from Amazon. With 4diac FORTE we still try to be as OS agnostic and keep it easily portable to different ones as much as possible. I still don't see a convergence in the devices 4diac FORTE is used in. Although there is a slight tendency that industrial controllers (PLCs and PLC like systems) move more and more to Linux based systems.

@both: your project sound very intersting. we are happy to host a guest blog post in our news section (and according social media channels) if you would like to present some results to our community.
Re: Does FORTE run on systems without OS [message #1797433 is a reply to message #1797399] Tue, 30 October 2018 19:41 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Frank Radermacher wrote on Tue, 30 October 2018 15:41
@ Franzl: "The final solution should run on another µC."

Which one?

Where are you based?


The final solution shall run on a µC which will cost ~nothing~ - because it is already there. The µC will be an Infineon Aurix which we have already integrated in our product. Forte then will run in the background - we will probably do not need hard realtime.
I am starting with the ESP32 in my free time because I first need to convince our product management about this approach/idea. For the Aurix I neither have a compiler nor an evalboard available - for the ESP32 this costs almost nothing.
I am located close to Krefeld.
Re: Does FORTE run on systems without OS [message #1797435 is a reply to message #1797433] Tue, 30 October 2018 20:51 Go to previous messageGo to next message
Frank Radermacher is currently offline Frank RadermacherFriend
Messages: 8
Registered: June 2018
Junior Member
"I am located close to Krefeld."

Good news. :D
Re: Does FORTE run on systems without OS [message #1797438 is a reply to message #1797435] Tue, 30 October 2018 21:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

As you are both located in Germany: there are regularly funding opportunities where public institutions (European Commission, German Government) sponsors R&D activities around 4diac. We try to announce them as we get to no them in our news channels. Currently there is for example an open call from the German BMBF: https://www.bmbf.de/foerderungen/bekanntmachung-1941.html
Re: Does FORTE run on systems without OS [message #1797490 is a reply to message #1797438] Wed, 31 October 2018 15:29 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Today I tried to configure and compile Forte for an ESP32 evalboard with FreeRTOS/lwip. The configuration seems to work; message: "Configuring done". Also the generate seems to work; message: "Generating done". Then I invoke make and get the error message:
Scanning dependencies of target FORTE_LITE
[ 50%] Building CXX object src/CMakeFiles/FORTE_LITE.dir/arch/freeRTOS/forte_thread.cpp.obj
xtensa-esp32-elf-g++: error: nano.specs: No such file or directory
src/CMakeFiles/FORTE_LITE.dir/build.make:63: die Regel für Ziel „src/CMakeFiles/FORTE_LITE.dir/arch/freeRTOS/forte_thread.cpp.obj" scheiterte
make[2]: *** [src/CMakeFiles/FORTE_LITE.dir/arch/freeRTOS/forte_thread.cpp.obj] Fehler 1
CMakeFiles/Makefile2:210: die Regel für Ziel „src/CMakeFiles/FORTE_LITE.dir/all" scheiterte
make[1]: *** [src/CMakeFiles/FORTE_LITE.dir/all] Fehler 2
Makefile:138: die Regel für Ziel „all" scheiterte
make: *** [all] Fehler 2

Obviously nano.specs was not found. Searching for this I find that /src/arch/FreeRTOS/CMakeLists.txt includes a compiler directive/definition "-specs=nano.specs". How can I fix that problem?
Should I open a separate thread for this topic?

Kind regards
Re: Does FORTE run on systems without OS [message #1797492 is a reply to message #1797490] Wed, 31 October 2018 16:01 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi, thanks for your feedback.

When the freeRTOS architecture was ported, it was used a specific compiler and archtecture to test.

Taking in account that not everyone uses the same as us, the code you mentioned should be removed, and probably add some CMake variables to add your own flags.

Does it work if you erase -specs=nano.specs from the CMakeLists.txt file?
Re: Does FORTE run on systems without OS [message #1797493 is a reply to message #1797492] Wed, 31 October 2018 16:33 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Then this error message disappears. But there are new error messages:
- xtensa-esp32-elf-g++: error: unrecognized command line option '-mcpu=cortex-m3'
- xtensa-esp32-elf-g++: error: unrecognized command line option '-mthumb'
So, I removed these defines also.
Then the next error is:
- org.eclipse.4diac.forte/src/arch/freeRTOS/forte_sync.h:14:46: fatal error: FreeRTOS_Source/include/FreeRTOS.h: No such file or directory
I think I need to provide the path for the FreeRTOS.h, right?
Here I think I will be running into problems. ESP-IDF (development framework for the ESP32) has its own make system. So, I would like to pull the necesary sources from Forte to the ESP-IDF environment and link this with my other sources. How can I obtain that?

[Updated on: Wed, 31 October 2018 17:16]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1797501 is a reply to message #1797492] Wed, 31 October 2018 17:46 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Jose Maria Jesus Cabral Lassalle wrote on Wed, 31 October 2018 16:01

Taking in account that not everyone uses the same as us, the code you mentioned should be removed, and probably add some CMake variables to add your own flags.


I made some first experiments with setting the CMake CFlags, CXXFlags, Linker flags for such setups. And got good results. Therefore I don't think that we need to add additional variables.
Re: Does FORTE run on systems without OS [message #1797555 is a reply to message #1790622] Thu, 01 November 2018 16:59 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Alois Zoitl wrote on Wed, 13 June 2018 16:04
You are welcome. We made good experiences in either compiling FORTE to a lib and linking it then to the rest of the embedded systems code (e.g., RCX operating system for the Hilscher netX Chips) or the other way rund linking the target code to FORTE for generating the final binary image (e.g., with eCos or freeRTOS).

I would like to copy the "generated" source from Forte and copy it to the make environment of ESP-IDF (toolchain and framework for ESP32). How can I do that? How can I generate these source files and where do I find them?
Re: Does FORTE run on systems without OS [message #1797563 is a reply to message #1797555] Thu, 01 November 2018 18:02 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

The code is generated when running cmake configure and generate. You'll find then .h and cpp files in your build dir. Furthermore in the src_gen dir and at least in the build_dir/core and build_dir/core/cominfra. Maybe there are more. Every time you add FBs or change the config these files are regenerated. Therefore I can not really recommend this step. Every time when I tried it it was a pain in the ass. We got the best results when we incorporated all build steps into the 4diac FORTE build.
Re: Does FORTE run on systems without OS [message #1797600 is a reply to message #1797563] Fri, 02 November 2018 13:54 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
porting the ESP-IDF source code libraries to the CMake system of Forte could be a similar pain in the ass. But I will have a try on this. Maybe I could need some support from you during this process...
Re: Does FORTE run on systems without OS [message #1797643 is a reply to message #1797600] Sat, 03 November 2018 14:04 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I spent a few hours on trying to include the ESP-IDF sources (mainly lwip and FreeRTOS) to Forte. I had to add several include directories to FORTE_FreeRTOSLwip_INCLUDES. It is quite cumbersome to do this in the CMake user interface because there is only one long line available to edit. Is there an easier way to do this?
But now I am stuck with a problem which I currently can not solve:
I am getting a compile error when compiling "org.eclipse.4diac.forte/src/arch/fdselecthand.cpp". The error message is:
In file included from /home/l/esp/apps/hello/org.eclipse.4diac.forte/src/components/lwip/include/lwip/port/lwipopts.h:42:0,
                 from /home/l/esp/apps/hello/org.eclipse.4diac.forte/src/components/lwip/include/lwip/lwip/opt.h:45,
                 from /home/l/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/sockhand.h:17,
                 from /home/l/esp/apps/hello/org.eclipse.4diac.forte/src/arch/fdselecthand.cpp:12:
/home/l/esp/apps/hello/org.eclipse.4diac.forte/src/components/newlib/platform_include/sys/select.h:25:22: error: 'fd_set' has not been declared
 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout);
                      ^

The error is inside a header file of the ESP-IDF sources. The definition of fd_set (which seems to be undefined) shall be defined in 'types.h' which also comes from ESP-IDF. But the definition of 'fd_set' in types.h is excluded from build by the following #ifdef:
Quote:
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))

So, obviously one of the above defines seems to be true. I guess that during a normal compile using the ESP-IDF build system somewhere the ~right~ defines are made so that this compiles correctly. I can not find any of these defines in the configuration system of ESP-IDF. Either these are set depending on other defines of ESP-IDF or they are set by the Forte make environment.
Does anybody have a hint for me?
Re: Does FORTE run on systems without OS [message #1797644 is a reply to message #1797643] Sat, 03 November 2018 14:35 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

regarding your first question. Did you have a look on cross-compiling with CMake. There you can setup toolchain files which could potentially pull in the required include paths. Also I would recommend to not copy you additional code into the FORTE source directory. This makes it very hard to manage changes on both ends. We have since 1.9.0 a flag for external modules directories which can help to add code to 4diac FORTE but keep the code separate.

Also for strategies to not needing to merge both code repos I always found it easier to have one of both sides (i.e., 4diac FORTE or the OS code) as library and link it to the other.

I googled around a bit on lwip and socket interface (we really should finally port forte also to the raw lwip interface) and to my understanding of lwip the select function as well as fd_set should come from a lwip/sockets.h. But I'm not sure how on the ESP-idf newlib and lwip work together.

What also often helps me is to setup a dummy project in the IDE of the target system. And then have a look on all the compiler flags and include paths. This can help to setup a 4diac FORTE build quite a lot. Often I put these options then either in a dedicated CMakeList.txt or in setup shell script for generating the basic environment.

I hope this helps.

Alois



Re: Does FORTE run on systems without OS [message #1797645 is a reply to message #1797644] Sat, 03 November 2018 16:13 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Hi Alois,
thank you for your fast answer! Where can I read about cross-compiling with CMake? Is it described somewhere on the 4Diac pages or should I have a look on the more generic documentation of CMake?
The hint with checking the compiler invocation in the native ESP-IDF environment is correct: I have done this already and this is how I came this far. But I will now have a second chek - maybe I missed something.
I will report about the results.
Best regards
Re: Does FORTE run on systems without OS [message #1797646 is a reply to message #1797645] Sat, 03 November 2018 17:44 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I fear we only have the very basic for crosscompiling in our docs.
Re: Does FORTE run on systems without OS [message #1797647 is a reply to message #1797646] Sat, 03 November 2018 19:34 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I checked again all compiler flags and I am quite sure that they are the same in both worlds - but still the same error message.
Now I am missing suitable ideas... :-(

[Updated on: Sat, 03 November 2018 19:49]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1797706 is a reply to message #1797647] Mon, 05 November 2018 13:24 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Do you have a small sample project using select for the ESP? From that we would know if select and such fd_set are correctly support.

The only idea I have is that we have include files in the wrong order.
Re: Does FORTE run on systems without OS [message #1797737 is a reply to message #1797706] Mon, 05 November 2018 22:06 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Until now I never used sleect() in ESP-IDF - I always used the native API of lwip.
I think next I will try to modify the sources (either from Forte or from lwip) and see if this helps. Changing the order of some includes might be a first good approach. I will try and let you kow. If this also does not work my next approach will be to copy the source files from Forte into an ESP-IDF project. But this will take some time because currentyl I am busy on other topics.
Re: Does FORTE run on systems without OS [message #1797851 is a reply to message #1797737] Wed, 07 November 2018 13:10 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I'm unfortunately also rather busy. But today I found time to google a bit. It looks like there was an issue with lwip clashing with newlib [1]. According to the messges in this issue ist should be fixed. However I din't find out in which version and how it was fixed.

[1] https://github.com/espressif/esp-idf/issues/1141
Re: Does FORTE run on systems without OS [message #1798093 is a reply to message #1797851] Mon, 12 November 2018 11:14 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Alois Zoitl wrote on Wed, 07 November 2018 13:10
I'm unfortunately also rather busy. But today I found time to google a bit. It looks like there was an issue with lwip clashing with newlib [1]. According to the messges in this issue ist should be fixed. However I din't find out in which version and how it was fixed.

[1] https://github.com/espressif/esp-idf/issues/1141


Thank you for providing this link. But I think it is related to a runtime problem rather than a compile problem. Nevertheless I updated the ESP-IDF sources to the latest version but the error is still the same.
Currently I am checking the use of the sdkconfig.h of ESP-IDF. This contains the result of a configuration process of ESP-IDF (using command: 'make menuconfig'). Maybe this contains some settings which might be used by lwip.
Re: Does FORTE run on systems without OS [message #1798140 is a reply to message #1798093] Tue, 13 November 2018 09:36 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Thanks for your patience. It would really be great to have ESP support for FORTE.
Re: Does FORTE run on systems without OS [message #1798317 is a reply to message #1798140] Thu, 15 November 2018 09:48 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Unfortunately the use of a properly configured sdkconfig.h did not help. Looking at the code this seems to be logical because the includes for 'sd_set' come first and then sdkconfig.h is included.
Next I will try to include the suitable definition for 'sd_set' manually. But this will take some time because I am quite busy these days.

[Updated on: Thu, 15 November 2018 09:49]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1798407 is a reply to message #1798317] Sat, 17 November 2018 14:58 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I found that "fd_set" is not comiled because "__USE_W32_SOCKETS" is set somewhere. Checking the compiler command line I see the following:
cd /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/out/src && /home/lothar/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++   -DFORTE_ENABLE_GENERATED_SOURCE_CPP -DFORTE_LITTLE_ENDIAN -DFORTE_SUPPORT_ARRAYS -DFORTE_SUPPORT_BOOT_FILE -DFORTE_SUPPORT_CUSTOM_SERIALIZABLE_DATATYPES -DFORTE_SUPPORT_MONITORING -DFORTE_SUPPORT_QUERY_CMD -DFORTE_UNICODE_SUPPORT -DFORTE_USE_64BIT_DATATYPES -DFORTE_USE_LREAL_DATATYPE -DFORTE_USE_REAL_DATATYPE -DFORTE_USE_WSTRING_DATATYPE -DNOLOG -D__USE_W32_SOCKETS @CMakeFiles/FORTE_LITE.dir/includes_CXX.rsp -std=gnu++11 -fno-rtti -Os -ggdb -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -fexceptions -DESP_PLATFORM -D IDF_VER=\"v3.2-beta1-34-gfb7ba1baa\" -MMD -MP -DGCC_NOT_5_2_0=0 -DWITH_POSIX -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -g   -ffunction-sections -fdata-sections -fstack-usage -Wall -DLWIP_TIMEVAL_PRIVATE=0 -fno-threadsafe-statics -fno-rtti -fno-exceptions -std=c++11 -o CMakeFiles/FORTE_LITE.dir/arch/freeRTOS/forte_thread.cpp.obj -c /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/forte_thread.cpp

inside this I find:
-DFORTE_ENABLE_GENERATED_SOURCE_CPP -DFORTE_LITTLE_ENDIAN -DFORTE_SUPPORT_ARRAYS -DFORTE_SUPPORT_BOOT_FILE -DFORTE_SUPPORT_CUSTOM_SERIALIZABLE_DATATYPES -DFORTE_SUPPORT_MONITORING -DFORTE_SUPPORT_QUERY_CMD -DFORTE_UNICODE_SUPPORT -DFORTE_USE_64BIT_DATATYPES -DFORTE_USE_LREAL_DATATYPE -DFORTE_USE_REAL_DATATYPE -DFORTE_USE_WSTRING_DATATYPE -DNOLOG -D__USE_W32_SOCKETS @CMakeFiles/

I am quite sure that these defines do not come from my settings but probably from the FORTE cmake build system. Unfortunately I have absolutely no idea how cmake works. Can you help me finding the appropriate modification on the FORTE cmake build system?
Kind regards
Re: Does FORTE run on systems without OS [message #1798413 is a reply to message #1798407] Sat, 17 November 2018 16:52 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

that is interesting. I see that in line 42 of arc/arch/freeRTOS/CMakeLists.txt. That exactly this define is added with a comment that this is somehow needed. I think this is coming from Jose. You can give it try by commenting this line.

Alois
Re: Does FORTE run on systems without OS [message #1798415 is a reply to message #1798413] Sat, 17 November 2018 18:48 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
When I comment this line, the error disappears. But the comment 'to hide the FD functions' could mean that there is a special reason for this. It would be interesting (maybe important) to know why...

And now there is the next error:
In file included from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/fdselecthand.cpp:12:0:
/home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/sockhand.h: In function 'int connect(int, const sockaddr*, socklen_t)':
/home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/sockhand.h:38:12: error: redefinition of 'int connect(int, const sockaddr*, socklen_t)'
 inline int connect(int s, const struct sockaddr *name, socklen_t namelen){
            ^
In file included from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/sockhand.h:22:0,
                 from /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/fdselecthand.cpp:12:
/home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/components/lwip/include/lwip/lwip/sockets.h:576:19: note: 'int connect(int, const sockaddr*, socklen_t)' previously defined here
 static inline int connect(int s,const struct sockaddr *name,socklen_t namelen)

The function 'connect' is already defined in sockets.h of lwip as 'lwip_connect_r(s,level,optname,opval,optlen);'. The definition in 'org.eclipse.4diac.forte/src/arch/freeRTOS/sockhand.h' is a function call to 'lwip_connect(s, name, namelen)' which is also defined in lwip. Looking into the sources of the ESP-IDF version of lwip I find that the "xxx_r" - functions are thread safe versions. Which one should I use?

[Updated on: Sat, 17 November 2018 19:50]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1798417 is a reply to message #1798415] Sat, 17 November 2018 19:48 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I decided to use the "lwip_connect_r()" version.

After that I get the error message:
esp/apps/hello/org.eclipse.4diac.forte/tests/forte_boost_tester.cpp:12:45: fatal error: boost/test/included/unit_test.hpp: No such file or directory
The file "unit_test.hpp" is nowhere available in 'org.eclipse.4diac.forte'. Also the subdirectory " boost/test/included" does not exist. Do I need to download parts of the boost libraries?
Re: Does FORTE run on systems without OS [message #1798418 is a reply to message #1798417] Sat, 17 November 2018 22:07 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I removed "FORTE_TESTS" from the CMake build. Then the whole thing compiles.
What do I have to do now? I ticked "FORTE_BUILD_STATIC_LIBRARY" in CMake GUI. So, somewhere there should be the library or at least the obj - files. But I can't find it...
Any hint?
Re: Does FORTE run on systems without OS [message #1798421 is a reply to message #1798418] Sun, 18 November 2018 09:38 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I think for now using the connect_r function is the better way. On the long run porting forte to the native lwIP interface seems the better option. But this is I guess quite some effort.

The FORTE_TESTS options enables that unit tests are generated for 4diac FORTE. We use BOOST Test as library for writing our unit tests. I don't think it is easily feasible to run these unit tests on the ESP. Therefore it is perfectly fine to disable them.

Currently the main output of your build should be in the 'src' directory which is located directly in you build directory.
Re: Does FORTE run on systems without OS [message #1798784 is a reply to message #1798421] Sat, 24 November 2018 19:17 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Today I was trying to use the generated library (and first all the Forte header files) in the ESP-EDF environment. Unfortunately here I am running in various problems (e.g. definition of various datatypes like lreal). I think this approach seems to be too tricky. Next I will try to generate an executable using the make system of Forte - but I think also this could be quite tricky.
Re: Does FORTE run on systems without OS [message #1798802 is a reply to message #1798784] Sun, 25 November 2018 18:21 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I was able to compile the whole thing and download it to the ESP32. Unfortunately it crashes when the ForteServerTask is started ("vStartForteServerTask(mainFORTE_TASK_PRIORITY);"). The error message is: Quote:
D (E:/msys32/opt/esp/esp-idf/components/freertos/timers.c:384 (prvInitialiseNewTimer)- assert failed!
abort() was called at PC 0x4008fabf on core 1
0x4008fabf: prvInitialiseNewTimer at E:/msys32/opt/esp/esp-idf/components/freertos/timers.c:384 (discriminator 1)

Do you have any hint what could cause this crash?
Re: Does FORTE run on systems without OS [message #1798871 is a reply to message #1798802] Mon, 26 November 2018 21:04 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
now I put some debug outputs into the code in order to localize where the system crashes. Obviously the code line in question is:Quote:
RMT_DEV *poDev = new RMT_DEV;
inside the function "void vForteTask( void* pvParameters )". The debug output right before this line is being displayed and the debug output after is not shown and the system crashes.
So, very likely it is related to memory allocation. Do you know how much memory is being allocated by "new RMT_DEV;"?

Additionally I configured the ESP-IDF to give some more debug output when crashing. The debug output now looks like this: Quote:
0x40090c60: invoke_abort at E:/msys32/opt/esp/esp-idf/components/esp32/panic.c:680

0x40090e91: abort at E:/msys32/opt/esp/esp-idf/components/esp32/panic.c:680

0x4008fabf: prvInitialiseNewTimer at E:/msys32/opt/esp/esp-idf/components/freertos/timers.c:384 (discriminator 1)

0x4008fb41: xTimerCreate at E:/msys32/opt/esp/esp-idf/components/freertos/timers.c:314

0x400de8a5: CFreeRTOSTimerHandler::CFreeRTOSTimerHandler(CDeviceExecution&) at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/freertostiha.cpp:20

0x400de8bd: CTimerHandler::createTimerHandler(CDeviceExecution&) at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/arch/freeRTOS/freertostiha.cpp:16

0x400de286: CDeviceExecution::createHandlers(CDeviceExecution&) at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/out/core/deviceExecutionHandlers.cpp:24

0x400ddec9: CDeviceExecution::CDeviceExecution() at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/core/devexec.cpp:60

0x400de370: CDevice::CDevice(SFBInterfaceSpec const*, unsigned int, unsigned char*, unsigned char*) at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/core/device.h:48
(inlined by) RMT_DEV::RMT_DEV() at /home/lothar/esp/apps/hello/org.eclipse.4diac.forte/src/stdfblib/ita/RMT_DEV.cpp:28

0x400d5132: vForteTask(void*) at E:/msys32/opt/devel/nk_wifi/main/main.cpp:34

0x4008eb11: vPortTaskWrapper at E:/msys32/opt/esp/esp-idf/components/freertos/po
rt.c:403


The final command which makes the system crash is in timers.c in the command:Quote:
/* 0 is not a valid value for xTimerPeriodInTicks. */
configASSERT( ( xTimerPeriodInTicks > 0 ) );

So, obvously the timer is being initialized with a period of 0; which is not allowed.
Do you have any hints on this?

[Updated on: Mon, 26 November 2018 21:18]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1798916 is a reply to message #1798871] Tue, 27 November 2018 11:16 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
The problem with the function connect is that in some part of the LwIP it's #defined and forte has some functions inside classes called conect (like in CConnection) and this gave some problems.

Regarding the __USE_W32_SOCKETS, I tested it many ways and that's the only one that worked for me. I also have in my FreeRTOSConfig.h file the following line:

#define __USE_W32_SOCKETS 1

To use the forte library you should use only one header, forte_Init.h. There you will find the functions that you can use to run forte, so no type problem should arise from that. (call forteGlobalInitialize first, and then forteStartInstance where you specify the port, and then you can leave it running until it ends by using forteJoinInstance).

Regarding the timer issue, this means that the xTimerCreate is receiving a zero from forte, which is sent as pdMS_TO_TICKS (1000 / getTicksPerSecond()), so maybe you could check what value you have in cmake in the variable FORTE_TicksPerSecond.

Re: Does FORTE run on systems without OS [message #1799161 is a reply to message #1798916] Fri, 30 November 2018 17:55 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Dear Jose,
thank you for the explanations.

I tested again with setting __USE_W32_SOCKETS to 1 - this time also in FreeRTOSConfig.h. But again I get the error message
org.eclipse.4diac.forte/src/components/newlib/platform_include/sys/select.h:25:22: error: 'fd_set' has not been declared
. So, the only option for me seems to be setting it to 0. Setting it to 0 seems more logical to me...

In main I am including:
#include "../forte_architecture.h"
#include "../devlog.h"
#include "../../stdfblib/ita/RMT_DEV.h"
like in the example under "src/arch/freeRTOS". If I include only "forte_Init.h" as you suggested I get the error message
main/main.cpp:35:3: error: 'RMT_DEV' was not declared in this scope
in vForteTask(void* pvParameters).

I checked the setting for "ForteTicksPerSecond" in CMakeGUI: it is set to 1000 - the same value is set in the configuration of ESP-IDF. So, also this seem to be somehow logical.

I need to add the information, that I currently have an a bit crazy make system:

    1. Configuration and Generation with CMake under Linux
    2. Compile Forte as a library using Eclipse under Linux
    3. Copy the resulting library to Windows/msys32
    4. Compile an ESP-IDF project (including the Forte library) under Windows/msys32

My next try could be to do all these steps under Linux... But I think also this will not help. :-(

Do you have any more suggestions?
Re: Does FORTE run on systems without OS [message #1799192 is a reply to message #1746839] Sat, 01 December 2018 10:10 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Don't follow exaclty the main.cpp in freeRTOS folder. In your ESP-IDF project you have somewhere a main.cpp file. In that file only include forte_Init.h and when you start your task (vForteTask or whatever), use the functions in forte_Init.h. For example

forteGlobalInitialize();
TForteInstance myForte;
if(FORTE_OK != forteStartInstance(61499, &myForte)){
  //something went wrong, handle it
} else {
  //forte started
  forteJoinInstance(myForte); //wait your forte to end
}



But before you start your forte task (or any other task actually) you should normally configure your hardware (timer among these configurations). Do you have already a running example? I'd recommend to use the same main, and add the code to start the forte instance there, so you be sure that the problem is coming from forte or not
Re: Does FORTE run on systems without OS [message #1799193 is a reply to message #1799192] Sat, 01 December 2018 10:15 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Maybe also one comment to your build process. If you are anyhow compiling in the end under windows with msys you can also have CMake Gui for Windows and generate a Mingw make files for building the 4diac FORTE lib directly under Windows.
Re: Does FORTE run on systems without OS [message #1799219 is a reply to message #1799193] Sun, 02 December 2018 17:28 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I changed my build system to completely running under Linux. And I also changed the initialization code as suggested by Jose. But "forteStartInstance(61499, &myForte)" does not return "FORTE_OK". When I try to deploy a test system (e.g. BlinkTest) I get the error message: "Problem: could not connect to device".

I checked the return code of "forteStartInstence": it is "FORTE_DEVICE_ALREADY_STARTED"

When I comment out the check for an already running Forte instance in forte_Init.cpp I get the same error message as a few days before:
/home/lothar/esp-idf/components/freertos/timers.c:384 (prvInitialiseNewTimer)- assert failed!
abort() was called at PC 0x40090227 on core 0
0x40090227: prvInitialiseNewTimer at /home/lothar/esp-idf/components/freertos/timers.c:384 (discriminator 1)


I checked if starting a timer via xTimerCreate() and xStartTimer() works in my environment - and this works. So, everything in ESP-IDF is setup correctly. My suspicion is that "getTicksPerSecond()" in Forte does not deliver the right value?

Maybe there is some initialization missing? Do you have any hints what to check next?

[Updated on: Sun, 02 December 2018 19:50]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1799238 is a reply to message #1799219] Mon, 03 December 2018 08:43 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
mmm regarding the FORTE_DEVICE_ALREADY_STARTED error, you should probably have:
 TForteInstance myForte = 0; 
but that won't fix the timer issue.

About the timer issue:
1- In you folder where you compile forte, check that the value of cg_nForteTicksPerSecond in forte_config is 1000
2- check in you FreeRTOSConfig.h file the value of configTICK_RATE_HZ. Set it to 1000 if it's not already, just to test it. I have it like this:
#define configTICK_RATE_HZ 			( ( portTickType ) 1000 )


If there's no problem there, the next thing to do is to debug step by step. Put a breakpoint in freertostiha.cpp:20 and check the value of the second parameter that's passed to xTimerCreate
Re: Does FORTE run on systems without OS [message #1799274 is a reply to message #1799238] Mon, 03 December 2018 19:32 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Thank you for the hints. The problem was in the definition of configTICK_RATE_HZ in FreeRTOSConfig.h. Here I currently have the additional difficult that I am handling two files of them - one during the creation of the forte library and one during the compilation of the final application under ESP-IDF. The error was that one of them did not have the correct setting for configTICK_RATE_HZ.
After correcting that I now have the next problem:
/home/lothar/esp-idf/components/freertos/queue.c:1442 (xQueueGenericReceive)- assert failed!
abort() was called at PC 0x4008e561 on core 0

Here in freeRTOS source file queue.c the following assertion seems to fail:
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );

I guess this could be related to some memory allocation problem. Could you provide your FreeRTOSConfig.h so that I can compare the configuration options for memory allocation and management of queues?
It would also be interesting to know on which µC you tested your FreeRTOS lwip Forte installation.

[Updated on: Tue, 04 December 2018 19:46]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1799346 is a reply to message #1799274] Wed, 05 December 2018 11:22 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Good to know that the timing issue is gone.

I attached the freeRTOSConfig.h file that I used.

We tested on a STM32F207IG: FLASH: 1024KB RAM: 112KB. But we had an external memory of 2048 which we use just for the heap

Hope it helps!
Re: Does FORTE run on systems without OS [message #1799368 is a reply to message #1799346] Wed, 05 December 2018 17:48 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Thank you for the FreeRTOSConfig.h file. I will comare it to mine as soon as I have time for it.
Is the 2048 external memory in your STM32 system measured in Bytes, kBytes or kBit? Or, if it is easier for you: which RAM chip did you use?
The memory footprint of Forte (RAM and flash) would be interseting to know. Do you have info about it from the STM32?
Re: Does FORTE run on systems without OS [message #1799412 is a reply to message #1799346] Thu, 06 December 2018 10:54 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I compared the two FreeRTOS.h files. But I could not find any relevant differences concerning memory allocation or queues. Unfortunately I do not have a debugging tool available; and when I put printf into the code in order to see whats going on I do not see any output - printf seems to be not working.
My next steps will be:
- using latest Forte 1.10.0 (which was recently released); I see that there are several changes in the file fortenew.h
- trying to integrate ESP-IDF debugging macros (ESP_LOGx() macros) into Forte
Do you have any other hint where to look for the root cause of the problem?

[Updated on: Thu, 06 December 2018 17:51]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1799446 is a reply to message #1799412] Thu, 06 December 2018 22:49 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Sorry about the missing informatoin. The memory was 2048 kilobytes (so 2MB). Unfortunately I cannot give you more information about the chip or the footprint because we don't have it anymore and it was used just to test.

Maybe one more hint to check if the problem is the memoy would be to disbable most modules, specially the 61131 which is very big. Just to see if you get the poblem.
Re: Does FORTE run on systems without OS [message #1799478 is a reply to message #1799446] Fri, 07 December 2018 13:30 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I'll try to add my points to this issue. Normally we are rather sensitive to memory consuption and working hard to reduce it. In 1.10.0 we achieved here again a few bytes per FB. Reducing the number of enabled modules could definitly be a starting point to track down where the problem is.

However I fear it is something more fundamental. I remember when we started our work with freeRTOS that we still had issues that not on all places forte_alloc and forte_free was used. I thought we have this under control now. But you could check in your map file if there are references to other allocation schemes. In your previous messages i noticed that you ESP32 is somehow using newlib together with freeRTOS. I know that newlib has an own heap managment. Maybe you can check in the docs how to correctly use this and who is reponsible for heap newlib or freeRTOS. You may have to then adjust fortealloc.h accordingly. You could also add here the ESP_LOG macros to check if allocation is always working.

Another problem could be if you have logging enabled that the default forte loging goes to printf. This can lead to problems. For a quick test you could disable the FORTE logging in cmake.

Another good starting point is looking in the map file generated by the linker. There you could see if strange stuff has been added.

I hope this helps so that we can tracke this down.
Re: Does FORTE run on systems without OS [message #1799542 is a reply to message #1799478] Sun, 09 December 2018 09:56 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I did the following steps:

    1. I now use an eval-board with 4MB of external SPI-RAM which I configured as heap memory. And I now used the latest official Forte version: 1.10.0. With this step the previous error (trigger of: "configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );") disappears. And the next error appears:
    assertion "res == coreID || res == portMUX_FREE_VAL" failed: file "/home/lothar/esp-idf/components/freertos/portmux_impl.inc.h", line 105, function: vPortCPUAcquireMutexIntsDisabledInternal
    abort() was called at PC 0x400e9887 on core 0

    2. Then I removed the IEC61131 modules from the build. The resulting Forte library now reduced in size from 32MB down to 8MB. But the error
    assertion "res == coreID || res == portMUX_FREE_VAL" failed: file "/home/lothar/esp-idf/components/freertos/portmux_impl.inc.h", line 105, function: vPortCPUAcquireMutexIntsDisabledInternal
    abort() was called at PC 0x400e9887 on core 0
    remains the same. So, it seems to be no problem related to memory limitations but maybe to memory allocation?

I now also checked the map file. I am not so familiar with reading map files but it seems to me that there are maybe two malloc functions being used, one called "_malloc" and another one called "_malloc_r". Both seem to come from lwip.
Next I will try to activate the logging macros from ESP_IDF. Maybe this helps to find the problem.
Re: Does FORTE run on systems without OS [message #1799598 is a reply to message #1799542] Mon, 10 December 2018 20:35 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Thanks for the investigation. If lwIP is using the default malloc functions i would assume these are the ones provide from newlib. Currently FORTE for freeRTOS is configured to use the pvPortMalloc function. I don't know if both are targeting the same memory manager. But for a quick test you could replace the freeRTOS specific mallacs with the default implemetnation. That means uncommenting the #include "../genfortealloc.h" line and commenting the rest.
Re: Does FORTE run on systems without OS [message #1799646 is a reply to message #1799598] Tue, 11 December 2018 20:25 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I modified fortealloc.h as you suggested: including gentfortealloc.h and commenting out forte_free() and forte_malloc(). Unfortunately the error remains the same. Here is a backtrace from the crash report:
assertion "res == coreID || res == portMUX_FREE_VAL" failed: file "/home/lothar/esp-idf/components/freertos/portmux_impl.inc.h", line 105, function: vPortCPUAcquireMutexIntsDisabledInternal
abort() was called at PC 0x400e963b on core 0
0x400e963b: __assert_func at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)

Backtrace: 0x4008ed3c:0x3ffbd750 0x4008ef65:0x3ffbd770 0x400e963b:0x3ffbd790 0x4009266d:0x3ffbd7c0 0x400916b4:0x3ffbd7f0 0x400e64e4:0x3ffbd830 0x400e6095:0x3ffbd850 0x40093b16:0x3ffbd870 0x40093b49:0x3ffbd890 0x40093c68:0x3ffbd8c0 0x40091949:0x3ffbd8f0
0x4008ed3c: invoke_abort at /home/lothar/esp-idf/components/esp32/panic.c:680
0x4008ef65: abort at /home/lothar/esp-idf/components/esp32/panic.c:680
0x400e963b: __assert_func at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x4009266d: vPortCPUAcquireMutexIntsDisabledInternal at /home/lothar/esp-idf/components/freertos/tasks.c:3537
 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/lothar/esp-idf/components/freertos/portmux_impl.h:98
 (inlined by) vTaskEnterCritical at /home/lothar/esp-idf/components/freertos/tasks.c:4231
0x400916b4: xQueueGenericReceive at /home/lothar/esp-idf/components/freertos/queue.c:2037
0x400e64e4: CFreeRTOSSyncObject::lock() at /home/lothar/esp/apps/forte/src/arch/freeRTOS/../genfortealloc.h:20
 (inlined by) CCriticalRegion::CCriticalRegion(CFreeRTOSSyncObject&) at /home/lothar/esp/apps/forte/src/arch/../core/utils/criticalregion.h:20
 (inlined by) CTimerHandler::nextTick() at /home/lothar/esp/apps/forte/src/arch/timerha.cpp:97
0x400e6095: CFreeRTOSTimerHandler::vCallbackFunction(void*) at /home/lothar/esp/apps/forte/src/arch/freeRTOS/freertostiha.cpp:47
0x40093b16: prvProcessExpiredTimer at /home/lothar/esp-idf/components/freertos/timers.c:523
0x40093b49: prvProcessTimerOrBlockTask at /home/lothar/esp-idf/components/freertos/timers.c:570
0x40093c68: prvTimerTask at /home/lothar/esp-idf/components/freertos/timers.c:543 (discriminator 1)
0x40091949: vPortTaskWrapper at /home/lothar/esp-idf/components/freertos/port.c:355 (discriminator 1)

From this we can see that the last line of code executed from Forte is: "genfortealloc.h:20" which is: "free(pa_pvData);". Then the next function call shall be in "xQueueGenericReceive at /home/lothar/esp-idf/components/freertos/queue.c:2037". This looks very weird to me - in free() there is very likely no call to any function in queue.c. I would expect that this is the place where the system actually crashes. So, I guess that the problem still is somewhere in the memory allocation functions.
I also tested again with and without the use of external SPI-RAM als heap memory. The error message is exactly the same in both cases.
When I compare this map file to a map file of another (working) application on the ESP32 I see no significant differences concerning the use of malloc and free: in both cases the _malloc_r and _free_r functions seem to be used. This could indicate that the problem is in a totally different location? I am lost...

[Updated on: Tue, 11 December 2018 21:01]

Report message to a moderator

Re: Does FORTE run on systems without OS [message #1799647 is a reply to message #1799646] Tue, 11 December 2018 22:40 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Thanks for the stack trace. This really shades some more light on the issue. I don't think it has anything to do with memory allocation. However I must say that the stack trace is a bit confusing. Which optimization level are you currently compiling with? Could you give -O0 a try to see if the stack trace is clearer.

The reason I'm asking is that the problem seems to be that an uninitialized mutex should get locked. Hover in the method which is acquiring the mutex this would only happen if a timed FB (i.e., E_CYCLE or E_DELAY has been started. Are you already at an stage where FBs are running?
Re: Does FORTE run on systems without OS [message #1799669 is a reply to message #1799647] Wed, 12 December 2018 07:22 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Now I set in Forte CMake -O0 and in ESP-IDF for debug mode optimization is set to -Og. Now the backtrace looks slightly different but with the same final crash:
assertion "res == coreID || res == portMUX_FREE_VAL" failed: file "/home/lothar/esp-idf/components/freertos/portmux_impl.inc.h", line 105, function: vPortCPUAcquireMutexIntsDisabledInternal
abort() was called at PC 0x400f6acb on core 0
0x400f6acb: __assert_func at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)

Backtrace: 0x4008ed54:0x3ffbd850 0x4008ef7d:0x3ffbd870 0x400f6acb:0x3ffbd890 0x40092685:0x3ffbd8c0 0x400916cc:0x3ffbd8f0 0x400d7296:0x3ffbd930 0x400d72d5:0x3ffbd960 0x400d8363:0x3ffbd990 0x400f08de:0x3ffbd9d0 0x40093b2e:0x3ffbda00 0x40093b61:0x3ffbda20 0x40093c80:0x3ffbda50 0x40091961:0x3ffbda80
0x4008ed54: invoke_abort at /home/lothar/esp-idf/components/esp32/panic.c:680
0x4008ef7d: abort at /home/lothar/esp-idf/components/esp32/panic.c:680
0x400f6acb: __assert_func at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x40092685: vPortCPUAcquireMutexIntsDisabledInternal at /home/lothar/esp-idf/components/freertos/tasks.c:3537
 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/lothar/esp-idf/components/freertos/portmux_impl.h:98
 (inlined by) vTaskEnterCritical at /home/lothar/esp-idf/components/freertos/tasks.c:4231
0x400916cc: xQueueGenericReceive at /home/lothar/esp-idf/components/freertos/queue.c:2037
0x400d7296: CFreeRTOSSyncObject::lock() at /home/lothar/esp/apps/forte/src/arch/freeRTOS/forte_sync.h:40
0x400d72d5: CCriticalRegion::CCriticalRegion(CFreeRTOSSyncObject&) at /home/lothar/esp/apps/forte/src/arch/../core/utils/criticalregion.h:20
0x400d8363: CTimerHandler::nextTick() at /home/lothar/esp/apps/forte/src/arch/timerha.cpp:97
0x400f08de: CFreeRTOSTimerHandler::vCallbackFunction(void*) at /home/lothar/esp/apps/forte/src/arch/freeRTOS/freertostiha.cpp:47
0x40093b2e: prvProcessExpiredTimer at /home/lothar/esp-idf/components/freertos/timers.c:523
0x40093b61: prvProcessTimerOrBlockTask at /home/lothar/esp-idf/components/freertos/timers.c:570
0x40093c80: prvTimerTask at /home/lothar/esp-idf/components/freertos/timers.c:543 (discriminator 1)
0x40091961: vPortTaskWrapper at /home/lothar/esp-idf/components/freertos/port.c:355 (discriminator 1)

Now the first function calls are the same. The difference comes after the call in "criticalregion.h:20" where now there is a call to "forte_sync.h:40". The rest again is the same.
To your question: no, I am not running any tasks. I am just trying to initialize the Forte system using:
    forteGlobalInitialize();
		ESP_LOGI(TAG, "2. free heap: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT));
    TForteInstance myForte;
		ESP_LOGI(TAG, "3. free heap: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT));
    int forteStartStatus;
    if(FORTE_OK != (forteStartStatus = forteStartInstance(61499, &myForte))){
      //something went wrong, handle it
      ESP_LOGI(TAG, "Forte init failed");
      if(forteStartStatus == FORTE_DEVICE_ALREADY_STARTED)
        ESP_LOGI(TAG, "Device already started");
      else if (forteStartStatus == FORTE_WRONG_ENDIANESS)
        ESP_LOGI(TAG, "wrong endianess");
      else if (forteStartStatus == FORTE_WRONG_PARAMETERS)
        ESP_LOGI(TAG, "wrong parameters");
      else if (forteStartStatus == FORTE_ARCHITECTURE_NOT_READY)
        ESP_LOGI(TAG, "architecture not ready");
    } else {
      //forte started
      ESP_LOGI(TAG, "Forte started");
      forteJoinInstance(myForte); //wait your forte to end
    }
In my log I see the last logging message: "ESP_LOGI(TAG, "3. free heap: %d", heap_caps_get_free_size(MALLOC_CAP_8BIT));"; after this the system crashes - obviously in forteStartInstance(). I am still not able to connect to Forte using 4diac and so I am not able to download or start any program.
Re: Does FORTE run on systems without OS [message #1799676 is a reply to message #1799669] Wed, 12 December 2018 09:05 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Thanks for the update. Ok this is what I've expected to see after you showed the last stack trace. My assumption is that somewhere after creating the FORTE timer during the device setup we have a segfault leading the timer callback into corrupted memory.

Now we need to find out where FORTE dies. I have an idea for that, which caused us grieve on several platforms. For that it would be great if I could see your map file ( you can also mail it privately to me alois.zoitl (at) gmx.at) and also your linker file (ending with .ld). In order that FORTE is working correctly we need a CTOR section in the linker file and that the CTOR sections is invoked during startup. The CTOR section is the section where all static classes and class members get there constructor invoked. We use this to automatically build up FORTE's typelibrary.
Re: Does FORTE run on systems without OS [message #1799689 is a reply to message #1799676] Wed, 12 December 2018 12:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

I looked through the map file, as well as in the docs of esp-idf. I think the c++ startup calling the global construtors should be in the espif. At least this is what I found in components/esp32/cpu_start.c which should handle the startup process.

I think a potential next step could be to add more ESP_LOGIs also to forte code. Or what would even be better to do remote debugging and stepping through the code to see what really happens.
Re: Does FORTE run on systems without OS [message #1821759 is a reply to message #1746839] Wed, 19 February 2020 16:35 Go to previous messageGo to next message
Paulo Louro is currently offline Paulo LouroFriend
Messages: 31
Registered: February 2020
Member
Hey guys

I'm just wondering if you ever managed to get this working.

Myself I have started looking into implementing the FORTE for esp32, but this is not a so easy task with such 2 big projects.

Re: Does FORTE run on systems without OS [message #1821767 is a reply to message #1821759] Wed, 19 February 2020 20:39 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
I did not continue with this project because I had to work on another project first. I will come back to this one as soon as possible.
I came already quite far; I was able to compile the whole thing and download it to the ESP32 board. Unfortunately it crashed during the initialization phase. I guess it has something to do with the available stack size. Since now in esp-idf there is support for external PSRAM I could imagine this could be fixed because the external PSRAM can be configured as normal (but slower) memory which can be used for heap also.
Re: Does FORTE run on systems without OS [message #1821836 is a reply to message #1821767] Thu, 20 February 2020 20:49 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Has anybody tried 4diac FORTE on the ESP256. There should be more RAM and Flash.
Re: Does FORTE run on systems without OS [message #1821870 is a reply to message #1746839] Fri, 21 February 2020 13:08 Go to previous messageGo to next message
Paulo Louro is currently offline Paulo LouroFriend
Messages: 31
Registered: February 2020
Member
Hey Frank

Are you able to share how you have accomplish to compile both projects together?
Re: Does FORTE run on systems without OS [message #1821895 is a reply to message #1821870] Fri, 21 February 2020 18:19 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Dear Paulo,
I did this job more than one year ago. At that time the build system of esp-idf was based on GNU make; in the meantime they switched to CMAKE. So, the things I did that time are probably not very helpful, I guess.
If you read this thread from the beginning you can see the steps I did and the difficulties I encountered with solutions mentioned. I remember that I started with a special version of FORTE with support for FreeRTOS already built in. Since esp-idf also uses FreeRTOS this is a good point to start with. One major difficultiy I remember was the definition of all the compiler settings in terms of include dirs, compiler switches etc. But in the end it was not too difficult - mainly a matter of diligence. And of course (!) I had the support from Alois Zoitl who gave me very helpful hints when there were difficulties.
If you just start with this project I could try to give some hints and I guess also Alois is willing to help.
Best regards
Lothar
Re: Does FORTE run on systems without OS [message #1821896 is a reply to message #1821836] Fri, 21 February 2020 18:27 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Alois Zoitl wrote on Thu, 20 February 2020 21:49
Has anybody tried 4diac FORTE on the ESP256. There should be more RAM and Flash.

I don't find anything about an ESP256. At Espressif there is only the "older" ESP8266 and the newer ESP32. The ESP8266 has less RAM and Flash and also only 1 µC core. The ESP32 is more powerful.
I am quite confident that it should be possible to make FORTE run on the ESP32 at least using the additional external PSRAM.
One question: has there been progress in the FreeRTOS implementation in FORTE in the meantime? Or is this project step currently on hold? I could imagine that FreeRTOS support could boost the use of 4Diac/FORTE in many µC applications. Especially the ESP32 could be interesting because it has WiFi/Ethernet communication on-chip at very low cost.
Re: Does FORTE run on systems without OS [message #1821904 is a reply to message #1821870] Sat, 22 February 2020 09:55 Go to previous messageGo to next message
Franz Beckenbauer is currently offline Franz BeckenbauerFriend
Messages: 45
Registered: November 2016
Member
Paulo Louro wrote on Fri, 21 February 2020 14:08
Hey Frank

Are you able to share how you have accomplish to compile both projects together?

@PAULO: I just noticed that now there is documentation available how to compile FORTE for FreeRTOS https://www.eclipse.org/4diac/en_help.php?helppage=html/installation/freeRTOSLwIP.html
I think this is a good starting point.
Re: Does FORTE run on systems without OS [message #1821916 is a reply to message #1821904] Sat, 22 February 2020 21:51 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Oh I think I have mixed up the ESP numbers then.

Jose did a great job in improving freeRTOS support and documentation. I have two boards on my desk where I need to test 4diac FORTE with freeRTOS on. I hope I find time soon and update the documentation if needed.
Previous Topic:Comparing negative values
Next Topic:ECC status change Hook executeEvent
Goto Forum:
  


Current Time: Thu Mar 28 18:49:59 GMT 2024

Powered by FUDForum. Page generated in 0.12666 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top