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 UART Problems
  • 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 Verified Answer
  • Replies 4 replies
  • Answers 3 answers
  • Subscribers 48 subscribers
  • Views 840 views
  • Users 0 members are here
Related

UART Problems

stephenmo
stephenmo over 6 years ago

Has anyone had any success getting UART working on the Azure Sphere?

 

I've taken a look at Microsofts documentation and the UART example that I could find. I can't seem to get a UART_OPEN that doesn't return an error (-1).

 

I think I'm getting Tripped up on UART ID. My guess is that this UART_ID is the ID defined in the application manifest eg "Uart": ["ISU0] would be 0.

image

I've done the usual rx->tx and tx_>rx, ensured my serial device is 3.3v and is outputting data so I'm a bit confused by this.

I've ensured that i've defined     "Uart": ["ISU0"] in my app_manifest.json.

 

Has anyone had any success and have any tips?

 

Minimal example for what I'm trying

 

 

```c

#include <applibs/log.h>

#include <applibs/gpio.h>

#define UART_STRUCTS_VERSION 1

#include <applibs/uart.h>

 

int uartFd = -2;

int main(int argc, char *argv[])

{

UART_Config uartConfig;

UART_InitConfig(&uartConfig);

uartConfig.baudRate = 9600;

uartFd = UART_Open(0, &uartConfig);

 

 

if (uartFd < 0)

{

Log_Debug(":( Couldn't open UART");

}

else

{

Log_Debug("YAY!");

}

    return 0;

}

```

  • Sign in to reply
  • Cancel

Top Replies

  • javagoza
    javagoza over 5 years ago +3 verified
    Hi, Stephen, Use MT3620_UART_ISU0. MT3620_UART_ISU0 is defined as 4 . In the AVNET examples it is defined as MT3620_RDB_HEADER2_ISU0_UART. uartFd = UART_Open(MT3620_UART_ISU0 , &uartConfig); // MT3620_UART_ISU0…
  • stephenmo
    stephenmo over 5 years ago +3 suggested
    Thanks Clem and Enrique, both of your solutions work. Those constants Enrique mentioned are defined here for anyone else looking.
  • clem57
    clem57 over 6 years ago +2 suggested
    This is the example for the bare metal usage which I recommend to have deterministic usage. : "Uart" : [ "ISU0" ], https://github.com/Azure/azure-sphere-samples/blob/master/Samples/UART/UART_RTApp_MT3620_BareMetal…
Parents
  • stephenmo
    0 stephenmo over 5 years ago

    Thanks Clem and Enrique, both of your solutions work.

    Those constants Enrique mentioned are defined here for anyone else looking.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • stephenmo
    0 stephenmo over 5 years ago

    Thanks Clem and Enrique, both of your solutions work.

    Those constants Enrique mentioned are defined here for anyone else looking.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
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