PandaDFU: SPI support (#1270)

* PandaDFU: SPI support

* get mcu type

* program bootstub

* little cleanup

* more cleanup

* connect by dfu serial

* time to remove that

* none

* fix linter

* little more

* catch

---------

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2023-03-06 21:52:08 -08:00
committed by GitHub
parent 18230831f3
commit efb36197bb
7 changed files with 217 additions and 181 deletions

View File

@@ -1,5 +1,7 @@
from abc import ABC, abstractmethod
from typing import List, Optional
from typing import List
from .constants import McuType
class BaseHandle(ABC):
@@ -33,6 +35,10 @@ class BaseSTBootloaderHandle(ABC):
A handle to talk to a panda while it's in the STM32 bootloader.
"""
@abstractmethod
def get_mcu_type(self) -> McuType:
...
@abstractmethod
def close(self) -> None:
...
@@ -42,11 +48,15 @@ class BaseSTBootloaderHandle(ABC):
...
@abstractmethod
def program(self, address: int, dat: bytes, block_size: Optional[int] = None) -> None:
def program(self, address: int, dat: bytes) -> None:
...
@abstractmethod
def erase(self, address: int) -> None:
def erase_app(self) -> None:
...
@abstractmethod
def erase_bootstub(self) -> None:
...
@abstractmethod