Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Crash in uxListRemove on Ameba Board

Posted by muratcakmak on August 7, 2017

I saw similar topics but non of them helped me.

I am working with Ameba IoT board and Ameba SDK v4.0. I have an application which connects to AWS Cloud using AWS SDK, mbedtls and LwIP. FreeRTOS v8.2 is used.

I am seeing errornous addresses in uxListRemove which crashes the system. configAssert is defined. I tried to change configLIBRARYMAXSYSCALLINTERRUPTPRIORITY and it is 1 now. configAssert called for Priority Grouping configASSERT( ( portAIRCRREG & portPRIORITYGROUP_MASK ) <= ulMaxPRIGROUPValue );

In fail case portAIRCRREG & portPRIORITYGROUP_MASK value was 768 ulMaxPRIGROUPValue value was 256

Therefore I called " NVIC_SetPriorityGrouping( 0 );" and I passed the configAssert() but still crashes in uxListRemove.

What problem can be? Any suggestion?

Thank you Murat Cakmak


Crash in uxListRemove on Ameba Board

Posted by rtel on August 7, 2017

Sounds like you are doing the right things.

My first suggestions would be to obtain the latest FreeRTOS code from the public SVN repository on SourceForge: https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/ That contains even more asserts that will help with interrupt priority issues - if that is indeed the issue.

Do you also have stack overflow detection turned on? If not then please turn that on too: http://www.freertos.org/Stacks-and-stack-overflow-checking.html

Finally, I'm afraid I don't know where to start with lwIP as there are lots of options there, but most issues can be traced to the driver code, as that is different in each system so not so well tested. Make sure you are following the lwIP threading requirements. Who created the port to the Ameba board? Please post a link to the board.


Crash in uxListRemove on Ameba Board

Posted by muratcakmak on August 8, 2017

Hello there, thank you.

Stack overflow is enabled. There can be a stack overflow which masked by hard fault, not sure.

Why there is not an internal protection in uxRemoveList? I saw some FreeRTOS modification as a workaround. https://github.com/nathanjel/esp-idf/commit/0694396f89f3c99e543c4ac3226ee757dcab0359

Can similar modification be applicable to solve the issue instead of fighting with huge amount of different modules (lwIP, mbedtls, our specific user app etc)?


Crash in uxListRemove on Ameba Board

Posted by muratcakmak on August 8, 2017

I am asking for FreeRTOS modification because there can be a problem with an specific ISR which set in a library.

Generally when I do backtrace for an assertion, root function is an ISR function

1 vAssertCalled (ulLine=389, pcFile=) at ../Boards/AmebaSDK/project/realtekameba1va0example/inc/FreeRTOSConfig.h:221 2 vPortEnterCritical () at ../Boards/AmebaSDK/component/os/freertos/freertosv8.1.2/Source/portable/GCC/ARMCM3/port.c:389 3 xQueueGenericReceive (xQueue=, pvBuffer=pvBuffer@entry=, xTicksToWait=xTicksToWait@entry=10000, xJustPeeking=xJustPeeking@entry=0) at ../Boards/AmebaSDK/component/os/freertos/freertosv8.1.2/Source/queue.c:1219 4 xTaskRemoveFromEventList (pxEventList=pxEventList@entry=) at ../Boards/AmebaSDK/component/os/freertos/freertosv8.1.2/Source/tasks.c:2474 5 xQueueGenericSendFromISR (xQueue=, pvItemToQueue=pvItemToQueue@entry=, pxHigherPriorityTaskWoken=pxHigherPriorityTaskWoken@entry=, xCopyPosition=xCopyPosition@entry=0) at ../Boards/AmebaSDK/component/os/freertos/freertosv8.1.2/Source/queue.c:1152 6 freertosupsemafromisr (sema=) at ../Boards/AmebaSDK/component/os/freertos/freertosservice.c:132 7 rtwupsemafromisr (sema=) at ../Boards/AmebaSDK/component/os/osdep/osdepservice.c:484 8 lextrabusdma_Interrupt (data=) at ../../../component/common/drivers/wlan/realtek/src/osdep/freertos/lxbus_intf.c:118

lextrabusdmaInterrupt is in a library (libwlan.a) and I cannot see the source file and who sets the priority.


Crash in uxListRemove on Ameba Board

Posted by muratcakmak on August 8, 2017

I had some concerns about Memory overflow but probably does not have. Because there are two different Memory Internal SRAM and SDRAM. All freertos is in the Internal SRAM. I moved it to SDRAM and still same issue. According to your feedbacks, only reason can be interrupt priorities.

I also disable all interrupts using _disableirq() __ from core_cm3.h in uxListRemove function but does not solve.


Crash in uxListRemove on Ameba Board

Posted by muratcakmak on August 14, 2017

It seems my issue was completely different. It was about conflict between two different timer function which one of them uses FreeRTOS timers and pass wrong values. So, it is completely implementation custom SDK specific.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS