Zahada FreeRTOS
Jaroslav Buchta
jaroslav.buchta na hascomp.cz
Pátek Prosinec 4 23:10:38 CET 2015
Pri vytvareni tasku se vytvori be TCB strukture reenrantni systemova
struktura takto:
#if ( configUSE_NEWLIB_REENTRANT == 1 )
/* Allocate a Newlib reent structure that is specific to this task.
Note Newlib support has been included by popular demand, but is not
used by the FreeRTOS maintainers themselves. FreeRTOS is not
responsible for resulting newlib operation. User must be
familiar with
newlib and must provide system-wide implementations of the
necessary
stubs. Be warned that (at the time of writing) the current
newlib design
implements a system-wide malloc() that must be provided with
locks. */
struct _reent xNewLib_reent;
#endif
Cili jako vlozena do struktury tskTCB.
Pri volani vTaskDelete(NULL) se vola na tuto polozku:
#if ( configUSE_NEWLIB_REENTRANT == 1 )
{
_reclaim_reent( &( pxTCB->xNewLib_reent ) );
}
#endif /* configUSE_NEWLIB_REENTRANT */
coz vede k pouziti funkce free a to zase k destrukci struktury heap...
V cem je chyba? V pouziti knihoven EmBitz, nebo ve zdrojaku FreeRTOS?
(Je to vygenerovano CubeMX)
kdyz radek _reclaim_reent( &( pxTCB->xNewLib_reent ) ); zakomentuju,
vsechny alokace pameti funguji OK.
Dalsi problem je s SD kartou (pres 1b SDIO) cteni celkem funguje, pri
zapisu je potreba vkladat 2ms pauzy mezi zapisy, zatim jsem to
podrobneji neanalyzoval ale je to divne. (zase vse - SDIO, FatFS,
nastaveno z CubeMX)
Další informace o konferenci Hw-list