Zahada FreeRTOS

Jaroslav Buchta jaroslav.buchta na hascomp.cz
Sobota Prosinec 5 12:18:49 CET 2015


Tak problem spolehlivosti operaci s kartou vyresilo pouziti DMA, asi se 
nestihaly dodavat spolehlive data pri spolubehu LWIP - ma vyssi prioritu 
tasku.
To pouziti struktury xNewLib_reent bude IMHO chybicka, pamet nikde 
neubyva bez volani _reclaim_reent ...
Jen se mi ted zkomplikovala situace, musel jsem zasahnout do zdrojaku co 
generuje CubeMX a ted uz to nemuzujednoduse vse znovu vygenerovat.

Dne 04.12.2015 v 23:10 Jaroslav Buchta napsal(a):
> 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)
>
>
> _______________________________________________
> HW-list mailing list  -  sponsored by www.HW.cz
> Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list



Další informace o konferenci Hw-list