Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Archim 2 Uploading to board but not working correctly #18816

Closed
AFprinter opened this issue Jul 28, 2020 · 13 comments
Closed

[BUG] Archim 2 Uploading to board but not working correctly #18816

AFprinter opened this issue Jul 28, 2020 · 13 comments

Comments

@AFprinter
Copy link

Bug Description

Upon completion of compiling Marlin in VSCode it will not upload to the board via USB.

Error message produced

CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html
PLATFORM: Atmel SAM 4.5.1 > Arduino Due (Programming Port)
HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink)
PACKAGES:

  • framework-arduino-sam 1.6.12
  • framework-cmsis 1.40500.0 (4.5.0)
  • framework-cmsis-atmel 1.2.0
  • tool-bossac 1.10700.190624 (1.7.0)
  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    Converting Marlin.ino
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 5 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- 0.7.1
    | |-- 1.0
    |-- 1.5.0
    | |-- 1.0
    |-- 1.0
    |-- 1.0
    Building in release mode
    Checking size .pio\build\DUE_archim\firmware.elf
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM: [= ] 9.4% (used 9284 bytes from 98304 bytes)
    Flash: [===== ] 45.8% (used 239972 bytes from 524288 bytes)
    Configuring upload protocol...
    AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba, stlink
    CURRENT: upload_protocol = sam-ba
    Looking for upload port...
    Auto-detected: COM3
    Forcing reset using 1200bps open/close on port COM3
    Uploading .pio\build\DUE_archim\firmware.bin
    ### bossac: missing file
    Try 'bossac -h' or 'bossac --help' for more information
    *** [upload] Error 1

Steps to Reproduce

  1. Compile Marlin
  2. Try to upload to Archim 2 board

**Expected behavior:**Completion of Upload of firmware to the board
Actual behavior: Fails

@ellensp
Copy link
Contributor

ellensp commented Jul 28, 2020

In platformio.ini is

[common_DUE_archim]
platform      = atmelsam
board         = due
src_filter    = ${common.default_src_filter} +<src/HAL/DUE>
build_flags   = ${common.build_flags}
  -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON
extra_scripts = ${common.extra_scripts}
  Marlin/src/HAL/DUE/upload_extra_script.py

It doesn't seem to need to the upload_extra_script.py anymore. In fact it seems to break windows uploading.
So change to

[common_DUE_archim]
platform      = atmelsam
board         = due
src_filter    = ${common.default_src_filter} +<src/HAL/DUE>
build_flags   = ${common.build_flags}
  -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON
extra_scripts = ${common.extra_scripts}

Can you confirm that this works for you also ?

@ellensp
Copy link
Contributor

ellensp commented Jul 28, 2020

Waiting on conformation before releasing PR

@AFprinter
Copy link
Author

I deleted the extra line as recommended and it actually connected this time but wont upload. Here's the new error.

Configuring upload protocol...
AVAILABLE: atmel-ice, blackmagic, jlink, sam-ba, stlink
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: COM3
Forcing reset using 1200bps open/close on port COM3
Uploading .pio\build\DUE_archim\firmware.bin
Atmel SMART device 0x285e0a60 found

SAM-BA operation failed
*** [upload] Error 1

@AFprinter
Copy link
Author

AFprinter commented Jul 28, 2020

To be clear I can upload a Marlin Bugfix from March that I've been using via Arduino IDE just fine, even as of today, so I know the board is working in programming mode. As of July 7 Bugfix I cannot use Arduino IDE for compiling or upload, something changed. And I've tried using the atmel-ice protocol as well as the SAM-BA that seems to be the default as selected in the platform.ini and both fail. The SAM-BA seems to get the furthest as it actually seems to make the connection to the board, it's just not pushing the file now, as per my last post.

P.S.- I seriously appreciate your help figuring this out.

@AFprinter
Copy link
Author

So after messing with this a little bit, I changed
board = due
to
board = dueUSB

and I got it to upload but now after restarting the printer the screen is just displaying random crap on the LCD (yes I double checked that the correct LCD was uncommented)
IMG_20200728_160607
and the y axis only moves in one direction (endstops are open) no matter which way I tell it to move in octoprint (yes I can connect via octoprint). I can move the x axis in both directions and the z axis in both directions. I can also interface with Marlin via the Octoprint terminal and use commands.

Configurations.zip

@AFprinter AFprinter changed the title [BUG] Archim 2 will not upload compiled firmware via VSCode [BUG] Archim 2 Uploading to board but not working correctly Jul 30, 2020
@jeffeb3
Copy link
Contributor

jeffeb3 commented Jul 31, 2020

Those are some goofy symptoms. Have you compared the configuration and pins files from the two versions?

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

@colinoflynn
Copy link

The issue with the pins is also called out in #19215, these are the same root problems.

Archim2 requires a special Arduino DUE environment, as it uses pins 92+ (these pins are beyond the normal Arduino DUE pins). See line https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/Makefile#L698 for example showing the inclusion of variants.cpp which I assume solves the problem(?). I put more details in #19215.

I'm not sure on the correct way to solve this as I'm not too familiar with either PlatformIO build system, or Marlin (new to both!).

@colinoflynn
Copy link

A workaround for this is in #19215 if it's still an issue for you.

@github-actions
Copy link

github-actions bot commented Oct 5, 2020

This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days.

@jeffeb3
Copy link
Contributor

jeffeb3 commented Oct 5, 2020

#19545 and #19546 might have helped these two issues. We had the same problems (bossac error and steopers not moving) and they seem to be fixed now (on archim 1)

@sjasonsmith
Copy link
Contributor

Several related fixes were introduced recently, and there haven’t been any replies regarding this still being an issue since before those were made.

I am going to close this, as I suspect it is fixed from comments made by @jeffeb3 and @colinoflynn.

Please let me know if this action was incorrect.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants