element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Experimenting with Gesture Sensors
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Gesture Sensors
  • More
  • Cancel
Experimenting with Gesture Sensors
Forum Establishing serial communication over UART instead of USB in MAX25405 EVKIT
  • Challenge Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Experimenting with Gesture Sensors requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 89 replies
  • Subscribers 41 subscribers
  • Views 9012 views
  • Users 0 members are here
  • MAX25405
  • gesture sensors
  • maxim integrated
  • uart
  • max32620fthr
Related

Establishing serial communication over UART instead of USB in MAX25405 EVKIT

rsjawale24
rsjawale24 over 2 years ago

The MAX25405EVKIT comes with a MAX32620FTHR board which is preprogrammed with custom binary file for the gesture recognition. The application note at Maxim Gesture Sensor EVKit Serial API (maximintegrated.com)

mentions "The serial interface can be implemented over the Universal Serial Bus (USB) virtual serial port or over a Universal Asynchronous Receiver-Transmitter (UART). The EV kit is shipped configured to use the USB serial port to work with the EV kit PC Graphical user Interface (GUI). If a UART serial interface is desired, custom firmware in binary format is available."

Upon researching more, I found the firmware_framework code that contains the code for gesture recognition compiled using mbed compiler.

The readme file says that a file called interface.h and interface.c define the communication protocol. When I open the interface.c file, I can see a comment in the code that says Option to implement serial API over UART instead of USB but there is only a MACRO set as #define macro_name 0 

I tried to change the 0 to 1 and compile the code, however, it does not compile successfully. The USBDevice library shows some error while compiling. 

Did anyone try to change the serial API over UART instead of USB? Was it successful?  

EDIT: I have successfully compiled the code for UART. However, I'll do some experiments and write introductory blogs before I re-program the MAX32620FTHR board with my firmware. 

  • Sign in to reply
  • Cancel

Top Replies

  • misaz
    misaz over 2 years ago in reply to misaz +4
    Today I found root cause of the issue. Issue is caused by invalid assembly code generated by modern ARM compiler. With older GCC compiler it works because it handle undefined behaviour used in code differently…
  • misaz
    misaz over 2 years ago +3
    I am curious how did you successfully compiled non-changed code? I started working with latest mbed-os but I was unable to compile it (missing toolchain) no matter of USE_UART_INTERFACE setting. Later…
  • BigG
    BigG over 2 years ago in reply to rsjawale24 +3
    I've create a very basic stripped down library based on the firmware framework using the latest MbedOS 6.16. github.com/.../Max25x05_MbedOS6 All it is doing is getting the raw pixel data. It is doing…
  • misaz
    misaz over 2 years ago in reply to BigG

    It is written in command list which I posted. It is following line:

    cd mbed-os
    git checkout 0fdfcf7350896a9c0b57c4a18237677abfe25f1a

    I found this commit ID somewhere on the internet. Someone was facing simmilar issue but with different firmware and library. I tried it and I was able to compile firmware with this version. But I had to fixed one old python script which come from this old mbed-os. See comments in code snippet in my previous comment.

    Currently I am out of home. I will of course try backup stock firmware before flashing my own. I always do this when possible. I will try this with MAX32620FTHR next weekend. If you want to do it yourself, you can use some of following commands. They come from my notes which comes from my last attemps of backuping firmware from MAX32625PICO board by other debug probe. Note that I recommend using openocd bundled as part of Maxim SDK (from C:\Maxim\... directory). In my case mainline openocd never worked with their chips. Last time I faces issue when mainline openocd successfully erased my MAX32625MCU but was unable to program new firmware (efficiently it bricked my MCU). Most probably Maxim patched openocd somehow to support their MCUs better. Following commands I post without any warranty. Since I am out of home I cant test that they work with MAX32625FTHR also.

    "C:\Maxim\Toolchain\bin\openocd.exe" -s C:\Maxim\Toolchain\share\openocd\scripts -f "path to config probe depending on debug probe used (ST-Link, J-Link, MAX32625PICO, ...)" -f target\max32625.cfg -c "reset"

    After connecting to target open putty and connect using telnet to localhost:<telnet port which can be determined from openocd output>. In telnet window execute:

    halt
    dump_image max_stock_fw.bin 0x00000000 0x00200000

    max_stock_fw.bin willget created in working directory. Run dump_image three time with different file names and after dumping check that all three files are the same and no bit error occured when transfering firmware.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rsjawale24
    rsjawale24 over 2 years ago in reply to BigG

    If I burn the Arduino Bootloader into the FTHR board then I'll have to rewrite the entire code for gesture recognition. I don't think I can write such complex codes. I just want the gesture data from MAX32620FTHR board over UART so that it can be read by Arduino.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rsjawale24
    rsjawale24 over 2 years ago in reply to BigG

    Yes, I tried sending ping and poll request over UART from Arduino to the MAX32620FTHR but still I'm getting the same response as 240. I'm testing it out now. Will update in an hour or so. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • misaz
    misaz over 2 years ago in reply to rsjawale24

    Only value 240 is wrong and I guess it have nothing to common with commands transmitted by MAX32620. Usualy it indicates wrong baudrate or something like this. Note that all response from MAX32620 are always longer than one char which also indicates bad baudrate. Did you initialized your Arduino Serial with baudrate 115200?

    Because I am out of home I cant test this firmware yet, but after I test I will give you know.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rsjawale24
    rsjawale24 over 2 years ago in reply to misaz

    Yes, the Arduino baud rate is set at 115200. If it is anything more or less, the serial monitor just prints gibberish because of baud rate mismatch. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • misaz
    misaz over 2 years ago in reply to rsjawale24

    I did it without --scm none but I think this has no impact on result. I think scm means that it initializes git repo for your project but I think it has no impact on operating system which is always downloaded using git.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • BigG
    BigG over 2 years ago in reply to rsjawale24

    Yes I have tried mbed new . --scm none but it did not work. I believe this just relates to version control. I believe misaz has the solution with git checkout 0fdf...

    I don't have a backup either.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rsjawale24
    rsjawale24 over 2 years ago

    UPDATE:

    The main.cpp file has a function to check if any command request from user has been sent to the MAX32620FTHR board. So upon initializing the serial comm. in Arduino, I'm sending the following command -

    Serial.write("cmd_poll");

    The main.cpp then sends the poll result over serial comm. which I'm continuously polling and reading the status of Serial.read() in a variable. Still no success. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • misaz
    misaz over 2 years ago in reply to rsjawale24

    It should be poll instead of cmd_poll. I recommend trying something more deterministic like ver (should return string containing firmware version).

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • BigG
    BigG over 2 years ago

    Just to say that I got this to compile, but I took a slightly different route along the way.

    I opened up Mbed Studio and created a new program from one of the available templates: mbed-os-example-blinky-baremetal-5

    This uses Mbed version 5.15.

    I then opened up Terminal in Mbed Studio and changed directory to the project folder.

    I then used the two commands as per readme.txt

    mbed add https://os.mbed.com/teams/MaximIntegrated/code/MAX32620FTHR/
    mbed add https://os.mbed.com/teams/MaximIntegrated/code/USBDevice/
    

    I then unzipped the firmware_framework.zip file.

    I then used the following for my mbed_app.json

    {
        "requires": ["bare-metal"],
        "config": {
            "main-stack-size": {
                "value": 65536
            }
        }
    }
    

    But when I tried to build the project it failed within Mbed Studio. This could well be because it is using ARMC6 as the default rather than GCC_ARM... I could probably change it inside Mbed Studio.

    But instead I existed and opened up terminal and then manually compiled using the command given in the readme file, namely

    mbed compile -t GCC_ARM -m MAX32620FTHR

    And it worked.

    Hope that helps.

    • Cancel
    • Vote Up +1 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