Hi,
If I define these two arrays
uint8_t testArr[300];
uint8_t testArr[300];
in source file and try to use this source file in RTOS tasks firmware execution stops. But if I define them with size of 150 i'm not facing any problem.
I tried to increase stack size of RTOS tasks without success.
What I need to change? (I'm using PN7462AU_ex_phExCcid sample project)
PN7462 only equipped with 12 KB of SRAM. Heap, stack and global data (BSS) and some revered memory will be stored in this region. I would not suggest you add so large array.
Regards
Daniel
Do you have this on the task stack (local variable?).
The both have the same name, are they in different scopes?
And you would need to have a task stack for this with at least 600 bytes (plus for everything else you have, probably around 1 KByte.
And where does it stop? Did you check it with the debugger?
They are global static variables.
They have different names.
If I increase task stack size when using 'phRtos_TaskCreate' I end up with Hard page fault error.
If I debug it, firmware stops somewhere and if I try to pause debugging to see where it stops IDE gives an error like ''Can't halt processor'.
If they are global variables, you don't have to increase the task stack size(s), as they are not allocated on the (task) stack memory.
Have you turned on the error hooks (e.g. for malloc failed)? If you try to create a task with a stack too large, and you don't have enough memory, this would be an error condition you have to catch.
So in essence: if the variables are global, you don't need to increase stack sizes. If you increase stack sizes, you might be running out of memory.
Thank you for your response.
So If I don't need to increase task stack sizes what's the couse of this problem?
As I said before I'm modifying 'PN7462AU_ex_phExCcid' example and problem arises when i add these 2 array definitions to 'phExCcid_UsbCcid_Process.c' file and try to read & write something on it.
I have no experience with your device (I don't have one), so cannot comment if this is something related to it. Adding global arrays (as said again) should not have an impact on what you do.
So I think your problem is something different. Maybe you copy these arrays somewhere and you don't check if the destination is large enough.
I recommend you turn on the compiler warnings if there is anything reported. But at the end you would have to step through your code and try to find out what is going in.
If you suspect things are writing to a location where it should not, you could use watchpoints (data breakpoints) to find out who is making the write.
In case you are not familiar with this: I wrote an article about it here:
https://mcuoneclipse.com/2018/08/11/tutorial-catching-rogue-memory-accesses-with-eclipse-and-gdb-wat...
I hope this helps,
Erich
PN7462 only equipped with 12 KB of SRAM. Heap, stack and global data (BSS) and some revered memory will be stored in this region. I would not suggest you add so large array.
Regards
Daniel