element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Azure Sphere Starter Kit
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Azure Sphere Starter Kit
  • More
  • Cancel
Azure Sphere Starter Kit
Forum I2C Resource busy error (errno 16) on OS 19.11
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Azure Sphere Starter Kit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 47 subscribers
  • Views 740 views
  • Users 0 members are here
  • i2c
  • azure sphere
Related

I2C Resource busy error (errno 16) on OS 19.11

jgroman
jgroman over 5 years ago

Since OS 19.11 I am having some trouble with I2CMaster_Write function which fails with with "Resource busy" error a lot when trying to do multiple writes in a row.

For now I managed to create a workaround by using tiny delays before writes:

 

struct timespec sleepTime;

sleepTime.tv_sec = 0;
sleepTime.tv_nsec = 800000;
nanosleep(&sleepTime, NULL);

result = I2CMaster_Write(i2c_fd, p_ccs->i2c_addr, p_arg_data, arg_int);

 

Are there any better solutions to this problem?

I cannot send all data in one write transaction as there is limited buffer size in target device.

I have the same problem with multiple different I2C targets.




  • Sign in to reply
  • Cancel

Top Replies

  • Fred27
    Fred27 over 5 years ago in reply to jgroman +1
    Ah - 19.11 must have just hit the standard channel. I'll update my device and see if it changes anything.
  • jgroman
    jgroman over 5 years ago in reply to Fred27 +1
    Oh, I did the migration thing after update to 19.10, it was confusing for a bit. I noticed this upgrade to 19.11 only after Visual Studio offered Azure Sphere SDK upgrade, too. What I2C bus speed do you…
  • Fred27
    0 Fred27 over 5 years ago

    Are you sure you mean 19.11? That's still in preview so you have to jump through a few hoops to get that on your device.

     

    I sometimes get that error but had already set up retries due to the repeated start byte problem. A retry seems to cover my use case so I just left it with that.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jgroman
    0 jgroman over 5 years ago in reply to Fred27

    Yep, pretty sure:

    >azsphere device show-deployment-status
    Your device is running Azure Sphere OS version 19.11.
    The Azure Sphere Security Service is targeting this device with Azure Sphere OS version 19.11.
    Your device has the expected version of the Azure Sphere OS: 19.11.

     

    Same code was working fine on previous releases, just after upgrade it started failing.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Fred27
    0 Fred27 over 5 years ago in reply to jgroman

    Ah - 19.11 must have just hit the standard channel. I'll update my device and see if it changes anything.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Fred27
    0 Fred27 over 5 years ago in reply to jgroman

    You're right - 19.11 has landed. I had to jump through quite a few hoops to migrate accounts over before I could "azsphere device show" in order to check.

     

    I'm definitely getting the occasional error but I don't think they're any more frequent than before. However, mine are "ERROR: I2CMaster_Write: errno=6 (No such device or address)".

     

    Apparently 19.11 should have fixed the repeated start byte error, so I'll remove my corrective code and see if that's the case...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jgroman
    0 jgroman over 5 years ago in reply to Fred27

    Oh, I did the migration thing after update to 19.10, it was confusing for a bit. I noticed this upgrade to 19.11 only after Visual Studio offered Azure Sphere SDK upgrade, too.

    What I2C bus speed do you use in your project?




    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube