OP-TEE / optee_os

Trusted side of the TEE
Other
1.51k stars 1.03k forks source link

Using malloc() to Allocate Large Memory in PTA fail with code 0xffff000c #6869

Closed zwb-233 closed 4 weeks ago

zwb-233 commented 4 weeks ago

I attempted to use malloc() in the Pseudo Trusted Application (PTA) to create a large memory space and copy data from params. However, even after the malloc allocation, the allocated pointer remains NULL. Are there any alternative functions available for allocating a large memory space or expanding the memory used by the PTA?

ivila commented 4 weeks ago

@zwb-233 How "large" is the memory you want? And how you configure the memory(for example: CFG_CORE_HEAP_SIZE) when building optee_os?

zwb-233 commented 4 weeks ago

How "large" is the memory you want?

It could be at least 10MB.

And how you configure the memory(for example: CFG_CORE_HEAP_SIZE) when building optee_os?

Sorry, I was previously unaware of the CFG_CORE_HEAP_SIZE setting. After researching and increasing its value, the program has now executed successfully. Thank you.