-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from mossmann/cynthion_r1
add support for Cynthion r0.6, r0.7, r1.0, r1.1, r1.2
- Loading branch information
Showing
51 changed files
with
281 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
|
||
# Apollo FPGA Programmer / Debugger | ||
|
||
This repository contains the work-in-progress extraction of the Apollo programmer from the LUNA repository. | ||
Apollo is the on-board debugger and programmer on [Cynthion](https://greatscottgadgets.com/cynthion/). It is used to load gateware over USB onto Cynthion's FPGA. Alternatively it may be used as an on-board or external debugger for certain other FPGA platforms. | ||
|
||
Apollo consists of two main parts: firmware for the on-board debug microcontroller and Python-based software for the host computer. | ||
|
||
## Building and Installing Firmware | ||
|
||
First activate Cynthion's Saturn-V bootloader by holding down the PROGRAM button while connecting power or while pressing and releasing the RESET button. LED C will blink, indicating that Saturn-V is running. | ||
|
||
To compile for the latest Cynthion hardware revision, type: | ||
|
||
``` | ||
$ cd apollo/firmware | ||
$ make APOLLO_BOARD=cynthion get-deps dfu | ||
``` | ||
|
||
This will download dependencies, compile the firmware, and install it onto Cynthion with Saturn-V. | ||
|
||
Alternatively you can use variables to specify the hardware revision: | ||
|
||
``` | ||
$ cd apollo/firmware | ||
$ make APOLLO_BOARD=cynthion BOARD_REVISION_MAJOR=1 BOARD_REVISION_MINOR=3 get-deps dfu | ||
``` | ||
|
||
Once installation is complete, LED E should blink, indicating that Apollo is running and idle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* switch control for USB port shared by Apollo and FPGA | ||
* | ||
* This file is part of Apollo. | ||
* | ||
* Copyright (c) 2023 Great Scott Gadgets <[email protected]> | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#include "usb_switch.h" | ||
#include "apollo_board.h" | ||
#include <hal/include/hal_gpio.h> | ||
|
||
/** | ||
* Hand off shared USB port to FPGA. | ||
*/ | ||
void hand_off_usb(void) | ||
{ | ||
#if (((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ >= 6)) || (_BOARD_REVISION_MAJOR_ == 1)) | ||
gpio_set_pin_level(USB_SWITCH, false); | ||
gpio_set_pin_direction(USB_SWITCH, GPIO_DIRECTION_OUT); | ||
#endif | ||
} | ||
|
||
/** | ||
* Take control of USB port from FPGA. | ||
*/ | ||
void take_over_usb(void) | ||
{ | ||
#if (((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ >= 6)) || (_BOARD_REVISION_MAJOR_ == 1)) | ||
gpio_set_pin_level(USB_SWITCH, true); | ||
gpio_set_pin_direction(USB_SWITCH, GPIO_DIRECTION_OUT); | ||
#endif | ||
} | ||
|
||
/** | ||
* Handle switch control user request. | ||
*/ | ||
void switch_control_task(void) | ||
{ | ||
if (gpio_get_pin_level(PROGRAM_BUTTON) == false) { | ||
take_over_usb(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* switch control for USB port shared by Apollo and FPGA | ||
* | ||
* This file is part of Apollo. | ||
* | ||
* Copyright (c) 2023 Great Scott Gadgets <[email protected]> | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#include "usb_switch.h" | ||
|
||
/** | ||
* Hand off shared USB port to FPGA. | ||
*/ | ||
void hand_off_usb(void) | ||
{ | ||
} | ||
|
||
/** | ||
* Take control of USB port from FPGA. | ||
*/ | ||
void take_over_usb(void) | ||
{ | ||
} | ||
|
||
/** | ||
* Handle switch control user request. | ||
*/ | ||
void switch_control_task(void) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* switch control for USB port shared by Apollo and FPGA | ||
* | ||
* This file is part of Apollo. | ||
* | ||
* Copyright (c) 2023 Great Scott Gadgets <[email protected]> | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#include "usb_switch.h" | ||
|
||
/** | ||
* Hand off shared USB port to FPGA. | ||
*/ | ||
void hand_off_usb(void) | ||
{ | ||
} | ||
|
||
/** | ||
* Take control of USB port from FPGA. | ||
*/ | ||
void take_over_usb(void) | ||
{ | ||
} | ||
|
||
/** | ||
* Handle switch control user request. | ||
*/ | ||
void switch_control_task(void) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.