eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.87k stars 782 forks source link

how can user use _tx_initialize_unused_memory #239

Closed xuzihan351 closed 1 year ago

xuzihan351 commented 1 year ago

_tx_initialize_unused_memory is passed to 'tx_application_define'. But I am confused that how can developer use that address without knowing the avilable memory size? What is the purpose to pass the symbol to application?

ghost commented 1 year ago

_tx_initialize_unused_memory is used to be the start address for application memory and stack used, users must specify the address where it started. it is usually set in the linker file. users should be responsible for memory exhaustion risk.

when _tx_initialize_unused_memory is not used. there are 2 ways to allocate memory for application.

  1. users can define globe variable. example:https://github.com/azure-rtos/netxduo/blob/master/samples/demo_netx_duo_ptp_client.c
    1. use "tx_byte_pool_create" to allocate memory. example : https://github.com/azure-rtos/threadx/blob/master/samples/demo_threadx.c
TiejunMS commented 1 year ago

Closing