# Problem using STRUCT in API file on Version 18

**URL:** <https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548>\
**Category:** Uncategorized\
**Created:** [December 21, 2020, 8:56am UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548 "2020-12-21T08:56:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![reinhard2](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reinhard2](https://forum.legato.io/u/reinhard2)\
**Post date:** [December 21, 2020, 8:56am UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/1 "2020-12-21T08:56:24Z")

</div>

Hey i have a problem I was using my MangOH red with the newest Firmware provided at: [mangOH Red Resources - Software - mangOH](https://mangoh.io/mangoh-red-resources-software) which is using legato version 20.04.0  
After using the I2C bus to speak to a LCD i noticed that after a few hours of use the I2C bus tends to block itself.

After Looking through a few forum pages it is recommended to update to the newest firmware of the WP provided at [https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/#sthash.UpXzxbms.dpbs](https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/#sthash.UpXzxbms.dpbs)  
to fix the I2C problem.

My Problem now is that the new Firmware uses legato 18.06.4 and in order to see if the I2C problem has been fixed i need to recompile my apps for version 18.06.4. But when compiling i get following error:  
/home/reinhard/myLeafWorkspace/CL\_Agents/apps/IF\_Health.api:4:0: error: missing EOF at u’STRUCT’

In my IF\_Health.api file i have a bunch of STRUCT definitions.

I am able to compile the Code for version 20.04.0 without any problems. Is STRUCT not supported for older Versions?

Edit:  
Ok i searched through the docs and it seems that the STRUCT option wasn’t yet added on Version 18.

But more important question how do i fix the i2c bus issue? Log tells me the following:

qup\_i2c qup\_i2c.0: Bus still busy, status 132100  
qup\_i2c qup\_i2c.0: Transaction timed out, SL-AD = 0x27

According to the MangOH forum it seems to be a reocurring problem

---

<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:** [December 21, 2020, 12:13pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/2 "2020-12-21T12:13:08Z")

</div>

“it is recommended to update to the newest firmware of the WP”

Did you try that?

---

<div class="post-metadata">

**Author:** ![reinhard2](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reinhard2](https://forum.legato.io/u/reinhard2)\
**Post date:** [December 21, 2020, 12:26pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/3 "2020-12-21T12:26:26Z")

</div>

I did that, but now i have the problem using STRUCT in the Api file. (Cause the supposedly newest firmware uses Legato 18 which doesn’t support STRUCT yet)

---

<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:** [December 21, 2020, 12:31pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/4 "2020-12-21T12:31:22Z")

</div>

Which module are you using?

---

<div class="post-metadata">

**Author:** ![reinhard2](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reinhard2](https://forum.legato.io/u/reinhard2)\
**Post date:** [December 21, 2020, 12:37pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/5 "2020-12-21T12:37:50Z")

</div>

WP8548 on a MangOH red carrier board

---

<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:** [December 21, 2020, 1:10pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/6 "2020-12-21T13:10:25Z")

</div>

Have you compiled and run legato 20 on it?

---

<div class="post-metadata">

**Author:** ![reinhard2](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reinhard2](https://forum.legato.io/u/reinhard2)\
**Post date:** [December 21, 2020, 1:21pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/7 "2020-12-21T13:21:46Z")

</div>

Thats the Problem! Let me explain:  
The newest Firmware Provided for the mangOH red on the official Mango website uses following Versions:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/b/b96f6818c2e0b499dd7a1ec8eb73c20ca74bc52b.png)

When using this version i can compile without problems but get the error that the I2C blocks itself after a few minutes/hours. (Giving me following message: qup\_i2c qup\_i2c.0: Bus still busy, status 132100  
qup\_i2c qup\_i2c.0: Transaction timed out, SL-AD = 0x27)

So i looked for a solution for my i2c problem, and found that a possible fix may be using the newest firmware for the WP85 provided at [https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/#sthash.UpXzxbms.dpbs](https://source.sierrawireless.com/resources/airprime/software/wpx5xx/wpx5xx-firmware-latest-release/#sthash.UpXzxbms.dpbs)  
so i switched to this version, but in this version (legato 18.04) it is not possible to use STRUCT in the Api files.

My main problem is actually just that the i2c blocks itself, i would actually prefer using legato 20.

I looked at: [WP8548 I2C bus lock up when read ADC2 and ADC3 - #9 by plu](https://forum.legato.io/t/wp8548-i2c-bus-lock-up-when-read-adc2-and-adc3/3942/9) and there it states that a possible fix may be building my own image using the patch for the i2c. But is there an easier fix?

---

<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:** [December 21, 2020, 1:30pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/8 "2020-12-21T13:30:56Z")

</div>

Two methods:

1. Download the legato 20 and compile it for wp8548
2. Modify your app to not using STRUCT

I search in “leaf search” , there is already some package is using legato 20 for WP8548:

│ swi-wp85\_3.14.0 │ SDK for WP85 (Release 17 + Legato 20.04.0)  
│ swi-wp85\_3.15.0 │ SDK for WP85 (Release 17 + Legato 20.08.0)

---

<div class="post-metadata">

**Author:** ![reinhard2](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reinhard2](https://forum.legato.io/u/reinhard2)\
**Post date:** [December 22, 2020, 4:06pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/9 "2020-12-22T16:06:06Z")

</div>

“I search in “leaf search” , there is already some package is using legato 20 for WP8548”

I know that, but don’t i also need to run legato application framework 20.08 on my device to be able to use it? And there isn’t an official release for that.

---

<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:** [December 22, 2020, 11:03pm UTC](https://forum.legato.io/t/problem-using-struct-in-api-file-on-version-18/5548/10 "2020-12-22T23:03:27Z")

</div>

Of course you need to compile the app with this package swi-wp85\_3.15.0

Not official ,still development phase
