# uxTaskGetStackHighWaterMark problem with 8-bit architectures

**URL:** <https://forums.freertos.org/t/uxtaskgetstackhighwatermark-problem-with-8-bit-architectures/6198>\
**Category:** Kernel\
**Created:** [October 30, 2016, 10:03am UTC](https://forums.freertos.org/t/uxtaskgetstackhighwatermark-problem-with-8-bit-architectures/6198 "2016-10-30T10:03:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 30, 2016, 10:03am UTC](https://forums.freertos.org/t/uxtaskgetstackhighwatermark-problem-with-8-bit-architectures/6198/1 "2016-10-30T10:03:35Z")

</div>

**[ollopa](https://sourceforge.net/u/ollopa/)** wrote on [Sunday, October 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/335d645d/#0ac3):

uxTaskGetStackHighWaterMark returns UBaseType\_t which is defined as an unsigned char on 8-bit architectures. This function’s return type needs to be at least a uint16\_t in order to work correctly with stack sizes larger than 256 bytes. Some parts like XMegas have enough SRAM that this is a problem.

UBaseType\_t uxTaskGetStackHighWaterMark( TaskHandle\_t xTask )

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 30, 2016, 2:35pm UTC](https://forums.freertos.org/t/uxtaskgetstackhighwatermark-problem-with-8-bit-architectures/6198/2 "2016-10-30T14:35:32Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, October 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/335d645d/#0ac3/9511):

Thank you for your feedback. In your case you can safely edit the code  
to use a uint16\_t instead. Remember to make similar edits inside the  
function itself, not just the return value.
