Does FORTE run on systems without OS [message #1746839] |
Sat, 05 November 2016 10:11  |
Eclipse User |
|
|
|
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 #1798415 is a reply to message #1798413] |
Sat, 17 November 2018 13:48   |
Eclipse User |
|
|
|
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 14:50] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Does FORTE run on systems without OS [message #1799669 is a reply to message #1799647] |
Wed, 12 December 2018 02:22   |
Eclipse User |
|
|
|
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 #1821916 is a reply to message #1821904] |
Sat, 22 February 2020 16:51  |
Eclipse User |
|
|
|
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.
|
|
|