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 Azure Sphere Starter Kit Reference Design Software Error
  • 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
  • Replies 5 replies
  • Subscribers 46 subscribers
  • Views 426 views
  • Users 0 members are here
  • azure sphere kit
  • azurespherech
  • azure sphere
Related

Azure Sphere Starter Kit Reference Design Software Error

rsc
rsc over 6 years ago

I found an error on line 140 in mt3620_avnet_dev.h of the reference design software.

 

mt3620_avnet_dev.h

line 139 /// <summary>Click Module 2 PWM is GPIO 1.</summary>

line 140 #define AVT_SK_CM2_PWM AVT_MODULE_GPIO0_PWM1

 

line 140 should be =>>  #define AVT_SK_CM2_PWM AVT_MODULE_GPIO1_PWM1

 

 

Found some other errors in the documentation

From my testing the user LEDs are:

RED = GPIO7

GREEN = GPIO8

BLUE = GPIO9

 

and the APP LED = GPIO10

 

Scott

  • Sign in to reply
  • Cancel

Top Replies

  • rsc
    rsc over 6 years ago in reply to bwilless +2
    Hi Brian, The GPIO mapping for the LEDs is confusing. If I leave the defines as: #define MT3620_RDB_LED1_RED 8 // AVT_MODULE_GPIO8 #define MT3620_RDB_LED1_GREEN 9 // AVT_MODULE_GPIO9 #define MT3620_RDB_LED1_BLUE…
  • bwilless
    bwilless over 6 years ago +1
    Hi Scott, Thank you for the feedback. I'll look into the items you point out and will update the GitHub project. Brian
  • bwilless
    bwilless over 6 years ago in reply to rsc +1
    Hi Scott, I've confirmed with the Starter Kit documentation and with my own testing that the user RGB GPIO mapping is correct 8 for Red, 9 for Green, and 10 for Blue. In the demo application if I connect…
  • bwilless
    bwilless over 6 years ago

    Hi Scott,

     

    Thank you for the feedback.  I'll look into the items you point out and will update the GitHub project.

     

    Brian

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rsc
    rsc over 6 years ago in reply to bwilless

    Hi Brian,

    The GPIO mapping for the LEDs is confusing.  If I leave the defines as:

     

    #define MT3620_RDB_LED1_RED    8   // AVT_MODULE_GPIO8

    #define MT3620_RDB_LED1_GREEN  9   // AVT_MODULE_GPIO9

    #define MT3620_RDB_LED1_BLUE   10   // AVT_MODULE_GPIO10

     

    Then

    GPIO_SetValue(MT3620_RDB_LED1_BLUE, GPIO_Value_Low);     turns on the red LED

    GPIO_SetValue(MT3620_RDB_LED1_RED, GPIO_Value_Low);       turns on the green LED

     

    However,

    GPIO_SetValue(userLedRedFd,GPIO_Value_Low);       turns on the red LED

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • bwilless
    bwilless over 6 years ago in reply to rsc

    Hi Scott,

     

    I've confirmed with the Starter Kit documentation and with my own testing that the user RGB GPIO mapping is correct 8 for Red, 9 for Green, and 10 for Blue.  In the demo application if I connect to my IoT Hub and use the device twins to update the user RGB LEDs, they work as expected.  From the device_twin.c file

     

    {.twinKey = "userLedRed",.twinVar = &userLedRedIsOn,.twinFd = &userLedRedFd,.twinGPIO = MT3620_RDB_LED1_RED/*8*/,.twinType = TYPE_BOOL,.active_high = false},

    {.twinKey = "userLedGreen",.twinVar = &userLedGreenIsOn,.twinFd = &userLedGreenFd,.twinGPIO = MT3620_RDB_LED1_GREEN/*9*/,.twinType = TYPE_BOOL,.active_high = false},

    {.twinKey = "userLedBlue",.twinVar = &userLedBlueIsOn,.twinFd = &userLedBlueFd,.twinGPIO = MT3620_RDB_LED1_BLUE/*10*/,.twinType = TYPE_BOOL,.active_high = false},

     

    I can exercise the them using the desired properties, and they are all working as expected.

     

      "properties": {

     

        "desired": {

          "userLedRed": false,

          "userLedGreen": true,

          "userLedBlue": false,

          "$metadata": {

     

    I'm not sure what the disconnect is.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rsc
    rsc over 6 years ago in reply to bwilless

    Hi Brian,

     

    GPIO_SetValue Function

    int GPIO_SetValue(int gpioFd, GPIO_Value_Type value);

    Parametershttps://docs.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-gpio/function-gpio-setvalue#parameters

    • gpioFd The file descriptor for the GPIO.
    • value The GPIO_Value value to set - GPIO_Value_High or GPIO_Value_Low.

    Errorshttps://docs.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-gpio/function-gpio-setvalue#errors

    If an error is encountered, returns -1 and sets errno to the error value.

    • EINVAL: the value is not a GPIO_Value.
    • EBADF: the gpioFd is not valid.

    Any other errno may also be specified; such errors aren't deterministic and there's no guarantee that the same behavior will be retained through system updates.

    Returnshttps://docs.microsoft.com/en-us/azure-sphere/reference/applibs-reference/applibs-gpio/function-gpio-setvalue#returns

    0 for success, or -1 for failure, in which case errno will be set to the error value.

     

    The problem is that I thought the value of the file descriptor "gpioFd" was the same as the gpio pin designation.

    Trying to find the "true" definition was difficult from the various included files.

    from avnet_mt3620_sk.h

    // User LED Red channel uses GPIO8.

    #define AVNET_MT3620_SK_USER_LED_RED AVNET_AESMS_PIN11_GPIO8

    // User LED Green channel uses GPIO9.

    #define AVNET_MT3620_SK_USER_LED_GREEN AVNET_AESMS_PIN12_GPIO9

    // User LED Blue channel uses GPIO10.

    #define AVNET_MT3620_SK_USER_LED_BLUE AVNET_AESMS_PIN13_GPIO10

     

    from mt3620.h

    // MT3620 GPIO 8

    #define MT3620_GPIO8 (8)

    // MT3620 GPIO 9

    #define MT3620_GPIO9 (9)

    // MT3620 GPIO 10

    #define MT3620_GPIO10 (10)

     

    from sample_hardware.h

    // MT3620 SK: User LED RED Channel.

    #define SAMPLE_RGBLED_RED AVNET_MT3620_SK_USER_LED_RED

    // MT3620 SK: User LED GREEN Channel.

    #define SAMPLE_RGBLED_GREEN AVNET_MT3620_SK_USER_LED_GREEN

    // MT3620 SK: User LED BLUE Channel.

    #define SAMPLE_RGBLED_BLUE AVNET_MT3620_SK_USER_LED_BLUE

     

    from mt3620_rdb.h

    // LED 1 Red channel uses GPIO8.

    #define MT3620_RDB_LED1_RED MT3620_GPIO8

    // LED 1 Green channel uses GPIO9

    #define MT3620_RDB_LED1_GREEN MT3620_GPIO9

    // LED 1 Blue channel uses GPIO10

    #define MT3620_RDB_LED1_BLUE MT3620_GPIO10

     

    The sample files are for various target hardware configurations and I didn't realize that.

    If you leave the Target Hardware Definition unconfigured, the program still compiles although runs with strange results.

    Scott

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • bwilless
    bwilless over 6 years ago in reply to rsc

    Hi Scott,

     

    Thanks for capturing all this detail!

     

    The Avnet OOB example application was created before Microsoft implemented the Target Hardware feature.  The current Microsoft GitHub example applications use the Target Hardware feature to allow users to run each sample application on all the different hardware development kits that are currently available.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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