Zahada FreeRTOS

Jaroslav Buchta jaroslav.buchta na hascomp.cz
Neděle Prosinec 6 20:10:07 CET 2015


Tak jsem zjistil, ze tech chyb a nesmyslu ma ST CUBE v kodu vic, spis az 
moc...
Pokud to nekoho zajima, tak se rozepisu, v principu je v zakladu malo 
bufferu pro pakety LWIP, neni osetren prichod dalsiho paketu dokud neni 
zpracovan stavajici, R/W SDIO neni implicitne resen pres DMA coz v 
prostredi RTOS nefunguje (asi se nestihaji dodavat data), a cekani na 
dokonceni prenosu SDIO je naprosta brutalita, stylem cekani na ISR od 
SDIO  v jinem ISR (DMA) stylem while (!xxx);... Trosku to lze resit 
prioritami ale to me fakt dostalo... Zatim resim dulezitejsi problemy 
ale tohle urcite prepisu.

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