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 configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY and it is 1 now.
configAssert called for Priority Grouping
configASSERT( ( portAIRCR_REG & portPRIORITY_GROUP_MASK ) <= ulMaxPRIGROUPValue );
In fail case portAIRCR_REG & portPRIORITY_GROUP_MASK value was 768
ulMaxPRIGROUPValue value was 256
Therefore I called " NVIC_SetPriorityGrouping( 0 );" and I passed the configAssert() but still crashes in uxListRemove.
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.
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.
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)?
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 __disable_irq() __ from core_cm3.h in uxListRemove function but does not solve.
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.