-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create freertos port #13
base: develop
Are you sure you want to change the base?
Conversation
Added the FreeRTOS port files created by DaBa and modified rkhplat and rkhtype header files to impact the addition.
Después de hacer un análisis de shared y del port para freertos, aporto algunas ideas para resolverlo:
bsp_init(...)
{
...
rkh_fwk_init();
RKH_FILTER_*;
RKH_TRC_OPEN();
}
rkh_fwk_init(...)
{
/* There are 3 alternatives to execute RKH_TIM_TICK() */
/* 1. From a FreeRTOS software timer (Task context) */ /* <- favorite */
/* 2. From a specific task (Task context) */
/* 3. From FreeRTOS tick hook function (ISR context) */
}
rkh_fwk_enter(...)
{
RKH_HOOK_START(); /* start-up callback */
RKH_TR_FWK_EN();
vTaskStartScheduler();
RKH_HOOK_EXIT(); /* cleanup callback */
} |
@leanfrancucci algunos comentarios sin sopesar completamente cada opción:
Estoy de acuerdo con lo anterior, siempre y cuando no afecte negativamente al port. Es decir, terminar haciendo un port a medida para una app y un main en particular. No creo que suceda pero me refiero a no tener completamente cerrada la opción de hacer una modificación en un main, mientras que la misma sea una abstracción compatible con todas las plataformas. Lo planteo en el sentido de no sesgar la solución, no por alguna razón técnica.
Si no me equivoco, el planteo es mantener el
Concuerdo con la idea y preferencia del Software Timer.
Me genera interrogantes de la compatibilidad del port cuando la aplicación sea parte no reactiva y parte reactiva. Por otra parte, tu análisis sugiere que no es necesaria la función |
Perdón, botón equivocado... :S |
@cmancon respecto del main() y su relación con el port. Ahora, a esta arquitectura se le pueden sumar, sin ningún problema, tareas que no usan el framework. Por otro lado, si se requiere usar el framework con una aplicación existente que usa freertos entonces puede que el port deba modificarse o incluso se requiera crear otro diferente. Eso lo veremos cuando nos enfrentemos con el problema. Por ahora me inclino por resolver el port para aplicaciones basadas en el fwk. Respecto de usar el fwk en aplicaciones ya funcionando, es exactamente el caso de lo que podríamos enfrentar al incluir RKH en ESP8266_RTOS_SDK. Dicho sea de paso, estuve analizando cómo crear tareas propias dentro de la arquitectura ESP8266_RTOS_SDK y en principio parece viable agregar el fwk para resolver la "lógica de más alto nivel" del dispositivo, haciendo uso de todas las bibliotecas y funcionalidades que provee ESP8266_RTOS_SDK
Si, en principio no es necesaria. |
> rkh_fwk_enter() now starts the FreeRTOS' Scheluder. > The RKH Timer Tick is generated through a FreeRTOS' Software Timer. > Removed rkh_startupTask().
demo/cross/shared/main.c
Outdated
@@ -67,9 +67,12 @@ main(int argc, char *argv[]) | |||
RKH_SMA_ACTIVATE(CLI(cn), cli_qsto[cn], QSTO_SIZE, cli_stk[cn], | |||
CLI_STK_SIZE); | |||
} | |||
|
|||
#ifdef __FREERTOS_V10_03_00__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahora se podrían eliminar las lineas 70-72 y 75. Quedando igual al original
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resuelto en 45c1128
&( xTimerBuffers[0] ) | ||
); | ||
|
||
RKH_ASSERT(tick_TimerHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para que sea más entendible el código podes usar RKH_ENSURE() que verifica las post-condiciones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfecto! Lo incluyo en el próximo commit.
TaskHandle_t TaskHandle = NULL; | ||
RKH_TRC_OPEN(); | ||
|
||
#if defined(RKH_USE_TRC_SENDER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¿Es correcto dejarlo con #if defined(RKH_USE_TRC_SENDER)
o se podría mejorar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fijate que está relacionado con
#if defined(RKH_USE_TRC_SENDER) |
Si no está definido RKH_USE_TRC_SENDER no tiene utilidad publicar el simbolo y tampoco su existencia.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sí, pero es tal vez más robusto envolver con #if RKH_CFG_TRC_EN == RKH_ENABLED
. ¿Valdrá la pena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hace falta. Para que RKH_USE_TRC_SENDER sea defined, TRC tiene que ser Enabled.
Line 74 in 45c1128
#if (((RKH_CFG_TRC_EN == 1) && (RKH_CFG_SMA_TRC_SNDR_EN == 1)) || \ |
@cmancon tenés algo de estadística de |
No recuerdo si tengo guardados los resultados pero he dejado funcionando el ejemplo unas 5 horas verificando los valores en las herramientas de Debug de FreeRTOS de MCUXpresso. Me parecían bastante saludables. Lo que no recuerdo que tuviera era el watermark, pero si el uso de ¿Te parece que hagamos un ensayo y registremos acá los resultados? |
> Added "console output" via Semihosting to print info about the Demo. > Added control of LEDs to show activity. > Removed unused or unrelated code.
> Modified OpenOCD config to manipulate configuration from MCUXpresso. > Added FreeRTOS helpers to improve integration with the built-in debugger and with OpenOCD. > Separated into two Build configurations: - Debug: no semihosting. - Debug_with_Semihosting: Using Redlib(semihost). > Created four Debug launchers: - Debug: No semihosting, No OpenOCD-FreeRTOS integration. - Debug Semihosting: Uses Debug_with_Semihosting build but No OpenOCD-FreeRTOS integration. - Debug OpenOCD+FreeRTOS: Uses Debug build but No OpenOCD-FreeRTOS integration. - Debug OpenOCD+FreeRTOS+Semihosting: Uses Debug_with_Semihosting build and OpenOCD-FreeRTOS integration. The OpenOCD-FreeRTOS integration enables tasks listed as threads by GDB. This allows to have fast and easy access to backtrace and current status of each task. The built-in debugger benefits with the helpers as it can access more data from the RTOS and show it on dedicated views. For example, depending on the memory scheme being used, it can show heap usage; or make a listing of timers, etc.
@cmancon tenés info de ocupación de RAM y ROM de los archivos de la app shared y del fwk?. Tal vez tengas el IDE resume estos datos o sino pueden estar en el archivo que especifica el mapa de carga |
Bueno, habría que ver qué compilación tomar como parámetro. Como para dar una idea, el siguiente es el uso de memoria del Shared usando semishoting con
Tanto RamLoc40 como RamAHB16 estan manejados por el MCUXpresso con el Como estamos usando el heap3 que envuelve el |
> Included a minimal debounce implementation to read imputs from GPIO. > Include Pause function trigered by TEC1 in EDU-CIAA or DIN0 in CIAA.
> Included the "BOARD" Environment Variable. It is also used to conditionally compile the code to use the specific platform. Its values are compatible with sAPI definitions. Further explanation: In case that you use a EDU-CIAA-NXP, the OpenOCD config file depends on a environment variable to know it. If it is not defined, it will fallback to CIAA-NXP. To give a seamless experience, this variable is included in the project and, additionally, it's used to adapt the GPIO pins hardware configuration. > All Build Configurations were checked and the "Release" configuration was corrected to work properly.
> Created debug configurations (and launchers) for each platform. > Simplified options to use OpenOCD FreeRTOS integration and semihosting in any case. > Left a "legacy" configuration as a temporary backup.
> Head pointing to tag V10.3.0-kernel-only.
Are there pending tasks related to this port?. It would be great to turn over a new leaf, and then to think about fresh application examples with freeRTOS and RKH, as we have talked about several weeks ago 💪 💪 |
We are back to English? hehe
What do you think? |
> Before implementing the tact switch (or digital inputs depending the specific platform) bsp_timeTick() was only used by the trace output. For that reason, the implementation was inside a conditional compilation block. When the previously said functionality was implemented, the corresponding section of the bsp_timeTick() function was modified to be conditionally compiled but it wasn't noticed the the entire function was inside a conditional block itself. This situation is corrected here and will correctly compile if the trace functionality is disabled.
fix freertos submodule link
Codecov Report
@@ Coverage Diff @@
## develop #13 +/- ##
===========================================
+ Coverage 95.65% 95.68% +0.03%
===========================================
Files 13 13
Lines 598 603 +5
===========================================
+ Hits 572 577 +5
Misses 26 26
Continue to review full report at Codecov.
|
No description provided.