# \_swimcu\_gpio\_set: illegal operation to set PULL for output pin 2

**URL:** <https://forum.legato.io/t/swimcu-gpio-set-illegal-operation-to-set-pull-for-output-pin-2/6436>\
**Category:** Legato Application Framework\
**Created:** [February 21, 2023, 11:30am UTC](https://forum.legato.io/t/swimcu-gpio-set-illegal-operation-to-set-pull-for-output-pin-2/6436 "2023-02-21T11:30:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [February 21, 2023, 11:30am UTC](https://forum.legato.io/t/swimcu-gpio-set-illegal-operation-to-set-pull-for-output-pin-2/6436/1 "2023-02-21T11:30:28Z")

</div>

Hi, we are trying to set a defined state for a pin to avoid unwanted behaviour on reboot. The current behaviour is that the pin is low after a hard-reset, then set high by one of our applications but on reboot not reset to low. Is there a way to detect a shutdown to reset it during one? The way we’re currently trying to solve this problem is by using pin\_EnablePullDown. However, this thows the error “\_swimcu\_gpio\_set: illegal operation to set PULL for output pin 2”

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 21, 2023, 11:33am UTC](https://forum.legato.io/t/swimcu-gpio-set-illegal-operation-to-set-pull-for-output-pin-2/6436/2 "2023-02-21T11:33:30Z")

</div>

You can try with some non mcu pin

> [@WP76xx not waking up from SPM on GPIO](https://forum.legato.io/t/wp76xx-not-waking-up-from-spm-on-gpio/6398/22):
>
> The problematic module is waking up from selective suspend with the gpioCf3SSDemo with GPIO35. We didn’t test the other module. So what remains is the missing connection between MCU and the module?

---

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [February 21, 2023, 2:57pm UTC](https://forum.legato.io/t/swimcu-gpio-set-illegal-operation-to-set-pull-for-output-pin-2/6436/3 "2023-02-21T14:57:04Z")

</div>

We solved it by implementing a heartbeat to which’s changes the other side listens. This way it’s depending on the change, not a static value and therefore, the value after a reboot doesn’t matter.
