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
Moto Mods
  • Products
  • Manufacturers
  • Moto Mods
  • More
  • Cancel
Moto Mods
Forum "The Moto Mod can't connect and isn't working. Try attaching it again.".
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Moto Mods to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 5 replies
  • Subscribers 57 subscribers
  • Views 838 views
  • Users 0 members are here
  • moto mod
  • flash
  • moto z
Related

"The Moto Mod can't connect and isn't working. Try attaching it again.".

mdastec
mdastec over 8 years ago

Hi.

Struggling here with learning the MotoZ Mod development steps.

 

I think I've got the entire build setup correct. I am building the Blinky example. If I build it using the VID/PID 312/10403 and then flask my build using openocd, the stock MDK Utility overwrites my firmware with one it downloads. If I change the VID/PID to 0x42/0x1, build and flash, my changes run. I modified stm32_modraw_blinky.c and changed the dbg("BLINK") message so I know it is running. I also added the example "Hello World" or now from the nsh> prompt I can run hello and I get the output "Hello, World!!".

 

But after doing the above the phone displays "The Moto Mod can't connect and isn't working. Try attaching it again". This message isn't coming from the MDK Utility app because I stop the app and/or uninstall it. So it must be form a service. This is what I am not understanding. I must me missing something simple. Why isn't the simple change from the stock VID/PID to the developer VID/PID causing the ref mod board from getting recognized?

 

I have also rebuilt the boot loader and it too has VID/PID or 0x42/0x01. i use the same boot loader for loading blinky with 0x312/0x10403 which as i say above, works. Is there yet another place like a manifest that needs updating too?

 

Mike

  • Sign in to reply
  • Cancel
Parents
  • mdastec
    mdastec over 8 years ago

    I found if I build my bootloader with

     

    CONFIG_ARCH_BOARDID_PID=0x00010403

    CONFIG_ARCH_BOARDID_VID=0x00000312

     

    to match my Blinky VID/PID, than the stock MDK Utility plays well with the blinky mod. I can control starting / stopping the blinking. I can see my Moto Mods Status info. I gave a new name to the Mod and it now final shows up in MDK Utility. So between that and the output from the nuttx terminal I know my firmware is running.

     

    Before changing the bootloader VID/PID I saw in the nsh> terminal a message along the lines of:

     

    no signature

    validate_image_signature failed

     

    Also

           TFTF     BOOTLOADER CHECKED

    VID: 0x00000312 0x00000042  YES

    PID: 0x00010403 0x00000001  NO

     

    These were clues.

     

    So I am still stuck understanding why, with both the boot loader and Blinky using the same developer VID/PID of 0x42/0x01 the phone will not connect.

     

    I read this from Motorola:

     

    VID/PID

    The Moto Mod must identify itself to the system to ensure certification compliance and receive proper infrastructure support such as over the air firmware updates. This identification is in the form of a Vendor ID and Product ID. The Vendor ID is assigned by Motorola through the certification process and the Product ID is managed by the Mod manufacturer. During prototyping and development a special VID of 0x42 is used. You can switch to the development VID simply using the MDK Utility.

     

    (Bold/Italic emphasis mine) But the MDK Utility will not even go active until after the connection is established.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • motomodsdev
    motomodsdev over 8 years ago in reply to mdastec

    You answered your own question!  If you notice, the VID/PID of your TFTF file (that is your firmware here) is NOT 42/1.  And the bootloader is configured to only boot a matching VID (I think developer skips the PID check).

     

    You'll also notice that if you use 312/10403, your firmware will be updated from the cloud whether you like it or not.

     

    One fun nuance, the make system doesn't recognize if you change the manifest file, or your VID/PID.  As a result, if you change either you'll need to do a clean build.  If you've made changes in menuconfig, make sure to backup your .config file over the project's defconfig.  Then, when you run configure.sh to select your "new" project, you won't need to re-change the VID/PID again.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mdastec
    mdastec over 8 years ago in reply to motomodsdev

    Well than maybe it is this nuance that is biting me.

     

    I changed the bootloader's VID/PID to 0x42 and 0x01 (edit the .config file), make and openocd flash it.

     

    I edit the nuttx .config file (or run make menuconfig) and set the VID/PID to the same 0x42/0x01, make and flash.

     

    After doing that, my firmware is running but I get the message that the Mod isn't working.

     

    So you are saying that I need to do a clean build. What are the steps for ensuring I am doing a clean build? And can you confirm that the only two places I need to set the VID and PID are in those two .config files? There is no other hardware or other manifest?

     

    Note that I think the changed VID/PID were used because I believe I see the values on the nsh> terminal output. The 'clue' I mentioned above was showing the bootloader using the 0x42/0x01 and with that 'clue' I rebuilt the bootloader with the 0x312/0x1003. There after it worked. Again, if I made both 0x42/0x01 I get the message "Mod can't connect". A mismatch forces the firmware load from an Internet download.

     

    I seem to observe that changing to Developer Mode via the MDK Utility seems to reflash the bootloader with one built with 0x42/0x01. I assume that is expected behavior but that was causing some of my confusion.

     

    Thank you sincerely for your assistance.

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mdastec
    mdastec over 8 years ago in reply to mdastec

    Yes I must be missing something in regard to this nuance. I edited the .config for nuttx, changing the VID/PID to 0x00000042/0x00000001 and then just ran make. It seemed like a complete recompile was performed and at the end I got:

     

    MuC

    Wrote nuttx.tftf

    TFTF Header for nuttx.tftf (115000 bytes)

      Sentinel:        'TFTF'

      Header size:      0x00000200 (512)

      Timestamp:        '20170601 023058 '

      Fw. pkg name:    'None                                            '

      Package type:      0x00000003

      Start location:    0x080086ac

      Unipro mfg ID:     0x00000104

      Unipro product ID: 0x00006415

      Ara vendor ID:     0x00000042

      Ara product ID:    0x00000001

      Reserved [0]:      0x00000000

      Reserved [1]:      0x00000000

      Reserved [2]:      0x00000000

      Reserved [3]:      0x00000001

      Section Table (all values in hex):

        Type Class  ID      Length  Load    Exp.Len

      0 01  000000 00000000 0001bf38 08008200 0001bf38 (Code)

      1 fe  000000 00000000 00000000 00000000 00000000 (End of descriptors)

      2 (unused)

      :    :

      19 (unused)

     

    TFTF contents for nuttx.tftf (115000 bytes)

      section [0] (114488 bytes): Code

      80230020ad8600089183000899830008a1830008a9830008b183000889830008

        :

      4000000000000000000600550000000000780402400000000000000000000000

     

     

    Done

    1+0 records in

    1+0 records out

    512 bytes copied, 0.00317836 s, 161 kB/s

     

    So from that output it looks like the VID/PID is correct (matches what I set in .config).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • motomodsdev
    motomodsdev over 8 years ago in reply to mdastec

    Yes, based on your compile output you have the correct VID/PID in your firmware.

     

    As for the Mode switch, that flashes in a bootloader which essentially updates your VID/PID.  When in example mode, that bootloader will identify which Personality Card is attached and download the firmware.  When in developer mode, that bootloader will boot any Mod with VID=0x42.

     

    When modifying the Manifest or the VID/PID, I always do a 'make distclean' to force it to rebuild.  Bear in mind, this wipes your .config file so if you've made changes you need to back it up to your project/defconfig.  Would be nice to figure out why Make doesn't handle that dependency properly.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • motomodsdev
    motomodsdev over 8 years ago in reply to mdastec

    Yes, based on your compile output you have the correct VID/PID in your firmware.

     

    As for the Mode switch, that flashes in a bootloader which essentially updates your VID/PID.  When in example mode, that bootloader will identify which Personality Card is attached and download the firmware.  When in developer mode, that bootloader will boot any Mod with VID=0x42.

     

    When modifying the Manifest or the VID/PID, I always do a 'make distclean' to force it to rebuild.  Bear in mind, this wipes your .config file so if you've made changes you need to back it up to your project/defconfig.  Would be nice to figure out why Make doesn't handle that dependency properly.

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