Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
A
AMC FMC Carrier AFC
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 16
    • Issues 16
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • Wiki
    • Wiki
  • image/svg+xml
    Discourse
    • Discourse
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Projects
  • AMC FMC Carrier AFC
  • Issues
  • #184

Closed
Open
Opened Jun 07, 2021 by Augusto Fraga Giachero@augustofg
  • Report abuse
  • New issue
Report abuse New issue

Leaving the USB cable connected prevents MMC from booting

From #177

Leaving the USB cable connected when powering up the AFC board causes MMC to boot into the serial bootloader. This happens because the RTS line is held '1' (output cmos level, not to be confused with the signal level set by software) when the serial port is unused (closed) and this signal is inverted by IC22 before going to P2.10, causing the MMC micro to enter the bootloader when reseting (my fault).

screenshot-2021-05-04_11-30-54

To fix it, we should remove IC22, R441 and R446, so P2.10 will be held high when the USB cable is connected but the serial port is closed or when the USB cable is unplugged. Opening the serial port causes DTR and RTS to go to '0' at the same time, C306 should prevent any unwanted reset in this case, but any manual reset while the serial port is open will cause the MMC micro to enter to the bootloader unless you instruct the serial terminal software to set RTS and DTR to '1' again (to '0' from the software perspective).

With the modifications I mentioned, here is a python script for putting the microcontroller into bootloader mode:

#!/usr/bin/env python3

import serial
import time

serport = serial.Serial()
serport.setPort("/dev/ttyUSB3")
serport.open()

# Activate the bootloader

serport.setRTS(1) # set RTS line to 0V
serport.setDTR(0) # set DTR line to 3.3V
time.sleep(0.1)
serport.setDTR(1) # set DTR line to 0V
Assignee
Assign to
AFC v4.0.2
Milestone
AFC v4.0.2
Assign milestone
Time tracking
None
Due date
No due date
1
Labels
bug
Assign labels
  • View project labels
Reference: project/afc#184