kittu111 wrote on Tuesday, November 16, 2010:
Hello …
I am using IAR Evaluation board as a development start up for battery managment project and I am using FreeRTOS as OS. I am experiencing some problems. I am kind of lost and felt I hit the wall. Need some pointers. Below are the list of issues I am facing
1. I started my development with uipWebserver demo FreeRTOS example. With some modifications I used the uipWebserver example in the project to read out the task’s run time stats for the application. And slowly I started adding my other BMS application related tasks. This started increasing my SRAM consumption, which is understandable. So I accordingly started adjusting my FreeRTOSConfig.h and eventually when I go over 32K of SRAM bank, my application crashes immediately before even it runs. I know the LPC1768 has two separate banks of 32K SRAM, I have changed my IAR compiler to treat the two separate SRAM banks as one and it did it. But for some reason when I set configTOTAL_HEAP_SIZE to put the SRAM over 32KB after compilation, the whole application crashes with Hardfault exception error shown in the debugger. I use IAR workbench compiler and debugger. I am using IAR 1768-SK evaluation board as my development board.
2. Second problem, I have added few task to the BMS application and in the process I wanted bumped the priority of uipTask to (tskIDLE_PRIORITY + 6) and in the webserver’s webpage in the runtime stats or in one of those tabs where it shows the each task’s details shows the priority as 4. If I put the task priority as 5 or higher it shows up as 4 on the webpage. But other tasks whose priority is 4 or less shows up correctly. Why? I remember reading in the freertos manual that you can setup up priority numbers pretty high and can run any number of tasks.
3. Third problem, when I add a new task or change priorities around, the whole application becomes very unstable. Any info or pointers would definitely help me get going.
Just to give you an idea of the application tasks that are presently running.
int main( void )
{
/* Configure the hardware for use by this demo. */
prvSetupHardware();
AppSetupHardware();
/* Create the uIP task. The WEB server runs in this task. */
xTaskCreate( vuIP_Task, ( signed char * ) “uIP”, (configMINIMAL_STACK_SIZE * 4), ( void * ) NULL, (tskIDLE_PRIORITY + 6), NULL );
/* Create the task to do the Book keeping like polling and updating periodically */
//xTaskCreate( AppMain.Main, (signed char *) “BookKeeping”, mainBASIC_CAN_STACK_SIZE, (void * ) NULL, mainBOOK_KEEPING_PRIORITY, NULL );
/* Create the Eeprom task. This task will handle periodic writes to Eeprom to store statistical data. */
//xTaskCreate( vStatsUpdate_Task, ( signed char * ) “Eeprom”, configMINIMAL_STACK_SIZE*3, ( void * ) NULL, mainEEPROM_TASK_PRIORITY, NULL );
/* Create the CAN Rx task */
xTaskCreate( CanApi.RxTask, (signed char *) “eCANRx”, (configMINIMAL_STACK_SIZE * 13) , (void * ) NULL, (tskIDLE_PRIORITY + 5), NULL );
/* Create the CAN Rx task */
//xTaskCreate( CanApi.TxTask, (signed char *) “eCANTx”, mainBASIC_CAN_STACK_SIZE, (void * ) NULL, mainCAN_TASK_PRIORITY+8, NULL );
/* Create the simple LED flash task. */
//xTaskCreate( prvFlashTask, ( signed char * ) “Flash”, configMINIMAL_STACK_SIZE*3, ( void * ) NULL, mainFLASH_TASK_PRIORITY, NULL );
/* Create the Timer task to calculate SoC, run TimerPoll(used for one time timer with call back function) & Charge Control Mgmt */
xTaskCreate( LpcTimer.Main, ( signed char * ) “TimerTask”, (configMINIMAL_STACK_SIZE * 4) ,( void * ) NULL, (tskIDLE_PRIORITY + 4), NULL );
/* Create the A2DTask ( does TI communication every 2sec ) */
xTaskCreate( AppTaskA2D.Main, ( signed char * ) “AppTaskA2D”, (configMINIMAL_STACK_SIZE*5), ( void * ) NULL, (tskIDLE_PRIORITY + 2), NULL );
/* Create the TaskControl ( manages Mosfet states, during charging, discharging and on startup and during sleep ) */
xTaskCreate( TaskControl.Main, ( signed char * ) “TaskControl”, (configMINIMAL_STACK_SIZE*4), ( void * ) NULL, (tskIDLE_PRIORITY + 3), NULL );
/* Start the scheduler. */
vTaskStartScheduler();
/* Will only get here if there was insufficient memory to create the idle
task. The idle task is created within vTaskStartScheduler(). */
for( ;; );
}
and
void AppSetupHardware( void )
{
/* Initialize System clock */
SystemInit(); -> this is a function I called from CMSIS library, which has all the drivers nicely developed for Cortex - M3
NVIC_DeInit();
NVIC_SCBDeInit();
/* Set Vector table offset value */
#if (__RAM_MODE__==1)
NVIC_SetVTOR(0x10000000);
#else
NVIC_SetVTOR(0x00000000);
#endif /* Pin Configuration */
}
Thanks in advance